Skip to main content
Version: 12 Dec 2024

ml_eye_calibration.h

Classes

Name
structMLEyeCalibrationState
A struct representing the eye calibration state.

Types

Name
typedef struct MLEyeCalibrationStateMLEyeCalibrationState
A struct representing the eye calibration state.

Enums

Name
enumMLEyeCalibrationStatus
{
MLEyeCalibrationStatus_None = 0,
MLEyeCalibrationStatus_Coarse = 1,
MLEyeCalibrationStatus_Fine = 2,
MLEyeCalibrationStatus_Ensure32Bits = 0x7FFFFFFF
}
A set of possible eye calibration codes that the eye calibration system can report.

Functions

Name
voidMLEyeCalibrationStateInit(MLEyeCalibrationState * inout_state)
Initialize MLEyeCalibrationState with version.
MLResultMLEyeCalibrationCreateClient(MLHandle * out_handle)
Creates an eye calibration client.
MLResultMLEyeCalibrationDestroyClient(MLHandle handle)
Destroys an eye calibration client.
MLResultMLEyeCalibrationGetState(MLHandle handle, MLEyeCalibrationState * out_state)
Gets information about the user's current eye calibration.

Enums Documentation

MLEyeCalibrationStatus

EnumeratorValueDescription
MLEyeCalibrationStatus_None0No valid calibration was found for eyes.
MLEyeCalibrationStatus_Coarse1Calibration is of lower accuracy.
MLEyeCalibrationStatus_Fine2Calibration is of higher accuracy.
MLEyeCalibrationStatus_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 bits.

A set of possible eye calibration codes that the eye calibration system can report.

Has a calibration occurred. If so, what was the granularity.

Deprecated

Deprecated since 1.6.0. Scheduled for removal.

API Level:

  • 20

Types Documentation

MLEyeCalibrationState

typedef struct MLEyeCalibrationState MLEyeCalibrationState;

A struct representing the eye calibration state.

More Info

Deprecated

Deprecated since 1.6.0. Scheduled for removal.

API Level:

  • 20

Functions Documentation

MLEyeCalibrationStateInit

static inline void MLEyeCalibrationStateInit(
MLEyeCalibrationState * inout_state
)

Initialize MLEyeCalibrationState with version.

Parameters

MLEyeCalibrationState *inout_stateSet up the version for inout_state and zero all other fields.
Deprecated

Deprecated since 1.6.0. Scheduled for removal.

API Level:

  • 20

MLEyeCalibrationCreateClient

MLResult MLEyeCalibrationCreateClient(
MLHandle * out_handle
)

Creates an eye calibration client.

Parameters

MLHandle *out_handleA pointer to an MLHandle to the newly created eye calibration client.

Returns

MLResultMLResult_InvalidParamFailed to create eye calibration client due to an invalid input parameter.
MLResultMLResult_OkSuccessfully created eye calibration client.
MLResultMLResult_UnspecifiedFaiureFailed to create eye calibration client due to an unknown failure.

Required Permissions:

  • None
Deprecated

Deprecated since 1.6.0. Scheduled for removal.

API Level:

  • 20

MLEyeCalibrationDestroyClient

MLResult MLEyeCalibrationDestroyClient(
MLHandle handle
)

Destroys an eye calibration client.

Parameters

MLHandlehandleMLHandle to the eye calibration cleint created by MLEyeCalibrationCreateClient.

Returns

MLResultMLResult_InvalidParamMLHandle is invalid.
MLResultMLResult_OkSuccessfully destroyed eye calibration client.
MLResultMLResult_UnspecifiedFaiureFailed to destroy eye calibration client due to an unknown failure.

Required Permissions:

  • None
Deprecated

Deprecated since 1.6.0. Scheduled for removal.

API Level:

  • 20

MLEyeCalibrationGetState

MLResult MLEyeCalibrationGetState(
MLHandle handle,
MLEyeCalibrationState * out_state
)

Gets information about the user's current eye calibration.

Parameters

MLHandlehandleA handle to an Eye calibration client created by MLEyeCalibrationCreateClient.
MLEyeCalibrationState *out_stateA pointer to MLEyeCalibrationState where information about the eye calibration state is to be stored.

Returns

MLResultMLResult_InvalidParamFailed to receive eye calibration state due to an invalid input parameter.
MLResultMLResult_OkSuccessfully received eye calibration state.
MLResultMLResult_UnspecifiedFailureFailed to receive eye calibration state due to an unknown failure.

Required Permissions:

  • None
Deprecated

Deprecated since 1.6.0. Scheduled for removal.

API Level:

  • 20

Source code

// %BANNER_BEGIN%
// ---------------------------------------------------------------------
// %COPYRIGHT_BEGIN%
// Copyright (c) 2022 Magic Leap, Inc. All Rights Reserved.
// Use of this file is governed by the Software License Agreement,
// located here: https://www.magicleap.com/software-license-agreement-ml2
// Terms and conditions applicable to third-party materials accompanying
// this distribution may also be found in the top-level NOTICE file
// appearing herein.
// %COPYRIGHT_END%
// ---------------------------------------------------------------------
// %BANNER_END%

#pragma once

#include "ml_api.h"
#include "ml_types.h"

#include <string.h>

ML_EXTERN_C_BEGIN

typedef enum MLEyeCalibrationStatus {
MLEyeCalibrationStatus_None = 0,
MLEyeCalibrationStatus_Coarse = 1,
MLEyeCalibrationStatus_Fine = 2,
MLEyeCalibrationStatus_Ensure32Bits = 0x7FFFFFFF
} MLEyeCalibrationStatus;

typedef ML_DEPRECATED_MSG("Use XR_ML_user_calibration OpenXR extention.") struct MLEyeCalibrationState {
uint32_t version;
MLEyeCalibrationStatus eye_calibration;
int64_t epoch_timestamp_us;
} MLEyeCalibrationState;

ML_DEPRECATED_MSG("Use XR_ML_user_calibration OpenXR extention.")
ML_STATIC_INLINE void MLEyeCalibrationStateInit(MLEyeCalibrationState *inout_state) {
if (inout_state) {
memset(inout_state, 0, sizeof(MLEyeCalibrationState));
inout_state->version = 1;
}
}

ML_DEPRECATED_MSG("Use XR_ML_user_calibration OpenXR extention.")
ML_API MLResult ML_CALL MLEyeCalibrationCreateClient(MLHandle *out_handle);

ML_DEPRECATED_MSG("Use XR_ML_user_calibration OpenXR extention.")
ML_API MLResult ML_CALL MLEyeCalibrationDestroyClient(MLHandle handle);

ML_DEPRECATED_MSG("Use XR_ML_user_calibration OpenXR extention.")
ML_API MLResult ML_CALL MLEyeCalibrationGetState(MLHandle handle, MLEyeCalibrationState *out_state);

ML_EXTERN_C_END