@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
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { LoaderContext } from '@loaders.gl/loader-utils';
|
|
2
|
+
import type { Texture } from '@loaders.gl/schema';
|
|
3
|
+
import type { TextureLoaderOptions as TextureApiLoaderOptions } from "./lib/texture-api/texture-api-types.js";
|
|
4
|
+
import { type ImageTextureArrayManifest } from "./lib/composite-image/parse-composite-image.js";
|
|
5
|
+
export type TextureArrayLoaderOptions = TextureApiLoaderOptions;
|
|
6
|
+
export type { ImageTextureArrayManifest as TextureArrayManifest };
|
|
7
|
+
export declare const TextureArrayLoader: {
|
|
8
|
+
readonly dataType: Texture;
|
|
9
|
+
readonly batchType: never;
|
|
10
|
+
readonly id: "texture-array";
|
|
11
|
+
readonly name: "Texture Array";
|
|
12
|
+
readonly module: "textures";
|
|
13
|
+
readonly version: any;
|
|
14
|
+
readonly extensions: [];
|
|
15
|
+
readonly mimeTypes: [];
|
|
16
|
+
readonly text: true;
|
|
17
|
+
readonly worker: false;
|
|
18
|
+
readonly testText: (text: string) => boolean;
|
|
19
|
+
readonly options: {
|
|
20
|
+
readonly image: {};
|
|
21
|
+
};
|
|
22
|
+
readonly parse: (arrayBuffer: ArrayBuffer, options?: TextureArrayLoaderOptions, context?: LoaderContext) => Promise<any>;
|
|
23
|
+
readonly parseText: (text: string, options?: TextureArrayLoaderOptions, context?: LoaderContext) => Promise<any>;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=texture-array-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"texture-array-loader.d.ts","sourceRoot":"","sources":["../src/texture-array-loader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,aAAa,EAAmB,MAAM,0BAA0B,CAAC;AAC9E,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,EAAC,oBAAoB,IAAI,uBAAuB,EAAC,+CAA4C;AAEzG,OAAO,EAGL,KAAK,yBAAyB,EAC/B,uDAAoD;AAErD,MAAM,MAAM,yBAAyB,GAAG,uBAAuB,CAAC;AAChE,YAAY,EAAC,yBAAyB,IAAI,oBAAoB,EAAC,CAAC;AAEhE,eAAO,MAAM,kBAAkB;uBACA,OAAO;wBACjB,KAAK;;;;;;;;;8BASP,MAAM;;;;kCAKR,WAAW,YACd,yBAAyB,YACzB,aAAa;+BAQD,MAAM,YAAY,yBAAyB,YAAY,aAAa;CAEd,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { VERSION } from "./lib/utils/version.js";
|
|
5
|
+
import { parseCompositeImageManifest, testCompositeImageManifestShape } from "./lib/composite-image/parse-composite-image.js";
|
|
6
|
+
export const TextureArrayLoader = {
|
|
7
|
+
dataType: null,
|
|
8
|
+
batchType: null,
|
|
9
|
+
id: 'texture-array',
|
|
10
|
+
name: 'Texture Array',
|
|
11
|
+
module: 'textures',
|
|
12
|
+
version: VERSION,
|
|
13
|
+
extensions: [],
|
|
14
|
+
mimeTypes: [],
|
|
15
|
+
text: true,
|
|
16
|
+
worker: false,
|
|
17
|
+
testText: (text) => testCompositeImageManifestShape(text, 'image-texture-array'),
|
|
18
|
+
options: {
|
|
19
|
+
image: {}
|
|
20
|
+
},
|
|
21
|
+
parse: async (arrayBuffer, options, context) => await parseCompositeImageManifest(new TextDecoder().decode(arrayBuffer), 'image-texture-array', options, context),
|
|
22
|
+
parseText: async (text, options, context) => await parseCompositeImageManifest(text, 'image-texture-array', options, context)
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=texture-array-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"texture-array-loader.js","sourceRoot":"","sources":["../src/texture-array-loader.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAKpC,OAAO,EAAC,OAAO,EAAC,+BAA4B;AAC5C,OAAO,EACL,2BAA2B,EAC3B,+BAA+B,EAEhC,uDAAoD;AAKrD,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,QAAQ,EAAE,IAA0B;IACpC,SAAS,EAAE,IAAa;IACxB,EAAE,EAAE,eAAe;IACnB,IAAI,EAAE,eAAe;IACrB,MAAM,EAAE,UAAU;IAClB,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,EAAE;IACd,SAAS,EAAE,EAAE;IACb,IAAI,EAAE,IAAI;IACV,MAAM,EAAE,KAAK;IACb,QAAQ,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,+BAA+B,CAAC,IAAI,EAAE,qBAAqB,CAAC;IACxF,OAAO,EAAE;QACP,KAAK,EAAE,EAAE;KACV;IACD,KAAK,EAAE,KAAK,EACV,WAAwB,EACxB,OAAmC,EACnC,OAAuB,EACvB,EAAE,CACF,MAAM,2BAA2B,CAC/B,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,EACrC,qBAAqB,EACrB,OAAO,EACP,OAAO,CACR;IACH,SAAS,EAAE,KAAK,EAAE,IAAY,EAAE,OAAmC,EAAE,OAAuB,EAAE,EAAE,CAC9F,MAAM,2BAA2B,CAAC,IAAI,EAAE,qBAAqB,EAAE,OAAO,EAAE,OAAO,CAAC;CACJ,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { LoaderContext } from '@loaders.gl/loader-utils';
|
|
2
|
+
import type { Texture } from '@loaders.gl/schema';
|
|
3
|
+
import type { TextureLoaderOptions as TextureApiLoaderOptions } from "./lib/texture-api/texture-api-types.js";
|
|
4
|
+
import { type ImageTextureCubeArrayManifest } from "./lib/composite-image/parse-composite-image.js";
|
|
5
|
+
export type TextureCubeArrayLoaderOptions = TextureApiLoaderOptions;
|
|
6
|
+
export type { ImageTextureCubeArrayManifest as TextureCubeArrayManifest };
|
|
7
|
+
export declare const TextureCubeArrayLoader: {
|
|
8
|
+
readonly dataType: Texture;
|
|
9
|
+
readonly batchType: never;
|
|
10
|
+
readonly id: "texture-cube-array";
|
|
11
|
+
readonly name: "Texture Cube Array";
|
|
12
|
+
readonly module: "textures";
|
|
13
|
+
readonly version: any;
|
|
14
|
+
readonly extensions: [];
|
|
15
|
+
readonly mimeTypes: [];
|
|
16
|
+
readonly text: true;
|
|
17
|
+
readonly worker: false;
|
|
18
|
+
readonly testText: (text: string) => boolean;
|
|
19
|
+
readonly options: {
|
|
20
|
+
readonly image: {};
|
|
21
|
+
};
|
|
22
|
+
readonly parse: (arrayBuffer: ArrayBuffer, options?: TextureCubeArrayLoaderOptions, context?: LoaderContext) => Promise<any>;
|
|
23
|
+
readonly parseText: (text: string, options?: TextureCubeArrayLoaderOptions, context?: LoaderContext) => Promise<any>;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=texture-cube-array-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"texture-cube-array-loader.d.ts","sourceRoot":"","sources":["../src/texture-cube-array-loader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,aAAa,EAAmB,MAAM,0BAA0B,CAAC;AAC9E,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,EAAC,oBAAoB,IAAI,uBAAuB,EAAC,+CAA4C;AAEzG,OAAO,EAGL,KAAK,6BAA6B,EACnC,uDAAoD;AAErD,MAAM,MAAM,6BAA6B,GAAG,uBAAuB,CAAC;AACpE,YAAY,EAAC,6BAA6B,IAAI,wBAAwB,EAAC,CAAC;AAExE,eAAO,MAAM,sBAAsB;uBACJ,OAAO;wBACjB,KAAK;;;;;;;;;8BASP,MAAM;;;;kCAKR,WAAW,YACd,6BAA6B,YAC7B,aAAa;+BASjB,MAAM,YACF,6BAA6B,YAC7B,aAAa;CAEyD,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { VERSION } from "./lib/utils/version.js";
|
|
5
|
+
import { parseCompositeImageManifest, testCompositeImageManifestShape } from "./lib/composite-image/parse-composite-image.js";
|
|
6
|
+
export const TextureCubeArrayLoader = {
|
|
7
|
+
dataType: null,
|
|
8
|
+
batchType: null,
|
|
9
|
+
id: 'texture-cube-array',
|
|
10
|
+
name: 'Texture Cube Array',
|
|
11
|
+
module: 'textures',
|
|
12
|
+
version: VERSION,
|
|
13
|
+
extensions: [],
|
|
14
|
+
mimeTypes: [],
|
|
15
|
+
text: true,
|
|
16
|
+
worker: false,
|
|
17
|
+
testText: (text) => testCompositeImageManifestShape(text, 'image-texture-cube-array'),
|
|
18
|
+
options: {
|
|
19
|
+
image: {}
|
|
20
|
+
},
|
|
21
|
+
parse: async (arrayBuffer, options, context) => await parseCompositeImageManifest(new TextDecoder().decode(arrayBuffer), 'image-texture-cube-array', options, context),
|
|
22
|
+
parseText: async (text, options, context) => await parseCompositeImageManifest(text, 'image-texture-cube-array', options, context)
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=texture-cube-array-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"texture-cube-array-loader.js","sourceRoot":"","sources":["../src/texture-cube-array-loader.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAKpC,OAAO,EAAC,OAAO,EAAC,+BAA4B;AAC5C,OAAO,EACL,2BAA2B,EAC3B,+BAA+B,EAEhC,uDAAoD;AAKrD,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,QAAQ,EAAE,IAA0B;IACpC,SAAS,EAAE,IAAa;IACxB,EAAE,EAAE,oBAAoB;IACxB,IAAI,EAAE,oBAAoB;IAC1B,MAAM,EAAE,UAAU;IAClB,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,EAAE;IACd,SAAS,EAAE,EAAE;IACb,IAAI,EAAE,IAAI;IACV,MAAM,EAAE,KAAK;IACb,QAAQ,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,+BAA+B,CAAC,IAAI,EAAE,0BAA0B,CAAC;IAC7F,OAAO,EAAE;QACP,KAAK,EAAE,EAAE;KACV;IACD,KAAK,EAAE,KAAK,EACV,WAAwB,EACxB,OAAuC,EACvC,OAAuB,EACvB,EAAE,CACF,MAAM,2BAA2B,CAC/B,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,EACrC,0BAA0B,EAC1B,OAAO,EACP,OAAO,CACR;IACH,SAAS,EAAE,KAAK,EACd,IAAY,EACZ,OAAuC,EACvC,OAAuB,EACvB,EAAE,CAAC,MAAM,2BAA2B,CAAC,IAAI,EAAE,0BAA0B,EAAE,OAAO,EAAE,OAAO,CAAC;CACR,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { LoaderContext } from '@loaders.gl/loader-utils';
|
|
2
|
+
import type { Texture } from '@loaders.gl/schema';
|
|
3
|
+
import type { TextureLoaderOptions as TextureApiLoaderOptions } from "./lib/texture-api/texture-api-types.js";
|
|
4
|
+
import { type ImageTextureCubeManifest } from "./lib/composite-image/parse-composite-image.js";
|
|
5
|
+
export type TextureCubeLoaderOptions = TextureApiLoaderOptions;
|
|
6
|
+
export type { ImageTextureCubeManifest as TextureCubeManifest };
|
|
7
|
+
export declare const TextureCubeLoader: {
|
|
8
|
+
readonly dataType: Texture;
|
|
9
|
+
readonly batchType: never;
|
|
10
|
+
readonly id: "texture-cube";
|
|
11
|
+
readonly name: "Texture Cube";
|
|
12
|
+
readonly module: "textures";
|
|
13
|
+
readonly version: any;
|
|
14
|
+
readonly extensions: [];
|
|
15
|
+
readonly mimeTypes: [];
|
|
16
|
+
readonly text: true;
|
|
17
|
+
readonly worker: false;
|
|
18
|
+
readonly testText: (text: string) => boolean;
|
|
19
|
+
readonly options: {
|
|
20
|
+
readonly image: {};
|
|
21
|
+
};
|
|
22
|
+
readonly parse: (arrayBuffer: ArrayBuffer, options?: TextureCubeLoaderOptions, context?: LoaderContext) => Promise<any>;
|
|
23
|
+
readonly parseText: (text: string, options?: TextureCubeLoaderOptions, context?: LoaderContext) => Promise<any>;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=texture-cube-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"texture-cube-loader.d.ts","sourceRoot":"","sources":["../src/texture-cube-loader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,aAAa,EAAmB,MAAM,0BAA0B,CAAC;AAC9E,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,EAAC,oBAAoB,IAAI,uBAAuB,EAAC,+CAA4C;AAEzG,OAAO,EAGL,KAAK,wBAAwB,EAC9B,uDAAoD;AAErD,MAAM,MAAM,wBAAwB,GAAG,uBAAuB,CAAC;AAC/D,YAAY,EAAC,wBAAwB,IAAI,mBAAmB,EAAC,CAAC;AAE9D,eAAO,MAAM,iBAAiB;uBACC,OAAO;wBACjB,KAAK;;;;;;;;;8BASP,MAAM;;;;kCAKR,WAAW,YACd,wBAAwB,YACxB,aAAa;+BAQD,MAAM,YAAY,wBAAwB,YAAY,aAAa;CAEd,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { VERSION } from "./lib/utils/version.js";
|
|
5
|
+
import { parseCompositeImageManifest, testCompositeImageManifestShape } from "./lib/composite-image/parse-composite-image.js";
|
|
6
|
+
export const TextureCubeLoader = {
|
|
7
|
+
dataType: null,
|
|
8
|
+
batchType: null,
|
|
9
|
+
id: 'texture-cube',
|
|
10
|
+
name: 'Texture Cube',
|
|
11
|
+
module: 'textures',
|
|
12
|
+
version: VERSION,
|
|
13
|
+
extensions: [],
|
|
14
|
+
mimeTypes: [],
|
|
15
|
+
text: true,
|
|
16
|
+
worker: false,
|
|
17
|
+
testText: (text) => testCompositeImageManifestShape(text, 'image-texture-cube'),
|
|
18
|
+
options: {
|
|
19
|
+
image: {}
|
|
20
|
+
},
|
|
21
|
+
parse: async (arrayBuffer, options, context) => await parseCompositeImageManifest(new TextDecoder().decode(arrayBuffer), 'image-texture-cube', options, context),
|
|
22
|
+
parseText: async (text, options, context) => await parseCompositeImageManifest(text, 'image-texture-cube', options, context)
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=texture-cube-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"texture-cube-loader.js","sourceRoot":"","sources":["../src/texture-cube-loader.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAKpC,OAAO,EAAC,OAAO,EAAC,+BAA4B;AAC5C,OAAO,EACL,2BAA2B,EAC3B,+BAA+B,EAEhC,uDAAoD;AAKrD,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,QAAQ,EAAE,IAA0B;IACpC,SAAS,EAAE,IAAa;IACxB,EAAE,EAAE,cAAc;IAClB,IAAI,EAAE,cAAc;IACpB,MAAM,EAAE,UAAU;IAClB,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,EAAE;IACd,SAAS,EAAE,EAAE;IACb,IAAI,EAAE,IAAI;IACV,MAAM,EAAE,KAAK;IACb,QAAQ,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,+BAA+B,CAAC,IAAI,EAAE,oBAAoB,CAAC;IACvF,OAAO,EAAE;QACP,KAAK,EAAE,EAAE;KACV;IACD,KAAK,EAAE,KAAK,EACV,WAAwB,EACxB,OAAkC,EAClC,OAAuB,EACvB,EAAE,CACF,MAAM,2BAA2B,CAC/B,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,EACrC,oBAAoB,EACpB,OAAO,EACP,OAAO,CACR;IACH,SAAS,EAAE,KAAK,EAAE,IAAY,EAAE,OAAkC,EAAE,OAAuB,EAAE,EAAE,CAC7F,MAAM,2BAA2B,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,EAAE,OAAO,CAAC;CACJ,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { LoaderContext } from '@loaders.gl/loader-utils';
|
|
2
|
+
import type { Texture } from '@loaders.gl/schema';
|
|
3
|
+
import type { TextureLoaderOptions as TextureApiLoaderOptions } from "./lib/texture-api/texture-api-types.js";
|
|
4
|
+
import { type ImageTextureManifest } from "./lib/composite-image/parse-composite-image.js";
|
|
5
|
+
export type TextureManifestLoaderOptions = TextureApiLoaderOptions;
|
|
6
|
+
export type { ImageTextureManifest as TextureManifest };
|
|
7
|
+
export declare const TextureLoader: {
|
|
8
|
+
readonly dataType: Texture;
|
|
9
|
+
readonly batchType: never;
|
|
10
|
+
readonly id: "texture";
|
|
11
|
+
readonly name: "Texture";
|
|
12
|
+
readonly module: "textures";
|
|
13
|
+
readonly version: any;
|
|
14
|
+
readonly extensions: [];
|
|
15
|
+
readonly mimeTypes: [];
|
|
16
|
+
readonly text: true;
|
|
17
|
+
readonly worker: false;
|
|
18
|
+
readonly testText: (text: string) => boolean;
|
|
19
|
+
readonly options: {
|
|
20
|
+
readonly image: {};
|
|
21
|
+
};
|
|
22
|
+
readonly parse: (arrayBuffer: ArrayBuffer, options?: TextureManifestLoaderOptions, context?: LoaderContext) => Promise<any>;
|
|
23
|
+
readonly parseText: (text: string, options?: TextureManifestLoaderOptions, context?: LoaderContext) => Promise<any>;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=texture-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"texture-loader.d.ts","sourceRoot":"","sources":["../src/texture-loader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,aAAa,EAAmB,MAAM,0BAA0B,CAAC;AAC9E,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,EAAC,oBAAoB,IAAI,uBAAuB,EAAC,+CAA4C;AAEzG,OAAO,EAGL,KAAK,oBAAoB,EAC1B,uDAAoD;AAErD,MAAM,MAAM,4BAA4B,GAAG,uBAAuB,CAAC;AACnE,YAAY,EAAC,oBAAoB,IAAI,eAAe,EAAC,CAAC;AAEtD,eAAO,MAAM,aAAa;uBACK,OAAO;wBACjB,KAAK;;;;;;;;;8BASP,MAAM;;;;kCAKR,WAAW,YACd,4BAA4B,YAC5B,aAAa;+BASjB,MAAM,YACF,4BAA4B,YAC5B,aAAa;CAEwD,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { VERSION } from "./lib/utils/version.js";
|
|
5
|
+
import { parseCompositeImageManifest, testCompositeImageManifestShape } from "./lib/composite-image/parse-composite-image.js";
|
|
6
|
+
export const TextureLoader = {
|
|
7
|
+
dataType: null,
|
|
8
|
+
batchType: null,
|
|
9
|
+
id: 'texture',
|
|
10
|
+
name: 'Texture',
|
|
11
|
+
module: 'textures',
|
|
12
|
+
version: VERSION,
|
|
13
|
+
extensions: [],
|
|
14
|
+
mimeTypes: [],
|
|
15
|
+
text: true,
|
|
16
|
+
worker: false,
|
|
17
|
+
testText: (text) => testCompositeImageManifestShape(text, 'image-texture'),
|
|
18
|
+
options: {
|
|
19
|
+
image: {}
|
|
20
|
+
},
|
|
21
|
+
parse: async (arrayBuffer, options, context) => await parseCompositeImageManifest(new TextDecoder().decode(arrayBuffer), 'image-texture', options, context),
|
|
22
|
+
parseText: async (text, options, context) => await parseCompositeImageManifest(text, 'image-texture', options, context)
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=texture-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"texture-loader.js","sourceRoot":"","sources":["../src/texture-loader.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAKpC,OAAO,EAAC,OAAO,EAAC,+BAA4B;AAC5C,OAAO,EACL,2BAA2B,EAC3B,+BAA+B,EAEhC,uDAAoD;AAKrD,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,QAAQ,EAAE,IAA0B;IACpC,SAAS,EAAE,IAAa;IACxB,EAAE,EAAE,SAAS;IACb,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,UAAU;IAClB,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,EAAE;IACd,SAAS,EAAE,EAAE;IACb,IAAI,EAAE,IAAI;IACV,MAAM,EAAE,KAAK;IACb,QAAQ,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,+BAA+B,CAAC,IAAI,EAAE,eAAe,CAAC;IAClF,OAAO,EAAE;QACP,KAAK,EAAE,EAAE;KACV;IACD,KAAK,EAAE,KAAK,EACV,WAAwB,EACxB,OAAsC,EACtC,OAAuB,EACvB,EAAE,CACF,MAAM,2BAA2B,CAC/B,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,EACrC,eAAe,EACf,OAAO,EACP,OAAO,CACR;IACH,SAAS,EAAE,KAAK,EACd,IAAY,EACZ,OAAsC,EACtC,OAAuB,EACvB,EAAE,CAAC,MAAM,2BAA2B,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,OAAO,CAAC;CACE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"basis-worker-node.js","sourceRoot":"","sources":["../../src/workers/basis-worker-node.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,mFAAmF;AACnF,OAAO,uBAAuB,CAAC;AAC/B,OAAO,EAAC,kBAAkB,EAAC,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAC,WAAW,EAAC,2BAAwB;AAE5C,kBAAkB,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"basis-worker.js","sourceRoot":"","sources":["../../src/workers/basis-worker.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,kBAAkB,EAAC,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAC,WAAW,EAAC,2BAAwB;AAE5C,kBAAkB,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
import { createLoaderWorker } from '@loaders.gl/loader-utils';
|
|
5
5
|
import { CompressedTextureLoader } from "../compressed-texture-loader.js";
|
|
6
|
-
// @ts-expect-error
|
|
7
6
|
createLoaderWorker(CompressedTextureLoader);
|
|
7
|
+
//# sourceMappingURL=compressed-texture-worker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compressed-texture-worker.js","sourceRoot":"","sources":["../../src/workers/compressed-texture-worker.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,kBAAkB,EAAC,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAC,uBAAuB,EAAC,wCAAqC;AAErE,kBAAkB,CAAC,uBAAuB,CAAC,CAAC"}
|
|
@@ -15,9 +15,7 @@ export declare const CrunchLoaderWithParser: {
|
|
|
15
15
|
mimeTypes: ["image/crn", "image/x-crn", "application/octet-stream"];
|
|
16
16
|
binary: true;
|
|
17
17
|
options: {
|
|
18
|
-
readonly crunch: {
|
|
19
|
-
readonly libraryPath: "libs/";
|
|
20
|
-
};
|
|
18
|
+
readonly crunch: {};
|
|
21
19
|
};
|
|
22
20
|
};
|
|
23
21
|
//# sourceMappingURL=crunch-worker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crunch-worker.d.ts","sourceRoot":"","sources":["../../src/workers/crunch-worker.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,WAAW,EAAC,uCAAoC;AAExD;;GAEG;AACH,eAAO,MAAM,sBAAsB
|
|
1
|
+
{"version":3,"file":"crunch-worker.d.ts","sourceRoot":"","sources":["../../src/workers/crunch-worker.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,WAAW,EAAC,uCAAoC;AAExD;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;CAGlC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crunch-worker.js","sourceRoot":"","sources":["../../src/workers/crunch-worker.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,kBAAkB,EAAC,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAC,YAAY,EAAC,4BAAyB;AAC9C,OAAO,EAAC,WAAW,EAAC,uCAAoC;AAExD;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,GAAG,YAAY;IACf,KAAK,EAAE,WAAW;CACnB,CAAC;AAEF,kBAAkB,CAAC,sBAAsB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ktx2-basis-writer-worker-node.js","sourceRoot":"","sources":["../../src/workers/ktx2-basis-writer-worker-node.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,mFAAmF;AACnF,OAAO,uBAAuB,CAAC;AAC/B,OAAO,EAAC,UAAU,EAAuB,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAC,eAAe,EAAyB,gCAA6B;AAE7E,CAAC,KAAK,IAAI,EAAE;IACV,gDAAgD;IAChD,IAAI,CAAC,CAAC,MAAM,UAAU,CAAC,cAAc,EAAE,CAAC,EAAE,CAAC;QACzC,OAAO;IACT,CAAC;IAED,UAAU,CAAC,SAAS,GAAG,KAAK,EAAE,IAAI,EAAE,OAA6B,EAAE,EAAE;QACnE,QAAQ,IAAI,EAAE,CAAC;YACb,KAAK,SAAS;gBACZ,IAAI,CAAC;oBACH,MAAM,EAAC,KAAK,EAAE,OAAO,EAAC,GAAG,OAAO,CAAC;oBACjC,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,OAAiC,CAAC,CAAC;oBACxF,UAAU,CAAC,WAAW,CAAC,MAAM,EAAE,EAAC,MAAM,EAAC,CAAC,CAAC;gBAC3C,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;oBAC5D,UAAU,CAAC,WAAW,CAAC,OAAO,EAAE,EAAC,KAAK,EAAE,OAAO,EAAC,CAAC,CAAC;gBACpD,CAAC;gBACD,MAAM;YACR,QAAQ;QACV,CAAC;IACH,CAAC,CAAC;AACJ,CAAC,CAAC,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ktx2-basis-writer-worker.js","sourceRoot":"","sources":["../../src/workers/ktx2-basis-writer-worker.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,UAAU,EAAuB,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAC,eAAe,EAAyB,gCAA6B;AAE7E,CAAC,KAAK,IAAI,EAAE;IACV,gDAAgD;IAChD,IAAI,CAAC,CAAC,MAAM,UAAU,CAAC,cAAc,EAAE,CAAC,EAAE,CAAC;QACzC,OAAO;IACT,CAAC;IAED,UAAU,CAAC,SAAS,GAAG,KAAK,EAAE,IAAI,EAAE,OAA6B,EAAE,EAAE;QACnE,QAAQ,IAAI,EAAE,CAAC;YACb,KAAK,SAAS;gBACZ,IAAI,CAAC;oBACH,MAAM,EAAC,KAAK,EAAE,OAAO,EAAC,GAAG,OAAO,CAAC;oBACjC,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,OAAiC,CAAC,CAAC;oBACxF,UAAU,CAAC,WAAW,CAAC,MAAM,EAAE,EAAC,MAAM,EAAC,CAAC,CAAC;gBAC3C,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;oBAC5D,UAAU,CAAC,WAAW,CAAC,OAAO,EAAE,EAAC,KAAK,EAAE,OAAO,EAAC,CAAC,CAAC;gBACpD,CAAC;gBACD,MAAM;YACR,QAAQ;QACV,CAAC;IACH,CAAC,CAAC;AACJ,CAAC,CAAC,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"npy-worker.js","sourceRoot":"","sources":["../../src/workers/npy-worker.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,SAAS,EAAC,yBAAsB;AACxC,OAAO,EAAC,kBAAkB,EAAC,MAAM,0BAA0B,CAAC;AAE5D,kBAAkB,CAAC,SAAS,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/textures",
|
|
3
|
-
"version": "4.4.0
|
|
3
|
+
"version": "4.4.0",
|
|
4
4
|
"description": "Framework-independent loaders for compressed and super compressed (basis) textures ",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -30,6 +30,27 @@
|
|
|
30
30
|
"types": "./dist/index.d.ts",
|
|
31
31
|
"import": "./dist/index.js",
|
|
32
32
|
"require": "./dist/index.cjs"
|
|
33
|
+
},
|
|
34
|
+
"./basis-worker.js": {
|
|
35
|
+
"import": "./dist/basis-worker.js"
|
|
36
|
+
},
|
|
37
|
+
"./basis-worker-node.js": {
|
|
38
|
+
"import": "./dist/basis-worker-node.js"
|
|
39
|
+
},
|
|
40
|
+
"./npy-worker.js": {
|
|
41
|
+
"import": "./dist/npy-worker.js"
|
|
42
|
+
},
|
|
43
|
+
"./compressed-texture-worker.js": {
|
|
44
|
+
"import": "./dist/compressed-texture-worker.js"
|
|
45
|
+
},
|
|
46
|
+
"./crunch-worker.js": {
|
|
47
|
+
"import": "./dist/crunch-worker.js"
|
|
48
|
+
},
|
|
49
|
+
"./ktx2-basis-writer-worker.js": {
|
|
50
|
+
"import": "./dist/ktx2-basis-writer-worker.js"
|
|
51
|
+
},
|
|
52
|
+
"./ktx2-basis-writer-worker-node.js": {
|
|
53
|
+
"import": "./dist/ktx2-basis-writer-worker-node.js"
|
|
33
54
|
}
|
|
34
55
|
},
|
|
35
56
|
"sideEffects": false,
|
|
@@ -54,10 +75,10 @@
|
|
|
54
75
|
"build-crunch-worker": "esbuild src/workers/crunch-worker.ts --outfile=dist/crunch-worker.js --target=esnext --bundle --define:__VERSION__=\\\"$npm_package_version\\\""
|
|
55
76
|
},
|
|
56
77
|
"dependencies": {
|
|
57
|
-
"@loaders.gl/images": "4.4.0
|
|
58
|
-
"@loaders.gl/loader-utils": "4.4.0
|
|
59
|
-
"@loaders.gl/schema": "4.4.0
|
|
60
|
-
"@loaders.gl/worker-utils": "4.4.0
|
|
78
|
+
"@loaders.gl/images": "4.4.0",
|
|
79
|
+
"@loaders.gl/loader-utils": "4.4.0",
|
|
80
|
+
"@loaders.gl/schema": "4.4.0",
|
|
81
|
+
"@loaders.gl/worker-utils": "4.4.0",
|
|
61
82
|
"@math.gl/types": "^4.1.0",
|
|
62
83
|
"ktx-parse": "^0.7.0",
|
|
63
84
|
"texture-compressor": "^1.0.2"
|
|
@@ -65,5 +86,5 @@
|
|
|
65
86
|
"peerDependencies": {
|
|
66
87
|
"@loaders.gl/core": "4.4.0-alpha.1"
|
|
67
88
|
},
|
|
68
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "b8a23bc05946bde7089936ff3ea1651ee9a45536"
|
|
69
90
|
}
|
package/src/basis-loader.ts
CHANGED
|
@@ -3,24 +3,35 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import type {Loader, LoaderOptions, LoaderWithParser} from '@loaders.gl/loader-utils';
|
|
6
|
-
import type {TextureLevel} from '@loaders.gl/schema';
|
|
6
|
+
import type {TextureFormat, TextureLevel} from '@loaders.gl/schema';
|
|
7
7
|
import {VERSION} from './lib/utils/version';
|
|
8
8
|
import {parseBasis} from './lib/parsers/parse-basis';
|
|
9
|
+
import type {BasisFormat} from './lib/parsers/parse-basis';
|
|
10
|
+
|
|
11
|
+
type BasisFormatOption = BasisFormat | Uppercase<BasisFormat>;
|
|
12
|
+
type BasisTargetFormat =
|
|
13
|
+
| 'auto'
|
|
14
|
+
| BasisFormatOption
|
|
15
|
+
| {
|
|
16
|
+
alpha: BasisFormatOption;
|
|
17
|
+
noAlpha: BasisFormatOption;
|
|
18
|
+
};
|
|
9
19
|
|
|
10
20
|
/** Options for the BasisLoader */
|
|
11
21
|
export type BasisLoaderOptions = LoaderOptions & {
|
|
12
22
|
/** Options for the BasisLoader */
|
|
13
23
|
basis?: {
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
|
|
24
|
+
/** Supported texture formats - app would typically query a WebGPU device or WebGL context to obtain the list of supported formats.*/
|
|
25
|
+
supportedTextureFormats?: TextureFormat[];
|
|
26
|
+
/** Override the URL to the worker bundle (by default loads from unpkg.com) */
|
|
27
|
+
workerUrl?: string;
|
|
28
|
+
|
|
18
29
|
/** What container format is used? */
|
|
19
|
-
containerFormat
|
|
30
|
+
containerFormat?: 'auto' | 'ktx2' | 'basis';
|
|
31
|
+
/** Format for texture data. auto selects based on platform caps (but gl context doesn't exist on a worker thread) */
|
|
32
|
+
format?: BasisTargetFormat;
|
|
20
33
|
/** What module to use for transcoding? */
|
|
21
34
|
module?: 'transcoder' | 'encoder';
|
|
22
|
-
/** Override the URL to the worker bundle (by default loads from unpkg.com) */
|
|
23
|
-
workerUrl?: string;
|
|
24
35
|
};
|
|
25
36
|
};
|
|
26
37
|
|
|
@@ -43,7 +54,6 @@ export const BasisWorkerLoader = {
|
|
|
43
54
|
options: {
|
|
44
55
|
basis: {
|
|
45
56
|
format: 'auto',
|
|
46
|
-
libraryPath: 'libs/',
|
|
47
57
|
containerFormat: 'auto',
|
|
48
58
|
module: 'transcoder'
|
|
49
59
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
// Classic-worker entrypoint that lazily loads the ESM worker implementation.
|
|
6
|
+
// This keeps `importScripts` available in the worker (used by library loading).
|
|
7
|
+
import(new URL('./workers/basis-worker.js', import.meta.url).toString());
|
|
@@ -2,16 +2,14 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import type {Loader, LoaderWithParser} from '@loaders.gl/loader-utils';
|
|
5
|
+
import type {Loader, LoaderWithParser, StrictLoaderOptions} from '@loaders.gl/loader-utils';
|
|
6
6
|
import {VERSION} from './lib/utils/version';
|
|
7
7
|
import {parseCompressedTexture} from './lib/parsers/parse-compressed-texture';
|
|
8
8
|
import {parseBasis} from './lib/parsers/parse-basis';
|
|
9
9
|
|
|
10
10
|
/** Options for the CompressedTextureLoader */
|
|
11
|
-
export type CompressedTextureLoaderOptions = {
|
|
11
|
+
export type CompressedTextureLoaderOptions = StrictLoaderOptions & {
|
|
12
12
|
'compressed-texture'?: {
|
|
13
|
-
/** @deprecated Specify path to libraries */
|
|
14
|
-
libraryPath?: string;
|
|
15
13
|
/** Whether to use Basis decoding */
|
|
16
14
|
useBasis?: boolean;
|
|
17
15
|
/** Override the URL to the worker bundle (by default loads from unpkg.com) */
|
|
@@ -47,7 +45,6 @@ export const CompressedTextureWorkerLoader = {
|
|
|
47
45
|
binary: true,
|
|
48
46
|
options: {
|
|
49
47
|
'compressed-texture': {
|
|
50
|
-
libraryPath: 'libs/',
|
|
51
48
|
useBasis: false
|
|
52
49
|
}
|
|
53
50
|
}
|
|
@@ -59,14 +56,13 @@ export const CompressedTextureWorkerLoader = {
|
|
|
59
56
|
export const CompressedTextureLoader = {
|
|
60
57
|
...CompressedTextureWorkerLoader,
|
|
61
58
|
parse: async (arrayBuffer: ArrayBuffer, options?: CompressedTextureLoaderOptions) => {
|
|
59
|
+
options = {...options};
|
|
62
60
|
if (options?.['compressed-texture']?.useBasis) {
|
|
63
|
-
// @ts-expect-error TODO not allowed to modify inputs
|
|
64
61
|
options.basis = {
|
|
65
62
|
format: {
|
|
66
63
|
alpha: 'BC3',
|
|
67
64
|
noAlpha: 'BC1'
|
|
68
65
|
},
|
|
69
|
-
// @ts-expect-error TODO not allowed to modify inputs
|
|
70
66
|
...options.basis,
|
|
71
67
|
containerFormat: 'ktx2',
|
|
72
68
|
module: 'encoder'
|
package/src/crunch-loader.ts
CHANGED
|
@@ -10,8 +10,6 @@ import {VERSION} from './lib/utils/version';
|
|
|
10
10
|
export type CrunchLoaderOptions = LoaderOptions & {
|
|
11
11
|
/** CrunchLoader options */
|
|
12
12
|
crunch?: {
|
|
13
|
-
/** @deprecated Specify where to load the Crunch decoder library */
|
|
14
|
-
libraryPath?: string;
|
|
15
13
|
/** Override the URL to the worker bundle (by default loads from unpkg.com) */
|
|
16
14
|
workerUrl?: string;
|
|
17
15
|
};
|
|
@@ -34,8 +32,6 @@ export const CrunchLoader = {
|
|
|
34
32
|
mimeTypes: ['image/crn', 'image/x-crn', 'application/octet-stream'],
|
|
35
33
|
binary: true,
|
|
36
34
|
options: {
|
|
37
|
-
crunch: {
|
|
38
|
-
libraryPath: 'libs/'
|
|
39
|
-
}
|
|
35
|
+
crunch: {}
|
|
40
36
|
}
|
|
41
37
|
} as const satisfies Loader<TextureLevel[], never, CrunchLoaderOptions>;
|
package/src/index.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import {VERSION} from './lib/utils/version';
|
|
6
6
|
|
|
7
7
|
// Types
|
|
8
|
-
export type {GPUTextureFormat} from '@loaders.gl/schema';
|
|
8
|
+
export type {GPUTextureFormat, TextureFormat} from '@loaders.gl/schema';
|
|
9
9
|
|
|
10
10
|
// Loaders
|
|
11
11
|
export type {BasisLoaderOptions} from './basis-loader';
|
|
@@ -17,9 +17,28 @@ export {CompressedTextureLoader, CompressedTextureWorkerLoader} from './compress
|
|
|
17
17
|
export type {CrunchLoaderOptions} from './crunch-loader';
|
|
18
18
|
export {CrunchLoader} from './crunch-loader';
|
|
19
19
|
|
|
20
|
+
export type {RadianceHDRLoaderOptions} from './radiance-hdr-loader';
|
|
21
|
+
export type {RadianceHDRMetadata} from './lib/parsers/parse-hdr';
|
|
22
|
+
export {RadianceHDRLoader} from './radiance-hdr-loader';
|
|
23
|
+
|
|
20
24
|
export type {NPYLoaderOptions} from './npy-loader';
|
|
21
25
|
export {NPYLoader, NPYWorkerLoader} from './npy-loader';
|
|
22
26
|
|
|
27
|
+
export type {TextureManifestLoaderOptions, TextureManifest} from './texture-loader';
|
|
28
|
+
export {TextureLoader} from './texture-loader';
|
|
29
|
+
|
|
30
|
+
export type {TextureArrayLoaderOptions, TextureArrayManifest} from './texture-array-loader';
|
|
31
|
+
export {TextureArrayLoader} from './texture-array-loader';
|
|
32
|
+
|
|
33
|
+
export type {TextureCubeLoaderOptions, TextureCubeManifest} from './texture-cube-loader';
|
|
34
|
+
export {TextureCubeLoader} from './texture-cube-loader';
|
|
35
|
+
|
|
36
|
+
export type {
|
|
37
|
+
TextureCubeArrayLoaderOptions,
|
|
38
|
+
TextureCubeArrayManifest
|
|
39
|
+
} from './texture-cube-array-loader';
|
|
40
|
+
export {TextureCubeArrayLoader} from './texture-cube-array-loader';
|
|
41
|
+
|
|
23
42
|
// Module constants
|
|
24
43
|
export {BASIS_EXTERNAL_LIBRARIES} from './lib/parsers/basis-module-loader';
|
|
25
44
|
export {CRUNCH_EXTERNAL_LIBRARIES} from './lib/parsers/crunch-module-loader';
|
|
@@ -49,9 +68,7 @@ export {loadImageTextureArray} from './lib/texture-api/load-image-array';
|
|
|
49
68
|
export {loadImageTextureCube} from './lib/texture-api/load-image-cube';
|
|
50
69
|
|
|
51
70
|
// Utilities
|
|
52
|
-
export
|
|
53
|
-
export {selectSupportedBasisFormat} from './lib/parsers/parse-basis';
|
|
54
|
-
export {getSupportedGPUTextureFormats} from './lib/utils/texture-formats';
|
|
71
|
+
export * from './lib/gl-extensions';
|
|
55
72
|
|
|
56
73
|
// DEPRECATED
|
|
57
74
|
// @deprecated
|