File: xr_android.h

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (379 lines) | stat: -rw-r--r-- 13,272 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
#ifndef THIRD_PARTY_OPENXR_DEV_XR_ANDROID_H_
#define THIRD_PARTY_OPENXR_DEV_XR_ANDROID_H_

/*
** Copyright 2017-2022 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0 OR MIT
*/

#include <stdint.h>

#include "third_party/openxr/src/include/openxr/openxr.h"
#include "third_party/openxr/src/include/openxr/openxr_platform_defines.h"

#ifndef XR_ANDROID_trackables
#define XR_ANDROID_trackables 1
#define XR_ANDROID_trackables_SPEC_VERSION 1
#define XR_ANDROID_TRACKABLES_EXTENSION_NAME "XR_ANDROID_trackables"

#define XR_TYPE_TRACKABLE_GET_INFO_ANDROID ((XrStructureType)1000455000U)
#define XR_TYPE_TRACKABLE_PLANE_ANDROID ((XrStructureType)1000455003U)
#define XR_TYPE_TRACKABLE_TRACKER_CREATE_INFO_ANDROID \
  ((XrStructureType)1000455004U)
#define XR_TYPE_ANCHOR_SPACE_CREATE_INFO_ANDROID ((XrStructureType)1000455001U)
#define XR_TYPE_ANCHOR_STATE_ANDROID ((XrStructureType)1000455002U)

#define XR_ERROR_MISMATCHING_TRACKABLE_TYPE_ANDROID ((XrResult)-1000455000U)

#define XR_OBJECT_TYPE_TRACKABLE_TRACKER_ANDROID ((XrObjectType)1000455001U)

XR_DEFINE_ATOM(XrTrackableANDROID)
#define XR_NULL_TRACKABLE_ANDROID 0

XR_DEFINE_HANDLE(XrTrackableTrackerANDROID)

enum XrTrackingStateANDROID {
  XR_TRACKING_STATE_PAUSED_ANDROID = 0,
  XR_TRACKING_STATE_STOPPED_ANDROID = 1,
  XR_TRACKING_STATE_TRACKING_ANDROID = 2,
};

enum XrTrackableTypeANDROID {
  XR_TRACKABLE_TYPE_NOT_VALID_ANDROID = 0,
  XR_TRACKABLE_TYPE_PLANE_ANDROID = 1,
  XR_TRACKABLE_TYPE_DEPTH_ANDROID = 2,
};

enum XrPlaneTypeANDROID {
  XR_PLANE_TYPE_HORIZONTAL_DOWNWARD_FACING_ANDROID = 0,
  XR_PLANE_TYPE_HORIZONTAL_UPWARD_FACING_ANDROID = 1,
  XR_PLANE_TYPE_VERTICAL_ANDROID = 2,
  XR_PLANE_TYPE_ARBITRARY_ANDROID = 3,
};

typedef struct XrTrackableTrackerCreateInfoANDROID {
  XrStructureType type;
  const void* next;
  XrTrackableTypeANDROID trackableType;
} XrTrackableTrackerCreateInfoANDROID;

typedef struct XrTrackableGetInfoANDROID {
  XrStructureType type;
  void* next;
  XrTrackableANDROID trackable;
  XrSpace baseSpace;
  XrTime time;
} XrTrackableGetInfoANDROID;

typedef struct XrTrackablePlaneANDROID {
  XrStructureType type;
  void* next;
  XrTrackingStateANDROID trackingState;
  XrPosef centerPose;
  XrExtent2Df extents;
  XrPlaneTypeANDROID planeType;
  uint32_t deprecated;
  XrTrackableANDROID subsumedByPlane;
  XrTime lastUpdatedTime;
  uint32_t vertexCapacityInput;
  uint32_t* vertexCountOutput;
  XrVector2f* vertices;
} XrTrackablePlaneANDROID;

typedef XrResult(XRAPI_PTR* PFN_xrCreateTrackableTrackerANDROID)(
    XrSession session,
    const XrTrackableTrackerCreateInfoANDROID* createInfo,
    XrTrackableTrackerANDROID* trackableTracker);

typedef XrResult(XRAPI_PTR* PFN_xrDestroyTrackableTrackerANDROID)(
    XrTrackableTrackerANDROID trackableTracker);

typedef XrResult(XRAPI_PTR* PFN_xrGetAllTrackablesANDROID)(
    XrTrackableTrackerANDROID trackableTracker,
    uint32_t trackableCapacityInput,
    uint32_t* trackableCountOutput,
    XrTrackableANDROID* trackablesOutput);

typedef XrResult(XRAPI_PTR* PFN_xrGetTrackablePlaneANDROID)(
    XrTrackableTrackerANDROID trackableTracker,
    const XrTrackableGetInfoANDROID* getInfo,
    XrTrackablePlaneANDROID* planeOutput);

typedef struct XrAnchorSpaceCreateInfoANDROID {
  XrStructureType type;
  void* next;
  XrSpace space;
  XrTime time;
  XrPosef pose;
  XrTrackableANDROID trackable;
} XrAnchorSpaceCreateInfoANDROID;

typedef struct XrAnchorStateANDROID {
  XrStructureType type;
  void* next;
  XrTrackingStateANDROID trackingState;
} XrAnchorStateANDROID;

typedef XrResult(XRAPI_PTR* PFN_xrCreateAnchorSpaceANDROID)(
    XrSession session,
    const XrAnchorSpaceCreateInfoANDROID* createInfo,
    XrSpace* anchorOutput);
#endif  // XR_ANDROID_trackables

#ifndef XR_ANDROID_raycast
#define XR_ANDROID_raycast 1
#define XR_ANDROID_raycast_SPEC_VERSION 1
#define XR_ANDROID_RAYCAST_EXTENSION_NAME "XR_ANDROID_raycast"

#define XR_TYPE_RAYCAST_INFO_ANDROID ((XrStructureType)1000463000U)
#define XR_TYPE_RAYCAST_HIT_RESULTS_ANDROID ((XrStructureType)1000463001U)

typedef struct XrRaycastInfoANDROID {
  XrStructureType type;
  void* next;
  uint32_t maxResults;
  uint32_t trackerCount;
  const XrTrackableTrackerANDROID* trackers;
  XrVector3f origin;
  XrVector3f trajectory;
  XrSpace space;
  XrTime time;
} XrRaycastInfoANDROID;

typedef struct XrRaycastHitResultANDROID {
  XrTrackableTypeANDROID type;
  XrTrackableANDROID trackable;
  XrPosef pose;
} XrRaycastHitResultANDROID;

typedef struct XrRaycastHitResultsANDROID {
  XrStructureType type;
  void* next;
  uint32_t resultsCapacityInput;
  uint32_t resultsCountOutput;
  XrRaycastHitResultANDROID* results;
} XrRaycastHitResultsANDROID;

typedef XrResult(XRAPI_PTR* PFN_xrRaycastANDROID)(
    XrSession session,
    const XrRaycastInfoANDROID* rayInfo,
    XrRaycastHitResultsANDROID* results);
#endif  // XR_ANDROID_raycast

#ifndef XR_ANDROID_unbounded_reference_space
#define XR_ANDROID_unbounded_reference_space 1
#define XR_ANDROID_unbounded_reference_space_SPEC_VERSION 1
#define XR_ANDROID_UNBOUNDED_REFERENCE_SPACE_EXTENSION_NAME \
  "XR_ANDROID_unbounded_reference_space"
#define XR_REFERENCE_SPACE_TYPE_UNBOUNDED_ANDROID \
  ((XrReferenceSpaceType)1000467000U)
#endif /* XR_ANDROID_unbounded_reference_space */

#ifndef XR_ANDROID_reference_space_bounds_polygon
#define XR_ANDROID_reference_space_bounds_polygon 1
#define XR_ANDROID_reference_space_bounds_polygon_SPEC_VERSION 1
#define XR_ANDROID_REFERENCE_SPACE_BOUNDS_POLYGON_EXTENSION_NAME \
  "XR_ANDROID_reference_space_bounds_polygon"
typedef XrResult(XRAPI_PTR* PFN_xrGetReferenceSpaceBoundsPolygonANDROID)(
    XrSession session,
    XrReferenceSpaceType referenceSpaceType,
    uint32_t boundaryVerticesCapacityInput,
    uint32_t* boundaryVerticesCountOutput,
    XrVector2f* boundaryVertices);
#endif /* XR_ANDROID_reference_space_bounds_polygon */

#ifndef XR_ANDROID_light_estimation
#define XR_ANDROID_light_estimation 1
XR_DEFINE_HANDLE(XrLightEstimatorANDROID)
#define XR_ANDROID_light_estimation_SPEC_VERSION 1
#define XR_ANDROID_LIGHT_ESTIMATION_EXTENSION_NAME "XR_ANDROID_light_estimation"
#define XR_TYPE_LIGHT_ESTIMATOR_CREATE_INFO_ANDROID \
  ((XrStructureType)1000700000U)
#define XR_TYPE_LIGHT_ESTIMATE_GET_INFO_ANDROID ((XrStructureType)1000700001U)
#define XR_TYPE_LIGHT_ESTIMATE_ANDROID ((XrStructureType)1000700002U)
#define XR_TYPE_DIRECTIONAL_LIGHT_ANDROID ((XrStructureType)1000700003U)
#define XR_TYPE_SPHERICAL_HARMONICS_ANDROID ((XrStructureType)1000700004U)
#define XR_TYPE_SYSTEM_LIGHT_ESTIMATION_PROPERTIES_ANDROID \
  ((XrStructureType)1000700006U)
#define XR_TYPE_AMBIENT_LIGHT_ANDROID ((XrStructureType)1000700005U)
#define XR_OBJECT_TYPE_LIGHT_ESTIMATOR_ANDROID ((XrObjectType)1000700000U)

typedef enum XrLightEstimateStateANDROID {
  XR_LIGHT_ESTIMATE_STATE_VALID_ANDROID = 0,
  XR_LIGHT_ESTIMATE_STATE_INVALID_ANDROID = 1,
  XR_LIGHT_ESTIMATE_STATE_MAX_ENUM_ANDROID = 0x7FFFFFFF
} XrLightEstimateStateANDROID;

typedef enum XrSphericalHarmonicsKindANDROID {
  XR_SPHERICAL_HARMONICS_KIND_TOTAL_ANDROID = 0,
  XR_SPHERICAL_HARMONICS_KIND_AMBIENT_ANDROID = 1,
  XR_SPHERICAL_HARMONICS_KIND_MAX_ENUM_ANDROID = 0x7FFFFFFF
} XrSphericalHarmonicsKindANDROID;

typedef struct XrSystemLightEstimationPropertiesANDROID {
  XrStructureType type;
  void* XR_MAY_ALIAS next;
  XrBool32 supportsLightEstimation;
} XrSystemLightEstimationPropertiesANDROID;

typedef struct XrLightEstimatorCreateInfoANDROID {
  XrStructureType type;
  void* XR_MAY_ALIAS next;
} XrLightEstimatorCreateInfoANDROID;

typedef struct XrLightEstimateGetInfoANDROID {
  XrStructureType type;
  void* XR_MAY_ALIAS next;
  XrSpace space;
  XrTime time;
} XrLightEstimateGetInfoANDROID;

typedef struct XrLightEstimateANDROID {
  XrStructureType type;
  void* XR_MAY_ALIAS next;
  XrLightEstimateStateANDROID state;
  XrTime lastUpdatedTime;
} XrLightEstimateANDROID;

// XrDirectionalLightANDROID extends XrLightEstimateANDROID
typedef struct XrDirectionalLightANDROID {
  XrStructureType type;
  void* XR_MAY_ALIAS next;
  XrLightEstimateStateANDROID state;
  XrVector3f intensity;
  XrVector3f direction;
} XrDirectionalLightANDROID;

// XrAmbientLightANDROID extends XrLightEstimateANDROID
typedef struct XrAmbientLightANDROID {
  XrStructureType type;
  void* XR_MAY_ALIAS next;
  XrLightEstimateStateANDROID state;
  XrVector3f intensity;
  XrVector3f colorCorrection;
} XrAmbientLightANDROID;

// XrSphericalHarmonicsANDROID extends XrLightEstimateANDROID
typedef struct XrSphericalHarmonicsANDROID {
  XrStructureType type;
  void* XR_MAY_ALIAS next;
  XrLightEstimateStateANDROID state;
  XrSphericalHarmonicsKindANDROID kind;
  float coefficients[9][3];
} XrSphericalHarmonicsANDROID;

typedef XrResult(XRAPI_PTR* PFN_xrCreateLightEstimatorANDROID)(
    XrSession session,
    XrLightEstimatorCreateInfoANDROID* createInfo,
    XrLightEstimatorANDROID* outHandle);
typedef XrResult(XRAPI_PTR* PFN_xrDestroyLightEstimatorANDROID)(
    XrLightEstimatorANDROID estimator);
typedef XrResult(XRAPI_PTR* PFN_xrGetLightEstimateANDROID)(
    XrLightEstimatorANDROID estimator,
    const XrLightEstimateGetInfoANDROID* input,
    XrLightEstimateANDROID* output);
#endif  // XR_ANDROID_light_estimation

#ifndef XR_ANDROID_depth_texture
#define XR_ANDROID_depth_texture 1
XR_DEFINE_HANDLE(XrDepthSwapchainANDROID)
#define XR_ANDROID_depth_texture_SPEC_VERSION 1
#define XR_ANDROID_DEPTH_TEXTURE_EXTENSION_NAME "XR_ANDROID_depth_texture"
#define XR_TYPE_DEPTH_SWAPCHAIN_CREATE_INFO_ANDROID \
  ((XrStructureType)1000702000U)
#define XR_TYPE_DEPTH_VIEW_ANDROID ((XrStructureType)1000702001U)
#define XR_TYPE_DEPTH_ACQUIRE_INFO_ANDROID ((XrStructureType)1000702002U)
#define XR_TYPE_DEPTH_ACQUIRE_RESULT_ANDROID ((XrStructureType)1000702003U)
#define XR_TYPE_SYSTEM_DEPTH_TRACKING_PROPERTIES_ANDROID \
  ((XrStructureType)1000702004U)
#define XR_TYPE_DEPTH_SWAPCHAIN_IMAGE_ANDROID ((XrStructureType)1000702005U)
#define XR_ERROR_DEPTH_NOT_AVAILABLE_ANDROID ((XrResult)-1000702000U)
#define XR_OBJECT_TYPE_DEPTH_SWAPCHAIN_ANDROID ((XrObjectType)1000702001U)

typedef enum XrDepthCameraResolutionANDROID {
  XR_DEPTH_CAMERA_RESOLUTION_80x80_ANDROID = 0,
  XR_DEPTH_CAMERA_RESOLUTION_160x160_ANDROID = 1,
  XR_DEPTH_CAMERA_RESOLUTION_320x320_ANDROID = 2,
  XR_DEPTH_CAMERA_RESOLUTION_MAX_ENUM_ANDROID = 0x7FFFFFFF
} XrDepthCameraResolutionANDROID;
typedef XrFlags64 XrDepthSwapchainCreateFlagsANDROID;

// Flag bits for XrDepthSwapchainCreateFlagsANDROID
static const XrDepthSwapchainCreateFlagsANDROID
    XR_DEPTH_SWAPCHAIN_CREATE_SMOOTH_DEPTH_IMAGE_BIT_ANDROID = 0x00000001;
static const XrDepthSwapchainCreateFlagsANDROID
    XR_DEPTH_SWAPCHAIN_CREATE_SMOOTH_CONFIDENCE_IMAGE_BIT_ANDROID = 0x00000002;
static const XrDepthSwapchainCreateFlagsANDROID
    XR_DEPTH_SWAPCHAIN_CREATE_RAW_DEPTH_IMAGE_BIT_ANDROID = 0x00000004;
static const XrDepthSwapchainCreateFlagsANDROID
    XR_DEPTH_SWAPCHAIN_CREATE_RAW_CONFIDENCE_IMAGE_BIT_ANDROID = 0x00000008;

typedef struct XrDepthSwapchainCreateInfoANDROID {
  XrStructureType type;
  const void* XR_MAY_ALIAS next;
  XrDepthCameraResolutionANDROID resolution;
  XrDepthSwapchainCreateFlagsANDROID createFlags;
} XrDepthSwapchainCreateInfoANDROID;

typedef struct XrDepthSwapchainImageANDROID {
  XrStructureType type;
  void* XR_MAY_ALIAS next;
  const float* rawDepthImage;
  const uint8_t* rawDepthConfidenceImage;
  const float* smoothDepthImage;
  const uint8_t* smoothDepthConfidenceImage;
} XrDepthSwapchainImageANDROID;

typedef struct XrDepthAcquireInfoANDROID {
  XrStructureType type;
  const void* next;
  XrSpace space;
  XrTime displayTime;
} XrDepthAcquireInfoANDROID;

typedef struct XrDepthViewANDROID {
  XrStructureType type;
  const void* next;
  XrFovf fov;
  XrPosef pose;
} XrDepthViewANDROID;

typedef struct XrDepthAcquireResultANDROID {
  XrStructureType type;
  const void* next;
  uint32_t acquiredIndex;
  XrTime exposureTimestamp;
  XrDepthViewANDROID views[2];
} XrDepthAcquireResultANDROID;

// XrSystemDepthTrackingPropertiesANDROID extends XrSystemProperties
typedef struct XrSystemDepthTrackingPropertiesANDROID {
  XrStructureType type;
  const void* next;
  XrBool32 supportsDepthTracking;
} XrSystemDepthTrackingPropertiesANDROID;

typedef XrResult(XRAPI_PTR* PFN_xrCreateDepthSwapchainANDROID)(
    XrSession session,
    const XrDepthSwapchainCreateInfoANDROID* createInfo,
    XrDepthSwapchainANDROID* swapchain);
typedef XrResult(XRAPI_PTR* PFN_xrDestroyDepthSwapchainANDROID)(
    XrDepthSwapchainANDROID swapchain);
typedef XrResult(XRAPI_PTR* PFN_xrEnumerateDepthSwapchainImagesANDROID)(
    XrDepthSwapchainANDROID depthSwapchain,
    uint32_t depthImageCapacityInput,
    uint32_t* depthImageCountOutput,
    XrDepthSwapchainImageANDROID* depthImages);
typedef XrResult(XRAPI_PTR* PFN_xrEnumerateDepthResolutionsANDROID)(
    XrSession session,
    uint32_t resolutionCapacityInput,
    uint32_t* resolutionCountOutput,
    XrDepthCameraResolutionANDROID* resolutions);
typedef XrResult(XRAPI_PTR* PFN_xrAcquireDepthSwapchainImagesANDROID)(
    XrDepthSwapchainANDROID depthSwapchain,
    const XrDepthAcquireInfoANDROID* acquireInfo,
    XrDepthAcquireResultANDROID* acquireResult);
#endif  // XR_ANDROID_depth_texture

#endif  // THIRD_PARTY_OPENXR_DEV_XR_ANDROID_H_