# AndroidXRRuntimeImageLibrary

Constructs a RuntimeReferenceImageLibrary which stores reference images for Marker Tracking and QR Code trackng at Android XR devices.

## Summary

### Inheritance

Inherits from: `RuntimeReferenceImageLibrary`

| ### Constructors and Destructors ||
|---|---|
| [AndroidXRRuntimeImageLibrary](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/AndroidXRRuntimeImageLibrary#androidxrruntimeimagelibrary)`(XRReferenceImageLibrary library)` Constructs a [AndroidXRRuntimeImageLibrary](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/AndroidXRRuntimeImageLibrary#classGoogle_1_1XR_1_1Extensions_1_1AndroidXRRuntimeImageLibrary) from a given XRReferenceImageLibrary ||

| ### Public attributes ||
|---|---|
| [MarkerReferenceCount](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/AndroidXRRuntimeImageLibrary#markerreferencecount)` => _markerCount` | `int` Gets the count of marker reference images. |
| [MarkerReferenceIndex](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/AndroidXRRuntimeImageLibrary#markerreferenceindex)` => _markerIndex` | `int` Gets the index of the first marker reference image. |
| [QrCodeReferenceIndex](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/AndroidXRRuntimeImageLibrary#qrcodereferenceindex)` => _qrCodeIndex` | `int` Gets the index of QR Code reference image. |
| [count](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/AndroidXRRuntimeImageLibrary#count)` => _images.Count` | `override int` |

| ### Properties ||
|---|---|
| [QRCodeReference](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/AndroidXRRuntimeImageLibrary#qrcodereference) | `XRReferenceImage` Gets QR Code reference image, or `null` if it's not found from the library. |

| ### Public static functions ||
|---|---|
| [IsMarkerReference](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/AndroidXRRuntimeImageLibrary#ismarkerreference)`(XRReferenceImage image)` | `bool` Determine if the given reference image is a marker reference. |
| [IsQrCodeReference](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/AndroidXRRuntimeImageLibrary#isqrcodereference)`(XRReferenceImage image)` | `bool` Determine if the given reference image is a QR code reference. |
| [ValidateMarker](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/AndroidXRRuntimeImageLibrary#validatemarker)`(IReferenceImageLibrary imageLibrary)` | `void` Validate marker configuration with a given XRReferenceImageLibrary. |
| [ValidateQrCode](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/AndroidXRRuntimeImageLibrary#validateqrcode)`(IReferenceImageLibrary imageLibrary)` | `void` Validate QR code configuration with a given XRReferenceImageLibrary. |

## Public attributes

### MarkerReferenceCount

```c#
int MarkerReferenceCount => _markerCount
```  
Gets the count of marker reference images.

It can be used to iterate all marker reference images starting from [MarkerReferenceIndex](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/AndroidXRRuntimeImageLibrary#markerreferenceindex).  

### MarkerReferenceIndex

```c#
int MarkerReferenceIndex => _markerIndex
```  
Gets the index of the first marker reference image.

Or return -1 if it doesn't exist.  

### QrCodeReferenceIndex

```c#
int QrCodeReferenceIndex => _qrCodeIndex
```  
Gets the index of QR Code reference image.

Or return -1 if it doesn't exist.  

### count

```c#
override int count => _images.Count
```  

## Properties

### QRCodeReference

```c#
XRReferenceImage QRCodeReference
```  
Gets QR Code reference image, or `null` if it's not found from the library.

## Public functions

### AndroidXRRuntimeImageLibrary

```c#
 AndroidXRRuntimeImageLibrary(
  XRReferenceImageLibrary library
)
```  
Constructs a [AndroidXRRuntimeImageLibrary](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/AndroidXRRuntimeImageLibrary#classGoogle_1_1XR_1_1Extensions_1_1AndroidXRRuntimeImageLibrary) from a given XRReferenceImageLibrary


| Details ||
|---|---|
| Parameters | |---|---| | `library` | The XRReferenceImageLibrary to collect images from. | |

## Public static functions

### IsMarkerReference

```c#
bool IsMarkerReference(
  XRReferenceImage image
)
```  
Determine if the given reference image is a marker reference.


| Details ||
|---|---|
| Parameters | |---|---| | `image` | The reference image with marker name or generated from [XRMarkerDatabase](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRMarkerDatabase#classGoogle_1_1XR_1_1Extensions_1_1XRMarkerDatabase). | |
| **Returns** | `true`, if it's a valid marker reference. |

### IsQrCodeReference

```c#
bool IsQrCodeReference(
  XRReferenceImage image
)
```  
Determine if the given reference image is a QR code reference.


| Details ||
|---|---|
| Parameters | |---|---| | `image` | The reference image with QR code name. | |
| **Returns** | `true`, if it's a valid QR code reference. |

### ValidateMarker

```c#
void ValidateMarker(
  IReferenceImageLibrary imageLibrary
)
```  
Validate marker configuration with a given XRReferenceImageLibrary.

It may be updated through [XRMarkerDatabase](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRMarkerDatabase#classGoogle_1_1XR_1_1Extensions_1_1XRMarkerDatabase) or manually added marker references where the XRReferenceImage.name matchs format "{}-{markId}".


| Details ||
|---|---|
| Parameters | |---|---| | `imageLibrary` |   | |

### ValidateQrCode

```c#
void ValidateQrCode(
  IReferenceImageLibrary imageLibrary
)
```  
Validate QR code configuration with a given XRReferenceImageLibrary.

Note: only one reference is needed for QR code tracking, where the XRReferenceImage.name starts with `QRCode`, case insensitive.


| Details ||
|---|---|
| Parameters | |---|---| | `imageLibrary` | The XRReferenceImageLibrary with QR code reference in it. | |