Eye Camera
Module: Pixel Sensors
APIs to access the eye camera data. More...
Classes
Name | |
---|---|
struct | MLEyeCameraSettings A structure to encapsulate the camera settings. |
struct | MLEyeCameraFrameBuffer A structure to encapsulate per plane info for each camera frame. |
struct | MLEyeCameraFrame A structure to encapsulate output data for each camera sensor. |
struct | MLEyeCameraData A structure to encapsulate all the eye camera data. |
Types
Name | |
---|---|
typedef struct MLEyeCameraSettings | MLEyeCameraSettings A structure to encapsulate the camera settings. |
typedef struct MLEyeCameraFrameBuffer | MLEyeCameraFrameBuffer A structure to encapsulate per plane info for each camera frame. |
typedef struct MLEyeCameraFrame | MLEyeCameraFrame A structure to encapsulate output data for each camera sensor. |
typedef struct MLEyeCameraData | MLEyeCameraData A structure to encapsulate all the eye camera data. |
Enums
Name | |
---|---|
enum | MLEyeCameraIdentifier { MLEyeCameraIdentifier_None = 0, MLEyeCameraIdentifier_LeftTemple = 1 << 0, MLEyeCameraIdentifier_LeftNasal = 1 << 1, MLEyeCameraIdentifier_RightNasal = 1 << 2, MLEyeCameraIdentifier_RightTemple = 1 << 3, MLEyeCameraIdentifier_All = MLEyeCameraIdentifier_LeftTemple |
MLEyeCameraIdentifier_LeftNasal | |
MLEyeCameraIdentifier_RightNasal | |
MLEyeCameraIdentifier_RightTemple, MLEyeCameraIdentifier_Ensure32Bits = 0x7FFFFFFF } Camera Identifier. |
Functions
Name | |
---|---|
void | MLEyeCameraSettingsInit(MLEyeCameraSettings * inout_settings) Initialize the camera settings structure. Shall be called before calling MLEyeCameraConnect(). |
void | MLEyeCameraDataInit(MLEyeCameraData * inout_eye_camera_data) Initialize MLEyeCameraData with version. |
MLResult | MLEyeCameraConnect(const MLEyeCameraSettings settings, MLHandle out_handle) Connect to eye cameras. |
MLResult | MLEyeCameraUpdateSettings(MLHandle handle, const MLEyeCameraSettings * settings) Update the eye camera settings. |
MLResult | MLEyeCameraGetLatestCameraData(MLHandle handle, uint64_t timeout_ms, MLEyeCameraData * out_data) Poll for Frames. |
MLResult | MLEyeCameraReleaseCameraData(MLHandle handle, MLEyeCameraData * eye_camera_data) Releases specified MLEyeCameraData object. |
MLResult | MLEyeCameraDisconnect(MLHandle handle) Disconnect from eye camera(s). |
Detailed Description
APIs to access the eye camera data.
\experimental This is an experimental API which may be modified or removed without any prior notice.
Enums Documentation
MLEyeCameraIdentifier
Enumerator | Value | Description |
---|---|---|
MLEyeCameraIdentifier_None | 0 | None. |
MLEyeCameraIdentifier_LeftTemple | 1 << 0 | Left temple eye camera. |
MLEyeCameraIdentifier_LeftNasal | 1 << 1 | Left nasal eye camera. |
MLEyeCameraIdentifier_RightNasal | 1 << 2 | Right nasal eye camera. |
MLEyeCameraIdentifier_RightTemple | 1 << 3 | Right temple eye camera. |
MLEyeCameraIdentifier_All | MLEyeCameraIdentifier_LeftTemple | |
MLEyeCameraIdentifier_LeftNasal | ||
MLEyeCameraIdentifier_RightNasal | ||
MLEyeCameraIdentifier_RightTemple | All Eye cameras. | |
MLEyeCameraIdentifier_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Camera Identifier.
Enumeration of all the available eye camera sensors.
Types Documentation
MLEyeCameraSettings
typedef struct MLEyeCameraSettings MLEyeCameraSettings;
A structure to encapsulate the camera settings.
This structure must be initialized by calling MLEyeCameraSettingsInit before use.
API Level:
- 26
MLEyeCameraFrameBuffer
typedef struct MLEyeCameraFrameBuffer MLEyeCameraFrameBuffer;
A structure to encapsulate per plane info for each camera frame.
API Level:
- 26
MLEyeCameraFrame
typedef struct MLEyeCameraFrame MLEyeCameraFrame;
A structure to encapsulate output data for each camera sensor.
API Level:
- 26
MLEyeCameraData
typedef struct MLEyeCameraData MLEyeCameraData;
A structure to encapsulate all the eye camera data.
This structure must be initialized by calling MLEyeCameraDataInit before use.
API Level:
- 26
Functions Documentation
MLEyeCameraSettingsInit
static inline void MLEyeCameraSettingsInit(
MLEyeCameraSettings * inout_settings
)
Initialize the camera settings structure. Shall be called before calling MLEyeCameraConnect().
Parameters
MLEyeCameraSettings * | inout_settings | MLEyeCameraSettings structure to initialize. |
Required Permissions:
- None
API Level:
- 26
MLEyeCameraDataInit
static inline void MLEyeCameraDataInit(
MLEyeCameraData * inout_eye_camera_data
)
Initialize MLEyeCameraData with version.
Parameters
MLEyeCameraData * | inout_eye_camera_data | Set up the version for inout_eye_camera_data. |
API Level:
- 26
MLEyeCameraConnect
MLResult MLEyeCameraConnect(
const MLEyeCameraSettings * settings,
MLHandle * out_handle
)
Connect to eye cameras.
Parameters
const MLEyeCameraSettings * | settings | A pointer to MLEyeCameraSettings structure. |
MLHandle * | out_handle | A pointer to camera handle to be used in later APIs. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | Connected to camera device(s) successfully. |
MLResult | MLResult_PermissionDenied | Necessary permission is missing. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- com.magicleap.permission.EYE_CAMERA (protection level: dangerous)
API Level:
- 26
MLEyeCameraUpdateSettings
MLResult MLEyeCameraUpdateSettings(
MLHandle handle,
const MLEyeCameraSettings * settings
)
Update the eye camera settings.
Parameters
MLHandle | handle | Camera handle obtained from MLEyeCameraConnect. |
const MLEyeCameraSettings * | settings | Pointer to MLEyeCameraSettings. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | Settings updated successfully. |
MLResult | MLResult_UnspecifiedFailure | Failed due to internal error. |
Required Permissions:
- None
API Level:
- 26
MLEyeCameraGetLatestCameraData
MLResult MLEyeCameraGetLatestCameraData(
MLHandle handle,
uint64_t timeout_ms,
MLEyeCameraData * out_data
)
Poll for Frames.
Parameters
MLHandle | handle | Camera handle obtained from MLEyeCameraConnect. |
uint64_t | timeout_ms | Timeout in milliseconds. |
MLEyeCameraData * | out_data | Eye camera data. Will be set to NULL if no valid data is available at this time. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | Camera frames fetched successfully. |
MLResult | MLResult_Timeout | Returned because no new frame available at this time. |
MLResult | MLResult_UnspecifiedFailure | Failed due to internal error. |
Required Permissions:
- None
Returns MLEyeCameraData with this latest data when available. The memory is owned by the system. Application should copy the data it needs to cache and release the memory by calling MLEyeCameraReleaseCameraData.
This is a blocking call. API is not thread safe.
If there are no new camera frames within the timeout_ms duration then the API will return MLResult_Timeout.
API Level:
- 26
MLEyeCameraReleaseCameraData
MLResult MLEyeCameraReleaseCameraData(
MLHandle handle,
MLEyeCameraData * eye_camera_data
)
Releases specified MLEyeCameraData object.
Parameters
MLHandle | handle | Camera handle obtained from MLEyeCameraConnect. |
MLEyeCameraData * | eye_camera_data | Pointer to a valid MLEyeCameraData object. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | Successfully released eye camera data. |
MLResult | MLResult_UnspecifiedFailure | Failed due to internal error. |
Required Permissions:
- None
This function should be called exactly once for each call to MLEyeCameraGetLatestCameraData.
API Level:
- 26
MLEyeCameraDisconnect
MLResult MLEyeCameraDisconnect(
MLHandle handle
)
Disconnect from eye camera(s).
Parameters
MLHandle | handle | Camera handle obtained from MLEyeCameraConnect. |
Returns
MLResult | MLResult_InvalidParam | Invalid handle. |
MLResult | MLResult_Ok | Disconnected camera(s) successfully. |
MLResult | MLResult_UnspecifiedFailure | Failed to disconnect camera(s). |
Required Permissions:
- None
This will disconnect from all the eye camera(s) currently connected.
API Level:
- 26