67 #define QTM_STATUS_CFG_BLK_ID 0x180000u
70 #define QTM_CAL_CFG_BLK_ID 0x180001u
static Result QTMU_GetTrackingData(QtmTrackingData *outData)
Gets the current normalized eye tracking data, made suitable for 3D programming.
Definition: qtm.h:306
Result QTMSP_NotifyTopLcdPowerOn(void)
Called by GSP's LCD driver during top LCD power-on to signal to QTM that it may power on and/or recon...
QtmServiceName
QTM service name enum, excluding qtm:c
Definition: qtm.h:205
@ QTM_SERVICE_SYSTEM_PROCESS
qtm:sp: has access to all qtm:s (and qtm:u) commands, and merely has a few more commands that GSP use...
Definition: qtm.h:227
@ QTM_SERVICE_USER
qtm:u: has eye-tracking commands and IR LED control commands, but for some reason cannot fetch ambian...
Definition: qtm.h:210
@ QTM_SERVICE_SYSTEM
qtm:s: has access to all qtm:u commands, plus luminosity sensor, plus manual barrier position setting...
Definition: qtm.h:217
void qtmExit(void)
Exits QTM.
Result QTMU_SetIrLedStatus(bool on)
Turns the IR LED on or off during manual control.
float qtmComputeInverseAspectRatio(const QtmTrackingData *data)
Computes a rough approximation of the inverse of the aspect ration of the camera based on eye trackin...
Result QTMU_DisableManualIrLedControl(void)
Temporarily disables manual control of the IR LED by user, re-enabling its automatic control.
float qtmComputeFovX(const QtmTrackingData *data)
Computes an approximation of the horizontal angular field of view of the camera based on eye tracking...
float qtmComputeFovY(const QtmTrackingData *data)
Computes an approximation of the vertical angular field of view of the camera based on eye tracking d...
Result QTMS_GetCurrentBarrierPosition(u8 *outPosition)
Gets the current position of the parallax barrier (offset in iod/12 units, slit width of 6 units).
bool qtmIsInitialized(void)
Checks whether or not a qtm:u, qtm:s or qtm:sp session is active.
Result qtmInit(QtmServiceName serviceName)
Initializes QTM (except qtm:c).
Result QTMSP_IsExpanderInUse(bool *outActive)
Called by GSP's LCD driver to know whether or not QTM's expander thread is using the TI TCA6416A expa...
bool qtmCheckServicesRegistered(void)
Check whether or not QTM services are registered.
Result QTMS_SetIrLedStatusOverride(bool on)
Temporarily overrides IR LED state.
static Result QTMU_GetRawTrackingData(QtmRawTrackingData *outData)
Gets the current raw eye tracking data.
Definition: qtm.h:279
QtmStatus
QTM enablement status (when cameras not in use by user), set by qtm:s.
Definition: qtm.h:77
@ QTM_STATUS_SS3D_DISABLED
QTM "super stable 3D" feature is disabled. Parallax barrier hardware state is configured to match O3D...
Definition: qtm.h:79
@ QTM_STATUS_ENABLED
QTM is fully enabled.
Definition: qtm.h:78
@ QTM_STATUS_UNAVAILABLE
QTM is unavailable: either "blacklisted" (usually by NS) for the current title, or console is a N2DSX...
Definition: qtm.h:92
Result QTMS_GetCameraLuminance(float *outLuminanceLux)
Gets the average ambient luminance as perceived by the inner camera (in lux).
Result QTMS_DisableAutoBarrierControl(void)
Temporarily disables automatic barrier control (when in 3D mode with "super stable 3D" enabled).
Result QTMU_GetRawTrackingDataEx(QtmRawTrackingData *outData, s64 predictionTimePointOrZero)
Gets the current raw eye tracking data, with an optional prediction made for predictionTimePointOrZer...
Result QTMS_SetCalibrationData(const QtmCalibrationData *cal, bool saveCalToCfg)
Sets calibration data, taking effect immediately, and optionally saves it to cfg.
Result qtmClearIrLedOverrides(void)
Attempts to clear IR LED overrides from any of the relevant commands in qtm:u, qtm:s (and qtm:c) comm...
Result QTMS_SetQtmStatus(QtmStatus qtmStatus)
Gets the current QTM status (enabled/ss3d disabled/unavailable).
Result QTMSP_NotifyTopLcdModeChange(u8 newMode)
Called by GSP's LCD driver to signal 2D<>3D mode change.
Result QTMS_SetCenterBarrierPosition(float position)
Sets the neutral (center) barrier position/offset in calibration, without saving it to cfg.
float qtmComputeHeadTiltAngle(const QtmTrackingData *data)
Computes the user's head tilt angle, that is, the angle between the line through both eyes and the ca...
Result QTMU_IsCurrentAppBlacklisted(bool *outBlacklisted)
Checks whether or not QTM has been blacklisted, ie.
Result QTMU_GetTrackingDataEx(QtmTrackingData *outData, s64 predictionTimePointOrZero)
Gets the current normalized eye tracking data, made suitable for 3D programming with an optional pred...
float qtmEstimateEyeToCameraDistance(const QtmTrackingData *data)
Estimates the distance between the user's eyes and the camera, based on eye tracking data.
Result QTMSP_NotifyTopLcdPowerOff(void)
Called by GSP's LCD driver during top LCD power-on to signal to QTM that it needs to switch the paral...
Result QTMS_EnableAutoBarrierControl(void)
Enables automatic barrier control when in 3D mode with "super stable 3D" enabled.
Result QTMU_EnableManualIrLedControl(void)
Temporarily enables manual control of the IR LED by user, disabling its automatic control.
Result QTMS_GetQtmStatus(QtmStatus *outQtmStatus)
Gets the current QTM status (enabled/ss3d disabled/unavailable).
QtmEyeSide
Left eye or right eye, for QtmTrackingData and QtmRawTrackingData.
Definition: qtm.h:134
@ QTM_EYE_LEFT
Left eye.
Definition: qtm.h:135
@ QTM_EYE_NUM
Number of eyes.
Definition: qtm.h:138
@ QTM_EYE_RIGHT
Right eye.
Definition: qtm.h:136
Handle * qtmGetSessionHandle(void)
Returns a pointer to the current qtm:u / qtm:s / qtm:sp session handle.
Result QTMS_SetBarrierPosition(u8 position)
Temporarily sets the parallax barrier's position (offset in iod/12 units, assuming slit width of 6 un...
QTM calibration data (fully enabled/SS3D disabled) in cfg. Usually all-zero on N2DSXL.
Definition: qtm.h:111
float translationY
Lens Y coord in inner camera space? Very low value and seems to be unused.
Definition: qtm.h:127
float rotationZ
Optimal eye-to-camera angle, in radians, without accounting for lens distortion.
Definition: qtm.h:128
float viewingDistance
Optimal viewing distance between user and top screen, assuming iod to be 62mm.
Definition: qtm.h:130
float translationX
Lens X coord in inner camera space? Very low value and seems to be unused.
Definition: qtm.h:126
float fovX
Camera's horizontal FoV in degrees, without accounting for lens distortion.
Definition: qtm.h:129
float centerBarrierPosition
Neutral (center) barrier position/offset (with slit width of 6 units), when the user is facing direct...
Definition: qtm.h:124
QTM raw eye tracking data.
Definition: qtm.h:142
s64 samplingTick
Time point the current measurements were made.
Definition: qtm.h:166
u8 _padding[3]
Padding.
Definition: qtm.h:150
float confidenceLevel
Eye tracking confidence level (0 to 1).
Definition: qtm.h:152
float dRoll
Difference in gyro roll from position at console boot.
Definition: qtm.h:164
float dYaw
Difference in gyro yaw from position at console boot.
Definition: qtm.h:163
bool eyesTracked
Eye position detected or predicted, equals (confidenceLevel > 0).
Definition: qtm.h:149
u32 singletonQtmPtr
Pointer to eye-tracking singleton pointer, in QTM's .bss, located in N3DS extra memory.
Definition: qtm.h:151
float rawEyeCameraCoordinates[QTM_EYE_NUM][2]
Raw predicted or detected eye coordinates.
Definition: qtm.h:160
float dPitch
Difference in gyro pitch from position at console boot.
Definition: qtm.h:162
QTM status data (fully enabled/SS3D disabled) in cfg. Usually all-zero on N2DSXL.
Definition: qtm.h:96
u8 gvLoadMode
"Global variable" (.data) section load mode? Unused.
Definition: qtm.h:106
QtmStatus defaultStats
QTM status at boot (fully enabled or SS3D disabled).
Definition: qtm.h:97
u8 _padding[2]
Padding.
Definition: qtm.h:107
QTM processed eye tracking data, suitable for 3D programming.
Definition: qtm.h:170
bool eyesDetected
Whether or not the user's eyes have actually been detected with full confidence.
Definition: qtm.h:173
bool faceDetected
Whether or not the entirety of the user's face has been detected with good confidence.
Definition: qtm.h:172
u8 _padding[3]
Padding.
Definition: qtm.h:176
float dPitch
Difference in gyro pitch from position at console boot.
Definition: qtm.h:196
float confidenceLevel
Eye tracking confidence level (0 to 1).
Definition: qtm.h:178
float eyeWorldCoordinates[QTM_EYE_NUM][2]
Normalized eye coordinates, for each eye, in world space.
Definition: qtm.h:194
bool clamped
Whether or not the normalized eye coordinates have been clamped after accounting for lens distortion.
Definition: qtm.h:175
bool eyesTracked
Eye position detected or tracked with some confidence, equals (confidenceLevel > 0)....
Definition: qtm.h:171
float dYaw
Difference in gyro yaw from position at console boot.
Definition: qtm.h:197
u8 _unused
Unused.
Definition: qtm.h:174
s64 samplingTick
Time point the current measurements were made.
Definition: qtm.h:201
float eyeCameraCoordinates[QTM_EYE_NUM][2]
Normalized eye coordinates, for each eye, after accounting for lens distortion, centered around camer...
Definition: qtm.h:186
float dRoll
Difference in gyro roll from position at console boot.
Definition: qtm.h:198
int64_t s64
64-bit signed integer
Definition: types.h:29
uint8_t u8
would be nice if newlib had this already
Definition: types.h:21
u32 Handle
Resource handle.
Definition: types.h:41
s32 Result
Function result.
Definition: types.h:42
uint32_t u32
32-bit unsigned integer
Definition: types.h:23