webxr-depth-sensing.idl (1909B)
1 // GENERATED CONTENT - DO NOT EDIT 2 // Content was automatically extracted by Reffy into webref 3 // (https://github.com/w3c/webref) 4 // Source: WebXR Depth Sensing Module (https://immersive-web.github.io/depth-sensing/) 5 6 enum XRDepthType { 7 "raw", 8 "smooth", 9 }; 10 11 enum XRDepthUsage { 12 "cpu-optimized", 13 "gpu-optimized", 14 }; 15 16 enum XRDepthDataFormat { 17 "luminance-alpha", 18 "float32", 19 "unsigned-short", 20 }; 21 22 dictionary XRDepthStateInit { 23 required sequence<XRDepthUsage> usagePreference; 24 required sequence<XRDepthDataFormat> dataFormatPreference; 25 sequence<XRDepthType> depthTypeRequest; 26 boolean matchDepthView = true; 27 }; 28 29 partial dictionary XRSessionInit { 30 XRDepthStateInit depthSensing; 31 }; 32 33 partial interface XRSession { 34 readonly attribute XRDepthUsage depthUsage; 35 readonly attribute XRDepthDataFormat depthDataFormat; 36 readonly attribute XRDepthType? depthType; 37 readonly attribute boolean? depthActive; 38 39 undefined pauseDepthSensing(); 40 undefined resumeDepthSensing(); 41 }; 42 43 [SecureContext, Exposed=Window] 44 interface XRDepthInformation { 45 readonly attribute unsigned long width; 46 readonly attribute unsigned long height; 47 48 [SameObject] readonly attribute XRRigidTransform normDepthBufferFromNormView; 49 readonly attribute float rawValueToMeters; 50 }; 51 52 XRDepthInformation includes XRViewGeometry; 53 54 [Exposed=Window] 55 interface XRCPUDepthInformation : XRDepthInformation { 56 [SameObject] readonly attribute ArrayBuffer data; 57 58 float getDepthInMeters(float x, float y); 59 }; 60 61 partial interface XRFrame { 62 XRCPUDepthInformation? getDepthInformation(XRView view); 63 }; 64 65 [Exposed=Window] 66 interface XRWebGLDepthInformation : XRDepthInformation { 67 [SameObject] readonly attribute WebGLTexture texture; 68 69 readonly attribute XRTextureType textureType; 70 readonly attribute unsigned long? imageIndex; 71 }; 72 73 partial interface XRWebGLBinding { 74 XRWebGLDepthInformation? getDepthInformation(XRView view); 75 };