ARTrackedImageExtensions

Extensions to AR Foundation's ARTrackedImage class.

Summary

Public static functions

IsMarker(this ARTrackedImage image)
bool
Check if the given image is a marker.
IsQrCode(this ARTrackedImage image)
bool
Check if the give image is a QR code.
TryGetMarkerData(this ARTrackedImage image, out XRMarkerDictionary dictionary, out int id)
bool
Try to get the XRMarkerDictionary and the id from the dictionary of a marker image.
TryGetQrCodeData(this ARTrackedImage image, out string decodedData)
bool
Try to get the decoded data from a QR code image.

Public static functions

IsMarker

bool IsMarker(
  this ARTrackedImage image
)

Check if the given image is a marker.

Details
Parameters
image
The ARTrackedImage instance.
Returns
true, if it's a valid marker image.

IsQrCode

bool IsQrCode(
  this ARTrackedImage image
)

Check if the give image is a QR code.

Details
Parameters
image
The ARTrackedImage instance.
Returns
true, if it's a valid QR code image.

TryGetMarkerData

bool TryGetMarkerData(
  this ARTrackedImage image,
  out XRMarkerDictionary dictionary,
  out int id
)

Try to get the XRMarkerDictionary and the id from the dictionary of a marker image.

Details
Parameters
image
The marker ARTrackedImage image instance which returns true from IsMarker(ARTrackedImage).
dictionary
The XRMarkerDictionary it belongs to.
id
The id from the dictionary .
Returns
true if it gets marker data successfully and output by dictionary and id .

TryGetQrCodeData

bool TryGetQrCodeData(
  this ARTrackedImage image,
  out string decodedData
)

Try to get the decoded data from a QR code image.

Details
Parameters
image
The QR code ARTrackedImage image instance which returns true from IsQrCode(ARTrackedImage).
decodedData
The decoded QR code data.
Returns
true, if it succeed to get QR Code data and decodedData contains valid data.

It can fail to get the data if the tracking server is still decoding or there is not data encoded with this QR code. You can try it again later if decoding finished.