MLEyeCamera
NameSpace: MagicLeap
MLEyeCamera class exposes static functions to query eye camera related functions. Most functions are currently a direct pass through functions to the native C-API functions and incur no overhead.
Inherits from:
MLAutoAPISingleton< MLEyeCamera >,
MLLazySingleton< T >
Public Fields
ActiveCamerasCount
The number of active eye cameras.
public static int ActiveCamerasCount { get; set; }
Public Methods
void CopyImageFrameDataToByteArray
Converts an image frame data pointer into a byte array.
public static void CopyImageFrameDataToByteArray(
EyeCameraFrameBuffer imageFrame,
ref byte [] byteArray
)
Parameters
Type | Name | Description |
---|---|---|
EyeCameraFrameBuffer | imageFrame | The associated eye camera frame buffer for an eye camera. |
ref byte [] | byteArray | The image data from the native eye camera data as a byte array. |
MLResult GetLatestCameraData
Polls for Frames. Returns EyeCameraData with this latest data when available. If there are no new camera frames within the timeout_ms duration then the API will return MLResult_Timeout.
public static MLResult GetLatestCameraData(
out EyeCameraData outData,
UInt64 timeoutMS
)
Parameters
Type | Name | Description |
---|---|---|
out EyeCameraData | outData | Eye camera data to be output. |
UInt64 | timeoutMS | Timeout in milliseconds. |
Returns: MLResult.Result will be MLResult.Code.Ok if succesfully fetched the camera frames and released the native data. MLResult.Result will be MLResult.Code.Timeout returned because no new frame available at this time. MLResult.Result will be MLResult.Code.InvalidParam if one of the parameters is invalid. MLResult.Result will be MLResult.Code.UnspecifiedFailure if the operation failed due to an internal error.
MLResult UpdateSettings
Update the eye camera settings.
public static MLResult UpdateSettings(
MLEyeCameraIdentifier cameras
)
Parameters
Type | Name | Description |
---|---|---|
MLEyeCameraIdentifier | cameras | The specific eye cameras that will be active with the updated settings. |
Returns: MLResult.Result will be MLResult.Code.Ok if the settings updated successfully. MLResult.Result will be MLResult.Code.InvalidParam if one of the parameters is invalid. MLResult.Result will be MLResult.Code.UnspecifiedFailure if the operation failed due to an internal error.
Protected Methods
StartAPI
Do API-specific creation/initialization of ML resources for this API, such as creating trackers, etc. Called automatically the first time Instance is accessed. Error checking on the return value is performed in the base class.
protected virtual override MLResult.Code StartAPI()
Reimplements: StartAPI
StopAPI
API-specific cleanup. Will be called whenever MLDevice is destroyed (at the latest, when the application is shutting down). Error checking on the return value is performed in the base class.
protected virtual override MLResult.Code StopAPI()
Reimplements: StopAPI
Public Attributes
ActiveCameras
The enumerated value representing which eye cameras are currently active.
public static MLEyeCameraIdentifier ActiveCameras => (MLEyeCameraIdentifier)Instance.settings.Cameras;
Type | Description |
---|---|
MLEyeCameraIdentifier | Enumeration of all the available eye camera sensors. |
Returns:
MaxFrameCount
The maximum number of eye camera frames.
public const int MaxFrameCount = 4;
Public Enums
MLEyeCameraIdentifier
Enumeration of all the available eye camera sensors.
Enumerator | Value | Description |
---|---|---|
None | 0 | None. |
LeftTemple | 1 << 0 | Left temple eye camera. |
LeftNasal | 1 << 1 | Left nasal eye camera. |
RightNasal | 1 << 2 | Right nasal eye camera. |
RightTemple | 1 << 3 | Right temple eye camera. |
All | LeftTemple | LeftNasal |