@loaders.gl/textures 4.4.0-alpha.17 → 4.4.0-alpha.19
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 +153 -1
- package/dist/basis-loader.d.ts +0 -4
- 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 +57 -30
- package/dist/basis-worker.js +55 -29
- 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 +122 -79
- 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 +36 -14
- package/dist/dist.dev.js +1526 -435
- package/dist/dist.min.js +1 -1
- package/dist/index.cjs +1034 -160
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/ktx2-basis-writer-worker-node.js +14 -3
- 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 +2 -0
- package/dist/lib/gl-extensions.d.ts.map +1 -1
- package/dist/lib/gl-extensions.js +2 -0
- 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 +9 -2
- package/dist/lib/parsers/parse-basis.d.ts.map +1 -1
- package/dist/lib/parsers/parse-basis.js +51 -26
- 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 +5 -5
- 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 -32
- 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.js +4 -4
- package/dist/lib/utils/extract-mipmap-images.d.ts +5 -1
- package/dist/lib/utils/extract-mipmap-images.d.ts.map +1 -1
- package/dist/lib/utils/extract-mipmap-images.js +4 -3
- package/dist/lib/utils/extract-mipmap-images.js.map +1 -1
- package/dist/lib/utils/ktx-format-helper.d.ts +8 -1
- package/dist/lib/utils/ktx-format-helper.d.ts.map +1 -1
- package/dist/lib/utils/ktx-format-helper.js +9 -0
- package/dist/lib/utils/ktx-format-helper.js.map +1 -1
- package/dist/lib/utils/texture-format-map.d.ts +8 -1
- package/dist/lib/utils/texture-format-map.d.ts.map +1 -1
- package/dist/lib/utils/texture-format-map.js +19 -3
- package/dist/lib/utils/texture-format-map.js.map +1 -1
- package/dist/lib/utils/version.js +1 -1
- 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 +6 -6
- package/src/basis-loader.ts +0 -3
- package/src/compressed-texture-loader.ts +0 -3
- package/src/crunch-loader.ts +1 -5
- package/src/index.ts +19 -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-ktx2-basis-texture.ts +2 -1
- package/src/lib/gl-extensions.ts +2 -0
- 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 +58 -28
- package/src/lib/parsers/parse-crunch.ts +8 -12
- package/src/lib/parsers/parse-dds.ts +11 -19
- package/src/lib/parsers/parse-hdr.ts +426 -0
- package/src/lib/parsers/parse-ktx.ts +6 -6
- 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 +4 -4
- package/src/lib/utils/extract-mipmap-images.ts +12 -4
- package/src/lib/utils/ktx-format-helper.ts +12 -1
- package/src/lib/utils/texture-format-map.ts +30 -3
- 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/index.d.ts
CHANGED
|
@@ -5,8 +5,19 @@ export type { CompressedTextureLoaderOptions } from "./compressed-texture-loader
|
|
|
5
5
|
export { CompressedTextureLoader, CompressedTextureWorkerLoader } from "./compressed-texture-loader.js";
|
|
6
6
|
export type { CrunchLoaderOptions } from "./crunch-loader.js";
|
|
7
7
|
export { CrunchLoader } from "./crunch-loader.js";
|
|
8
|
+
export type { RadianceHDRLoaderOptions } from "./radiance-hdr-loader.js";
|
|
9
|
+
export type { RadianceHDRMetadata } from "./lib/parsers/parse-hdr.js";
|
|
10
|
+
export { RadianceHDRLoader } from "./radiance-hdr-loader.js";
|
|
8
11
|
export type { NPYLoaderOptions } from "./npy-loader.js";
|
|
9
12
|
export { NPYLoader, NPYWorkerLoader } from "./npy-loader.js";
|
|
13
|
+
export type { TextureManifestLoaderOptions, TextureManifest } from "./texture-loader.js";
|
|
14
|
+
export { TextureLoader } from "./texture-loader.js";
|
|
15
|
+
export type { TextureArrayLoaderOptions, TextureArrayManifest } from "./texture-array-loader.js";
|
|
16
|
+
export { TextureArrayLoader } from "./texture-array-loader.js";
|
|
17
|
+
export type { TextureCubeLoaderOptions, TextureCubeManifest } from "./texture-cube-loader.js";
|
|
18
|
+
export { TextureCubeLoader } from "./texture-cube-loader.js";
|
|
19
|
+
export type { TextureCubeArrayLoaderOptions, TextureCubeArrayManifest } from "./texture-cube-array-loader.js";
|
|
20
|
+
export { TextureCubeArrayLoader } from "./texture-cube-array-loader.js";
|
|
10
21
|
export { BASIS_EXTERNAL_LIBRARIES } from "./lib/parsers/basis-module-loader.js";
|
|
11
22
|
export { CRUNCH_EXTERNAL_LIBRARIES } from "./lib/parsers/crunch-module-loader.js";
|
|
12
23
|
export { CompressedTextureWriter } from "./compressed-texture-writer.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,YAAY,EAAC,gBAAgB,EAAE,aAAa,EAAC,MAAM,oBAAoB,CAAC;AAGxE,YAAY,EAAC,kBAAkB,EAAC,0BAAuB;AACvD,OAAO,EAAC,WAAW,EAAE,iBAAiB,EAAC,0BAAuB;AAE9D,YAAY,EAAC,8BAA8B,EAAC,uCAAoC;AAChF,OAAO,EAAC,uBAAuB,EAAE,6BAA6B,EAAC,uCAAoC;AAEnG,YAAY,EAAC,mBAAmB,EAAC,2BAAwB;AACzD,OAAO,EAAC,YAAY,EAAC,2BAAwB;AAE7C,YAAY,EAAC,gBAAgB,EAAC,wBAAqB;AACnD,OAAO,EAAC,SAAS,EAAE,eAAe,EAAC,wBAAqB;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,YAAY,EAAC,gBAAgB,EAAE,aAAa,EAAC,MAAM,oBAAoB,CAAC;AAGxE,YAAY,EAAC,kBAAkB,EAAC,0BAAuB;AACvD,OAAO,EAAC,WAAW,EAAE,iBAAiB,EAAC,0BAAuB;AAE9D,YAAY,EAAC,8BAA8B,EAAC,uCAAoC;AAChF,OAAO,EAAC,uBAAuB,EAAE,6BAA6B,EAAC,uCAAoC;AAEnG,YAAY,EAAC,mBAAmB,EAAC,2BAAwB;AACzD,OAAO,EAAC,YAAY,EAAC,2BAAwB;AAE7C,YAAY,EAAC,wBAAwB,EAAC,iCAA8B;AACpE,YAAY,EAAC,mBAAmB,EAAC,mCAAgC;AACjE,OAAO,EAAC,iBAAiB,EAAC,iCAA8B;AAExD,YAAY,EAAC,gBAAgB,EAAC,wBAAqB;AACnD,OAAO,EAAC,SAAS,EAAE,eAAe,EAAC,wBAAqB;AAExD,YAAY,EAAC,4BAA4B,EAAE,eAAe,EAAC,4BAAyB;AACpF,OAAO,EAAC,aAAa,EAAC,4BAAyB;AAE/C,YAAY,EAAC,yBAAyB,EAAE,oBAAoB,EAAC,kCAA+B;AAC5F,OAAO,EAAC,kBAAkB,EAAC,kCAA+B;AAE1D,YAAY,EAAC,wBAAwB,EAAE,mBAAmB,EAAC,iCAA8B;AACzF,OAAO,EAAC,iBAAiB,EAAC,iCAA8B;AAExD,YAAY,EACV,6BAA6B,EAC7B,wBAAwB,EACzB,uCAAoC;AACrC,OAAO,EAAC,sBAAsB,EAAC,uCAAoC;AAGnE,OAAO,EAAC,wBAAwB,EAAC,6CAA0C;AAC3E,OAAO,EAAC,yBAAyB,EAAC,8CAA2C;AAG7E,OAAO,EAAC,uBAAuB,EAAC,uCAAoC;AACpE,OAAO,EAAC,eAAe,EAAC,+BAA4B;AAEpD,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;CAajC,CAAC;AAGF,OAAO,EAAC,gBAAgB,EAAC,wCAAqC;AAC9D,OAAO,EAAC,qBAAqB,EAAC,8CAA2C;AACzE,OAAO,EAAC,oBAAoB,EAAC,6CAA0C;AAGvE,uCAAoC;AAIpC,OAAO,EAAC,YAAY,IAAI,kBAAkB,EAAC,2BAAwB;AAEnE,YAAY,EAAC,8BAA8B,IAAI,oBAAoB,EAAC,uCAAoC"}
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,12 @@ import { VERSION } from "./lib/utils/version.js";
|
|
|
5
5
|
export { BasisLoader, BasisWorkerLoader } from "./basis-loader.js";
|
|
6
6
|
export { CompressedTextureLoader, CompressedTextureWorkerLoader } from "./compressed-texture-loader.js";
|
|
7
7
|
export { CrunchLoader } from "./crunch-loader.js";
|
|
8
|
+
export { RadianceHDRLoader } from "./radiance-hdr-loader.js";
|
|
8
9
|
export { NPYLoader, NPYWorkerLoader } from "./npy-loader.js";
|
|
10
|
+
export { TextureLoader } from "./texture-loader.js";
|
|
11
|
+
export { TextureArrayLoader } from "./texture-array-loader.js";
|
|
12
|
+
export { TextureCubeLoader } from "./texture-cube-loader.js";
|
|
13
|
+
export { TextureCubeArrayLoader } from "./texture-cube-array-loader.js";
|
|
9
14
|
// Module constants
|
|
10
15
|
export { BASIS_EXTERNAL_LIBRARIES } from "./lib/parsers/basis-module-loader.js";
|
|
11
16
|
export { CRUNCH_EXTERNAL_LIBRARIES } from "./lib/parsers/crunch-module-loader.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,OAAO,EAAC,+BAA4B;AAO5C,OAAO,EAAC,WAAW,EAAE,iBAAiB,EAAC,0BAAuB;AAG9D,OAAO,EAAC,uBAAuB,EAAE,6BAA6B,EAAC,uCAAoC;AAGnG,OAAO,EAAC,YAAY,EAAC,2BAAwB;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,OAAO,EAAC,+BAA4B;AAO5C,OAAO,EAAC,WAAW,EAAE,iBAAiB,EAAC,0BAAuB;AAG9D,OAAO,EAAC,uBAAuB,EAAE,6BAA6B,EAAC,uCAAoC;AAGnG,OAAO,EAAC,YAAY,EAAC,2BAAwB;AAI7C,OAAO,EAAC,iBAAiB,EAAC,iCAA8B;AAGxD,OAAO,EAAC,SAAS,EAAE,eAAe,EAAC,wBAAqB;AAGxD,OAAO,EAAC,aAAa,EAAC,4BAAyB;AAG/C,OAAO,EAAC,kBAAkB,EAAC,kCAA+B;AAG1D,OAAO,EAAC,iBAAiB,EAAC,iCAA8B;AAMxD,OAAO,EAAC,sBAAsB,EAAC,uCAAoC;AAEnE,mBAAmB;AACnB,OAAO,EAAC,wBAAwB,EAAC,6CAA0C;AAC3E,OAAO,EAAC,yBAAyB,EAAC,8CAA2C;AAE7E,UAAU;AACV,OAAO,EAAC,uBAAuB,EAAC,uCAAoC;AACpE,OAAO,EAAC,eAAe,EAAC,+BAA4B;AAEpD,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,IAAI,EAAE,6CAA6C;IACnD,EAAE,EAAE,mBAAmB;IACvB,MAAM,EAAE,UAAU;IAClB,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,CAAC,MAAM,CAAC;IACpB,MAAM,EAAE,IAAI;IACZ,OAAO,EAAE;QACP,OAAO,EAAE,KAAK;QACd,YAAY,EAAE,EAAE;QAChB,WAAW,EAAE,KAAK;QAClB,OAAO,EAAE,KAAK;KACf;CACF,CAAC;AAEF,sBAAsB;AACtB,OAAO,EAAC,gBAAgB,EAAC,wCAAqC;AAC9D,OAAO,EAAC,qBAAqB,EAAC,8CAA2C;AACzE,OAAO,EAAC,oBAAoB,EAAC,6CAA0C;AAEvE,YAAY;AACZ,uCAAoC;AAEpC,aAAa;AACb,cAAc;AACd,OAAO,EAAC,YAAY,IAAI,kBAAkB,EAAC,2BAAwB"}
|
|
@@ -50482,7 +50482,7 @@ function getVersion() {
|
|
|
50482
50482
|
globalThis._loadersgl_.version = NPM_TAG;
|
|
50483
50483
|
warningIssued = true;
|
|
50484
50484
|
} else {
|
|
50485
|
-
globalThis._loadersgl_.version = "4.4.0-alpha.
|
|
50485
|
+
globalThis._loadersgl_.version = "4.4.0-alpha.19";
|
|
50486
50486
|
}
|
|
50487
50487
|
}
|
|
50488
50488
|
return globalThis._loadersgl_.version;
|
|
@@ -50644,6 +50644,17 @@ function isKnownMessage(message) {
|
|
|
50644
50644
|
|
|
50645
50645
|
// ../worker-utils/src/lib/library-utils/library-utils.ts
|
|
50646
50646
|
var loadLibraryPromises = {};
|
|
50647
|
+
function extractLoadLibraryOptions(options = {}) {
|
|
50648
|
+
var _a, _b;
|
|
50649
|
+
const useLocalLibraries = options.useLocalLibraries ?? ((_a = options.core) == null ? void 0 : _a.useLocalLibraries);
|
|
50650
|
+
const CDN = options.CDN ?? ((_b = options.core) == null ? void 0 : _b.CDN);
|
|
50651
|
+
const modules = options.modules;
|
|
50652
|
+
return {
|
|
50653
|
+
...useLocalLibraries !== void 0 ? { useLocalLibraries } : {},
|
|
50654
|
+
...CDN !== void 0 ? { CDN } : {},
|
|
50655
|
+
...modules !== void 0 ? { modules } : {}
|
|
50656
|
+
};
|
|
50657
|
+
}
|
|
50647
50658
|
async function loadLibrary(libraryUrl, moduleName = null, options = {}, libraryName = null) {
|
|
50648
50659
|
if (moduleName) {
|
|
50649
50660
|
libraryUrl = getLibraryUrl(libraryUrl, moduleName, options, libraryName);
|
|
@@ -54132,7 +54143,7 @@ if (nodeVersion2 < 18) {
|
|
|
54132
54143
|
}
|
|
54133
54144
|
|
|
54134
54145
|
// src/lib/utils/version.ts
|
|
54135
|
-
var VERSION2 = true ? "4.4.0-alpha.
|
|
54146
|
+
var VERSION2 = true ? "4.4.0-alpha.19" : "latest";
|
|
54136
54147
|
|
|
54137
54148
|
// src/lib/parsers/basis-module-loader.ts
|
|
54138
54149
|
var BASIS_EXTERNAL_LIBRARIES = {
|
|
@@ -54186,7 +54197,7 @@ async function encodeKTX2BasisTexture(image, options = {}) {
|
|
|
54186
54197
|
encodeUASTC = false,
|
|
54187
54198
|
mipmaps = false
|
|
54188
54199
|
} = (options == null ? void 0 : options["ktx2-basis-writer"]) || {};
|
|
54189
|
-
const { BasisEncoder } = await loadBasisEncoderModule(options
|
|
54200
|
+
const { BasisEncoder } = await loadBasisEncoderModule(extractLoadLibraryOptions(options));
|
|
54190
54201
|
const basisEncoder = new BasisEncoder();
|
|
54191
54202
|
try {
|
|
54192
54203
|
const basisFileData = new Uint8Array(image.width * image.height * 4);
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
globalThis._loadersgl_.version = NPM_TAG;
|
|
12
12
|
warningIssued = true;
|
|
13
13
|
} else {
|
|
14
|
-
globalThis._loadersgl_.version = "4.4.0-alpha.
|
|
14
|
+
globalThis._loadersgl_.version = "4.4.0-alpha.19";
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
return globalThis._loadersgl_.version;
|
|
@@ -165,6 +165,16 @@
|
|
|
165
165
|
|
|
166
166
|
// ../worker-utils/src/lib/library-utils/library-utils.ts
|
|
167
167
|
var loadLibraryPromises = {};
|
|
168
|
+
function extractLoadLibraryOptions(options = {}) {
|
|
169
|
+
const useLocalLibraries = options.useLocalLibraries ?? options.core?.useLocalLibraries;
|
|
170
|
+
const CDN = options.CDN ?? options.core?.CDN;
|
|
171
|
+
const modules = options.modules;
|
|
172
|
+
return {
|
|
173
|
+
...useLocalLibraries !== void 0 ? { useLocalLibraries } : {},
|
|
174
|
+
...CDN !== void 0 ? { CDN } : {},
|
|
175
|
+
...modules !== void 0 ? { modules } : {}
|
|
176
|
+
};
|
|
177
|
+
}
|
|
168
178
|
async function loadLibrary(libraryUrl, moduleName = null, options = {}, libraryName = null) {
|
|
169
179
|
if (moduleName) {
|
|
170
180
|
libraryUrl = getLibraryUrl(libraryUrl, moduleName, options, libraryName);
|
|
@@ -277,7 +287,7 @@
|
|
|
277
287
|
}
|
|
278
288
|
|
|
279
289
|
// src/lib/utils/version.ts
|
|
280
|
-
var VERSION2 = true ? "4.4.0-alpha.
|
|
290
|
+
var VERSION2 = true ? "4.4.0-alpha.19" : "latest";
|
|
281
291
|
|
|
282
292
|
// src/lib/parsers/basis-module-loader.ts
|
|
283
293
|
var BASIS_EXTERNAL_LIBRARIES = {
|
|
@@ -331,7 +341,7 @@
|
|
|
331
341
|
encodeUASTC = false,
|
|
332
342
|
mipmaps = false
|
|
333
343
|
} = options?.["ktx2-basis-writer"] || {};
|
|
334
|
-
const { BasisEncoder } = await loadBasisEncoderModule(options
|
|
344
|
+
const { BasisEncoder } = await loadBasisEncoderModule(extractLoadLibraryOptions(options));
|
|
335
345
|
const basisEncoder = new BasisEncoder();
|
|
336
346
|
try {
|
|
337
347
|
const basisFileData = new Uint8Array(image.width * image.height * 4);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export declare const GL_TEXTURE_CUBE_MAP_POSITIVE_X = 34069;
|
|
2
|
+
export declare const GL_TEXTURE_CUBE_MAP_NEGATIVE_X = 34070;
|
|
3
|
+
export declare const GL_TEXTURE_CUBE_MAP_POSITIVE_Y = 34071;
|
|
4
|
+
export declare const GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072;
|
|
5
|
+
export declare const GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 34073;
|
|
6
|
+
export declare const GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074;
|
|
7
|
+
export type ImageTextureCubeFace = '+X' | '-X' | '+Y' | '-Y' | '+Z' | '-Z';
|
|
8
|
+
export type ImageTextureCubeDirectionAlias = 'right' | 'left' | 'top' | 'bottom' | 'front' | 'back';
|
|
9
|
+
export declare const IMAGE_TEXTURE_CUBE_FACES: readonly [{
|
|
10
|
+
readonly face: 34069;
|
|
11
|
+
readonly name: "+X";
|
|
12
|
+
readonly direction: "right";
|
|
13
|
+
readonly axis: "x";
|
|
14
|
+
readonly sign: "positive";
|
|
15
|
+
}, {
|
|
16
|
+
readonly face: 34070;
|
|
17
|
+
readonly name: "-X";
|
|
18
|
+
readonly direction: "left";
|
|
19
|
+
readonly axis: "x";
|
|
20
|
+
readonly sign: "negative";
|
|
21
|
+
}, {
|
|
22
|
+
readonly face: 34071;
|
|
23
|
+
readonly name: "+Y";
|
|
24
|
+
readonly direction: "top";
|
|
25
|
+
readonly axis: "y";
|
|
26
|
+
readonly sign: "positive";
|
|
27
|
+
}, {
|
|
28
|
+
readonly face: 34072;
|
|
29
|
+
readonly name: "-Y";
|
|
30
|
+
readonly direction: "bottom";
|
|
31
|
+
readonly axis: "y";
|
|
32
|
+
readonly sign: "negative";
|
|
33
|
+
}, {
|
|
34
|
+
readonly face: 34073;
|
|
35
|
+
readonly name: "+Z";
|
|
36
|
+
readonly direction: "front";
|
|
37
|
+
readonly axis: "z";
|
|
38
|
+
readonly sign: "positive";
|
|
39
|
+
}, {
|
|
40
|
+
readonly face: 34074;
|
|
41
|
+
readonly name: "-Z";
|
|
42
|
+
readonly direction: "back";
|
|
43
|
+
readonly axis: "z";
|
|
44
|
+
readonly sign: "negative";
|
|
45
|
+
}];
|
|
46
|
+
export type ImageCubeTexture = Record<number, any>;
|
|
47
|
+
//# sourceMappingURL=image-texture-cube.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-texture-cube.d.ts","sourceRoot":"","sources":["../../../src/lib/composite-image/image-texture-cube.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,8BAA8B,QAAS,CAAC;AACrD,eAAO,MAAM,8BAA8B,QAAS,CAAC;AACrD,eAAO,MAAM,8BAA8B,QAAS,CAAC;AACrD,eAAO,MAAM,8BAA8B,QAAS,CAAC;AACrD,eAAO,MAAM,8BAA8B,QAAS,CAAC;AACrD,eAAO,MAAM,8BAA8B,QAAS,CAAC;AAErD,MAAM,MAAM,oBAAoB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE3E,MAAM,MAAM,8BAA8B,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;AAEpG,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+B3B,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
export const GL_TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515;
|
|
5
|
+
export const GL_TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516;
|
|
6
|
+
export const GL_TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517;
|
|
7
|
+
export const GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518;
|
|
8
|
+
export const GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519;
|
|
9
|
+
export const GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851a;
|
|
10
|
+
export const IMAGE_TEXTURE_CUBE_FACES = [
|
|
11
|
+
{
|
|
12
|
+
face: GL_TEXTURE_CUBE_MAP_POSITIVE_X,
|
|
13
|
+
name: '+X',
|
|
14
|
+
direction: 'right',
|
|
15
|
+
axis: 'x',
|
|
16
|
+
sign: 'positive'
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
face: GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
|
|
20
|
+
name: '-X',
|
|
21
|
+
direction: 'left',
|
|
22
|
+
axis: 'x',
|
|
23
|
+
sign: 'negative'
|
|
24
|
+
},
|
|
25
|
+
{ face: GL_TEXTURE_CUBE_MAP_POSITIVE_Y, name: '+Y', direction: 'top', axis: 'y', sign: 'positive' },
|
|
26
|
+
{
|
|
27
|
+
face: GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,
|
|
28
|
+
name: '-Y',
|
|
29
|
+
direction: 'bottom',
|
|
30
|
+
axis: 'y',
|
|
31
|
+
sign: 'negative'
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
face: GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
|
|
35
|
+
name: '+Z',
|
|
36
|
+
direction: 'front',
|
|
37
|
+
axis: 'z',
|
|
38
|
+
sign: 'positive'
|
|
39
|
+
},
|
|
40
|
+
{ face: GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, name: '-Z', direction: 'back', axis: 'z', sign: 'negative' }
|
|
41
|
+
];
|
|
42
|
+
//# sourceMappingURL=image-texture-cube.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-texture-cube.js","sourceRoot":"","sources":["../../../src/lib/composite-image/image-texture-cube.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAA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|
+
import type { Texture } from '@loaders.gl/schema';
|
|
3
|
+
import type { TextureLoaderOptions } from "../texture-api/texture-api-types.js";
|
|
4
|
+
import { type ImageCubeTexture, type ImageTextureCubeDirectionAlias, type ImageTextureCubeFace } from "./image-texture-cube.js";
|
|
5
|
+
export type ImageTextureTemplateSource = {
|
|
6
|
+
mipLevels: number | 'auto';
|
|
7
|
+
template: string;
|
|
8
|
+
};
|
|
9
|
+
export type ImageTextureSource = string | string[] | ImageTextureTemplateSource;
|
|
10
|
+
export type ImageTextureManifest = {
|
|
11
|
+
shape: 'image-texture';
|
|
12
|
+
image?: string;
|
|
13
|
+
mipLevels?: number | 'auto';
|
|
14
|
+
template?: string;
|
|
15
|
+
mipmaps?: string[];
|
|
16
|
+
};
|
|
17
|
+
export type ImageTextureArrayManifest = {
|
|
18
|
+
shape: 'image-texture-array';
|
|
19
|
+
layers: ImageTextureSource[];
|
|
20
|
+
};
|
|
21
|
+
export type ImageTextureCubeFaces = Partial<Record<ImageTextureCubeFace | ImageTextureCubeDirectionAlias, ImageTextureSource>>;
|
|
22
|
+
export type ImageTextureCubeManifest = {
|
|
23
|
+
shape: 'image-texture-cube';
|
|
24
|
+
faces: ImageTextureCubeFaces;
|
|
25
|
+
};
|
|
26
|
+
export type ImageTextureCubeArrayLayer = {
|
|
27
|
+
faces: ImageTextureCubeFaces;
|
|
28
|
+
};
|
|
29
|
+
export type ImageTextureCubeArrayManifest = {
|
|
30
|
+
shape: 'image-texture-cube-array';
|
|
31
|
+
layers: ImageTextureCubeArrayLayer[];
|
|
32
|
+
};
|
|
33
|
+
export type CompositeImageManifest = ImageTextureManifest | ImageTextureArrayManifest | ImageTextureCubeManifest | ImageTextureCubeArrayManifest;
|
|
34
|
+
export type CompositeImageUrlTree = ImageTextureSource | ImageTextureSource[] | ImageCubeTexture | ImageCubeTexture[];
|
|
35
|
+
export declare function parseCompositeImageManifest(text: string, expectedShape: CompositeImageManifest['shape'], options?: TextureLoaderOptions, context?: LoaderContext): Promise<any>;
|
|
36
|
+
export declare function testCompositeImageManifestShape(text: string, shape: CompositeImageManifest['shape']): boolean;
|
|
37
|
+
export declare function loadCompositeImageManifest(manifest: CompositeImageManifest, options?: TextureLoaderOptions, context?: LoaderContext): Promise<Texture>;
|
|
38
|
+
export declare function loadCompositeImageUrlTree(urlTree: CompositeImageUrlTree, options?: TextureLoaderOptions, context?: LoaderContext): Promise<any>;
|
|
39
|
+
export declare function loadCompositeImageMember(url: string, options?: TextureLoaderOptions, context?: LoaderContext): Promise<any>;
|
|
40
|
+
export declare function getCompositeImageUrlTree(manifest: CompositeImageManifest, options?: TextureLoaderOptions, context?: LoaderContext): Promise<CompositeImageUrlTree>;
|
|
41
|
+
export declare function normalizeCompositeImageOptions(options?: TextureLoaderOptions): TextureLoaderOptions;
|
|
42
|
+
export declare function resolveCompositeImageUrl(url: string, options?: TextureLoaderOptions, context?: LoaderContext): string;
|
|
43
|
+
//# sourceMappingURL=parse-composite-image.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-composite-image.d.ts","sourceRoot":"","sources":["../../../src/lib/composite-image/parse-composite-image.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAE5D,OAAO,KAAK,EAAC,OAAO,EAA8B,MAAM,oBAAoB,CAAC;AAG7E,OAAO,KAAK,EAAC,oBAAoB,EAAC,4CAAyC;AAC3E,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,8BAA8B,EACnC,KAAK,oBAAoB,EAC1B,gCAA6B;AAE9B,MAAM,MAAM,0BAA0B,GAAG;IACvC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,0BAA0B,CAAC;AAEhF,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,eAA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