Eye Tracking
APIs for the Eye Tracking system. More...
Classes
Name | |
---|---|
struct | MLEyeTrackingStaticData Static information about the eye tracking. |
struct | MLEyeTrackingStateEx Information about the state of the eye tracking system. |
Types
Name | |
---|---|
typedef struct MLEyeTrackingStaticData | MLEyeTrackingStaticData Static information about the eye tracking. |
typedef struct MLEyeTrackingStateEx | MLEyeTrackingStateEx Information about the state of the eye tracking system. |
Enums
Name | |
---|---|
enum | MLEyeTrackingError { MLEyeTrackingError_None, MLEyeTrackingError_Generic, MLEyeTrackingError_Ensure32Bits = 0x7FFFFFFF } |
Functions
Name | |
---|---|
void | MLEyeTrackingStateInit(MLEyeTrackingStateEx * inout_state) Initialize MLEyeTrackingStateEx with version. |
MLResult | MLEyeTrackingCreate(MLHandle * out_handle) Creates an eye tracker. |
MLResult | MLEyeTrackingDestroy(MLHandle eye_tracker) Destroys an eye tracker. |
MLResult | MLEyeTrackingGetStaticData(MLHandle eye_tracker, MLEyeTrackingStaticData * out_data) Gets static information about the eye tracker. |
MLResult | MLEyeTrackingGetStateEx(MLHandle eye_tracker, MLEyeTrackingStateEx * out_state) Gets information about the user's eyes. |
Detailed Description
APIs for the Eye Tracking system.
Shared Object:
- perception.magicleap*
Enums Documentation
MLEyeTrackingError
Enumerator | Value | Description |
---|---|---|
MLEyeTrackingError_None | No error, tracking is nominal. | |
MLEyeTrackingError_Generic | Eye Tracker failed. | |
MLEyeTrackingError_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
A set of possible error codes that the Eye Tracking system can report.
Types Documentation
MLEyeTrackingStaticData
typedef struct MLEyeTrackingStaticData MLEyeTrackingStaticData;
Static information about the eye tracking.
Populate with MLEyeTrackingGetStaticData().
API Level:
- 20
MLEyeTrackingStateEx
typedef struct MLEyeTrackingStateEx MLEyeTrackingStateEx;
Information about the state of the eye tracking system.
This structure must be initialized by calling MLEyeTrackingStateInit() before use.
API Level:
- 26
Functions Documentation
MLEyeTrackingStateInit
static inline void MLEyeTrackingStateInit(
MLEyeTrackingStateEx * inout_state
)
Initialize MLEyeTrackingStateEx with version.
Parameters
MLEyeTrackingStateEx * | inout_state | Set up the version for inout_state and zero all other fields. |
API Level:
- 26
MLEyeTrackingCreate
MLResult MLEyeTrackingCreate(
MLHandle * out_handle
)
Creates an eye tracker.
Parameters
MLHandle * | out_handle | A pointer to an MLHandle which will contain the handle of the eye tracker. If this operation fails, out_handle will be ML_INVALID_HANDLE. |
Returns
MLResult | MLResult_InvalidParam | Failed to create eye tracker due to an invalid input parameter. |
MLResult | MLResult_Ok | Successfully created eye tracker. |
MLResult | MLResult_UnspecifiedFaiure | Failed to create eye tracker due to an unknown failure. |
MLResult | MLResult_PermissionDenied | The application lacks permission. |
Required Permissions:
- com.magicleap.permission.EYE_TRACKING (protection level: dangerous)
MLEyeTrackingDestroy
MLResult MLEyeTrackingDestroy(
MLHandle eye_tracker
)
Destroys an eye tracker.
Parameters
MLHandle | eye_tracker | A handle to an Eye Tracker created by MLEyeTrackingCreate(). |
Returns
MLResult | MLResult_Ok | Successfully destroyed eye tracker. |
MLResult | MLResult_UnspecifiedFaiure | Failed to destroy eye tracker due to an unknown failure. |
Required Permissions:
- None
MLEyeTrackingGetStaticData
MLResult MLEyeTrackingGetStaticData(
MLHandle eye_tracker,
MLEyeTrackingStaticData * out_data
)
Gets static information about the eye tracker.
Parameters
MLHandle | eye_tracker | A handle to an Eye Tracker created by MLEyeTrackingCreate(). |
MLEyeTrackingStaticData * | out_data | Target to populate the data about the eye tracker. |
Returns
MLResult | MLResult_InvalidParam | The out_data parameter was not valid (null). |
MLResult | MLResult_Ok | Eye tracking static data was successfully received. |
MLResult | MLResult_UnspecifiedFailure | Failed to receive eye tracking static data. |
Required Permissions:
- None
API Level:
- 20
MLEyeTrackingGetStateEx
MLResult MLEyeTrackingGetStateEx(
MLHandle eye_tracker,
MLEyeTrackingStateEx * out_state
)
Gets information about the user's eyes.
Parameters
MLHandle | eye_tracker | A handle to an Eye Tracker created by MLEyeTrackingCreate(). |
MLEyeTrackingStateEx * | out_state | Information about the eyes. |
Returns
MLResult | MLResult_InvalidParam | Failed to receive eye tracking state due to an invalid input parameter. |
MLResult | MLResult_Ok | Successfully received eye tracking state. |
MLResult | MLResult_UnspecifiedFailure | Failed to receive eye tracking state due to an unknown failure. |
Required Permissions:
- None
NOTE: To ensure a clean trace of any eye state, it is important to monitor the confidence value of that eye to reject frames where confidence is 0 (or employ another fallback strategy like propagating the last high confidence value).
API Level:
- 9