AndroidXRRuntimeImageLibrary

Constructs a RuntimeReferenceImageLibrary which stores reference images

for Image, Marker and QR Code tracking on Android XR devices.

Summary

Inheritance

Inherits from: RuntimeReferenceImageLibrary

Constructors and Destructors

AndroidXRRuntimeImageLibrary(XRReferenceImageLibrary library)
Constructs a AndroidXRRuntimeImageLibrary from a given XRReferenceImageLibrary

Public attributes

ImageReferenceCount => _imageReferenceCount
int
The number of image references in the library.
ImageReferenceIndex => _imageReferenceIndex
int
The index of the first image reference in the library, or -1 if no image was added.
MarkerReferenceCount => _markerReferenceCount
int
The number of marker references in the library.
MarkerReferenceIndex => _markerReferenceIndex
int
The index of the first marker reference in the library, or -1 if no marker was added.
QRCodeReference => _qrCodeReference
XRReferenceImage
The QR CodeXRReferenceImage, or null if it's not found from the library.
QrCodeReferenceCount => _qrCodeReferenceCount
int
The number of QR Code references in the library.
QrCodeReferenceIndex => _qrCodeReferenceIndex
int
The index of the QR Code reference in the library, or -1 if no QR Code was added.
count => _qrCodeReferenceCount + _markerReferenceCount + _imageReferenceCount
override int

Public static functions

IsMarkerReference(XRReferenceImage image)
bool
Determine if the given reference image is a marker reference.
IsQrCodeReference(XRReferenceImage image)
bool
Determine if the given reference image is a QR code reference.
ValidateImages(IReferenceImageLibrary referenceLibrary, out int validImageCount, out int invalidImageCount)
bool
Validates all image references within a given XRReferenceImageLibrary.
ValidateMarker(IReferenceImageLibrary imageLibrary)
void
Validate marker configuration with a given XRReferenceImageLibrary.
ValidateQrCode(IReferenceImageLibrary imageLibrary)
void
Validate QR code configuration with a given XRReferenceImageLibrary.

Public attributes

ImageReferenceCount

int ImageReferenceCount => _imageReferenceCount

The number of image references in the library.

ImageReferenceIndex

int ImageReferenceIndex => _imageReferenceIndex

The index of the first image reference in the library, or -1 if no image was added.

MarkerReferenceCount

int MarkerReferenceCount => _markerReferenceCount

The number of marker references in the library.

It can be used to iterate all marker reference images starting from MarkerReferenceIndex.

MarkerReferenceIndex

int MarkerReferenceIndex => _markerReferenceIndex

The index of the first marker reference in the library, or -1 if no marker was added.

QRCodeReference

XRReferenceImage QRCodeReference => _qrCodeReference

The QR CodeXRReferenceImage, or null if it's not found from the library.

QrCodeReferenceCount

int QrCodeReferenceCount => _qrCodeReferenceCount

The number of QR Code references in the library.

QrCodeReferenceIndex

int QrCodeReferenceIndex => _qrCodeReferenceIndex

The index of the QR Code reference in the library, or -1 if no QR Code was added.

count

override int count =>
            _qrCodeReferenceCount + _markerReferenceCount + _imageReferenceCount

Public functions

AndroidXRRuntimeImageLibrary

 AndroidXRRuntimeImageLibrary(
  XRReferenceImageLibrary library
)

Constructs a AndroidXRRuntimeImageLibrary from a given XRReferenceImageLibrary

Details
Parameters
library
The XRReferenceImageLibrary to collect images from.

Public static functions

IsMarkerReference

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.
Returns
true, if it's a valid marker reference.

IsQrCodeReference

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.

ValidateImages

bool ValidateImages(
  IReferenceImageLibrary referenceLibrary,
  out int validImageCount,
  out int invalidImageCount
)

Validates all image references within a given XRReferenceImageLibrary.

Details
Parameters
referenceLibrary
The XRReferenceImageLibrary to validate.
validImageCount
Number of valid image references in the given referenceLibrary (excluding QR codes and markers).
invalidImageCount
Number of invalid image references in the given referenceLibrary, which will be ignored for image tracking.
Returns
Returns true if all image references are valid or if there are no image references; otherwise, returns false.

ValidateMarker

void ValidateMarker(
  IReferenceImageLibrary imageLibrary
)

Validate marker configuration with a given XRReferenceImageLibrary.

It may be updated through XRMarkerDatabase or manually added marker references where the XRReferenceImage.name matches format "{}-{markId}".

Details
Parameters
imageLibrary

ValidateQrCode

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.