@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.
- package/README.md +197 -1
- package/dist/basis-loader.d.ts +15 -10
- package/dist/basis-loader.d.ts.map +1 -1
- package/dist/basis-loader.js +1 -1
- package/dist/basis-loader.js.map +1 -0
- package/dist/basis-worker-node.js +932 -10040
- package/dist/basis-worker.d.ts +2 -0
- package/dist/basis-worker.d.ts.map +1 -0
- package/dist/basis-worker.js +337 -151
- package/dist/basis-worker.js.map +1 -0
- package/dist/compressed-texture-loader.d.ts +2 -5
- package/dist/compressed-texture-loader.d.ts.map +1 -1
- package/dist/compressed-texture-loader.js +2 -3
- package/dist/compressed-texture-loader.js.map +1 -0
- package/dist/compressed-texture-worker.d.ts +2 -0
- package/dist/compressed-texture-worker.d.ts.map +1 -0
- package/dist/compressed-texture-worker.js +1148 -365
- package/dist/compressed-texture-worker.js.map +1 -0
- package/dist/compressed-texture-writer.js +1 -0
- package/dist/compressed-texture-writer.js.map +1 -0
- package/dist/crunch-loader.d.ts +1 -5
- package/dist/crunch-loader.d.ts.map +1 -1
- package/dist/crunch-loader.js +2 -3
- package/dist/crunch-loader.js.map +1 -0
- package/dist/crunch-worker.d.ts +2 -0
- package/dist/crunch-worker.d.ts.map +1 -0
- package/dist/crunch-worker.js +204 -92
- package/dist/crunch-worker.js.map +1 -0
- package/dist/dist.dev.js +2687 -677
- package/dist/dist.min.js +1 -2
- package/dist/index.cjs +1644 -428
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +13 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -0
- package/dist/ktx2-basis-writer-worker-node.js +574 -9832
- package/dist/ktx2-basis-writer-worker.d.ts +2 -0
- package/dist/ktx2-basis-writer-worker.d.ts.map +1 -0
- package/dist/ktx2-basis-writer-worker.js +45 -7
- package/dist/ktx2-basis-writer-worker.js.map +1 -0
- package/dist/ktx2-basis-writer.js +1 -0
- package/dist/ktx2-basis-writer.js.map +1 -0
- package/dist/lib/composite-image/image-texture-cube.d.ts +47 -0
- package/dist/lib/composite-image/image-texture-cube.d.ts.map +1 -0
- package/dist/lib/composite-image/image-texture-cube.js +42 -0
- package/dist/lib/composite-image/image-texture-cube.js.map +1 -0
- package/dist/lib/composite-image/parse-composite-image.d.ts +43 -0
- package/dist/lib/composite-image/parse-composite-image.d.ts.map +1 -0
- package/dist/lib/composite-image/parse-composite-image.js +437 -0
- package/dist/lib/composite-image/parse-composite-image.js.map +1 -0
- package/dist/lib/encoders/encode-ktx.d.ts +1 -1
- package/dist/lib/encoders/encode-ktx.d.ts.map +1 -1
- package/dist/lib/encoders/encode-ktx.js +1 -0
- package/dist/lib/encoders/encode-ktx.js.map +1 -0
- package/dist/lib/encoders/encode-ktx2-basis-texture.d.ts +2 -1
- package/dist/lib/encoders/encode-ktx2-basis-texture.d.ts.map +1 -1
- package/dist/lib/encoders/encode-ktx2-basis-texture.js +3 -1
- package/dist/lib/encoders/encode-ktx2-basis-texture.js.map +1 -0
- package/dist/lib/encoders/encode-texture.js +1 -0
- package/dist/lib/encoders/encode-texture.js.map +1 -0
- package/dist/lib/gl-extensions.d.ts +166 -58
- package/dist/lib/gl-extensions.d.ts.map +1 -1
- package/dist/lib/gl-extensions.js +178 -66
- package/dist/lib/gl-extensions.js.map +1 -0
- package/dist/lib/gl-types.d.ts +4 -0
- package/dist/lib/gl-types.d.ts.map +1 -0
- package/dist/lib/gl-types.js +5 -0
- package/dist/lib/gl-types.js.map +1 -0
- package/dist/lib/parsers/basis-module-loader.d.ts +3 -2
- package/dist/lib/parsers/basis-module-loader.d.ts.map +1 -1
- package/dist/lib/parsers/basis-module-loader.js +1 -0
- package/dist/lib/parsers/basis-module-loader.js.map +1 -0
- package/dist/lib/parsers/crunch-module-loader.d.ts +2 -2
- package/dist/lib/parsers/crunch-module-loader.d.ts.map +1 -1
- package/dist/lib/parsers/crunch-module-loader.js +1 -0
- package/dist/lib/parsers/crunch-module-loader.js.map +1 -0
- package/dist/lib/parsers/parse-basis.d.ts +34 -2
- package/dist/lib/parsers/parse-basis.d.ts.map +1 -1
- package/dist/lib/parsers/parse-basis.js +265 -64
- package/dist/lib/parsers/parse-basis.js.map +1 -0
- package/dist/lib/parsers/parse-compressed-texture.js +1 -0
- package/dist/lib/parsers/parse-compressed-texture.js.map +1 -0
- package/dist/lib/parsers/parse-crunch.d.ts.map +1 -1
- package/dist/lib/parsers/parse-crunch.js +7 -6
- package/dist/lib/parsers/parse-crunch.js.map +1 -0
- package/dist/lib/parsers/parse-dds.d.ts.map +1 -1
- package/dist/lib/parsers/parse-dds.js +11 -11
- package/dist/lib/parsers/parse-dds.js.map +1 -0
- package/dist/lib/parsers/parse-hdr.d.ts +21 -0
- package/dist/lib/parsers/parse-hdr.d.ts.map +1 -0
- package/dist/lib/parsers/parse-hdr.js +305 -0
- package/dist/lib/parsers/parse-hdr.js.map +1 -0
- package/dist/lib/parsers/parse-ktx.d.ts.map +1 -1
- package/dist/lib/parsers/parse-ktx.js +11 -3
- package/dist/lib/parsers/parse-ktx.js.map +1 -0
- package/dist/lib/parsers/parse-npy.js +1 -0
- package/dist/lib/parsers/parse-npy.js.map +1 -0
- package/dist/lib/parsers/parse-pvr.d.ts.map +1 -1
- package/dist/lib/parsers/parse-pvr.js +32 -74
- package/dist/lib/parsers/parse-pvr.js.map +1 -0
- package/dist/lib/texture-api/async-deep-map.js +1 -0
- package/dist/lib/texture-api/async-deep-map.js.map +1 -0
- package/dist/lib/texture-api/deep-load.js +1 -0
- package/dist/lib/texture-api/deep-load.js.map +1 -0
- package/dist/lib/texture-api/generate-url.d.ts.map +1 -1
- package/dist/lib/texture-api/generate-url.js +3 -10
- package/dist/lib/texture-api/generate-url.js.map +1 -0
- package/dist/lib/texture-api/load-image-array.d.ts +6 -3
- package/dist/lib/texture-api/load-image-array.d.ts.map +1 -1
- package/dist/lib/texture-api/load-image-array.js +6 -3
- package/dist/lib/texture-api/load-image-array.js.map +1 -0
- package/dist/lib/texture-api/load-image-cube.d.ts +7 -11
- package/dist/lib/texture-api/load-image-cube.d.ts.map +1 -1
- package/dist/lib/texture-api/load-image-cube.js +9 -20
- package/dist/lib/texture-api/load-image-cube.js.map +1 -0
- package/dist/lib/texture-api/load-image.d.ts +6 -3
- package/dist/lib/texture-api/load-image.d.ts.map +1 -1
- package/dist/lib/texture-api/load-image.js +9 -4
- package/dist/lib/texture-api/load-image.js.map +1 -0
- package/dist/lib/texture-api/texture-api-types.d.ts +13 -0
- package/dist/lib/texture-api/texture-api-types.d.ts.map +1 -1
- package/dist/lib/texture-api/texture-api-types.js +1 -0
- package/dist/lib/texture-api/texture-api-types.js.map +1 -0
- package/dist/lib/utils/detect-supported-texture-formats.d.ts +14 -0
- package/dist/lib/utils/detect-supported-texture-formats.d.ts.map +1 -0
- package/dist/lib/utils/detect-supported-texture-formats.js +197 -0
- package/dist/lib/utils/detect-supported-texture-formats.js.map +1 -0
- package/dist/lib/utils/extract-mipmap-images.d.ts +6 -2
- package/dist/lib/utils/extract-mipmap-images.d.ts.map +1 -1
- package/dist/lib/utils/extract-mipmap-images.js +14 -2
- package/dist/lib/utils/extract-mipmap-images.js.map +1 -0
- package/dist/lib/utils/ktx-format-helper.d.ts +9 -1
- package/dist/lib/utils/ktx-format-helper.d.ts.map +1 -1
- package/dist/lib/utils/ktx-format-helper.js +77 -109
- package/dist/lib/utils/ktx-format-helper.js.map +1 -0
- package/dist/lib/utils/texture-format-map.d.ts +10 -0
- package/dist/lib/utils/texture-format-map.d.ts.map +1 -0
- package/dist/lib/utils/texture-format-map.js +87 -0
- package/dist/lib/utils/texture-format-map.js.map +1 -0
- package/dist/lib/utils/version.js +2 -1
- package/dist/lib/utils/version.js.map +1 -0
- package/dist/libs/libs/README.md +9 -0
- package/dist/libs/libs/basis_encoder.js +21 -0
- package/dist/libs/libs/basis_encoder.wasm +0 -0
- package/dist/libs/libs/basis_transcoder.js +22 -0
- package/dist/libs/libs/basis_transcoder.wasm +0 -0
- package/dist/libs/libs/crunch.js +136 -0
- package/dist/npy-loader.d.ts +2 -2
- package/dist/npy-loader.js +1 -0
- package/dist/npy-loader.js.map +1 -0
- package/dist/npy-worker.d.ts +2 -0
- package/dist/npy-worker.d.ts.map +1 -0
- package/dist/npy-worker.js +5 -2
- package/dist/npy-worker.js.map +1 -0
- package/dist/radiance-hdr-loader.d.ts +25 -0
- package/dist/radiance-hdr-loader.d.ts.map +1 -0
- package/dist/radiance-hdr-loader.js +23 -0
- package/dist/radiance-hdr-loader.js.map +1 -0
- package/dist/texture-array-loader.d.ts +25 -0
- package/dist/texture-array-loader.d.ts.map +1 -0
- package/dist/texture-array-loader.js +24 -0
- package/dist/texture-array-loader.js.map +1 -0
- package/dist/texture-cube-array-loader.d.ts +25 -0
- package/dist/texture-cube-array-loader.d.ts.map +1 -0
- package/dist/texture-cube-array-loader.js +24 -0
- package/dist/texture-cube-array-loader.js.map +1 -0
- package/dist/texture-cube-loader.d.ts +25 -0
- package/dist/texture-cube-loader.d.ts.map +1 -0
- package/dist/texture-cube-loader.js +24 -0
- package/dist/texture-cube-loader.js.map +1 -0
- package/dist/texture-loader.d.ts +25 -0
- package/dist/texture-loader.d.ts.map +1 -0
- package/dist/texture-loader.js +24 -0
- package/dist/texture-loader.js.map +1 -0
- package/dist/workers/basis-worker-node.js +1 -0
- package/dist/workers/basis-worker-node.js.map +1 -0
- package/dist/workers/basis-worker.js +1 -0
- package/dist/workers/basis-worker.js.map +1 -0
- package/dist/workers/compressed-texture-worker.js +1 -1
- package/dist/workers/compressed-texture-worker.js.map +1 -0
- package/dist/workers/crunch-worker.d.ts +1 -3
- package/dist/workers/crunch-worker.d.ts.map +1 -1
- package/dist/workers/crunch-worker.js +1 -0
- package/dist/workers/crunch-worker.js.map +1 -0
- package/dist/workers/ktx2-basis-writer-worker-node.js +1 -0
- package/dist/workers/ktx2-basis-writer-worker-node.js.map +1 -0
- package/dist/workers/ktx2-basis-writer-worker.js +1 -0
- package/dist/workers/ktx2-basis-writer-worker.js.map +1 -0
- package/dist/workers/npy-worker.js +1 -0
- package/dist/workers/npy-worker.js.map +1 -0
- package/package.json +27 -6
- package/src/basis-loader.ts +19 -9
- package/src/basis-worker.ts +7 -0
- package/src/compressed-texture-loader.ts +3 -7
- package/src/compressed-texture-worker.ts +6 -0
- package/src/crunch-loader.ts +1 -5
- package/src/crunch-worker.ts +6 -0
- package/src/index.ts +21 -4
- package/src/ktx2-basis-writer-worker.ts +6 -0
- package/src/lib/composite-image/image-texture-cube.ts +49 -0
- package/src/lib/composite-image/parse-composite-image.ts +699 -0
- package/src/lib/encoders/encode-ktx.ts +1 -1
- package/src/lib/encoders/encode-ktx2-basis-texture.ts +4 -2
- package/src/lib/gl-extensions.ts +188 -81
- package/src/lib/gl-types.ts +136 -0
- package/src/lib/parsers/basis-module-loader.ts +5 -5
- package/src/lib/parsers/crunch-module-loader.ts +4 -4
- package/src/lib/parsers/parse-basis.ts +358 -66
- package/src/lib/parsers/parse-crunch.ts +11 -8
- package/src/lib/parsers/parse-dds.ts +11 -12
- package/src/lib/parsers/parse-hdr.ts +426 -0
- package/src/lib/parsers/parse-ktx.ts +13 -3
- package/src/lib/parsers/parse-pvr.ts +33 -75
- package/src/lib/texture-api/generate-url.ts +2 -12
- package/src/lib/texture-api/load-image-array.ts +15 -6
- package/src/lib/texture-api/load-image-cube.ts +20 -34
- package/src/lib/texture-api/load-image.ts +19 -8
- package/src/lib/texture-api/texture-api-types.ts +15 -0
- package/src/lib/utils/detect-supported-texture-formats.ts +210 -0
- package/src/lib/utils/extract-mipmap-images.ts +23 -4
- package/src/lib/utils/ktx-format-helper.ts +135 -111
- package/src/lib/utils/texture-format-map.ts +162 -0
- package/src/npy-worker.ts +6 -0
- package/src/radiance-hdr-loader.ts +36 -0
- package/src/texture-array-loader.ts +46 -0
- package/src/texture-cube-array-loader.ts +49 -0
- package/src/texture-cube-loader.ts +46 -0
- package/src/texture-loader.ts +49 -0
- package/src/workers/compressed-texture-worker.ts +0 -1
- package/dist/lib/utils/texture-formats.d.ts +0 -8
- package/dist/lib/utils/texture-formats.d.ts.map +0 -1
- package/dist/lib/utils/texture-formats.js +0 -50
- 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:
|
|
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 {
|
package/src/lib/gl-extensions.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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,
|
|
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:
|
|
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:
|
|
36
|
+
async function loadCrunch(options: LoadLibraryOptions): Promise<any> {
|
|
37
37
|
if (crunchModule) {
|
|
38
38
|
return crunchModule;
|
|
39
39
|
}
|