@loaders.gl/textures 4.4.0-alpha.2 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (234) hide show
  1. package/README.md +197 -1
  2. package/dist/basis-loader.d.ts +15 -10
  3. package/dist/basis-loader.d.ts.map +1 -1
  4. package/dist/basis-loader.js +1 -1
  5. package/dist/basis-loader.js.map +1 -0
  6. package/dist/basis-worker-node.js +932 -10040
  7. package/dist/basis-worker.d.ts +2 -0
  8. package/dist/basis-worker.d.ts.map +1 -0
  9. package/dist/basis-worker.js +337 -151
  10. package/dist/basis-worker.js.map +1 -0
  11. package/dist/compressed-texture-loader.d.ts +2 -5
  12. package/dist/compressed-texture-loader.d.ts.map +1 -1
  13. package/dist/compressed-texture-loader.js +2 -3
  14. package/dist/compressed-texture-loader.js.map +1 -0
  15. package/dist/compressed-texture-worker.d.ts +2 -0
  16. package/dist/compressed-texture-worker.d.ts.map +1 -0
  17. package/dist/compressed-texture-worker.js +1148 -365
  18. package/dist/compressed-texture-worker.js.map +1 -0
  19. package/dist/compressed-texture-writer.js +1 -0
  20. package/dist/compressed-texture-writer.js.map +1 -0
  21. package/dist/crunch-loader.d.ts +1 -5
  22. package/dist/crunch-loader.d.ts.map +1 -1
  23. package/dist/crunch-loader.js +2 -3
  24. package/dist/crunch-loader.js.map +1 -0
  25. package/dist/crunch-worker.d.ts +2 -0
  26. package/dist/crunch-worker.d.ts.map +1 -0
  27. package/dist/crunch-worker.js +204 -92
  28. package/dist/crunch-worker.js.map +1 -0
  29. package/dist/dist.dev.js +2687 -677
  30. package/dist/dist.min.js +1 -2
  31. package/dist/index.cjs +1644 -428
  32. package/dist/index.cjs.map +4 -4
  33. package/dist/index.d.ts +13 -4
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +7 -3
  36. package/dist/index.js.map +1 -0
  37. package/dist/ktx2-basis-writer-worker-node.js +574 -9832
  38. package/dist/ktx2-basis-writer-worker.d.ts +2 -0
  39. package/dist/ktx2-basis-writer-worker.d.ts.map +1 -0
  40. package/dist/ktx2-basis-writer-worker.js +45 -7
  41. package/dist/ktx2-basis-writer-worker.js.map +1 -0
  42. package/dist/ktx2-basis-writer.js +1 -0
  43. package/dist/ktx2-basis-writer.js.map +1 -0
  44. package/dist/lib/composite-image/image-texture-cube.d.ts +47 -0
  45. package/dist/lib/composite-image/image-texture-cube.d.ts.map +1 -0
  46. package/dist/lib/composite-image/image-texture-cube.js +42 -0
  47. package/dist/lib/composite-image/image-texture-cube.js.map +1 -0
  48. package/dist/lib/composite-image/parse-composite-image.d.ts +43 -0
  49. package/dist/lib/composite-image/parse-composite-image.d.ts.map +1 -0
  50. package/dist/lib/composite-image/parse-composite-image.js +437 -0
  51. package/dist/lib/composite-image/parse-composite-image.js.map +1 -0
  52. package/dist/lib/encoders/encode-ktx.d.ts +1 -1
  53. package/dist/lib/encoders/encode-ktx.d.ts.map +1 -1
  54. package/dist/lib/encoders/encode-ktx.js +1 -0
  55. package/dist/lib/encoders/encode-ktx.js.map +1 -0
  56. package/dist/lib/encoders/encode-ktx2-basis-texture.d.ts +2 -1
  57. package/dist/lib/encoders/encode-ktx2-basis-texture.d.ts.map +1 -1
  58. package/dist/lib/encoders/encode-ktx2-basis-texture.js +3 -1
  59. package/dist/lib/encoders/encode-ktx2-basis-texture.js.map +1 -0
  60. package/dist/lib/encoders/encode-texture.js +1 -0
  61. package/dist/lib/encoders/encode-texture.js.map +1 -0
  62. package/dist/lib/gl-extensions.d.ts +166 -58
  63. package/dist/lib/gl-extensions.d.ts.map +1 -1
  64. package/dist/lib/gl-extensions.js +178 -66
  65. package/dist/lib/gl-extensions.js.map +1 -0
  66. package/dist/lib/gl-types.d.ts +4 -0
  67. package/dist/lib/gl-types.d.ts.map +1 -0
  68. package/dist/lib/gl-types.js +5 -0
  69. package/dist/lib/gl-types.js.map +1 -0
  70. package/dist/lib/parsers/basis-module-loader.d.ts +3 -2
  71. package/dist/lib/parsers/basis-module-loader.d.ts.map +1 -1
  72. package/dist/lib/parsers/basis-module-loader.js +1 -0
  73. package/dist/lib/parsers/basis-module-loader.js.map +1 -0
  74. package/dist/lib/parsers/crunch-module-loader.d.ts +2 -2
  75. package/dist/lib/parsers/crunch-module-loader.d.ts.map +1 -1
  76. package/dist/lib/parsers/crunch-module-loader.js +1 -0
  77. package/dist/lib/parsers/crunch-module-loader.js.map +1 -0
  78. package/dist/lib/parsers/parse-basis.d.ts +34 -2
  79. package/dist/lib/parsers/parse-basis.d.ts.map +1 -1
  80. package/dist/lib/parsers/parse-basis.js +265 -64
  81. package/dist/lib/parsers/parse-basis.js.map +1 -0
  82. package/dist/lib/parsers/parse-compressed-texture.js +1 -0
  83. package/dist/lib/parsers/parse-compressed-texture.js.map +1 -0
  84. package/dist/lib/parsers/parse-crunch.d.ts.map +1 -1
  85. package/dist/lib/parsers/parse-crunch.js +7 -6
  86. package/dist/lib/parsers/parse-crunch.js.map +1 -0
  87. package/dist/lib/parsers/parse-dds.d.ts.map +1 -1
  88. package/dist/lib/parsers/parse-dds.js +11 -11
  89. package/dist/lib/parsers/parse-dds.js.map +1 -0
  90. package/dist/lib/parsers/parse-hdr.d.ts +21 -0
  91. package/dist/lib/parsers/parse-hdr.d.ts.map +1 -0
  92. package/dist/lib/parsers/parse-hdr.js +305 -0
  93. package/dist/lib/parsers/parse-hdr.js.map +1 -0
  94. package/dist/lib/parsers/parse-ktx.d.ts.map +1 -1
  95. package/dist/lib/parsers/parse-ktx.js +11 -3
  96. package/dist/lib/parsers/parse-ktx.js.map +1 -0
  97. package/dist/lib/parsers/parse-npy.js +1 -0
  98. package/dist/lib/parsers/parse-npy.js.map +1 -0
  99. package/dist/lib/parsers/parse-pvr.d.ts.map +1 -1
  100. package/dist/lib/parsers/parse-pvr.js +32 -74
  101. package/dist/lib/parsers/parse-pvr.js.map +1 -0
  102. package/dist/lib/texture-api/async-deep-map.js +1 -0
  103. package/dist/lib/texture-api/async-deep-map.js.map +1 -0
  104. package/dist/lib/texture-api/deep-load.js +1 -0
  105. package/dist/lib/texture-api/deep-load.js.map +1 -0
  106. package/dist/lib/texture-api/generate-url.d.ts.map +1 -1
  107. package/dist/lib/texture-api/generate-url.js +3 -10
  108. package/dist/lib/texture-api/generate-url.js.map +1 -0
  109. package/dist/lib/texture-api/load-image-array.d.ts +6 -3
  110. package/dist/lib/texture-api/load-image-array.d.ts.map +1 -1
  111. package/dist/lib/texture-api/load-image-array.js +6 -3
  112. package/dist/lib/texture-api/load-image-array.js.map +1 -0
  113. package/dist/lib/texture-api/load-image-cube.d.ts +7 -11
  114. package/dist/lib/texture-api/load-image-cube.d.ts.map +1 -1
  115. package/dist/lib/texture-api/load-image-cube.js +9 -20
  116. package/dist/lib/texture-api/load-image-cube.js.map +1 -0
  117. package/dist/lib/texture-api/load-image.d.ts +6 -3
  118. package/dist/lib/texture-api/load-image.d.ts.map +1 -1
  119. package/dist/lib/texture-api/load-image.js +9 -4
  120. package/dist/lib/texture-api/load-image.js.map +1 -0
  121. package/dist/lib/texture-api/texture-api-types.d.ts +13 -0
  122. package/dist/lib/texture-api/texture-api-types.d.ts.map +1 -1
  123. package/dist/lib/texture-api/texture-api-types.js +1 -0
  124. package/dist/lib/texture-api/texture-api-types.js.map +1 -0
  125. package/dist/lib/utils/detect-supported-texture-formats.d.ts +14 -0
  126. package/dist/lib/utils/detect-supported-texture-formats.d.ts.map +1 -0
  127. package/dist/lib/utils/detect-supported-texture-formats.js +197 -0
  128. package/dist/lib/utils/detect-supported-texture-formats.js.map +1 -0
  129. package/dist/lib/utils/extract-mipmap-images.d.ts +6 -2
  130. package/dist/lib/utils/extract-mipmap-images.d.ts.map +1 -1
  131. package/dist/lib/utils/extract-mipmap-images.js +14 -2
  132. package/dist/lib/utils/extract-mipmap-images.js.map +1 -0
  133. package/dist/lib/utils/ktx-format-helper.d.ts +9 -1
  134. package/dist/lib/utils/ktx-format-helper.d.ts.map +1 -1
  135. package/dist/lib/utils/ktx-format-helper.js +77 -109
  136. package/dist/lib/utils/ktx-format-helper.js.map +1 -0
  137. package/dist/lib/utils/texture-format-map.d.ts +10 -0
  138. package/dist/lib/utils/texture-format-map.d.ts.map +1 -0
  139. package/dist/lib/utils/texture-format-map.js +87 -0
  140. package/dist/lib/utils/texture-format-map.js.map +1 -0
  141. package/dist/lib/utils/version.js +2 -1
  142. package/dist/lib/utils/version.js.map +1 -0
  143. package/dist/libs/libs/README.md +9 -0
  144. package/dist/libs/libs/basis_encoder.js +21 -0
  145. package/dist/libs/libs/basis_encoder.wasm +0 -0
  146. package/dist/libs/libs/basis_transcoder.js +22 -0
  147. package/dist/libs/libs/basis_transcoder.wasm +0 -0
  148. package/dist/libs/libs/crunch.js +136 -0
  149. package/dist/npy-loader.d.ts +2 -2
  150. package/dist/npy-loader.js +1 -0
  151. package/dist/npy-loader.js.map +1 -0
  152. package/dist/npy-worker.d.ts +2 -0
  153. package/dist/npy-worker.d.ts.map +1 -0
  154. package/dist/npy-worker.js +5 -2
  155. package/dist/npy-worker.js.map +1 -0
  156. package/dist/radiance-hdr-loader.d.ts +25 -0
  157. package/dist/radiance-hdr-loader.d.ts.map +1 -0
  158. package/dist/radiance-hdr-loader.js +23 -0
  159. package/dist/radiance-hdr-loader.js.map +1 -0
  160. package/dist/texture-array-loader.d.ts +25 -0
  161. package/dist/texture-array-loader.d.ts.map +1 -0
  162. package/dist/texture-array-loader.js +24 -0
  163. package/dist/texture-array-loader.js.map +1 -0
  164. package/dist/texture-cube-array-loader.d.ts +25 -0
  165. package/dist/texture-cube-array-loader.d.ts.map +1 -0
  166. package/dist/texture-cube-array-loader.js +24 -0
  167. package/dist/texture-cube-array-loader.js.map +1 -0
  168. package/dist/texture-cube-loader.d.ts +25 -0
  169. package/dist/texture-cube-loader.d.ts.map +1 -0
  170. package/dist/texture-cube-loader.js +24 -0
  171. package/dist/texture-cube-loader.js.map +1 -0
  172. package/dist/texture-loader.d.ts +25 -0
  173. package/dist/texture-loader.d.ts.map +1 -0
  174. package/dist/texture-loader.js +24 -0
  175. package/dist/texture-loader.js.map +1 -0
  176. package/dist/workers/basis-worker-node.js +1 -0
  177. package/dist/workers/basis-worker-node.js.map +1 -0
  178. package/dist/workers/basis-worker.js +1 -0
  179. package/dist/workers/basis-worker.js.map +1 -0
  180. package/dist/workers/compressed-texture-worker.js +1 -1
  181. package/dist/workers/compressed-texture-worker.js.map +1 -0
  182. package/dist/workers/crunch-worker.d.ts +1 -3
  183. package/dist/workers/crunch-worker.d.ts.map +1 -1
  184. package/dist/workers/crunch-worker.js +1 -0
  185. package/dist/workers/crunch-worker.js.map +1 -0
  186. package/dist/workers/ktx2-basis-writer-worker-node.js +1 -0
  187. package/dist/workers/ktx2-basis-writer-worker-node.js.map +1 -0
  188. package/dist/workers/ktx2-basis-writer-worker.js +1 -0
  189. package/dist/workers/ktx2-basis-writer-worker.js.map +1 -0
  190. package/dist/workers/npy-worker.js +1 -0
  191. package/dist/workers/npy-worker.js.map +1 -0
  192. package/package.json +27 -6
  193. package/src/basis-loader.ts +19 -9
  194. package/src/basis-worker.ts +7 -0
  195. package/src/compressed-texture-loader.ts +3 -7
  196. package/src/compressed-texture-worker.ts +6 -0
  197. package/src/crunch-loader.ts +1 -5
  198. package/src/crunch-worker.ts +6 -0
  199. package/src/index.ts +21 -4
  200. package/src/ktx2-basis-writer-worker.ts +6 -0
  201. package/src/lib/composite-image/image-texture-cube.ts +49 -0
  202. package/src/lib/composite-image/parse-composite-image.ts +699 -0
  203. package/src/lib/encoders/encode-ktx.ts +1 -1
  204. package/src/lib/encoders/encode-ktx2-basis-texture.ts +4 -2
  205. package/src/lib/gl-extensions.ts +188 -81
  206. package/src/lib/gl-types.ts +136 -0
  207. package/src/lib/parsers/basis-module-loader.ts +5 -5
  208. package/src/lib/parsers/crunch-module-loader.ts +4 -4
  209. package/src/lib/parsers/parse-basis.ts +358 -66
  210. package/src/lib/parsers/parse-crunch.ts +11 -8
  211. package/src/lib/parsers/parse-dds.ts +11 -12
  212. package/src/lib/parsers/parse-hdr.ts +426 -0
  213. package/src/lib/parsers/parse-ktx.ts +13 -3
  214. package/src/lib/parsers/parse-pvr.ts +33 -75
  215. package/src/lib/texture-api/generate-url.ts +2 -12
  216. package/src/lib/texture-api/load-image-array.ts +15 -6
  217. package/src/lib/texture-api/load-image-cube.ts +20 -34
  218. package/src/lib/texture-api/load-image.ts +19 -8
  219. package/src/lib/texture-api/texture-api-types.ts +15 -0
  220. package/src/lib/utils/detect-supported-texture-formats.ts +210 -0
  221. package/src/lib/utils/extract-mipmap-images.ts +23 -4
  222. package/src/lib/utils/ktx-format-helper.ts +135 -111
  223. package/src/lib/utils/texture-format-map.ts +162 -0
  224. package/src/npy-worker.ts +6 -0
  225. package/src/radiance-hdr-loader.ts +36 -0
  226. package/src/texture-array-loader.ts +46 -0
  227. package/src/texture-cube-array-loader.ts +49 -0
  228. package/src/texture-cube-loader.ts +46 -0
  229. package/src/texture-loader.ts +49 -0
  230. package/src/workers/compressed-texture-worker.ts +0 -1
  231. package/dist/lib/utils/texture-formats.d.ts +0 -8
  232. package/dist/lib/utils/texture-formats.d.ts.map +0 -1
  233. package/dist/lib/utils/texture-formats.js +0 -50
  234. package/src/lib/utils/texture-formats.ts +0 -59
@@ -3,7 +3,9 @@
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
5
  import type {ImageDataType} from '@loaders.gl/images';
6
+ import {extractLoadLibraryOptions} from '@loaders.gl/worker-utils';
6
7
  import {loadBasisEncoderModule} from '../parsers/basis-module-loader';
8
+ import {type KTX2BasisWriterOptions} from '../../ktx2-basis-writer';
7
9
 
8
10
  /**
9
11
  * Encodes image to Basis Universal Supercompressed GPU Texture.
@@ -14,7 +16,7 @@ import {loadBasisEncoderModule} from '../parsers/basis-module-loader';
14
16
  */
15
17
  export async function encodeKTX2BasisTexture(
16
18
  image: ImageDataType,
17
- options: any = {}
19
+ options: KTX2BasisWriterOptions = {}
18
20
  ): Promise<ArrayBuffer> {
19
21
  // TODO remove default values after writer options will be normalized like it done in load module.
20
22
  const {
@@ -23,7 +25,7 @@ export async function encodeKTX2BasisTexture(
23
25
  encodeUASTC = false,
24
26
  mipmaps = false
25
27
  } = options?.['ktx2-basis-writer'] || {};
26
- const {BasisEncoder} = await loadBasisEncoderModule(options);
28
+ const {BasisEncoder} = await loadBasisEncoderModule(extractLoadLibraryOptions(options));
27
29
  const basisEncoder = new BasisEncoder();
28
30
 
29
31
  try {
@@ -3,86 +3,193 @@
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
5
  /* eslint-disable camelcase */
6
- export const GL_EXTENSIONS_CONSTANTS = {
7
- // WEBGL_compressed_texture_s3tc
8
-
9
- COMPRESSED_RGB_S3TC_DXT1_EXT: 0x83f0,
10
- COMPRESSED_RGBA_S3TC_DXT1_EXT: 0x83f1,
11
- COMPRESSED_RGBA_S3TC_DXT3_EXT: 0x83f2,
12
- COMPRESSED_RGBA_S3TC_DXT5_EXT: 0x83f3,
13
-
14
- // WEBGL_compressed_texture_es3
15
-
16
- COMPRESSED_R11_EAC: 0x9270,
17
- COMPRESSED_SIGNED_R11_EAC: 0x9271,
18
- COMPRESSED_RG11_EAC: 0x9272,
19
- COMPRESSED_SIGNED_RG11_EAC: 0x9273,
20
- COMPRESSED_RGB8_ETC2: 0x9274,
21
- COMPRESSED_RGBA8_ETC2_EAC: 0x9275,
22
- COMPRESSED_SRGB8_ETC2: 0x9276,
23
- COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: 0x9277,
24
- COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: 0x9278,
25
- COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: 0x9279,
26
-
27
- // WEBGL_compressed_texture_pvrtc
28
-
29
- COMPRESSED_RGB_PVRTC_4BPPV1_IMG: 0x8c00,
30
- COMPRESSED_RGBA_PVRTC_4BPPV1_IMG: 0x8c02,
31
- COMPRESSED_RGB_PVRTC_2BPPV1_IMG: 0x8c01,
32
- COMPRESSED_RGBA_PVRTC_2BPPV1_IMG: 0x8c03,
33
-
34
- // WEBGL_compressed_texture_etc1
35
-
36
- COMPRESSED_RGB_ETC1_WEBGL: 0x8d64,
37
6
 
38
- // WEBGL_compressed_texture_atc
7
+ // Core WebGL texture formats
8
+ export const GL_RGB = 0x1907;
9
+ export const GL_RGBA = 0x1908;
10
+ export const GL_RGBA4 = 0x8056;
11
+ export const GL_RGB5_A1 = 0x8057;
12
+ export const GL_RGBA8 = 0x8058;
13
+ export const GL_RGB565 = 0x8d62;
14
+ export const GL_RGBA32F = 0x8814;
15
+
16
+ // WEBGL_compressed_texture_s3tc
17
+ export const GL_COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83f0;
18
+ export const GL_COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83f1;
19
+ export const GL_COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83f2;
20
+ export const GL_COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83f3;
21
+
22
+ // WEBGL_compressed_texture_es3
23
+ export const GL_COMPRESSED_R11_EAC = 0x9270;
24
+ export const GL_COMPRESSED_SIGNED_R11_EAC = 0x9271;
25
+ export const GL_COMPRESSED_RG11_EAC = 0x9272;
26
+ export const GL_COMPRESSED_SIGNED_RG11_EAC = 0x9273;
27
+ export const GL_COMPRESSED_RGB8_ETC2 = 0x9274;
28
+ export const GL_COMPRESSED_RGBA8_ETC2_EAC = 0x9275;
29
+ export const GL_COMPRESSED_SRGB8_ETC2 = 0x9276;
30
+ export const GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9277;
31
+ export const GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9278;
32
+ export const GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9279;
33
+
34
+ // WEBGL_compressed_texture_pvrtc
35
+ export const GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8c00;
36
+ export const GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 0x8c01;
37
+ export const GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 0x8c02;
38
+ export const GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 0x8c03;
39
+
40
+ // WEBGL_compressed_texture_etc1
41
+ export const GL_COMPRESSED_RGB_ETC1_WEBGL = 0x8d64;
42
+
43
+ // WEBGL_compressed_texture_atc
44
+ export const GL_COMPRESSED_RGB_ATC_WEBGL = 0x8c92;
45
+ export const GL_COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL = 0x8c93;
46
+ export const GL_COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL = 0x87ee;
47
+
48
+ // WEBGL_compressed_texture_astc
49
+ export const GL_COMPRESSED_RGBA_ASTC_4x4_KHR = 0x93b0;
50
+ export const GL_COMPRESSED_RGBA_ASTC_5x4_KHR = 0x93b1;
51
+ export const GL_COMPRESSED_RGBA_ASTC_5x5_KHR = 0x93b2;
52
+ export const GL_COMPRESSED_RGBA_ASTC_6x5_KHR = 0x93b3;
53
+ export const GL_COMPRESSED_RGBA_ASTC_6x6_KHR = 0x93b4;
54
+ export const GL_COMPRESSED_RGBA_ASTC_8x5_KHR = 0x93b5;
55
+ export const GL_COMPRESSED_RGBA_ASTC_8x6_KHR = 0x93b6;
56
+ export const GL_COMPRESSED_RGBA_ASTC_8x8_KHR = 0x93b7;
57
+ export const GL_COMPRESSED_RGBA_ASTC_10x5_KHR = 0x93b8;
58
+ export const GL_COMPRESSED_RGBA_ASTC_10x6_KHR = 0x93b9;
59
+ export const GL_COMPRESSED_RGBA_ASTC_10x8_KHR = 0x93ba;
60
+ export const GL_COMPRESSED_RGBA_ASTC_10x10_KHR = 0x93bb;
61
+ export const GL_COMPRESSED_RGBA_ASTC_12x10_KHR = 0x93bc;
62
+ export const GL_COMPRESSED_RGBA_ASTC_12x12_KHR = 0x93bd;
63
+ export const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 0x93d0;
64
+ export const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 0x93d1;
65
+ export const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 0x93d2;
66
+ export const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 0x93d3;
67
+ export const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 0x93d4;
68
+ export const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 0x93d5;
69
+ export const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 0x93d6;
70
+ export const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 0x93d7;
71
+ export const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR = 0x93d8;
72
+ export const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR = 0x93d9;
73
+ export const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR = 0x93da;
74
+ export const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR = 0x93db;
75
+ export const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = 0x93dc;
76
+ export const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = 0x93dd;
77
+
78
+ // EXT_texture_compression_rgtc
79
+ export const GL_COMPRESSED_RED_RGTC1_EXT = 0x8dbb;
80
+ export const GL_COMPRESSED_SIGNED_RED_RGTC1_EXT = 0x8dbc;
81
+ export const GL_COMPRESSED_RED_GREEN_RGTC2_EXT = 0x8dbd;
82
+ export const GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT = 0x8dbe;
83
+
84
+ // EXT_texture_compression_bptc
85
+ export const GL_COMPRESSED_RGBA_BPTC_UNORM_EXT = 0x8e8c;
86
+ export const GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT = 0x8e8d;
87
+ export const GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT = 0x8e8e;
88
+ export const GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT = 0x8e8f;
89
+
90
+ // WEBGL_compressed_texture_s3tc_srgb
91
+ export const GL_COMPRESSED_SRGB_S3TC_DXT1_EXT = 0x8c4c;
92
+ export const GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 0x8c4d;
93
+ export const GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 0x8c4e;
94
+ export const GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 0x8c4f;
39
95
 
40
- COMPRESSED_RGB_ATC_WEBGL: 0x8c92,
41
- COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL: 0x8c93,
42
- COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL: 0x87ee,
43
-
44
- // WEBGL_compressed_texture_astc
45
-
46
- COMPRESSED_RGBA_ASTC_4X4_KHR: 0x93b0,
47
- COMPRESSED_RGBA_ASTC_5X4_KHR: 0x93b1,
48
- COMPRESSED_RGBA_ASTC_5X5_KHR: 0x93b2,
49
- COMPRESSED_RGBA_ASTC_6X5_KHR: 0x93b3,
50
- COMPRESSED_RGBA_ASTC_6X6_KHR: 0x93b4,
51
- COMPRESSED_RGBA_ASTC_8X5_KHR: 0x93b5,
52
- COMPRESSED_RGBA_ASTC_8X6_KHR: 0x93b6,
53
- COMPRESSED_RGBA_ASTC_8X8_KHR: 0x93b7,
54
- COMPRESSED_RGBA_ASTC_10X5_KHR: 0x93b8,
55
- COMPRESSED_RGBA_ASTC_10X6_KHR: 0x93b9,
56
- COMPRESSED_RGBA_ASTC_10X8_KHR: 0x93ba,
57
- COMPRESSED_RGBA_ASTC_10X10_KHR: 0x93bb,
58
- COMPRESSED_RGBA_ASTC_12X10_KHR: 0x93bc,
59
- COMPRESSED_RGBA_ASTC_12X12_KHR: 0x93bd,
60
- COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR: 0x93d0,
61
- COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR: 0x93d1,
62
- COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR: 0x93d2,
63
- COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR: 0x93d3,
64
- COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR: 0x93d4,
65
- COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR: 0x93d5,
66
- COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR: 0x93d6,
67
- COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR: 0x93d7,
68
- COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR: 0x93d8,
69
- COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR: 0x93d9,
70
- COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR: 0x93da,
71
- COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR: 0x93db,
72
- COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR: 0x93dc,
73
- COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR: 0x93dd,
74
-
75
- // EXT_texture_compression_rgtc
76
-
77
- COMPRESSED_RED_RGTC1_EXT: 0x8dbb,
78
- COMPRESSED_SIGNED_RED_RGTC1_EXT: 0x8dbc,
79
- COMPRESSED_RED_GREEN_RGTC2_EXT: 0x8dbd,
80
- COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT: 0x8dbe,
81
-
82
- // WEBGL_compressed_texture_s3tc_srgb
83
-
84
- COMPRESSED_SRGB_S3TC_DXT1_EXT: 0x8c4c,
85
- COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: 0x8c4d,
86
- COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: 0x8c4e,
87
- COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: 0x8c4f
88
- };
96
+ export const GL_EXTENSIONS_CONSTANTS = {
97
+ RGB: GL_RGB,
98
+ RGBA: GL_RGBA,
99
+ RGBA4: GL_RGBA4,
100
+ RGB5_A1: GL_RGB5_A1,
101
+ RGBA8: GL_RGBA8,
102
+ RGB565: GL_RGB565,
103
+ RGBA32F: GL_RGBA32F,
104
+ COMPRESSED_RGB_S3TC_DXT1_EXT: GL_COMPRESSED_RGB_S3TC_DXT1_EXT,
105
+ COMPRESSED_RGBA_S3TC_DXT1_EXT: GL_COMPRESSED_RGBA_S3TC_DXT1_EXT,
106
+ COMPRESSED_RGBA_S3TC_DXT3_EXT: GL_COMPRESSED_RGBA_S3TC_DXT3_EXT,
107
+ COMPRESSED_RGBA_S3TC_DXT5_EXT: GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,
108
+ COMPRESSED_R11_EAC: GL_COMPRESSED_R11_EAC,
109
+ COMPRESSED_SIGNED_R11_EAC: GL_COMPRESSED_SIGNED_R11_EAC,
110
+ COMPRESSED_RG11_EAC: GL_COMPRESSED_RG11_EAC,
111
+ COMPRESSED_SIGNED_RG11_EAC: GL_COMPRESSED_SIGNED_RG11_EAC,
112
+ COMPRESSED_RGB8_ETC2: GL_COMPRESSED_RGB8_ETC2,
113
+ COMPRESSED_RGBA8_ETC2_EAC: GL_COMPRESSED_RGBA8_ETC2_EAC,
114
+ COMPRESSED_SRGB8_ETC2: GL_COMPRESSED_SRGB8_ETC2,
115
+ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,
116
+ COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,
117
+ COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,
118
+ COMPRESSED_RGB_PVRTC_4BPPV1_IMG: GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG,
119
+ COMPRESSED_RGB_PVRTC_2BPPV1_IMG: GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG,
120
+ COMPRESSED_RGBA_PVRTC_4BPPV1_IMG: GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,
121
+ COMPRESSED_RGBA_PVRTC_2BPPV1_IMG: GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,
122
+ COMPRESSED_RGB_ETC1_WEBGL: GL_COMPRESSED_RGB_ETC1_WEBGL,
123
+ COMPRESSED_RGB_ATC_WEBGL: GL_COMPRESSED_RGB_ATC_WEBGL,
124
+ COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL: GL_COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,
125
+ COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL: GL_COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL,
126
+ COMPRESSED_RGBA_ASTC_4x4_KHR: GL_COMPRESSED_RGBA_ASTC_4x4_KHR,
127
+ COMPRESSED_RGBA_ASTC_5x4_KHR: GL_COMPRESSED_RGBA_ASTC_5x4_KHR,
128
+ COMPRESSED_RGBA_ASTC_5x5_KHR: GL_COMPRESSED_RGBA_ASTC_5x5_KHR,
129
+ COMPRESSED_RGBA_ASTC_6x5_KHR: GL_COMPRESSED_RGBA_ASTC_6x5_KHR,
130
+ COMPRESSED_RGBA_ASTC_6x6_KHR: GL_COMPRESSED_RGBA_ASTC_6x6_KHR,
131
+ COMPRESSED_RGBA_ASTC_8x5_KHR: GL_COMPRESSED_RGBA_ASTC_8x5_KHR,
132
+ COMPRESSED_RGBA_ASTC_8x6_KHR: GL_COMPRESSED_RGBA_ASTC_8x6_KHR,
133
+ COMPRESSED_RGBA_ASTC_8x8_KHR: GL_COMPRESSED_RGBA_ASTC_8x8_KHR,
134
+ COMPRESSED_RGBA_ASTC_10x5_KHR: GL_COMPRESSED_RGBA_ASTC_10x5_KHR,
135
+ COMPRESSED_RGBA_ASTC_10x6_KHR: GL_COMPRESSED_RGBA_ASTC_10x6_KHR,
136
+ COMPRESSED_RGBA_ASTC_10x8_KHR: GL_COMPRESSED_RGBA_ASTC_10x8_KHR,
137
+ COMPRESSED_RGBA_ASTC_10x10_KHR: GL_COMPRESSED_RGBA_ASTC_10x10_KHR,
138
+ COMPRESSED_RGBA_ASTC_12x10_KHR: GL_COMPRESSED_RGBA_ASTC_12x10_KHR,
139
+ COMPRESSED_RGBA_ASTC_12x12_KHR: GL_COMPRESSED_RGBA_ASTC_12x12_KHR,
140
+ COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,
141
+ COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,
142
+ COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,
143
+ COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,
144
+ COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,
145
+ COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,
146
+ COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,
147
+ COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,
148
+ COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,
149
+ COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,
150
+ COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,
151
+ COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,
152
+ COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,
153
+ COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,
154
+ COMPRESSED_RED_RGTC1_EXT: GL_COMPRESSED_RED_RGTC1_EXT,
155
+ COMPRESSED_SIGNED_RED_RGTC1_EXT: GL_COMPRESSED_SIGNED_RED_RGTC1_EXT,
156
+ COMPRESSED_RED_GREEN_RGTC2_EXT: GL_COMPRESSED_RED_GREEN_RGTC2_EXT,
157
+ COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT: GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,
158
+ COMPRESSED_RGBA_BPTC_UNORM_EXT: GL_COMPRESSED_RGBA_BPTC_UNORM_EXT,
159
+ COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT: GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT,
160
+ COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT: GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,
161
+ COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT: GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,
162
+ COMPRESSED_SRGB_S3TC_DXT1_EXT: GL_COMPRESSED_SRGB_S3TC_DXT1_EXT,
163
+ COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,
164
+ COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,
165
+ COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,
166
+ // Deprecated legacy aliases with non-standard ASTC casing.
167
+ COMPRESSED_RGBA_ASTC_4X4_KHR: GL_COMPRESSED_RGBA_ASTC_4x4_KHR,
168
+ COMPRESSED_RGBA_ASTC_5X4_KHR: GL_COMPRESSED_RGBA_ASTC_5x4_KHR,
169
+ COMPRESSED_RGBA_ASTC_5X5_KHR: GL_COMPRESSED_RGBA_ASTC_5x5_KHR,
170
+ COMPRESSED_RGBA_ASTC_6X5_KHR: GL_COMPRESSED_RGBA_ASTC_6x5_KHR,
171
+ COMPRESSED_RGBA_ASTC_6X6_KHR: GL_COMPRESSED_RGBA_ASTC_6x6_KHR,
172
+ COMPRESSED_RGBA_ASTC_8X5_KHR: GL_COMPRESSED_RGBA_ASTC_8x5_KHR,
173
+ COMPRESSED_RGBA_ASTC_8X6_KHR: GL_COMPRESSED_RGBA_ASTC_8x6_KHR,
174
+ COMPRESSED_RGBA_ASTC_8X8_KHR: GL_COMPRESSED_RGBA_ASTC_8x8_KHR,
175
+ COMPRESSED_RGBA_ASTC_10X5_KHR: GL_COMPRESSED_RGBA_ASTC_10x5_KHR,
176
+ COMPRESSED_RGBA_ASTC_10X6_KHR: GL_COMPRESSED_RGBA_ASTC_10x6_KHR,
177
+ COMPRESSED_RGBA_ASTC_10X8_KHR: GL_COMPRESSED_RGBA_ASTC_10x8_KHR,
178
+ COMPRESSED_RGBA_ASTC_10X10_KHR: GL_COMPRESSED_RGBA_ASTC_10x10_KHR,
179
+ COMPRESSED_RGBA_ASTC_12X10_KHR: GL_COMPRESSED_RGBA_ASTC_12x10_KHR,
180
+ COMPRESSED_RGBA_ASTC_12X12_KHR: GL_COMPRESSED_RGBA_ASTC_12x12_KHR,
181
+ COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,
182
+ COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,
183
+ COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,
184
+ COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,
185
+ COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,
186
+ COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,
187
+ COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,
188
+ COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,
189
+ COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,
190
+ COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,
191
+ COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,
192
+ COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,
193
+ COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,
194
+ COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR: GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR
195
+ } as const;
@@ -0,0 +1,136 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+
5
+ /* eslint-disable camelcase */
6
+ import type {
7
+ GL_COMPRESSED_R11_EAC,
8
+ GL_COMPRESSED_RED_GREEN_RGTC2_EXT,
9
+ GL_COMPRESSED_RED_RGTC1_EXT,
10
+ GL_COMPRESSED_RG11_EAC,
11
+ GL_COMPRESSED_RGB8_ETC2,
12
+ GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,
13
+ GL_COMPRESSED_RGB_ATC_WEBGL,
14
+ GL_COMPRESSED_RGB_ETC1_WEBGL,
15
+ GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG,
16
+ GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG,
17
+ GL_COMPRESSED_RGB_S3TC_DXT1_EXT,
18
+ GL_COMPRESSED_RGBA8_ETC2_EAC,
19
+ GL_COMPRESSED_RGBA_ASTC_10x10_KHR,
20
+ GL_COMPRESSED_RGBA_ASTC_10x5_KHR,
21
+ GL_COMPRESSED_RGBA_ASTC_10x6_KHR,
22
+ GL_COMPRESSED_RGBA_ASTC_10x8_KHR,
23
+ GL_COMPRESSED_RGBA_ASTC_12x10_KHR,
24
+ GL_COMPRESSED_RGBA_ASTC_12x12_KHR,
25
+ GL_COMPRESSED_RGBA_ASTC_4x4_KHR,
26
+ GL_COMPRESSED_RGBA_ASTC_5x4_KHR,
27
+ GL_COMPRESSED_RGBA_ASTC_5x5_KHR,
28
+ GL_COMPRESSED_RGBA_ASTC_6x5_KHR,
29
+ GL_COMPRESSED_RGBA_ASTC_6x6_KHR,
30
+ GL_COMPRESSED_RGBA_ASTC_8x5_KHR,
31
+ GL_COMPRESSED_RGBA_ASTC_8x6_KHR,
32
+ GL_COMPRESSED_RGBA_ASTC_8x8_KHR,
33
+ GL_COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,
34
+ GL_COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL,
35
+ GL_COMPRESSED_RGBA_BPTC_UNORM_EXT,
36
+ GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,
37
+ GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,
38
+ GL_COMPRESSED_RGBA_S3TC_DXT1_EXT,
39
+ GL_COMPRESSED_RGBA_S3TC_DXT3_EXT,
40
+ GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,
41
+ GL_COMPRESSED_SIGNED_R11_EAC,
42
+ GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,
43
+ GL_COMPRESSED_SIGNED_RED_RGTC1_EXT,
44
+ GL_COMPRESSED_SIGNED_RG11_EAC,
45
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,
46
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,
47
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,
48
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,
49
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,
50
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,
51
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,
52
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,
53
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,
54
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,
55
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,
56
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,
57
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,
58
+ GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,
59
+ GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,
60
+ GL_COMPRESSED_SRGB8_ETC2,
61
+ GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,
62
+ GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,
63
+ GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,
64
+ GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,
65
+ GL_COMPRESSED_SRGB_S3TC_DXT1_EXT,
66
+ GL_RGB565,
67
+ GL_RGBA32F,
68
+ GL_RGBA4,
69
+ GL_RGBA8
70
+ } from './gl-extensions';
71
+
72
+ /** WebGL/OpenGL texture format constants used internally by the textures module. */
73
+ export type GLTextureFormat =
74
+ | typeof GL_COMPRESSED_R11_EAC
75
+ | typeof GL_COMPRESSED_RED_GREEN_RGTC2_EXT
76
+ | typeof GL_COMPRESSED_RED_RGTC1_EXT
77
+ | typeof GL_COMPRESSED_RG11_EAC
78
+ | typeof GL_COMPRESSED_RGB8_ETC2
79
+ | typeof GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2
80
+ | typeof GL_COMPRESSED_RGB_ATC_WEBGL
81
+ | typeof GL_COMPRESSED_RGB_ETC1_WEBGL
82
+ | typeof GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG
83
+ | typeof GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG
84
+ | typeof GL_COMPRESSED_RGB_S3TC_DXT1_EXT
85
+ | typeof GL_COMPRESSED_RGBA8_ETC2_EAC
86
+ | typeof GL_COMPRESSED_RGBA_ASTC_10x10_KHR
87
+ | typeof GL_COMPRESSED_RGBA_ASTC_10x5_KHR
88
+ | typeof GL_COMPRESSED_RGBA_ASTC_10x6_KHR
89
+ | typeof GL_COMPRESSED_RGBA_ASTC_10x8_KHR
90
+ | typeof GL_COMPRESSED_RGBA_ASTC_12x10_KHR
91
+ | typeof GL_COMPRESSED_RGBA_ASTC_12x12_KHR
92
+ | typeof GL_COMPRESSED_RGBA_ASTC_4x4_KHR
93
+ | typeof GL_COMPRESSED_RGBA_ASTC_5x4_KHR
94
+ | typeof GL_COMPRESSED_RGBA_ASTC_5x5_KHR
95
+ | typeof GL_COMPRESSED_RGBA_ASTC_6x5_KHR
96
+ | typeof GL_COMPRESSED_RGBA_ASTC_6x6_KHR
97
+ | typeof GL_COMPRESSED_RGBA_ASTC_8x5_KHR
98
+ | typeof GL_COMPRESSED_RGBA_ASTC_8x6_KHR
99
+ | typeof GL_COMPRESSED_RGBA_ASTC_8x8_KHR
100
+ | typeof GL_COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL
101
+ | typeof GL_COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL
102
+ | typeof GL_COMPRESSED_RGBA_BPTC_UNORM_EXT
103
+ | typeof GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
104
+ | typeof GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG
105
+ | typeof GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
106
+ | typeof GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
107
+ | typeof GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
108
+ | typeof GL_COMPRESSED_SIGNED_R11_EAC
109
+ | typeof GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT
110
+ | typeof GL_COMPRESSED_SIGNED_RED_RGTC1_EXT
111
+ | typeof GL_COMPRESSED_SIGNED_RG11_EAC
112
+ | typeof GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR
113
+ | typeof GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR
114
+ | typeof GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR
115
+ | typeof GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR
116
+ | typeof GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR
117
+ | typeof GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR
118
+ | typeof GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR
119
+ | typeof GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR
120
+ | typeof GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR
121
+ | typeof GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR
122
+ | typeof GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR
123
+ | typeof GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR
124
+ | typeof GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR
125
+ | typeof GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR
126
+ | typeof GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
127
+ | typeof GL_COMPRESSED_SRGB8_ETC2
128
+ | typeof GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2
129
+ | typeof GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT
130
+ | typeof GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT
131
+ | typeof GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT
132
+ | typeof GL_COMPRESSED_SRGB_S3TC_DXT1_EXT
133
+ | typeof GL_RGB565
134
+ | typeof GL_RGBA32F
135
+ | typeof GL_RGBA4
136
+ | typeof GL_RGBA8;
@@ -3,7 +3,7 @@
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
5
  import {registerJSModules, getJSModuleOrNull} from '@loaders.gl/loader-utils';
6
- import {loadLibrary} from '@loaders.gl/worker-utils';
6
+ import {loadLibrary, LoadLibraryOptions} from '@loaders.gl/worker-utils';
7
7
 
8
8
  export const BASIS_EXTERNAL_LIBRARIES = {
9
9
  /** Basis transcoder, javascript wrapper part */
@@ -23,7 +23,7 @@ let loadBasisTranscoderPromise;
23
23
  * @param options
24
24
  * @returns {BasisFile} promise
25
25
  */
26
- export async function loadBasisTranscoderModule(options) {
26
+ export async function loadBasisTranscoderModule(options: LoadLibraryOptions) {
27
27
  registerJSModules(options.modules);
28
28
  const basis = getJSModuleOrNull('basis');
29
29
  if (basis) {
@@ -39,7 +39,7 @@ export async function loadBasisTranscoderModule(options) {
39
39
  * @param options
40
40
  * @returns {BasisFile} promise
41
41
  */
42
- async function loadBasisTranscoder(options) {
42
+ async function loadBasisTranscoder(options: LoadLibraryOptions) {
43
43
  let BASIS = null;
44
44
  let wasmBinary = null;
45
45
 
@@ -84,7 +84,7 @@ let loadBasisEncoderPromise;
84
84
  * @param options
85
85
  * @returns {BasisFile, KTX2File} promise
86
86
  */
87
- export async function loadBasisEncoderModule(options) {
87
+ export async function loadBasisEncoderModule(options: LoadLibraryOptions) {
88
88
  const modules = options.modules || {};
89
89
  if (modules.basisEncoder) {
90
90
  return modules.basisEncoder;
@@ -99,7 +99,7 @@ export async function loadBasisEncoderModule(options) {
99
99
  * @param options
100
100
  * @returns {BasisFile, KTX2File} promise
101
101
  */
102
- async function loadBasisEncoder(options) {
102
+ async function loadBasisEncoder(options: LoadLibraryOptions) {
103
103
  let BASIS_ENCODER = null;
104
104
  let wasmBinary = null;
105
105
 
@@ -3,8 +3,8 @@
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
5
  // @ts-nocheck
6
- import {getJSModuleOrNull, LoaderOptions, registerJSModules} from '@loaders.gl/loader-utils';
7
- import {loadLibrary} from '@loaders.gl/worker-utils';
6
+ import {getJSModuleOrNull, registerJSModules} from '@loaders.gl/loader-utils';
7
+ import {loadLibrary, type LoadLibraryOptions} from '@loaders.gl/worker-utils';
8
8
 
9
9
  export const CRUNCH_EXTERNAL_LIBRARIES = {
10
10
  /** Crunch decoder library. It is used as dynamically imported script */
@@ -16,7 +16,7 @@ export const CRUNCH_EXTERNAL_LIBRARIES = {
16
16
  * @param options - loader options
17
17
  * @returns Promise of module object
18
18
  */
19
- export async function loadCrunchModule(options: LoaderOptions): Promise<any> {
19
+ export async function loadCrunchModule(options: LoadLibraryOptions): Promise<any> {
20
20
  registerJSModules(options.modules);
21
21
  const crunch = getJSModuleOrNull('crunch');
22
22
  if (crunch) {
@@ -33,7 +33,7 @@ let crunchModule;
33
33
  * @param {any} options - Loader options
34
34
  * @returns {Promise<any>} Promise of Module object
35
35
  */
36
- async function loadCrunch(options: LoaderOptions): Promise<any> {
36
+ async function loadCrunch(options: LoadLibraryOptions): Promise<any> {
37
37
  if (crunchModule) {
38
38
  return crunchModule;
39
39
  }