MLWorldCamera
NameSpace: MagicLeap
Magic Leap 2 has three world cameras which it uses for environment tracking. The three cameras area located on the left, center, and right side of the headset. This API will provide a way to query for the frames from these world cameras, at this point the app will not be able to configure the world camera parameters. More...
Inherits from:
MLAutoAPISingleton< MLWorldCamera >,
MLLazySingleton< T >
Detailed Description
public class MLWorldCamera : MLAutoAPISingleton< MLWorldCamera >
Details*
This is an experimental API which may be modified or removed without any prior notice.
Public Fields
CurrentSettings
public Settings CurrentSettings { get; set; }
Type | Description |
---|---|
Settings | A structure to encapsulate the camera settings. |
IsConnected
public bool IsConnected { get; set; }
Public Methods
MLResult Connect
Connect to world cameras.
public MLResult Connect(
in Settings settings
)
Parameters
Type | Name | Description |
---|---|---|
in Settings | settings | A structure to encapsulate the camera settings. |
MLResult Disconnect
Disconnect from world camera. This will disconnect from all the world camera currently connected.
public MLResult Disconnect()
MLResult GetLatestWorldCameraData
Poll for Frames. Returns #MLWorldCameraData with this latest data when available. The memory is owned by the system. Application should copy the data it needs to cache it and then release the memory by calling #MLWorldCameraReleaseCameraData. This is a blocking call. API is not thread safe. If there are no new world camera data frames for a given duration (duration determined by the system) then the API will return MLResult_Timeout. To Do : Are there any other meaningful return codes that we need to consider. Say something like MLResult_ResourceNotAvailble for cases where the world camera is not ready yet or is not generating any data because its been turned off.
public MLResult GetLatestWorldCameraData(
out Frame [] data,
uint timeOutMs =1
)
Parameters
Type | Name | Description |
---|---|---|
out Frame [] | data | A structure to encapsulate per plane info for each camera frame. |
uint | timeOutMs |
MLResult UpdateSettings
Update the world camera settings.
public MLResult UpdateSettings(
in Settings settings
)
Parameters
Type | Name | Description |
---|---|---|
in Settings | settings | A structure to encapsulate the camera settings. |
Protected Methods
OnApplicationPause
Callback sent to all MagicLeap APIs on application pause.
protected virtual override void OnApplicationPause(
bool pauseStatus
)
Parameters
Type | Name | Description |
---|---|---|
bool | pauseStatus | True if the application is paused, else False. |
Reimplements: OnApplicationPause
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 Enums
CameraId
Enumeration of all the available world camera sensors.
Enumerator | Value | Description |
---|---|---|
Left | 1 << 0 | Left World camera. |
Right | 1 << 1 | Right World camera. |
Center | 1 << 2 | Center World camera. |
All | Left | Right |
Mode
Enumeration of world camera modes.
Enumerator | Value | Description |
---|---|---|
Unknown | 0 | None. |
LowExposure | 1 << 0 | Low exposure mode. This mode is currently only available when the controller is being tracked. |
NormalExposure | 1 << 1 | Normal exposure mode. |