Monado OpenXR Runtime
xrt_device.h
Go to the documentation of this file.
1// Copyright 2019-2024, Collabora, Ltd.
2// Copyright 2024-2025, NVIDIA CORPORATION.
3// SPDX-License-Identifier: BSL-1.0
4/*!
5 * @file
6 * @brief Header defining an xrt display or controller device.
7 * @author Jakob Bornecrantz <jakob@collabora.com>
8 * @author Moshi Turner <moshiturner@protonmail.com>
9 * @author Korcan Hussein <korcan.hussein@collabora.com>
10 * @ingroup xrt_iface
11 */
12
13#pragma once
14
15#include "xrt/xrt_defines.h"
18#include "xrt/xrt_limits.h"
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24struct xrt_tracking;
25
26#define XRT_DEVICE_NAME_LEN 256
27
28
29/*!
30 * A per-lens/display view information.
31 *
32 * @ingroup xrt_iface
33 */
35{
36 /*!
37 * @brief Viewport position on the screen.
38 *
39 * In absolute screen coordinates on an unrotated display, like the
40 * HMD presents it to the OS.
41 *
42 * This field is only used by @ref comp to setup the device rendering.
43 *
44 * If the view is being rotated by xrt_view.rot 90° right in the
45 * distortion shader then `display.w_pixels == viewport.h_pixels` and
46 * `display.h_pixels == viewport.w_pixels`.
47 */
48 struct
49 {
50 uint32_t x_pixels;
51 uint32_t y_pixels;
52 uint32_t w_pixels;
53 uint32_t h_pixels;
55
56 /*!
57 * @brief Physical properties of this display (or the part of a display
58 * that covers this view).
59 *
60 * Not in absolute screen coordinates but like the clients see them i.e.
61 * after rotation is applied by xrt_view::rot.
62 * This field is only used for the clients' swapchain setup.
63 *
64 * The xrt_view::display::w_pixels and xrt_view::display::h_pixels
65 * become the recommended image size for this view, after being scaled
66 * by the debug environment variable `XRT_COMPOSITOR_SCALE_PERCENTAGE`.
67 */
68 struct
69 {
70 uint32_t w_pixels;
71 uint32_t h_pixels;
73
74 /*!
75 * @brief Rotation 2d matrix used to rotate the position of the output
76 * of the distortion shaders onto the screen.
77 *
78 * If the distortion shader is based on a mesh, then this matrix rotates
79 * the vertex positions.
80 */
82};
83
84/*!
85 * @brief Compositor information for a device.
86 */
88{
89 //! The direction scanout on the display occurs.
91 /*!
92 * The amount of time it takes to scanout the display in nanoseconds, from the start of the scanout, to the end
93 * of the scanout.
94 *
95 * @note alignas for 32 bit client support, see @ref ipc-design
96 */
97 XRT_ALIGNAS(8) int64_t scanout_time_ns;
98};
99
100/*!
101 * @brief Compositor mode information for a device.
102 */
104{
105 //! The amount of nanoseconds between frames.
107};
108
109/*!
110 * All of the device components that deals with interfacing to a users head.
111 *
112 * HMD is probably a bad name for the future but for now will have to do.
113 *
114 * @ingroup xrt_iface
115 */
117{
118 /*!
119 * @brief The hmd screen as an unrotated display, like the HMD presents
120 * it to the OS.
121 *
122 * This field is used by @ref comp to setup the extended mode window.
123 */
124 struct
125 {
126 int w_pixels;
127 int h_pixels;
128 //! Nominal frame interval
130 } screens[1];
131
132 /*!
133 * Display information.
134 *
135 * For now hardcoded display to two.
136 */
137 struct xrt_view views[XRT_MAX_VIEWS];
138
139 size_t view_count;
140 /*!
141 * Array of supported blend modes.
142 */
143 enum xrt_blend_mode blend_modes[XRT_MAX_DEVICE_BLEND_MODES];
144 size_t blend_mode_count;
145
146 /*!
147 * Distortion information.
148 */
149 struct
150 {
151 //! Supported distortion models, a bitfield.
153 //! Preferred disortion model, single value.
155
156 struct
157 {
158 //! Data.
159 float *vertices;
160 //! Number of vertices.
161 uint32_t vertex_count;
162 //! Stride of vertices
163 uint32_t stride;
164 //! 1 or 3 for (chromatic aberration).
166
167 //! Indices, for triangle strip.
169 //! Number of indices for the triangle strips (one per view).
170 uint32_t index_counts[XRT_MAX_VIEWS];
171 //! Offsets for the indices (one offset per view).
172 uint32_t index_offsets[XRT_MAX_VIEWS];
173 //! Total number of elements in mesh::indices array.
175 } mesh;
176
177 //! distortion is subject to the field of view
178 struct xrt_fov fov[XRT_MAX_VIEWS];
179 } distortion;
180};
181
182/*!
183 * A single named input, that sits on a @ref xrt_device.
184 *
185 * @ingroup xrt_iface
186 */
188{
189 //! Is this input active.
190 bool active;
191
192 //! alignas for 32 bit client support, see @ref ipc-design
193 XRT_ALIGNAS(8) int64_t timestamp;
194
195 enum xrt_input_name name;
196
197 union xrt_input_value value;
198};
199
200/*!
201 * A single named output, that sits on a @ref xrt_device.
202 *
203 * @ingroup xrt_iface
204 */
206{
207 enum xrt_output_name name;
208};
209
210
211/*!
212 * A binding pair, going @p from a binding point to a @p device input.
213 *
214 * @ingroup xrt_iface
215 */
217{
218 enum xrt_input_name from; //!< From which name.
219 enum xrt_input_name device; //!< To input on the device.
220};
221
222/*!
223 * A binding pair, going @p from a binding point to a @p device output.
224 *
225 * @ingroup xrt_iface
226 */
228{
229 enum xrt_output_name from; //!< From which name.
230 enum xrt_output_name device; //!< To output on the device.
231};
232
233/*!
234 * A binding profile, has lists of binding pairs to goes from device in @p name
235 * to the device it hangs off on.
236 *
237 * @ingroup xrt_iface
238 */
240{
241 //! Device this binding emulates.
243
244 struct xrt_binding_input_pair *inputs;
245 size_t input_count;
246 struct xrt_binding_output_pair *outputs;
247 size_t output_count;
248};
249
250/*!
251 * Higher level features for devices.
252 */
254{
255 XRT_DEVICE_FEATURE_HAND_TRACKING_LEFT = 0,
256 XRT_DEVICE_FEATURE_HAND_TRACKING_RIGHT,
257 XRT_DEVICE_FEATURE_EYE_TRACKING,
258 XRT_DEVICE_FEATURE_FACE_TRACKING,
259 XRT_DEVICE_FEATURE_MAX_ENUM,
260};
261
262/*!
263 * Output limits of a particular device
264 */
266{
267 //! The sample rate of the device's haptic PCM support, 0 if haptic PCM is not supported.
269};
270
271/*!
272 * Static data of supported features of the @ref xrt_device this struct sits on.
273 *
274 * This struct needs to always be a piece of data as it sits inside of the
275 * shared memory area in the IPC layer, so no pointers please.
276 *
277 * @ingroup xrt_iface
278 */
280{
281 bool orientation_tracking;
282 bool position_tracking;
283 bool hand_tracking;
284 bool eye_gaze;
285 bool presence;
286 bool force_feedback;
287 bool ref_space_usage;
288 bool form_factor_check;
289 bool stage;
290 bool face_tracking;
291 bool body_tracking;
292 bool body_tracking_calibration;
293 bool battery_status;
294 bool brightness_control;
295 bool compositor_info;
296
297 bool planes;
298 enum xrt_plane_detection_capability_flags_ext plane_capability_flags;
299};
300
301/*!
302 * @interface xrt_device
303 *
304 * A single HMD or input device.
305 *
306 * @ingroup xrt_iface
307 */
309{
310 //! Enum identifier of the device.
312 enum xrt_device_type device_type;
313
314 //! A string describing the device.
315 char str[XRT_DEVICE_NAME_LEN];
316
317 //! A unique identifier. Persistent across configurations, if possible.
318 char serial[XRT_DEVICE_NAME_LEN];
319
320 //! Null if this device does not interface with the users head.
322
323 //! Always set, pointing to the tracking system for this device.
325
326 //! Number of bindings in xrt_device::binding_profiles
328 // Array of alternative binding profiles.
329 struct xrt_binding_profile *binding_profiles;
330
331 //! Number of inputs.
333 //! Array of input structs.
335
336 //! Number of outputs.
338 //! Array of output structs.
340
341 //! What features/functions/things does this device supports?
342 struct xrt_device_supported supported;
343
344
345 /*
346 *
347 * Functions.
348 *
349 */
350
351 /*!
352 * Update any attached inputs.
353 *
354 * @param[in] xdev The device.
355 */
356 xrt_result_t (*update_inputs)(struct xrt_device *xdev);
357
358 /*!
359 * @brief Get relationship of a tracked device to the tracking origin
360 * space as the base space.
361 *
362 * It is the responsibility of the device driver to do any prediction,
363 * there are helper functions available for this.
364 *
365 * The timestamps are system monotonic timestamps, such as returned by
366 * os_monotonic_get_ns().
367 *
368 * @param[in] xdev The device.
369 * @param[in] name Some devices may have multiple poses on
370 * them, select the one using this field. For
371 * HMDs use @p XRT_INPUT_GENERIC_HEAD_POSE.
372 * For Unbounded Reference Space you can use
373 * @p XRT_INPUT_GENERIC_UNBOUNDED_SPACE_POSE
374 * to get the origin of that space.
375 * @param[in] at_timestamp_ns If the device can predict or has a history
376 * of positions, this is when the caller
377 * wants the pose to be from.
378 * @param[out] out_relation The relation read from the device.
379 *
380 * @see xrt_input_name
381 */
383 enum xrt_input_name name,
384 int64_t at_timestamp_ns,
385 struct xrt_space_relation *out_relation);
386
387 /*!
388 * @brief Get relationship of hand joints to the tracking origin space as
389 * the base space.
390 *
391 * It is the responsibility of the device driver to either do prediction
392 * or return joints from a previous time and write that time out to
393 * @p out_timestamp_ns.
394 *
395 * The timestamps are system monotonic timestamps, such as returned by
396 * os_monotonic_get_ns().
397 *
398 * @param[in] xdev The device.
399 * @param[in] name Some devices may have multiple poses on
400 * them, select the one using this field. For
401 * hand tracking use @p XRT_INPUT_GENERIC_HAND_TRACKING_DEFAULT_SET.
402 * @param[in] desired_timestamp_ns If the device can predict or has a history
403 * of positions, this is when the caller
404 * wants the pose to be from.
405 * @param[out] out_value The hand joint data read from the device.
406 * @param[out] out_timestamp_ns The timestamp of the data being returned.
407 *
408 * @see xrt_input_name
409 */
410 xrt_result_t (*get_hand_tracking)(struct xrt_device *xdev,
411 enum xrt_input_name name,
412 int64_t desired_timestamp_ns,
413 struct xrt_hand_joint_set *out_value,
414 int64_t *out_timestamp_ns);
415
416 /*!
417 * @brief Get the requested blend shape properties & weights for a face tracker
418 *
419 * @param[in] xdev The device.
420 * @param[in] facial_expression_type The facial expression data type (XR_FB_face_tracking,
421 * XR_HTC_facial_tracking, etc).
422 * @param[in] at_timestamp_ns Timestamp to be optionally used for prediction/history. For OXR extensions
423 * that do not pass a timestamp, the current timestamp is used.
424 * @param[in] out_value Set of requested expression weights & blend shape properties.
425 *
426 * @see xrt_input_name
427 */
428 xrt_result_t (*get_face_tracking)(struct xrt_device *xdev,
429 enum xrt_input_name facial_expression_type,
430 int64_t at_timestamp_ns,
431 struct xrt_facial_expression_set *out_value);
432
433 /*!
434 * @brief Gets the face tracking calibration state
435 *
436 * @param[in] xdev The device.
437 * @param[in] out_value Is face tracking calibrated?
438 *
439 * @see xrt_input_name
440 */
441 xrt_result_t (*get_face_calibration_state_android)(struct xrt_device *xdev, bool *out_face_is_calibrated);
442
443 /*!
444 * @brief Get the body skeleton in T-pose, used to query the skeleton hierarchy, scale, proportions etc
445 *
446 * @param[in] xdev The device.
447 * @param[in] body_tracking_type The body joint set type (XR_FB_body_tracking,
448 * XR_META_body_tracking_full_body, etc).
449 * @param[in] out_value The body skeleton hierarchy/properties.
450 *
451 * @see xrt_input_name
452 */
454 enum xrt_input_name body_tracking_type,
455 struct xrt_body_skeleton *out_value);
456
457 /*!
458 * @brief Get the joint locations for a body tracker
459 *
460 * @param[in] xdev The device.
461 * @param[in] body_tracking_type The body joint set type (XR_FB_body_tracking,
462 * XR_META_body_tracking_full_body, etc).
463 * @param[in] desired_timestamp_ns If the device can predict or has a history
464 * of locations, this is when the caller
465 * @param[in] out_value Set of body joint locations & properties.
466 *
467 * @see xrt_input_name
468 */
469 xrt_result_t (*get_body_joints)(struct xrt_device *xdev,
470 enum xrt_input_name body_tracking_type,
471 int64_t desired_timestamp_ns,
472 struct xrt_body_joint_set *out_value);
473
474 /*!
475 * @brief XR_META_body_tracking_calibration - body tracking extension to reset the body tracking calibration
476 *
477 * @param[in] xdev The body tracking device.
478 */
479 xrt_result_t (*reset_body_tracking_calibration_meta)(struct xrt_device *xdev);
480
481 /*!
482 * @brief XR_META_body_tracking_calibration - body tracking extension to suggest a body tracking calibration
483 * override
484 *
485 * @param[in] xdev The body tracking device.
486 * @param[in] new_body_height The suggested new body height to override.
487 */
489
490 /*!
491 * Set a output value.
492 *
493 * @param[in] xdev The device.
494 * @param[in] name The output component name to set.
495 * @param[in] value The value to set the output to.
496 * @see xrt_output_name
497 */
500 const struct xrt_output_value *value);
501
502 /*!
503 * Gets limits of this devices outputs.
504 *
505 * @param[in] xdev The device.
506 * @param[out] limits The returned limits.
507 */
508 xrt_result_t (*get_output_limits)(struct xrt_device *xdev, struct xrt_output_limits *limits);
509
510 /*!
511 * @brief Get current presence status of the device.
512 *
513 * @param[in] xdev The device.
514 * @param[out] presence The returned presence status.
515 */
516 xrt_result_t (*get_presence)(struct xrt_device *xdev, bool *presence);
517
518 /*!
519 * Begin a plane detection request
520 *
521 * @param[in] xdev The device.
522 * @param[in] begin_info The query specifying what type of planes are requested.
523 * @param[in] plane_detection_id The id for a previous plane detection request to be replaced or 0.
524 * @param[out] out_plane_detection_id The id of the new plane detection request generated by the xdev.
525 * @return generally XRT_SUCCESS, except for internal runtime failures.
526 */
528 const struct xrt_plane_detector_begin_info_ext *begin_info,
529 uint64_t plane_detection_id,
530 uint64_t *out_plane_detection_id);
531
532 /*!
533 * Destroy internal resources associated with plane_detector_id.
534 *
535 * @param[in] xdev The device.
536 * @param[in] plane_detection_id An id generated by the xdev.
537 * @return generally XRT_SUCCESS, except for internal runtime failures.
538 */
539 xrt_result_t (*destroy_plane_detection_ext)(struct xrt_device *xdev, uint64_t plane_detection_id);
540
541 /*!
542 * Get the state of a plane detection request.
543 *
544 * @param[in] xdev The device.
545 * @param[in] plane_detector_id An id generated by the xdev.
546 * @param[out] out_state The state of the plane detection.
547 * @return generally XRT_SUCCESS, except for internal runtime failures.
548 */
550 uint64_t plane_detection_id,
551 enum xrt_plane_detector_state_ext *out_state);
552
553 /*!
554 * Get results of a plane detection request.
555 *
556 * @param[in] xdev The device.
557 * @param[in] plane_detector_id An id generated by the xdev.
558 * @param[out] detections The detected planes, if any.
559 * @return generally XRT_SUCCESS, except for internal runtime failures.
560 */
562 uint64_t plane_detection_id,
563 struct xrt_plane_detections_ext *out_detections);
564
565 /*!
566 * @brief Get the per-view pose in relation to the view space.
567 *
568 * On most devices with coplanar displays and no built-in eye tracking
569 * or IPD sensing, this just calls a helper to process the provided
570 * eye relation, but this may also handle canted displays as well as
571 * eye tracking.
572 *
573 * Incorporates a call to xrt_device::get_tracked_pose or a wrapper for it
574 *
575 * @param[in] xdev The device.
576 * @param[in] default_eye_relation
577 * The interpupillary relation as a 3D position.
578 * Most simple stereo devices would just want to
579 * set `out_pose->position.[x|y|z] = ipd.[x|y|z]
580 * / 2.0f` and adjust for left vs right view.
581 * Not to be confused with IPD that is absolute
582 * distance, this is a full 3D translation
583 * If a device has a more accurate/dynamic way of
584 * knowing the eye relation, it may ignore this
585 * input.
586 * @param[in] at_timestamp_ns This is when the caller wants the poses and FOVs to be from.
587 * @param[in] view_count Number of views.
588 * @param[in] view_type Type of view configuration (mono or stereo).
589 * @param[out] out_head_relation
590 * The head pose in the device tracking space.
591 * Combine with @p out_poses to get the views in
592 * device tracking space.
593 * @param[out] out_fovs An array (of size @p view_count ) to populate
594 * with the device-suggested fields of view.
595 * @param[out] out_poses An array (of size @p view_count ) to populate
596 * with view output poses in head space. When
597 * implementing, be sure to also set orientation:
598 * most likely identity orientation unless you
599 * have canted screens.
600 * (Caution: Even if you have eye tracking, you
601 * won't use eye orientation here!)
602 */
603 xrt_result_t (*get_view_poses)(struct xrt_device *xdev,
604 const struct xrt_vec3 *default_eye_relation,
605 int64_t at_timestamp_ns,
606 enum xrt_view_type view_type,
607 uint32_t view_count,
608 struct xrt_space_relation *out_head_relation,
609 struct xrt_fov *out_fovs,
610 struct xrt_pose *out_poses);
611
612 /**
613 * Compute the distortion at a single point.
614 *
615 * The input is @p u @p v in screen/output space (that is, predistorted), you are to compute and return the u,v
616 * coordinates to sample the render texture. The compositor will step through a range of u,v parameters to build
617 * the lookup (vertex attribute or distortion texture) used to pre-distort the image as required by the device's
618 * optics.
619 *
620 * @param xdev the device
621 * @param view the view index
622 * @param u horizontal texture coordinate
623 * @param v vertical texture coordinate
624 * @param[out] out_result corresponding u,v pairs for all three color channels.
625 */
626 xrt_result_t (*compute_distortion)(
627 struct xrt_device *xdev, uint32_t view, float u, float v, struct xrt_uv_triplet *out_result);
628
629 /*!
630 * Get the visibility mask for this device.
631 *
632 * @param[in] xdev The device.
633 * @param[in] type The type of visibility mask.
634 * @param[in] view_index The index of the view to get the mask for.
635 * @param[out] out_mask Output mask, caller must free.
636 */
637 xrt_result_t (*get_visibility_mask)(struct xrt_device *xdev,
638 enum xrt_visibility_mask_type type,
639 uint32_t view_index,
640 struct xrt_visibility_mask **out_mask);
641
642 /*!
643 * Called by the @ref xrt_space_overseer when a reference space that is
644 * implemented by this device is first used, or when the last usage of
645 * the reference space stops.
646 *
647 * What is provided is both the @ref xrt_reference_space_type that
648 * triggered the usage change and the @ref xrt_input_name (if any) that
649 * is used to drive the space.
650 *
651 * @see xrt_space_overseer_ref_space_inc
652 * @see xrt_space_overseer_ref_space_dec
653 * @see xrt_input_name
654 * @see xrt_reference_space_type
655 */
656 xrt_result_t (*ref_space_usage)(struct xrt_device *xdev,
657 enum xrt_reference_space_type type,
658 enum xrt_input_name name,
659 bool used);
660
661 /*!
662 * @brief Check if given form factor is available or not.
663 *
664 * This should only be used in HMD device, if the device driver supports form factor check.
665 *
666 * @param[in] xdev The device.
667 * @param[in] form_factor Form factor to check.
668 *
669 * @return true if given form factor is available; otherwise false.
670 */
671 bool (*is_form_factor_available)(struct xrt_device *xdev, enum xrt_form_factor form_factor);
672
673 /*!
674 * @brief Get battery status information.
675 *
676 * @param[in] xdev The device.
677 * @param[out] out_present Whether battery status information exist for this device.
678 * @param[out] out_charging Whether the device's battery is being charged.
679 * @param[out] out_charge Battery charge as a value between 0 and 1.
680 */
682 bool *out_present,
683 bool *out_charging,
684 float *out_charge);
685
686 /*!
687 * @brief Get the current display brightness.
688 *
689 * @param[in] xdev The device.
690 * @param[out] out_brightness Current display brightness. Usually between 0 and 1. Some devices may
691 * exceed 1 if the supported range exceeds 100%
692 */
693 xrt_result_t (*get_brightness)(struct xrt_device *xdev, float *out_brightness);
694
695 /*!
696 * @brief Set the display brightness.
697 *
698 * @param[in] xdev The device.
699 * @param[in] brightness Desired display brightness. Usually between 0 and 1. Some devices may
700 * allow exceeding 1 if the supported range exceeds 100%, but it will be clamped to
701 * the supported range.
702 * @param[in] relative Whether to add \a brightness to the current brightness, instead of overwriting
703 * the current brightness.
704 */
705 xrt_result_t (*set_brightness)(struct xrt_device *xdev, float brightness, bool relative);
706
707 /*!
708 * @brief Gets the compositor info for a device for the given mode.
709 *
710 * This function should never block, and never wait on congested locks.
711 *
712 * @param[in] xdev The device.
713 * @param[in] brightness Desired display brightness. Usually between 0 and 1. Some devices may
714 * allow exceeding 1 if the supported range exceeds 100%, but it will be clamped to
715 * the supported range.
716 * @param[in] relative Whether to add \a brightness to the current brightness, instead of overwriting
717 * the current brightness.
718 */
720 const struct xrt_device_compositor_mode *mode,
721 struct xrt_device_compositor_info *out_info);
722
723 /*!
724 * Enable the feature for this device.
725 *
726 * @param[in] xdev The device.
727 * @param[in] type The type of device feature.
728 */
729 xrt_result_t (*begin_feature)(struct xrt_device *xdev, enum xrt_device_feature_type type);
730
731 /*!
732 * Disable the feature for this device.
733 *
734 * @param[in] xdev The device.
735 * @param[in] type The type of device feature.
736 */
738
739 /*!
740 * Destroy device.
741 */
742 void (*destroy)(struct xrt_device *xdev);
743
744 // Add new functions above destroy.
745};
746
747/*!
748 * Helper function for @ref xrt_device::update_inputs.
749 *
750 * @copydoc xrt_device::update_inputs
751 *
752 * @public @memberof xrt_device
753 */
754static inline xrt_result_t
756{
757 return xdev->update_inputs(xdev);
758}
759
760/*!
761 * Helper function for @ref xrt_device::get_tracked_pose.
762 *
763 * @copydoc xrt_device::get_tracked_pose
764 *
765 * @public @memberof xrt_device
766 */
767static inline xrt_result_t
769 enum xrt_input_name name,
770 int64_t at_timestamp_ns,
771 struct xrt_space_relation *out_relation)
772{
773 return xdev->get_tracked_pose(xdev, name, at_timestamp_ns, out_relation);
774}
775
776/*!
777 * Helper function for @ref xrt_device::get_hand_tracking.
778 *
779 * @copydoc xrt_device::get_hand_tracking
780 *
781 * @public @memberof xrt_device
782 */
783static inline xrt_result_t
785 enum xrt_input_name name,
786 int64_t desired_timestamp_ns,
787 struct xrt_hand_joint_set *out_value,
788 int64_t *out_timestamp_ns)
789{
790 return xdev->get_hand_tracking(xdev, name, desired_timestamp_ns, out_value, out_timestamp_ns);
791}
792
793/*!
794 * Helper function for @ref xrt_device::get_face_tracking.
795 *
796 * @copydoc xrt_device::get_face_tracking
797 *
798 * @public @memberof xrt_device
799 */
800static inline xrt_result_t
802 enum xrt_input_name facial_expression_type,
803 int64_t at_timestamp_ns,
804 struct xrt_facial_expression_set *out_value)
805{
806 return xdev->get_face_tracking(xdev, facial_expression_type, at_timestamp_ns, out_value);
807}
808
809/*!
810 * Helper function for @ref xrt_device::get_face_calibration_state_android.
811 *
812 * @copydoc xrt_device::get_face_calibration_state_android
813 *
814 * @public @memberof xrt_device
815 */
816static inline xrt_result_t
817xrt_device_get_face_calibration_state_android(struct xrt_device *xdev, bool *out_face_is_calibrated)
818{
819 return xdev->get_face_calibration_state_android(xdev, out_face_is_calibrated);
820}
821
822/*!
823 * Helper function for @ref xrt_device::get_body_skeleton.
824 *
825 * @copydoc xrt_device::get_body_skeleton
826 *
827 * @public @memberof xrt_device
828 */
829static inline xrt_result_t
831 enum xrt_input_name body_tracking_type,
832 struct xrt_body_skeleton *out_value)
833{
834 return xdev->get_body_skeleton(xdev, body_tracking_type, out_value);
835}
836
837/*!
838 * Helper function for @ref xrt_device::get_body_joints.
839 *
840 * @copydoc xrt_device::get_body_joints
841 *
842 * @public @memberof xrt_device
843 */
844static inline xrt_result_t
846 enum xrt_input_name body_tracking_type,
847 int64_t desired_timestamp_ns,
848 struct xrt_body_joint_set *out_value)
849{
850 return xdev->get_body_joints(xdev, body_tracking_type, desired_timestamp_ns, out_value);
851}
852
853/*!
854 * Helper function for @ref xrt_device::reset_body_tracking_calibration_meta.
855 *
856 * @copydoc xrt_device::reset_body_tracking_calibration_meta
857 *
858 * @public @memberof xrt_device
859 */
860static inline xrt_result_t
862{
863 if (xdev->reset_body_tracking_calibration_meta == NULL) {
865 }
866 return xdev->reset_body_tracking_calibration_meta(xdev);
867}
868
869/*!
870 * Helper function for @ref xrt_device::set_body_tracking_calibration_override_meta.
871 *
872 * @copydoc xrt_device::set_body_tracking_calibration_override_meta
873 *
874 * @public @memberof xrt_device
875 */
876static inline xrt_result_t
878{
881 }
882 return xdev->set_body_tracking_calibration_override_meta(xdev, new_body_height);
883}
884
885/*!
886 * Helper function for @ref xrt_device::set_output.
887 *
888 * @copydoc xrt_device::set_output
889 *
890 * @public @memberof xrt_device
891 */
892static inline xrt_result_t
894{
895 xdev->set_output(xdev, name, value);
896 return XRT_SUCCESS;
897}
898
899static inline xrt_result_t
900xrt_device_get_output_limits(struct xrt_device *xdev, struct xrt_output_limits *limits)
901{
902 if (xdev->get_output_limits) {
903 return xdev->get_output_limits(xdev, limits);
904 } else {
906 }
907}
908
909/*!
910 * Helper function for @ref xrt_device::get_presence.
911 *
912 * @copydoc xrt_device::get_presence
913 *
914 * @public @memberof xrt_device
915 */
916static inline xrt_result_t
917xrt_device_get_presence(struct xrt_device *xdev, bool *presence)
918{
919 if (xdev->get_presence) {
920 return xdev->get_presence(xdev, presence);
921 } else {
923 }
924}
925
926/*!
927 * Helper function for @ref xrt_device::begin_plane_detection_ext.
928 *
929 * @public @memberof xrt_device
930 */
931static inline xrt_result_t
933 const struct xrt_plane_detector_begin_info_ext *begin_info,
934 uint64_t plane_detection_id,
935 uint64_t *out_plane_detection_id)
936{
937 return xdev->begin_plane_detection_ext(xdev, begin_info, plane_detection_id, out_plane_detection_id);
938}
939
940/*!
941 * Helper function for @ref xrt_device::destroy_plane_detection_ext.
942 *
943 * @public @memberof xrt_device
944 */
945static inline xrt_result_t
946xrt_device_destroy_plane_detection_ext(struct xrt_device *xdev, uint64_t plane_detection_id)
947{
948 return xdev->destroy_plane_detection_ext(xdev, plane_detection_id);
949}
950
951/*!
952 * Helper function for @ref xrt_device::get_plane_detections_ext.
953 *
954 * @public @memberof xrt_device
955 */
956static inline xrt_result_t
958 uint64_t plane_detection_id,
959 enum xrt_plane_detector_state_ext *out_state)
960{
961 return xdev->get_plane_detection_state_ext(xdev, plane_detection_id, out_state);
962}
963
964/*!
965 * Helper function for @ref xrt_device::get_plane_detections_ext.
966 *
967 * @public @memberof xrt_device
968 */
969static inline xrt_result_t
971 uint64_t plane_detection_id,
972 struct xrt_plane_detections_ext *out_detections)
973{
974 return xdev->get_plane_detections_ext(xdev, plane_detection_id, out_detections);
975}
976
977/*!
978 * Helper function for @ref xrt_device::get_view_poses.
979 *
980 * @copydoc xrt_device::get_view_poses
981 * @public @memberof xrt_device
982 */
983static inline xrt_result_t
985 const struct xrt_vec3 *default_eye_relation,
986 int64_t at_timestamp_ns,
987 enum xrt_view_type view_type,
988 uint32_t view_count,
989 struct xrt_space_relation *out_head_relation,
990 struct xrt_fov *out_fovs,
991 struct xrt_pose *out_poses)
992{
993 return xdev->get_view_poses( //
994 xdev, //
995 default_eye_relation, //
996 at_timestamp_ns, //
997 view_type, //
998 view_count, //
999 out_head_relation, //
1000 out_fovs, //
1001 out_poses); //
1002}
1003
1004/*!
1005 * Helper function for @ref xrt_device::compute_distortion.
1006 *
1007 * @copydoc xrt_device::compute_distortion
1008 *
1009 * @public @memberof xrt_device
1010 */
1011static inline xrt_result_t
1013 struct xrt_device *xdev, uint32_t view, float u, float v, struct xrt_uv_triplet *out_result)
1014{
1015 return xdev->compute_distortion(xdev, view, u, v, out_result);
1016}
1017
1018/*!
1019 * Helper function for @ref xrt_device::get_visibility_mask.
1020 *
1021 * @copydoc xrt_device::get_visibility_mask
1022 *
1023 * @public @memberof xrt_device
1024 */
1025static inline xrt_result_t
1027 enum xrt_visibility_mask_type type,
1028 uint32_t view_index,
1029 struct xrt_visibility_mask **out_mask)
1030{
1031 return xdev->get_visibility_mask(xdev, type, view_index, out_mask);
1032}
1033
1034/*!
1035 * Helper function for @ref xrt_device::ref_space_usage.
1036 *
1037 * @copydoc xrt_device::ref_space_usage
1038 *
1039 * @public @memberof xrt_device
1040 */
1041static inline xrt_result_t
1043 enum xrt_reference_space_type type,
1044 enum xrt_input_name name,
1045 bool used)
1046{
1047 return xdev->ref_space_usage(xdev, type, name, used);
1048}
1049
1050/*!
1051 * Helper function for @ref xrt_device::is_form_factor_available.
1052 *
1053 * @copydoc xrt_device::is_form_factor_available
1054 *
1055 * @public @memberof xrt_device
1056 */
1057static inline bool
1059{
1060 return xdev->is_form_factor_available(xdev, form_factor);
1061}
1062
1063/*!
1064 * Helper function for @ref xrt_device::get_battery_status.
1065 *
1066 * @copydoc xrt_device::get_battery_status
1067 *
1068 * @public @memberof xrt_device
1069 */
1070static inline xrt_result_t
1071xrt_device_get_battery_status(struct xrt_device *xdev, bool *out_present, bool *out_charging, float *out_charge)
1072{
1073 return xdev->get_battery_status(xdev, out_present, out_charging, out_charge);
1074}
1075
1076/*!
1077 * Helper function for @ref xrt_device::get_brightness.
1078 *
1079 * @copydoc xrt_device::get_brightness
1080 * @public @memberof xrt_device
1081 */
1082static inline xrt_result_t
1083xrt_device_get_brightness(struct xrt_device *xdev, float *out_brightness)
1084{
1085 return xdev->get_brightness(xdev, out_brightness);
1086}
1087
1088/*!
1089 * Helper function for @ref xrt_device::set_brightness.
1090 *
1091 * @copydoc xrt_device::set_brightness
1092 * @public @memberof xrt_device
1093 */
1094static inline xrt_result_t
1095xrt_device_set_brightness(struct xrt_device *xdev, float brightness, bool relative)
1096{
1097 return xdev->set_brightness(xdev, brightness, relative);
1098}
1099
1100/*!
1101 * Helper function for @ref xrt_device::get_compositor_info.
1102 *
1103 * @copydoc xrt_device::get_compositor_info
1104 *
1105 * @public @memberof xrt_device
1106 */
1107static inline xrt_result_t
1109 const struct xrt_device_compositor_mode *mode,
1110 struct xrt_device_compositor_info *out_info)
1111{
1112 return xdev->get_compositor_info(xdev, mode, out_info);
1113}
1114
1115/*!
1116 * Helper function for @ref xrt_device::begin_feature.
1117 *
1118 * @copydoc xrt_device::begin_feature
1119 *
1120 * @public @memberof xrt_device
1121 */
1122static inline xrt_result_t
1124{
1125 return xdev->begin_feature(xdev, type);
1126}
1127
1128/*!
1129 * Helper function for @ref xrt_device::end_feature.
1130 *
1131 * @copydoc xrt_device::end_feature
1132 *
1133 * @public @memberof xrt_device
1134 */
1135static inline xrt_result_t
1137{
1138 return xdev->end_feature(xdev, type);
1139}
1140
1141/*!
1142 * Helper function for @ref xrt_device::destroy.
1143 *
1144 * Handles nulls, sets your pointer to null.
1145 *
1146 * @public @memberof xrt_device
1147 */
1148static inline void
1150{
1151 struct xrt_device *xdev = *xdev_ptr;
1152 if (xdev == NULL) {
1153 return;
1154 }
1155
1156 xdev->destroy(xdev);
1157 *xdev_ptr = NULL;
1158}
1159
1160
1161#ifdef __cplusplus
1162} // extern "C"
1163#endif
xrt_plane_detection_capability_flags_ext
Caps for a plane detector, see xrt_device.
Definition: xrt_plane_detector.h:30
xrt_visibility_mask_type
Visibility mask, mirror of XrVisibilityMaskKHR.
Definition: xrt_defines.h:2331
xrt_blend_mode
Blend mode that the device supports, exact mirror of XrEnvironmentBlendMode.
Definition: xrt_defines.h:112
xrt_form_factor
What form factor is this device, mostly maps onto OpenXR's XrFormFactor.
Definition: xrt_defines.h:2272
xrt_input_name
Every internal input source known to monado with a baked in type.
Definition: xrt_defines.h:1359
enum xrt_result xrt_result_t
Result type used across Monado.
xrt_reference_space_type
Type of a OpenXR mapped reference space, maps to the semantic spaces on the xrt_space_overseer struct...
Definition: xrt_defines.h:612
xrt_output_name
Name of a output with a baked in type.
Definition: xrt_defines.h:1594
xrt_plane_detector_state_ext
State of a plane detector, see xrt_device.
Definition: xrt_plane_detector.h:83
xrt_device_type
How an xrt_device can be used.
Definition: xrt_defines.h:816
@ XRT_SUCCESS
The operation succeeded.
Definition: xrt_results.h:27
@ XRT_ERROR_NOT_IMPLEMENTED
The interface function called is not implemented by its interface.
Definition: xrt_results.h:192
A binding pair, going from a binding point to a device input.
Definition: xrt_device.h:217
enum xrt_input_name device
To input on the device.
Definition: xrt_device.h:219
enum xrt_input_name from
From which name.
Definition: xrt_device.h:218
A binding pair, going from a binding point to a device output.
Definition: xrt_device.h:228
enum xrt_output_name device
To output on the device.
Definition: xrt_device.h:230
enum xrt_output_name from
From which name.
Definition: xrt_device.h:229
A binding profile, has lists of binding pairs to goes from device in name to the device it hangs off ...
Definition: xrt_device.h:240
enum xrt_device_name name
Device this binding emulates.
Definition: xrt_device.h:242
Definition: xrt_defines.h:2166
Definition: xrt_defines.h:2123
Compositor information for a device.
Definition: xrt_device.h:88
XRT_ALIGNAS(8) int64_t scanout_time_ns
The amount of time it takes to scanout the display in nanoseconds, from the start of the scanout,...
enum xrt_scanout_direction scanout_direction
The direction scanout on the display occurs.
Definition: xrt_device.h:90
Compositor mode information for a device.
Definition: xrt_device.h:104
int64_t frame_interval_ns
The amount of nanoseconds between frames.
Definition: xrt_device.h:106
Static data of supported features of the xrt_device this struct sits on.
Definition: xrt_device.h:280
A single HMD or input device.
Definition: xrt_device.h:309
xrt_result_t(* get_plane_detections_ext)(struct xrt_device *xdev, uint64_t plane_detection_id, struct xrt_plane_detections_ext *out_detections)
Get results of a plane detection request.
Definition: xrt_device.h:561
static xrt_result_t xrt_device_get_tracked_pose(struct xrt_device *xdev, enum xrt_input_name name, int64_t at_timestamp_ns, struct xrt_space_relation *out_relation)
Helper function for xrt_device::get_tracked_pose.
Definition: xrt_device.h:768
xrt_result_t(* get_body_skeleton)(struct xrt_device *xdev, enum xrt_input_name body_tracking_type, struct xrt_body_skeleton *out_value)
Get the body skeleton in T-pose, used to query the skeleton hierarchy, scale, proportions etc.
Definition: xrt_device.h:453
xrt_result_t(* reset_body_tracking_calibration_meta)(struct xrt_device *xdev)
XR_META_body_tracking_calibration - body tracking extension to reset the body tracking calibration.
Definition: xrt_device.h:479
static xrt_result_t xrt_device_begin_feature(struct xrt_device *xdev, enum xrt_device_feature_type type)
Helper function for xrt_device::begin_feature.
Definition: xrt_device.h:1123
static xrt_result_t xrt_device_get_compositor_info(struct xrt_device *xdev, const struct xrt_device_compositor_mode *mode, struct xrt_device_compositor_info *out_info)
Helper function for xrt_device::get_compositor_info.
Definition: xrt_device.h:1108
static xrt_result_t xrt_device_get_hand_tracking(struct xrt_device *xdev, enum xrt_input_name name, int64_t desired_timestamp_ns, struct xrt_hand_joint_set *out_value, int64_t *out_timestamp_ns)
Helper function for xrt_device::get_hand_tracking.
Definition: xrt_device.h:784
xrt_result_t(* get_body_joints)(struct xrt_device *xdev, enum xrt_input_name body_tracking_type, int64_t desired_timestamp_ns, struct xrt_body_joint_set *out_value)
Get the joint locations for a body tracker.
Definition: xrt_device.h:469
xrt_result_t(* begin_plane_detection_ext)(struct xrt_device *xdev, const struct xrt_plane_detector_begin_info_ext *begin_info, uint64_t plane_detection_id, uint64_t *out_plane_detection_id)
Begin a plane detection request.
Definition: xrt_device.h:527
static xrt_result_t xrt_device_destroy_plane_detection_ext(struct xrt_device *xdev, uint64_t plane_detection_id)
Helper function for xrt_device::destroy_plane_detection_ext.
Definition: xrt_device.h:946
xrt_result_t(* ref_space_usage)(struct xrt_device *xdev, enum xrt_reference_space_type type, enum xrt_input_name name, bool used)
Called by the xrt_space_overseer when a reference space that is implemented by this device is first u...
Definition: xrt_device.h:656
xrt_result_t(* get_presence)(struct xrt_device *xdev, bool *presence)
Get current presence status of the device.
Definition: xrt_device.h:516
xrt_result_t(* set_output)(struct xrt_device *xdev, enum xrt_output_name name, const struct xrt_output_value *value)
Set a output value.
Definition: xrt_device.h:498
xrt_result_t(* compute_distortion)(struct xrt_device *xdev, uint32_t view, float u, float v, struct xrt_uv_triplet *out_result)
Compute the distortion at a single point.
Definition: xrt_device.h:626
static xrt_result_t xrt_device_update_inputs(struct xrt_device *xdev)
Helper function for xrt_device::update_inputs.
Definition: xrt_device.h:755
xrt_result_t(* set_body_tracking_calibration_override_meta)(struct xrt_device *xdev, float new_body_height)
XR_META_body_tracking_calibration - body tracking extension to suggest a body tracking calibration ov...
Definition: xrt_device.h:488
xrt_result_t(* get_output_limits)(struct xrt_device *xdev, struct xrt_output_limits *limits)
Gets limits of this devices outputs.
Definition: xrt_device.h:508
static xrt_result_t xrt_device_ref_space_usage(struct xrt_device *xdev, enum xrt_reference_space_type type, enum xrt_input_name name, bool used)
Helper function for xrt_device::ref_space_usage.
Definition: xrt_device.h:1042
static xrt_result_t xrt_device_get_face_calibration_state_android(struct xrt_device *xdev, bool *out_face_is_calibrated)
Helper function for xrt_device::get_face_calibration_state_android.
Definition: xrt_device.h:817
static xrt_result_t xrt_device_reset_body_tracking_calibration_meta(struct xrt_device *xdev)
Helper function for xrt_device::reset_body_tracking_calibration_meta.
Definition: xrt_device.h:861
xrt_result_t(* get_hand_tracking)(struct xrt_device *xdev, enum xrt_input_name name, int64_t desired_timestamp_ns, struct xrt_hand_joint_set *out_value, int64_t *out_timestamp_ns)
Get relationship of hand joints to the tracking origin space as the base space.
Definition: xrt_device.h:410
static xrt_result_t xrt_device_get_face_tracking(struct xrt_device *xdev, enum xrt_input_name facial_expression_type, int64_t at_timestamp_ns, struct xrt_facial_expression_set *out_value)
Helper function for xrt_device::get_face_tracking.
Definition: xrt_device.h:801
xrt_result_t(* get_visibility_mask)(struct xrt_device *xdev, enum xrt_visibility_mask_type type, uint32_t view_index, struct xrt_visibility_mask **out_mask)
Get the visibility mask for this device.
Definition: xrt_device.h:637
static xrt_result_t xrt_device_begin_plane_detection_ext(struct xrt_device *xdev, const struct xrt_plane_detector_begin_info_ext *begin_info, uint64_t plane_detection_id, uint64_t *out_plane_detection_id)
Helper function for xrt_device::begin_plane_detection_ext.
Definition: xrt_device.h:932
struct xrt_hmd_parts * hmd
Null if this device does not interface with the users head.
Definition: xrt_device.h:321
xrt_result_t(* get_face_tracking)(struct xrt_device *xdev, enum xrt_input_name facial_expression_type, int64_t at_timestamp_ns, struct xrt_facial_expression_set *out_value)
Get the requested blend shape properties & weights for a face tracker.
Definition: xrt_device.h:428
xrt_result_t(* destroy_plane_detection_ext)(struct xrt_device *xdev, uint64_t plane_detection_id)
Destroy internal resources associated with plane_detector_id.
Definition: xrt_device.h:539
static xrt_result_t xrt_device_compute_distortion(struct xrt_device *xdev, uint32_t view, float u, float v, struct xrt_uv_triplet *out_result)
Helper function for xrt_device::compute_distortion.
Definition: xrt_device.h:1012
struct xrt_output * outputs
Array of output structs.
Definition: xrt_device.h:339
xrt_result_t(* begin_feature)(struct xrt_device *xdev, enum xrt_device_feature_type type)
Enable the feature for this device.
Definition: xrt_device.h:729
static xrt_result_t xrt_device_get_presence(struct xrt_device *xdev, bool *presence)
Helper function for xrt_device::get_presence.
Definition: xrt_device.h:917
size_t output_count
Number of outputs.
Definition: xrt_device.h:337
bool(* is_form_factor_available)(struct xrt_device *xdev, enum xrt_form_factor form_factor)
Check if given form factor is available or not.
Definition: xrt_device.h:671
xrt_result_t(* set_brightness)(struct xrt_device *xdev, float brightness, bool relative)
Set the display brightness.
Definition: xrt_device.h:705
struct xrt_input * inputs
Array of input structs.
Definition: xrt_device.h:334
static xrt_result_t xrt_device_get_body_skeleton(struct xrt_device *xdev, enum xrt_input_name body_tracking_type, struct xrt_body_skeleton *out_value)
Helper function for xrt_device::get_body_skeleton.
Definition: xrt_device.h:830
size_t input_count
Number of inputs.
Definition: xrt_device.h:332
xrt_result_t(* get_battery_status)(struct xrt_device *xdev, bool *out_present, bool *out_charging, float *out_charge)
Get battery status information.
Definition: xrt_device.h:681
void(* destroy)(struct xrt_device *xdev)
Destroy device.
Definition: xrt_device.h:742
static xrt_result_t xrt_device_get_plane_detections_ext(struct xrt_device *xdev, uint64_t plane_detection_id, struct xrt_plane_detections_ext *out_detections)
Helper function for xrt_device::get_plane_detections_ext.
Definition: xrt_device.h:970
xrt_result_t(* get_brightness)(struct xrt_device *xdev, float *out_brightness)
Get the current display brightness.
Definition: xrt_device.h:693
xrt_result_t(* get_compositor_info)(struct xrt_device *xdev, const struct xrt_device_compositor_mode *mode, struct xrt_device_compositor_info *out_info)
Gets the compositor info for a device for the given mode.
Definition: xrt_device.h:719
static xrt_result_t xrt_device_set_brightness(struct xrt_device *xdev, float brightness, bool relative)
Helper function for xrt_device::set_brightness.
Definition: xrt_device.h:1095
static xrt_result_t xrt_device_end_feature(struct xrt_device *xdev, enum xrt_device_feature_type type)
Helper function for xrt_device::end_feature.
Definition: xrt_device.h:1136
xrt_result_t(* get_plane_detection_state_ext)(struct xrt_device *xdev, uint64_t plane_detection_id, enum xrt_plane_detector_state_ext *out_state)
Get the state of a plane detection request.
Definition: xrt_device.h:549
xrt_result_t(* update_inputs)(struct xrt_device *xdev)
Update any attached inputs.
Definition: xrt_device.h:356
static xrt_result_t xrt_device_get_body_joints(struct xrt_device *xdev, enum xrt_input_name body_tracking_type, int64_t desired_timestamp_ns, struct xrt_body_joint_set *out_value)
Helper function for xrt_device::get_body_joints.
Definition: xrt_device.h:845
static xrt_result_t xrt_device_set_body_tracking_calibration_override_meta(struct xrt_device *xdev, float new_body_height)
Helper function for xrt_device::set_body_tracking_calibration_override_meta.
Definition: xrt_device.h:877
xrt_result_t(* get_view_poses)(struct xrt_device *xdev, const struct xrt_vec3 *default_eye_relation, int64_t at_timestamp_ns, enum xrt_view_type view_type, uint32_t view_count, struct xrt_space_relation *out_head_relation, struct xrt_fov *out_fovs, struct xrt_pose *out_poses)
Get the per-view pose in relation to the view space.
Definition: xrt_device.h:603
xrt_result_t(* get_face_calibration_state_android)(struct xrt_device *xdev, bool *out_face_is_calibrated)
Gets the face tracking calibration state.
Definition: xrt_device.h:441
static xrt_result_t xrt_device_get_plane_detection_state_ext(struct xrt_device *xdev, uint64_t plane_detection_id, enum xrt_plane_detector_state_ext *out_state)
Helper function for xrt_device::get_plane_detections_ext.
Definition: xrt_device.h:957
struct xrt_tracking_origin * tracking_origin
Always set, pointing to the tracking system for this device.
Definition: xrt_device.h:324
xrt_result_t(* end_feature)(struct xrt_device *xdev, enum xrt_device_feature_type type)
Disable the feature for this device.
Definition: xrt_device.h:737
size_t binding_profile_count
Number of bindings in xrt_device::binding_profiles.
Definition: xrt_device.h:327
static xrt_result_t xrt_device_get_view_poses(struct xrt_device *xdev, const struct xrt_vec3 *default_eye_relation, int64_t at_timestamp_ns, enum xrt_view_type view_type, uint32_t view_count, struct xrt_space_relation *out_head_relation, struct xrt_fov *out_fovs, struct xrt_pose *out_poses)
Helper function for xrt_device::get_view_poses.
Definition: xrt_device.h:984
enum xrt_device_name name
Enum identifier of the device.
Definition: xrt_device.h:311
static xrt_result_t xrt_device_get_visibility_mask(struct xrt_device *xdev, enum xrt_visibility_mask_type type, uint32_t view_index, struct xrt_visibility_mask **out_mask)
Helper function for xrt_device::get_visibility_mask.
Definition: xrt_device.h:1026
static bool xrt_device_is_form_factor_available(struct xrt_device *xdev, enum xrt_form_factor form_factor)
Helper function for xrt_device::is_form_factor_available.
Definition: xrt_device.h:1058
static xrt_result_t xrt_device_get_brightness(struct xrt_device *xdev, float *out_brightness)
Helper function for xrt_device::get_brightness.
Definition: xrt_device.h:1083
static void xrt_device_destroy(struct xrt_device **xdev_ptr)
Helper function for xrt_device::destroy.
Definition: xrt_device.h:1149
xrt_result_t(* get_tracked_pose)(struct xrt_device *xdev, enum xrt_input_name name, int64_t at_timestamp_ns, struct xrt_space_relation *out_relation)
Get relationship of a tracked device to the tracking origin space as the base space.
Definition: xrt_device.h:382
static xrt_result_t xrt_device_get_battery_status(struct xrt_device *xdev, bool *out_present, bool *out_charging, float *out_charge)
Helper function for xrt_device::get_battery_status.
Definition: xrt_device.h:1071
static xrt_result_t xrt_device_set_output(struct xrt_device *xdev, enum xrt_output_name name, const struct xrt_output_value *value)
Helper function for xrt_device::set_output.
Definition: xrt_device.h:893
Definition: xrt_defines.h:1900
Describes a projection matrix fov.
Definition: xrt_defines.h:499
Joint set type used for hand tracking.
Definition: xrt_defines.h:1458
All of the device components that deals with interfacing to a users head.
Definition: xrt_device.h:117
float * vertices
Data.
Definition: xrt_device.h:159
uint32_t vertex_count
Number of vertices.
Definition: xrt_device.h:161
uint64_t nominal_frame_interval_ns
Nominal frame interval.
Definition: xrt_device.h:129
uint32_t stride
Stride of vertices.
Definition: xrt_device.h:163
int * indices
Indices, for triangle strip.
Definition: xrt_device.h:168
enum xrt_distortion_model models
Supported distortion models, a bitfield.
Definition: xrt_device.h:152
uint32_t index_count_total
Total number of elements in mesh::indices array.
Definition: xrt_device.h:174
uint32_t uv_channels_count
1 or 3 for (chromatic aberration).
Definition: xrt_device.h:165
enum xrt_distortion_model preferred
Preferred disortion model, single value.
Definition: xrt_device.h:154
A single named input, that sits on a xrt_device.
Definition: xrt_device.h:188
XRT_ALIGNAS(8) int64_t timestamp
alignas for 32 bit client support, see IPC Design and Implementation
bool active
Is this input active.
Definition: xrt_device.h:190
A tightly packed 2x2 matrix of floats.
Definition: xrt_defines.h:526
Output limits of a particular device.
Definition: xrt_device.h:266
float haptic_pcm_sample_rate
The sample rate of the device's haptic PCM support, 0 if haptic PCM is not supported.
Definition: xrt_device.h:268
A union of all output types.
Definition: xrt_defines.h:2250
A single named output, that sits on a xrt_device.
Definition: xrt_device.h:206
Each plane has n polygons; ultimately plane metadata from locations and vetices is reconstructed.
Definition: xrt_plane_detector.h:171
A query for a plane.
Definition: xrt_plane_detector.h:97
A pose composed of a position and orientation.
Definition: xrt_defines.h:479
A relation with two spaces, includes velocity and acceleration.
Definition: xrt_defines.h:670
A tracking system or device origin.
Definition: xrt_tracking.h:75
Represents a uv triplet for distortion, basically just three xrt_vec2.
Definition: xrt_defines.h:279
A 3 element vector with single floats.
Definition: xrt_defines.h:289
A per-lens/display view information.
Definition: xrt_device.h:35
struct xrt_matrix_2x2 rot
Rotation 2d matrix used to rotate the position of the output of the distortion shaders onto the scree...
Definition: xrt_device.h:81
struct xrt_view::@249 viewport
Viewport position on the screen.
struct xrt_view::@250 display
Physical properties of this display (or the part of a display that covers this view).
Visibility mask helper, the indices and vertices are tightly packed after this struct.
Definition: xrt_visibility_mask.h:25
A union of all input types.
Definition: xrt_defines.h:1474
Common defines and enums for XRT.
xrt_distortion_model
Which distortion model does the device expose, used both as a bitfield and value.
Definition: xrt_defines.h:167
xrt_device_name
A enum that is used to name devices so that the state trackers can reason about the devices easier.
Definition: xrt_defines.h:804
xrt_scanout_direction
Screen scanout direction.
Definition: xrt_defines.h:179
xrt_view_type
View type to be rendered to by the compositor.
Definition: xrt_defines.h:2281
xrt_device_feature_type
Higher level features for devices.
Definition: xrt_device.h:254
Header for limits of the XRT interfaces.
Header defining planes detector enum and structs.
Header defining visibility mask helper struct.