@loaders.gl/textures 4.4.0-alpha.9 → 4.4.1
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 +0 -1
- package/dist/basis-loader.js.map +1 -1
- package/dist/basis-worker-node.js +797 -9971
- package/dist/basis-worker.js +300 -145
- package/dist/compressed-texture-loader.d.ts +0 -4
- package/dist/compressed-texture-loader.d.ts.map +1 -1
- package/dist/compressed-texture-loader.js +0 -1
- package/dist/compressed-texture-loader.js.map +1 -1
- package/dist/compressed-texture-worker.js +1110 -358
- package/dist/crunch-loader.d.ts +1 -5
- package/dist/crunch-loader.d.ts.map +1 -1
- package/dist/crunch-loader.js +1 -3
- package/dist/crunch-loader.js.map +1 -1
- package/dist/crunch-worker.js +168 -87
- package/dist/dist.dev.js +2648 -671
- package/dist/dist.min.js +1 -2
- package/dist/index.cjs +1642 -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 +6 -3
- package/dist/index.js.map +1 -1
- package/dist/ktx2-basis-writer-worker-node.js +444 -9763
- package/dist/ktx2-basis-writer-worker.js +13 -3
- 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-ktx2-basis-texture.d.ts.map +1 -1
- package/dist/lib/encoders/encode-ktx2-basis-texture.js +2 -1
- package/dist/lib/encoders/encode-ktx2-basis-texture.js.map +1 -1
- 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 +177 -66
- package/dist/lib/gl-extensions.js.map +1 -1
- 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/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.map +1 -1
- package/dist/lib/parsers/parse-basis.d.ts +24 -2
- package/dist/lib/parsers/parse-basis.d.ts.map +1 -1
- package/dist/lib/parsers/parse-basis.js +262 -64
- package/dist/lib/parsers/parse-basis.js.map +1 -1
- package/dist/lib/parsers/parse-crunch.d.ts.map +1 -1
- package/dist/lib/parsers/parse-crunch.js +6 -6
- package/dist/lib/parsers/parse-crunch.js.map +1 -1
- package/dist/lib/parsers/parse-dds.d.ts.map +1 -1
- package/dist/lib/parsers/parse-dds.js +10 -11
- package/dist/lib/parsers/parse-dds.js.map +1 -1
- 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 +10 -3
- package/dist/lib/parsers/parse-ktx.js.map +1 -1
- package/dist/lib/parsers/parse-pvr.d.ts.map +1 -1
- package/dist/lib/parsers/parse-pvr.js +31 -74
- package/dist/lib/parsers/parse-pvr.js.map +1 -1
- package/dist/lib/texture-api/generate-url.d.ts.map +1 -1
- package/dist/lib/texture-api/generate-url.js +2 -10
- package/dist/lib/texture-api/generate-url.js.map +1 -1
- 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 +5 -3
- package/dist/lib/texture-api/load-image-array.js.map +1 -1
- 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 +8 -20
- package/dist/lib/texture-api/load-image-cube.js.map +1 -1
- 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 +8 -4
- package/dist/lib/texture-api/load-image.js.map +1 -1
- 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/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 +13 -2
- package/dist/lib/utils/extract-mipmap-images.js.map +1 -1
- 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 +76 -109
- package/dist/lib/utils/ktx-format-helper.js.map +1 -1
- 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 +1 -1
- package/dist/lib/utils/version.js.map +1 -1
- package/dist/npy-loader.d.ts +2 -2
- package/dist/npy-worker.js +1 -1
- 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/crunch-worker.d.ts +1 -3
- package/dist/workers/crunch-worker.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/basis-loader.ts +19 -9
- package/src/compressed-texture-loader.ts +0 -3
- package/src/crunch-loader.ts +1 -5
- package/src/index.ts +21 -4
- 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-ktx2-basis-texture.ts +2 -1
- package/src/lib/gl-extensions.ts +188 -81
- package/src/lib/gl-types.ts +136 -0
- package/src/lib/parsers/crunch-module-loader.ts +4 -4
- package/src/lib/parsers/parse-basis.ts +326 -62
- 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/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/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 -51
- package/dist/lib/utils/texture-formats.js.map +0 -1
- package/src/lib/utils/texture-formats.ts +0 -59
|
@@ -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"}
|
|
@@ -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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/textures",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.1",
|
|
4
4
|
"description": "Framework-independent loaders for compressed and super compressed (basis) textures ",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -75,16 +75,16 @@
|
|
|
75
75
|
"build-crunch-worker": "esbuild src/workers/crunch-worker.ts --outfile=dist/crunch-worker.js --target=esnext --bundle --define:__VERSION__=\\\"$npm_package_version\\\""
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@loaders.gl/images": "4.4.
|
|
79
|
-
"@loaders.gl/loader-utils": "4.4.
|
|
80
|
-
"@loaders.gl/schema": "4.4.
|
|
81
|
-
"@loaders.gl/worker-utils": "4.4.
|
|
78
|
+
"@loaders.gl/images": "4.4.1",
|
|
79
|
+
"@loaders.gl/loader-utils": "4.4.1",
|
|
80
|
+
"@loaders.gl/schema": "4.4.1",
|
|
81
|
+
"@loaders.gl/worker-utils": "4.4.1",
|
|
82
82
|
"@math.gl/types": "^4.1.0",
|
|
83
83
|
"ktx-parse": "^0.7.0",
|
|
84
84
|
"texture-compressor": "^1.0.2"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
|
-
"@loaders.gl/core": "4.4.0
|
|
87
|
+
"@loaders.gl/core": "~4.4.0"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "18d4fdf37667eaf6ec832473a8ae89907e391992"
|
|
90
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
|
}
|
|
@@ -10,8 +10,6 @@ import {parseBasis} from './lib/parsers/parse-basis';
|
|
|
10
10
|
/** Options for the CompressedTextureLoader */
|
|
11
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
|
}
|
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
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
export const GL_TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515;
|
|
6
|
+
export const GL_TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516;
|
|
7
|
+
export const GL_TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517;
|
|
8
|
+
export const GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518;
|
|
9
|
+
export const GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519;
|
|
10
|
+
export const GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851a;
|
|
11
|
+
|
|
12
|
+
export type ImageTextureCubeFace = '+X' | '-X' | '+Y' | '-Y' | '+Z' | '-Z';
|
|
13
|
+
|
|
14
|
+
export type ImageTextureCubeDirectionAlias = 'right' | 'left' | 'top' | 'bottom' | 'front' | 'back';
|
|
15
|
+
|
|
16
|
+
export const IMAGE_TEXTURE_CUBE_FACES = [
|
|
17
|
+
{
|
|
18
|
+
face: GL_TEXTURE_CUBE_MAP_POSITIVE_X,
|
|
19
|
+
name: '+X',
|
|
20
|
+
direction: 'right',
|
|
21
|
+
axis: 'x',
|
|
22
|
+
sign: 'positive'
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
face: GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
|
|
26
|
+
name: '-X',
|
|
27
|
+
direction: 'left',
|
|
28
|
+
axis: 'x',
|
|
29
|
+
sign: 'negative'
|
|
30
|
+
},
|
|
31
|
+
{face: GL_TEXTURE_CUBE_MAP_POSITIVE_Y, name: '+Y', direction: 'top', axis: 'y', sign: 'positive'},
|
|
32
|
+
{
|
|
33
|
+
face: GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,
|
|
34
|
+
name: '-Y',
|
|
35
|
+
direction: 'bottom',
|
|
36
|
+
axis: 'y',
|
|
37
|
+
sign: 'negative'
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
face: GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
|
|
41
|
+
name: '+Z',
|
|
42
|
+
direction: 'front',
|
|
43
|
+
axis: 'z',
|
|
44
|
+
sign: 'positive'
|
|
45
|
+
},
|
|
46
|
+
{face: GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, name: '-Z', direction: 'back', axis: 'z', sign: 'negative'}
|
|
47
|
+
] as const;
|
|
48
|
+
|
|
49
|
+
export type ImageCubeTexture = Record<number, any>;
|