@loaders.gl/textures 4.3.2 → 4.4.0-alpha.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.
@@ -156,9 +156,9 @@ var require_inherits = __commonJS({
156
156
  }
157
157
  });
158
158
 
159
- // ../../node_modules/string_decoder/index.js
159
+ // ../../node_modules/contentstream/node_modules/string_decoder/index.js
160
160
  var require_string_decoder = __commonJS({
161
- "../../node_modules/string_decoder/index.js"(exports) {
161
+ "../../node_modules/contentstream/node_modules/string_decoder/index.js"(exports) {
162
162
  var Buffer2 = require("buffer").Buffer;
163
163
  var isBufferEncoding = Buffer2.isEncoding || function(encoding) {
164
164
  switch (encoding && encoding.toLowerCase()) {
@@ -1685,6 +1685,144 @@ var require_stream_duplex2 = __commonJS({
1685
1685
  }
1686
1686
  });
1687
1687
 
1688
+ // ../../node_modules/gif-encoder/node_modules/string_decoder/index.js
1689
+ var require_string_decoder2 = __commonJS({
1690
+ "../../node_modules/gif-encoder/node_modules/string_decoder/index.js"(exports) {
1691
+ var Buffer2 = require("buffer").Buffer;
1692
+ var isBufferEncoding = Buffer2.isEncoding || function(encoding) {
1693
+ switch (encoding && encoding.toLowerCase()) {
1694
+ case "hex":
1695
+ case "utf8":
1696
+ case "utf-8":
1697
+ case "ascii":
1698
+ case "binary":
1699
+ case "base64":
1700
+ case "ucs2":
1701
+ case "ucs-2":
1702
+ case "utf16le":
1703
+ case "utf-16le":
1704
+ case "raw":
1705
+ return true;
1706
+ default:
1707
+ return false;
1708
+ }
1709
+ };
1710
+ function assertEncoding(encoding) {
1711
+ if (encoding && !isBufferEncoding(encoding)) {
1712
+ throw new Error("Unknown encoding: " + encoding);
1713
+ }
1714
+ }
1715
+ var StringDecoder = exports.StringDecoder = function(encoding) {
1716
+ this.encoding = (encoding || "utf8").toLowerCase().replace(/[-_]/, "");
1717
+ assertEncoding(encoding);
1718
+ switch (this.encoding) {
1719
+ case "utf8":
1720
+ this.surrogateSize = 3;
1721
+ break;
1722
+ case "ucs2":
1723
+ case "utf16le":
1724
+ this.surrogateSize = 2;
1725
+ this.detectIncompleteChar = utf16DetectIncompleteChar;
1726
+ break;
1727
+ case "base64":
1728
+ this.surrogateSize = 3;
1729
+ this.detectIncompleteChar = base64DetectIncompleteChar;
1730
+ break;
1731
+ default:
1732
+ this.write = passThroughWrite;
1733
+ return;
1734
+ }
1735
+ this.charBuffer = new Buffer2(6);
1736
+ this.charReceived = 0;
1737
+ this.charLength = 0;
1738
+ };
1739
+ StringDecoder.prototype.write = function(buffer) {
1740
+ var charStr = "";
1741
+ while (this.charLength) {
1742
+ var available = buffer.length >= this.charLength - this.charReceived ? this.charLength - this.charReceived : buffer.length;
1743
+ buffer.copy(this.charBuffer, this.charReceived, 0, available);
1744
+ this.charReceived += available;
1745
+ if (this.charReceived < this.charLength) {
1746
+ return "";
1747
+ }
1748
+ buffer = buffer.slice(available, buffer.length);
1749
+ charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding);
1750
+ var charCode = charStr.charCodeAt(charStr.length - 1);
1751
+ if (charCode >= 55296 && charCode <= 56319) {
1752
+ this.charLength += this.surrogateSize;
1753
+ charStr = "";
1754
+ continue;
1755
+ }
1756
+ this.charReceived = this.charLength = 0;
1757
+ if (buffer.length === 0) {
1758
+ return charStr;
1759
+ }
1760
+ break;
1761
+ }
1762
+ this.detectIncompleteChar(buffer);
1763
+ var end = buffer.length;
1764
+ if (this.charLength) {
1765
+ buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end);
1766
+ end -= this.charReceived;
1767
+ }
1768
+ charStr += buffer.toString(this.encoding, 0, end);
1769
+ var end = charStr.length - 1;
1770
+ var charCode = charStr.charCodeAt(end);
1771
+ if (charCode >= 55296 && charCode <= 56319) {
1772
+ var size = this.surrogateSize;
1773
+ this.charLength += size;
1774
+ this.charReceived += size;
1775
+ this.charBuffer.copy(this.charBuffer, size, 0, size);
1776
+ buffer.copy(this.charBuffer, 0, 0, size);
1777
+ return charStr.substring(0, end);
1778
+ }
1779
+ return charStr;
1780
+ };
1781
+ StringDecoder.prototype.detectIncompleteChar = function(buffer) {
1782
+ var i2 = buffer.length >= 3 ? 3 : buffer.length;
1783
+ for (; i2 > 0; i2--) {
1784
+ var c2 = buffer[buffer.length - i2];
1785
+ if (i2 == 1 && c2 >> 5 == 6) {
1786
+ this.charLength = 2;
1787
+ break;
1788
+ }
1789
+ if (i2 <= 2 && c2 >> 4 == 14) {
1790
+ this.charLength = 3;
1791
+ break;
1792
+ }
1793
+ if (i2 <= 3 && c2 >> 3 == 30) {
1794
+ this.charLength = 4;
1795
+ break;
1796
+ }
1797
+ }
1798
+ this.charReceived = i2;
1799
+ };
1800
+ StringDecoder.prototype.end = function(buffer) {
1801
+ var res = "";
1802
+ if (buffer && buffer.length)
1803
+ res = this.write(buffer);
1804
+ if (this.charReceived) {
1805
+ var cr2 = this.charReceived;
1806
+ var buf = this.charBuffer;
1807
+ var enc = this.encoding;
1808
+ res += buf.slice(0, cr2).toString(enc);
1809
+ }
1810
+ return res;
1811
+ };
1812
+ function passThroughWrite(buffer) {
1813
+ return buffer.toString(this.encoding);
1814
+ }
1815
+ function utf16DetectIncompleteChar(buffer) {
1816
+ this.charReceived = buffer.length % 2;
1817
+ this.charLength = this.charReceived ? 2 : 0;
1818
+ }
1819
+ function base64DetectIncompleteChar(buffer) {
1820
+ this.charReceived = buffer.length % 3;
1821
+ this.charLength = this.charReceived ? 3 : 0;
1822
+ }
1823
+ }
1824
+ });
1825
+
1688
1826
  // ../../node_modules/gif-encoder/node_modules/readable-stream/lib/_stream_readable.js
1689
1827
  var require_stream_readable2 = __commonJS({
1690
1828
  "../../node_modules/gif-encoder/node_modules/readable-stream/lib/_stream_readable.js"(exports, module2) {
@@ -1739,7 +1877,7 @@ var require_stream_readable2 = __commonJS({
1739
1877
  this.encoding = null;
1740
1878
  if (options.encoding) {
1741
1879
  if (!StringDecoder)
1742
- StringDecoder = require_string_decoder().StringDecoder;
1880
+ StringDecoder = require_string_decoder2().StringDecoder;
1743
1881
  this.decoder = new StringDecoder(options.encoding);
1744
1882
  this.encoding = options.encoding;
1745
1883
  }
@@ -1811,7 +1949,7 @@ var require_stream_readable2 = __commonJS({
1811
1949
  }
1812
1950
  Readable5.prototype.setEncoding = function(enc) {
1813
1951
  if (!StringDecoder)
1814
- StringDecoder = require_string_decoder().StringDecoder;
1952
+ StringDecoder = require_string_decoder2().StringDecoder;
1815
1953
  this._readableState.decoder = new StringDecoder(enc);
1816
1954
  this._readableState.encoding = enc;
1817
1955
  return this;
@@ -59679,7 +59817,7 @@ function getVersion() {
59679
59817
  );
59680
59818
  globalThis._loadersgl_.version = NPM_TAG;
59681
59819
  } else {
59682
- globalThis._loadersgl_.version = "4.3.1";
59820
+ globalThis._loadersgl_.version = "4.4.0-alpha.0";
59683
59821
  }
59684
59822
  }
59685
59823
  return globalThis._loadersgl_.version;
@@ -63263,7 +63401,7 @@ if (nodeVersion2 < 18) {
63263
63401
  }
63264
63402
 
63265
63403
  // src/lib/utils/version.ts
63266
- var VERSION2 = true ? "4.3.1" : "latest";
63404
+ var VERSION2 = true ? "4.4.0-alpha.0" : "latest";
63267
63405
 
63268
63406
  // src/lib/parsers/basis-module-loader.ts
63269
63407
  var BASIS_EXTERNAL_LIBRARIES = {
@@ -63348,6 +63486,7 @@ var KTX2BasisWriter = {
63348
63486
  module: "textures",
63349
63487
  version: VERSION2,
63350
63488
  extensions: ["ktx2"],
63489
+ mimeTypes: ["image/ktx2"],
63351
63490
  options: {
63352
63491
  ["ktx2-basis-writer"]: {
63353
63492
  useSRGB: false,
@@ -10,7 +10,7 @@
10
10
  );
11
11
  globalThis._loadersgl_.version = NPM_TAG;
12
12
  } else {
13
- globalThis._loadersgl_.version = "4.3.1";
13
+ globalThis._loadersgl_.version = "4.4.0-alpha.0";
14
14
  }
15
15
  }
16
16
  return globalThis._loadersgl_.version;
@@ -249,7 +249,7 @@
249
249
  }
250
250
 
251
251
  // src/lib/utils/version.ts
252
- var VERSION2 = true ? "4.3.1" : "latest";
252
+ var VERSION2 = true ? "4.4.0-alpha.0" : "latest";
253
253
 
254
254
  // src/lib/parsers/basis-module-loader.ts
255
255
  var BASIS_EXTERNAL_LIBRARIES = {
@@ -334,6 +334,7 @@
334
334
  module: "textures",
335
335
  version: VERSION2,
336
336
  extensions: ["ktx2"],
337
+ mimeTypes: ["image/ktx2"],
337
338
  options: {
338
339
  ["ktx2-basis-writer"]: {
339
340
  useSRGB: false,
@@ -19,6 +19,7 @@ export declare const KTX2BasisWriter: {
19
19
  readonly module: "textures";
20
20
  readonly version: any;
21
21
  readonly extensions: ["ktx2"];
22
+ readonly mimeTypes: ["image/ktx2"];
22
23
  readonly options: {
23
24
  readonly "ktx2-basis-writer": {
24
25
  readonly useSRGB: false;
@@ -1 +1 @@
1
- {"version":3,"file":"ktx2-basis-writer.d.ts","sourceRoot":"","sources":["../src/ktx2-basis-writer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAoB,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAG/E,OAAO,EAAC,sBAAsB,EAAC,oDAAiD;AAEhF,0CAA0C;AAC1C,MAAM,MAAM,sBAAsB,GAAG,aAAa,GAAG;IACnD,CAAC,mBAAmB,CAAC,CAAC,EAAE;QACtB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB,CAAC;CACH,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;CAiB0D,CAAC"}
1
+ {"version":3,"file":"ktx2-basis-writer.d.ts","sourceRoot":"","sources":["../src/ktx2-basis-writer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAoB,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAG/E,OAAO,EAAC,sBAAsB,EAAC,oDAAiD;AAEhF,0CAA0C;AAC1C,MAAM,MAAM,sBAAsB,GAAG,aAAa,GAAG;IACnD,CAAC,mBAAmB,CAAC,CAAC,EAAE;QACtB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB,CAAC;CACH,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;CAkB0D,CAAC"}
@@ -13,6 +13,7 @@ export const KTX2BasisWriter = {
13
13
  module: 'textures',
14
14
  version: VERSION,
15
15
  extensions: ['ktx2'],
16
+ mimeTypes: ['image/ktx2'],
16
17
  options: {
17
18
  ['ktx2-basis-writer']: {
18
19
  useSRGB: false,
@@ -4,4 +4,4 @@
4
4
  // Version constant cannot be imported, it needs to correspond to the build version of **this** module.
5
5
  // __VERSION__ is injected by babel-plugin-version-inline
6
6
  // @ts-ignore TS2304: Cannot find name '__VERSION__'.
7
- export const VERSION = typeof "4.3.1" !== 'undefined' ? "4.3.1" : 'latest';
7
+ export const VERSION = typeof "4.4.0-alpha.0" !== 'undefined' ? "4.4.0-alpha.0" : 'latest';
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  (() => {
3
3
  // src/lib/utils/version.ts
4
- var VERSION = true ? "4.3.1" : "latest";
4
+ var VERSION = true ? "4.4.0-alpha.0" : "latest";
5
5
 
6
6
  // src/lib/parsers/parse-npy.ts
7
7
  var a = new Uint32Array([305419896]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/textures",
3
- "version": "4.3.2",
3
+ "version": "4.4.0-alpha.1",
4
4
  "description": "Framework-independent loaders for compressed and super compressed (basis) textures ",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -54,16 +54,16 @@
54
54
  "build-crunch-worker": "esbuild src/workers/crunch-worker.ts --outfile=dist/crunch-worker.js --target=esnext --bundle --define:__VERSION__=\\\"$npm_package_version\\\""
55
55
  },
56
56
  "dependencies": {
57
- "@loaders.gl/images": "4.3.2",
58
- "@loaders.gl/loader-utils": "4.3.2",
59
- "@loaders.gl/schema": "4.3.2",
60
- "@loaders.gl/worker-utils": "4.3.2",
57
+ "@loaders.gl/images": "4.4.0-alpha.1",
58
+ "@loaders.gl/loader-utils": "4.4.0-alpha.1",
59
+ "@loaders.gl/schema": "4.4.0-alpha.1",
60
+ "@loaders.gl/worker-utils": "4.4.0-alpha.1",
61
61
  "@math.gl/types": "^4.1.0",
62
62
  "ktx-parse": "^0.7.0",
63
63
  "texture-compressor": "^1.0.2"
64
64
  },
65
65
  "peerDependencies": {
66
- "@loaders.gl/core": "^4.3.0"
66
+ "@loaders.gl/core": "4.4.0-alpha.0"
67
67
  },
68
- "gitHead": "b4203b8703f64a38d6f79a3113bc7bb51d45c93a"
68
+ "gitHead": "f1732de45907bd500bf4eedb4803beca8bf4bfb0"
69
69
  }
@@ -31,6 +31,7 @@ export const CompressedTextureWriter = {
31
31
  version: VERSION,
32
32
 
33
33
  extensions: ['dds'],
34
+ mimeTypes: ['image/vnd-ms.dds', 'image/x-dds', 'application/octet-stream'],
34
35
 
35
36
  options: {
36
37
  texture: {
@@ -28,6 +28,7 @@ export const KTX2BasisWriter = {
28
28
  version: VERSION,
29
29
 
30
30
  extensions: ['ktx2'],
31
+ mimeTypes: ['image/ktx2'],
31
32
  options: {
32
33
  ['ktx2-basis-writer']: {
33
34
  useSRGB: false,