@babylonjs/ktx2decoder 8.55.3 → 8.55.4

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/NOTICE.md ADDED
@@ -0,0 +1,15 @@
1
+ Babylon.js KTX2 Decoder
2
+ Copyright 2024 The Babylon.js team
3
+
4
+ This package contains compiled js andd binary wasm files developed by The Khronos Group (https://github.com/KhronosGroup/KTX-Software/)
5
+ Copyright 2024 The Khronos Group (https://www.khronos.org/),
6
+ Licensed under the Apache 2.0 license.
7
+
8
+ This package contains compiled js andd binary wasm files developed by The Khronos Group (https://github.com/KhronosGroup/Basis-Universal-Transcoders)
9
+ Copyright 2024 The Khronos Group (https://www.khronos.org/),
10
+ Licensed under the Apache 2.0 license.
11
+
12
+ This package contains a compiled binary wasm file (zstddec.wasm) from https://github.com/donmccurdy/zstddec by Don McCurdy,
13
+ which contains the Zstandard decompression library.
14
+ Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
15
+ Licensed under the BSD 3-Clause license.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babylonjs/ktx2decoder",
3
- "version": "8.55.3",
3
+ "version": "8.55.4",
4
4
  "main": "index.js",
5
5
  "module": "index.js",
6
6
  "types": "index.d.ts",
@@ -10,16 +10,17 @@
10
10
  "**/*.map",
11
11
  "**/*.wasm",
12
12
  "readme.md",
13
- "license.md"
13
+ "license.md",
14
+ "NOTICE.md"
14
15
  ],
15
16
  "scripts": {
16
17
  "build": "npm run clean && npm run compile",
17
18
  "clean": "rimraf dist && rimraf *.tsbuildinfo -g && rimraf \"./**/*.!(md|json|build.json|lts.json)\" -g",
18
19
  "compile": "tsc -b tsconfig.build.json",
19
- "postcompile": "build-tools -c add-js-to-es6 && build-tools -c cp -f \"../../../tools/babylonServer/public/ktx2Transcoders/1\" -t ./wasm"
20
+ "postcompile": "build-tools -c add-js-to-es6 && build-tools -c cp -f \"../../../tools/babylonServer/public/ktx2Transcoders/1\" -t ./wasm && build-tools -c cp -f \"../../../tools/babylonServer/public/zstddec.wasm\" -t ./wasm"
20
21
  },
21
22
  "devDependencies": {
22
- "@babylonjs/core": "8.55.3",
23
+ "@babylonjs/core": "8.55.4",
23
24
  "@dev/build-tools": "^1.0.0",
24
25
  "@tools/ktx2decoder": "^1.0.0"
25
26
  },
package/transcoder.js CHANGED
@@ -43,6 +43,6 @@ Transcoder.WasmBaseUrl = "";
43
43
  * When set, unversioned CDN URLs will be rewritten to include this version prefix.
44
44
  * @internal
45
45
  */
46
- Transcoder.CdnVersion = "8.55.3";
46
+ Transcoder.CdnVersion = "8.55.4";
47
47
  Transcoder._DefaultCdnUrl = "https://cdn.babylonjs.com";
48
48
  //# sourceMappingURL=transcoder.js.map
package/transcoder.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"transcoder.js","sourceRoot":"","sources":["../../../tools/ktx2Decoder/src/transcoder.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,MAAM,OAAO,UAAU;IACZ,MAAM,CAAC,YAAY,CAAC,GAA6B,EAAE,GAAyB,EAAE,cAAuB;QACxG,OAAO,KAAK,CAAC;IACjB,CAAC;IAgBM,MAAM,CAAC,UAAU,CAAC,OAAe;QACpC,IAAI,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;YAChD,IAAI,UAAU,CAAC,WAAW,EAAE,CAAC;gBACzB,yBAAyB;gBACzB,MAAM,OAAO,GAAG,UAAU,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC;gBACpH,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;YAClE,CAAC;iBAAM,IAAI,UAAU,CAAC,UAAU,EAAE,CAAC;gBAC/B,MAAM,aAAa,GAAG,GAAG,UAAU,CAAC,cAAc,KAAK,UAAU,CAAC,UAAU,EAAE,CAAC;gBAC/E,iFAAiF;gBACjF,kEAAkE;gBAClE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;oBACrC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC;gBACxE,CAAC;YACL,CAAC;QACL,CAAC;QACD,OAAO,OAAO,CAAC;IACnB,CAAC;IAEM,OAAO;QACV,OAAO,UAAU,CAAC,IAAI,CAAC;IAC3B,CAAC;IAEM,UAAU,KAAU,CAAC;IAErB,iBAAiB;QACpB,OAAO,KAAK,CAAC;IACjB,CAAC;IAEM,gBAAgB,CAAC,SAA4B,IAAS,CAAC;IAEvD,KAAK,CAAC,SAAS,CAClB,GAA6B,EAC7B,GAAyB,EACzB,KAAa,EACb,KAAa,EACb,MAAc,EACd,sBAA8B,EAC9B,UAA0B,EAC1B,SAAiC,EACjC,WAAuB;QAEvB,OAAO,IAAI,CAAC;IAChB,CAAC;;AAxDa,eAAI,GAAG,YAAY,CAAC;AAEpB,sBAAW,GAAG,EAAE,CAAC;AAE/B;;;;;GAKG;AACW,qBAAU,GAAG,QAAQ,CAAC;AAEZ,yBAAc,GAAG,2BAA2B,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\r\n/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type * as KTX2 from \"core/Materials/Textures/ktx2decoderTypes\";\r\n\r\nimport type { WASMMemoryManager } from \"./wasmMemoryManager\";\r\nimport type { KTX2FileReader, IKTX2_ImageDesc } from \"./ktx2FileReader\";\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class Transcoder {\r\n public static CanTranscode(src: KTX2.SourceTextureFormat, dst: KTX2.TranscodeTarget, isInGammaSpace: boolean): boolean {\r\n return false;\r\n }\r\n\r\n public static Name = \"Transcoder\";\r\n\r\n public static WasmBaseUrl = \"\";\r\n\r\n /**\r\n * The CDN version to use when constructing versioned CDN URLs.\r\n * Injected at build time by the version update script.\r\n * When set, unversioned CDN URLs will be rewritten to include this version prefix.\r\n * @internal\r\n */\r\n public static CdnVersion = \"8.55.3\";\r\n\r\n private static readonly _DefaultCdnUrl = \"https://cdn.babylonjs.com\";\r\n\r\n public static GetWasmUrl(wasmUrl: string) {\r\n if (wasmUrl.startsWith(Transcoder._DefaultCdnUrl)) {\r\n if (Transcoder.WasmBaseUrl) {\r\n // Normalize the base url\r\n const baseUrl = Transcoder.WasmBaseUrl.endsWith(\"/\") ? Transcoder.WasmBaseUrl.slice(0, -1) : Transcoder.WasmBaseUrl;\r\n wasmUrl = wasmUrl.replace(Transcoder._DefaultCdnUrl, baseUrl);\r\n } else if (Transcoder.CdnVersion) {\r\n const versionedBase = `${Transcoder._DefaultCdnUrl}/v${Transcoder.CdnVersion}`;\r\n // Guard against double-versioning if the URL already contains the version prefix\r\n // (e.g. when GetWasmUrl is called multiple times on the same URL)\r\n if (!wasmUrl.startsWith(versionedBase)) {\r\n wasmUrl = wasmUrl.replace(Transcoder._DefaultCdnUrl, versionedBase);\r\n }\r\n }\r\n }\r\n return wasmUrl;\r\n }\r\n\r\n public getName(): string {\r\n return Transcoder.Name;\r\n }\r\n\r\n public initialize(): void {}\r\n\r\n public needMemoryManager(): boolean {\r\n return false;\r\n }\r\n\r\n public setMemoryManager(memoryMgr: WASMMemoryManager): void {}\r\n\r\n public async transcode(\r\n src: KTX2.SourceTextureFormat,\r\n dst: KTX2.TranscodeTarget,\r\n level: number,\r\n width: number,\r\n height: number,\r\n uncompressedByteLength: number,\r\n ktx2Reader: KTX2FileReader,\r\n imageDesc: IKTX2_ImageDesc | null,\r\n encodedData: Uint8Array\r\n ): Promise<Uint8Array | null> {\r\n return null;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"transcoder.js","sourceRoot":"","sources":["../../../tools/ktx2Decoder/src/transcoder.ts"],"names":[],"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EACb,KAAa,EACb,MAAc,EACd,sBAA8B,EAC9B,UAA0B,EAC1B,SAAiC,EACjC,WAAuB;QAEvB,OAAO,IAAI,CAAC;IAChB,CAAC;;AAxDa,eAAI,GAAG,YAAY,CAAC;AAEpB,sBAAW,GAAG,EAAE,CAAC;AAE/B;;;;;GAKG;AACW,qBAAU,GAAG,QAAQ,CAAC;AAEZ,yBAAc,GAAG,2BAA2B,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\r\n/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type * as KTX2 from \"core/Materials/Textures/ktx2decoderTypes\";\r\n\r\nimport type { WASMMemoryManager } from \"./wasmMemoryManager\";\r\nimport type { KTX2FileReader, IKTX2_ImageDesc } from \"./ktx2FileReader\";\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class Transcoder {\r\n public static CanTranscode(src: KTX2.SourceTextureFormat, dst: KTX2.TranscodeTarget, isInGammaSpace: boolean): boolean {\r\n return false;\r\n }\r\n\r\n public static Name = \"Transcoder\";\r\n\r\n public static WasmBaseUrl = \"\";\r\n\r\n /**\r\n * The CDN version to use when constructing versioned CDN URLs.\r\n * Injected at build time by the version update script.\r\n * When set, unversioned CDN URLs will be rewritten to include this version prefix.\r\n * @internal\r\n */\r\n public static CdnVersion = \"8.55.4\";\r\n\r\n private static readonly _DefaultCdnUrl = \"https://cdn.babylonjs.com\";\r\n\r\n public static GetWasmUrl(wasmUrl: string) {\r\n if (wasmUrl.startsWith(Transcoder._DefaultCdnUrl)) {\r\n if (Transcoder.WasmBaseUrl) {\r\n // Normalize the base url\r\n const baseUrl = Transcoder.WasmBaseUrl.endsWith(\"/\") ? Transcoder.WasmBaseUrl.slice(0, -1) : Transcoder.WasmBaseUrl;\r\n wasmUrl = wasmUrl.replace(Transcoder._DefaultCdnUrl, baseUrl);\r\n } else if (Transcoder.CdnVersion) {\r\n const versionedBase = `${Transcoder._DefaultCdnUrl}/v${Transcoder.CdnVersion}`;\r\n // Guard against double-versioning if the URL already contains the version prefix\r\n // (e.g. when GetWasmUrl is called multiple times on the same URL)\r\n if (!wasmUrl.startsWith(versionedBase)) {\r\n wasmUrl = wasmUrl.replace(Transcoder._DefaultCdnUrl, versionedBase);\r\n }\r\n }\r\n }\r\n return wasmUrl;\r\n }\r\n\r\n public getName(): string {\r\n return Transcoder.Name;\r\n }\r\n\r\n public initialize(): void {}\r\n\r\n public needMemoryManager(): boolean {\r\n return false;\r\n }\r\n\r\n public setMemoryManager(memoryMgr: WASMMemoryManager): void {}\r\n\r\n public async transcode(\r\n src: KTX2.SourceTextureFormat,\r\n dst: KTX2.TranscodeTarget,\r\n level: number,\r\n width: number,\r\n height: number,\r\n uncompressedByteLength: number,\r\n ktx2Reader: KTX2FileReader,\r\n imageDesc: IKTX2_ImageDesc | null,\r\n encodedData: Uint8Array\r\n ): Promise<Uint8Array | null> {\r\n return null;\r\n }\r\n}\r\n"]}
package/wasm/license.md CHANGED
@@ -359,3 +359,38 @@ This SLA shall be governed by the substantive law of Sweden. Any
359
359
  dispute, controversy or claim arising out of or in connection with
360
360
  this SLA, or the breach, termination or invalidity thereof, shall be
361
361
  submitted to the exclusive jurisdiction of the Swedish Courts.
362
+
363
+ =============
364
+
365
+ This package contains a compiled binary (zstddec.wasm) from https://github.com/donmccurdy/zstddec by Don McCurdy, which contains the Zstandard decompression library.
366
+
367
+ ### Copyright: 2016-present, Yann Collet, Facebook, Inc.
368
+
369
+ License: BSD-3-Clause
370
+
371
+ Copyright (c) 2016-present, Yann Collet, Facebook, Inc. All rights reserved.
372
+
373
+ Redistribution and use in source and binary forms, with or without modification,
374
+ are permitted provided that the following conditions are met:
375
+
376
+ * Redistributions of source code must retain the above copyright notice, this
377
+ list of conditions and the following disclaimer.
378
+
379
+ * Redistributions in binary form must reproduce the above copyright notice,
380
+ this list of conditions and the following disclaimer in the documentation
381
+ and/or other materials provided with the distribution.
382
+
383
+ * Neither the name Facebook nor the names of its contributors may be used to
384
+ endorse or promote products derived from this software without specific
385
+ prior written permission.
386
+
387
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
388
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
389
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
390
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
391
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
392
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
393
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
394
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
395
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
396
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Binary file