Skip to main content
Version: 21 Aug 2024

NativeBindings

Inherits from:
MagicLeapNativeBindings

Public Methods

MLResult.Code MLMarkerTrackerCreate

Create a Marker Scanner. Requires CameraCapture, LowLatencyLightwear priveledges.

public MLResult.Code MLMarkerTrackerCreate(
in MLMarkerTrackerSettings settings,
out ulong handle
)

Parameters

TypeNameDescription
in MLMarkerTrackerSettingssettingsList of settings of type MLMarkerTrackerSettings that configure the scanner.
out ulonghandleA pointer to an MLHandle to the newly created Marker Scanner. If this operation fails, handle will be ML_INVALID_HANDLE .

Returns: MLResult_InvalidParam : Failed to create Marker Scanner due to invalid out_handle. MLResult_Ok Successfully : created Marker Scanner. MLResult_PermissionDenied Failed : to create scanner due to lack of permission(s). MLResult_UnspecifiedFailure : Failed to create the Marker Scanner due to an internal error.


MLResult.Code MLMarkerTrackerDestroy

Destroy a Marker Scanner. Requires CameraCapture, LowLatencyLightwear priveleges.

public MLResult.Code MLMarkerTrackerDestroy(
ulong scannerHandle
)

Parameters

TypeNameDescription
ulongscannerHandleMLHandle to the Marker Scanner created by MLMarkerTrackerCreate().

Returns: MLResult_Ok : Successfully destroyed the Marker Scanner. MLResult_UnspecifiedFailure : Failed to destroy the scanner due to an internal error.


MLResult.Code MLMarkerTrackerGetResult

brief Get the results for Marker Scanning.= This function can be used to poll results from the scanner. This will allocate memory for the results array that will have to be freed later.

public MLResult.Code MLMarkerTrackerGetResult(
ulong scanner_handle,
ref MLMarkerTrackerResultArray data
)

Parameters

TypeNameDescription
ulongscanner_handleMLHandle to the Marker Scanner created by MLMarkerTrackerCreate().
ref MLMarkerTrackerResultArraydataout_data Pointer to an array of pointers to MLMarkerTrackerResult. The content will be freed by the MLMarkerTrackerReleaseResult.

Returns

TypeNameDescription
MLResult.CodeMLResult_UnspecifiedFailureFailed to return detections due to an internal error.

Returns: MLResult_InvalidParam Failed to return detection data due to invalid out_data.

MLResult_Ok Successfully fetched and returned all detections.


MLResult.Code MLMarkerTrackerReleaseResult

Release the resources for the results array.

public MLResult.Code MLMarkerTrackerReleaseResult(
ref MLMarkerTrackerResultArray data
)

Parameters

TypeNameDescription
ref MLMarkerTrackerResultArraydataThe list of detections to be freed.

Returns: MLResult_InvaldParam Failed to free structure due to invalid data. MLResult_Ok Successfully freed data structure. MLResult_UnspecifiedFailure Failed to free data due to an internal error.


MLResult.Code MLMarkerTrackerUpdateSettings

Update the Marker Scanner with new settings. Requires CameraCapture, LowLatencyLightwear priveledges.

public MLResult.Code MLMarkerTrackerUpdateSettings(
ulong scanner_handle,
in MLMarkerTrackerSettings scanner_settings
)

Parameters

TypeNameDescription
ulongscanner_handleMLHandle to the Marker Scanner created by MLArucoScannerCreate().
in MLMarkerTrackerSettingsscanner_settingsList of new Marker Scanner settings.

Returns: MLResult_InvalidParam : Failed to update the settings due to invalid scanner_settings. MLResult_Ok Successfully : updated the Marker Scanner settings. MLResult_PermissionDenied : Failed to update the settings due to lack of permission(s). MLResult_UnspecifiedFailure : Failed to update the settings due to an internal error.


Public Enums

DecodedDataType

Data type of the decoded marker data.

EnumeratorValueDescription
None
ArucoThis covers Aruco and AprilTag
QR
EAN_13
UPC_A