webxrlayers.idl (6403B)
1 // GENERATED CONTENT - DO NOT EDIT 2 // Content was automatically extracted by Reffy into webref 3 // (https://github.com/w3c/webref) 4 // Source: WebXR Layers API Level 1 (https://immersive-web.github.io/layers/) 5 6 enum XRLayerLayout { 7 "default", 8 "mono", 9 "stereo", 10 "stereo-left-right", 11 "stereo-top-bottom" 12 }; 13 14 enum XRLayerQuality { 15 "default", 16 "text-optimized", 17 "graphics-optimized" 18 }; 19 20 [Exposed=Window] interface XRCompositionLayer : XRLayer { 21 readonly attribute XRLayerLayout layout; 22 23 attribute boolean blendTextureSourceAlpha; 24 attribute boolean forceMonoPresentation; 25 attribute float opacity; 26 readonly attribute unsigned long mipLevels; 27 attribute XRLayerQuality quality; 28 29 readonly attribute boolean needsRedraw; 30 31 undefined destroy(); 32 }; 33 34 [Exposed=Window] interface XRProjectionLayer : XRCompositionLayer { 35 readonly attribute unsigned long textureWidth; 36 readonly attribute unsigned long textureHeight; 37 readonly attribute unsigned long textureArrayLength; 38 39 readonly attribute boolean ignoreDepthValues; 40 attribute float? fixedFoveation; 41 attribute XRRigidTransform? deltaPose; 42 }; 43 44 [Exposed=Window] interface XRQuadLayer : XRCompositionLayer { 45 attribute XRSpace space; 46 attribute XRRigidTransform transform; 47 48 attribute float width; 49 attribute float height; 50 51 // Events 52 attribute EventHandler onredraw; 53 }; 54 55 [Exposed=Window] interface XRCylinderLayer : XRCompositionLayer { 56 attribute XRSpace space; 57 attribute XRRigidTransform transform; 58 59 attribute float radius; 60 attribute float centralAngle; 61 attribute float aspectRatio; 62 63 // Events 64 attribute EventHandler onredraw; 65 }; 66 67 [Exposed=Window] interface XREquirectLayer : XRCompositionLayer { 68 attribute XRSpace space; 69 attribute XRRigidTransform transform; 70 71 attribute float radius; 72 attribute float centralHorizontalAngle; 73 attribute float upperVerticalAngle; 74 attribute float lowerVerticalAngle; 75 76 // Events 77 attribute EventHandler onredraw; 78 }; 79 80 [Exposed=Window] interface XRCubeLayer : XRCompositionLayer { 81 attribute XRSpace space; 82 attribute DOMPointReadOnly orientation; 83 84 // Events 85 attribute EventHandler onredraw; 86 }; 87 88 [Exposed=Window] interface XRSubImage { 89 [SameObject] readonly attribute XRViewport viewport; 90 }; 91 92 [Exposed=Window] interface XRWebGLSubImage : XRSubImage { 93 [SameObject] readonly attribute WebGLTexture colorTexture; 94 [SameObject] readonly attribute WebGLTexture? depthStencilTexture; 95 [SameObject] readonly attribute WebGLTexture? motionVectorTexture; 96 97 readonly attribute unsigned long? imageIndex; 98 readonly attribute unsigned long colorTextureWidth; 99 readonly attribute unsigned long colorTextureHeight; 100 readonly attribute unsigned long? depthStencilTextureWidth; 101 readonly attribute unsigned long? depthStencilTextureHeight; 102 readonly attribute unsigned long? motionVectorTextureWidth; 103 readonly attribute unsigned long? motionVectorTextureHeight; 104 }; 105 106 enum XRTextureType { 107 "texture", 108 "texture-array" 109 }; 110 111 dictionary XRProjectionLayerInit { 112 XRTextureType textureType = "texture"; 113 GLenum colorFormat = 0x1908; // RGBA 114 GLenum depthFormat = 0x1902; // DEPTH_COMPONENT 115 double scaleFactor = 1.0; 116 boolean clearOnAccess = true; 117 }; 118 119 dictionary XRLayerInit { 120 required XRSpace space; 121 XRTextureType textureType = "texture"; 122 GLenum colorFormat = 0x1908; // RGBA 123 GLenum? depthFormat; 124 unsigned long mipLevels = 1; 125 required unsigned long viewPixelWidth; 126 required unsigned long viewPixelHeight; 127 XRLayerLayout layout = "mono"; 128 boolean isStatic = false; 129 boolean clearOnAccess = true; 130 }; 131 132 dictionary XRQuadLayerInit : XRLayerInit { 133 XRRigidTransform? transform; 134 float width = 1.0; 135 float height = 1.0; 136 }; 137 138 dictionary XRCylinderLayerInit : XRLayerInit { 139 XRRigidTransform? transform; 140 float radius = 2.0; 141 float centralAngle = 0.78539; 142 float aspectRatio = 2.0; 143 }; 144 145 dictionary XREquirectLayerInit : XRLayerInit { 146 XRRigidTransform? transform; 147 float radius = 0; 148 float centralHorizontalAngle = 6.28318; 149 float upperVerticalAngle = 1.570795; 150 float lowerVerticalAngle = -1.570795; 151 }; 152 153 dictionary XRCubeLayerInit : XRLayerInit { 154 DOMPointReadOnly? orientation; 155 }; 156 157 [Exposed=Window] interface XRWebGLBinding { 158 constructor(XRSession session, XRWebGLRenderingContext context); 159 160 readonly attribute double nativeProjectionScaleFactor; 161 readonly attribute boolean usesDepthValues; 162 163 XRProjectionLayer createProjectionLayer(optional XRProjectionLayerInit init = {}); 164 XRQuadLayer createQuadLayer(optional XRQuadLayerInit init = {}); 165 XRCylinderLayer createCylinderLayer(optional XRCylinderLayerInit init = {}); 166 XREquirectLayer createEquirectLayer(optional XREquirectLayerInit init = {}); 167 XRCubeLayer createCubeLayer(optional XRCubeLayerInit init = {}); 168 169 XRWebGLSubImage getSubImage(XRCompositionLayer layer, XRFrame frame, optional XREye eye = "none"); 170 XRWebGLSubImage getViewSubImage(XRProjectionLayer layer, XRView view); 171 172 undefined foveateBoundTexture(GLenum target, float fixed_foveation); 173 }; 174 175 dictionary XRMediaLayerInit { 176 required XRSpace space; 177 XRLayerLayout layout = "mono"; 178 boolean invertStereo = false; 179 }; 180 181 dictionary XRMediaQuadLayerInit : XRMediaLayerInit { 182 XRRigidTransform? transform; 183 float? width; 184 float? height; 185 }; 186 187 dictionary XRMediaCylinderLayerInit : XRMediaLayerInit { 188 XRRigidTransform? transform; 189 float radius = 2.0; 190 float centralAngle = 0.78539; 191 float? aspectRatio; 192 }; 193 194 dictionary XRMediaEquirectLayerInit : XRMediaLayerInit { 195 XRRigidTransform? transform; 196 float radius = 0.0; 197 float centralHorizontalAngle = 6.28318; 198 float upperVerticalAngle = 1.570795; 199 float lowerVerticalAngle = -1.570795; 200 }; 201 202 [Exposed=Window] interface XRMediaBinding { 203 constructor(XRSession session); 204 205 XRQuadLayer createQuadLayer(HTMLVideoElement video, optional XRMediaQuadLayerInit init = {}); 206 XRCylinderLayer createCylinderLayer(HTMLVideoElement video, optional XRMediaCylinderLayerInit init = {}); 207 XREquirectLayer createEquirectLayer(HTMLVideoElement video, optional XRMediaEquirectLayerInit init = {}); 208 }; 209 210 [SecureContext, Exposed=Window] interface XRLayerEvent : Event { 211 constructor(DOMString type, XRLayerEventInit eventInitDict); 212 [SameObject] readonly attribute XRLayer layer; 213 }; 214 215 dictionary XRLayerEventInit : EventInit { 216 required XRLayer layer; 217 }; 218 219 [SecureContext, Exposed=Window] partial interface XRRenderState { 220 readonly attribute FrozenArray<XRLayer> layers; 221 };