three-stdlib 2.13.1 → 2.14.0
Sign up to get free protection for your applications and to get access to all the features.
- package/{Nodes-607e9ed8.js → Nodes-4f766d71.js} +0 -0
- package/{Nodes-627a8bdf.js → Nodes-9aa16d74.js} +0 -0
- package/index.cjs.js +1 -1
- package/loaders/FontLoader.cjs.js +1 -1
- package/loaders/FontLoader.d.ts +8 -1
- package/loaders/FontLoader.js +18 -6
- package/loaders/KTX2Loader.cjs.js +1 -1
- package/loaders/KTX2Loader.js +493 -102
- package/loaders/NodeMaterialLoader.cjs.js +1 -1
- package/loaders/RGBMLoader.js +248 -177
- package/nodes/Nodes.cjs.js +1 -1
- package/nodes/core/NodeBuilder.js +5 -1
- package/nodes/loaders/NodeLoader.cjs.js +1 -1
- package/nodes/loaders/NodeObjectLoader.cjs.js +1 -1
- package/package.json +2 -2
- package/utils/WorkerPool.cjs.js +1 -0
- package/utils/WorkerPool.js +82 -0
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("three");function
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("three");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=s(e);class n extends t.Loader{constructor(e){super(e),r.default(this,"options",{lineHeight:1,letterSpacing:0})}load(e,s,r,n){const o=new t.FileLoader(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(e=>{if("string"!=typeof e)throw new Error("unsupported data type");const t=JSON.parse(e),r=this.parse(t);s&&s(r)}),r,n)}parse(e){return new o(e,this.options)}setOptions(e){Object.assign(this.options,e)}}class o{constructor(e,t){r.default(this,"data",void 0),r.default(this,"options",void 0),this.data=e,this.options=t}generateShapes(e,t=100){const s=[],r=function(e,t,s,r){const n=Array.from(e),o=t/s.resolution,i=(s.boundingBox.yMax-s.boundingBox.yMin+s.underlineThickness)*o,p=[];let l=0,h=0;for(let e=0;e<n.length;e++){const t=n[e];if("\n"===t)l=0,h-=i*r.lineHeight;else{const e=a(t,o,l,h,s);e&&(l+=e.offsetX+r.letterSpacing,p.push(e.path))}}return p}(e,t,this.data,this.options);for(let e=0,t=r.length;e<t;e++)Array.prototype.push.apply(s,r[e].toShapes(!1));return s}}function a(e,s,r,n,o){const a=o.glyphs[e]||o.glyphs["?"];if(!a)return void console.error('THREE.Font: character "'+e+'" does not exists in font family '+o.familyName+".");const i=new t.ShapePath;let p,l,h,u,c,d,f,y;if(a.o){const e=a._cachedOutline||(a._cachedOutline=a.o.split(" "));for(let t=0,o=e.length;t<o;){switch(e[t++]){case"m":p=parseInt(e[t++])*s+r,l=parseInt(e[t++])*s+n,i.moveTo(p,l);break;case"l":p=parseInt(e[t++])*s+r,l=parseInt(e[t++])*s+n,i.lineTo(p,l);break;case"q":h=parseInt(e[t++])*s+r,u=parseInt(e[t++])*s+n,c=parseInt(e[t++])*s+r,d=parseInt(e[t++])*s+n,i.quadraticCurveTo(c,d,h,u);break;case"b":h=parseInt(e[t++])*s+r,u=parseInt(e[t++])*s+n,c=parseInt(e[t++])*s+r,d=parseInt(e[t++])*s+n,f=parseInt(e[t++])*s+r,y=parseInt(e[t++])*s+n,i.bezierCurveTo(c,d,f,y,h,u)}}}return{offsetX:a.ha*s,path:i}}r.default(o,"isFont",void 0),r.default(o,"type",void 0),exports.Font=o,exports.FontLoader=n;
|
package/loaders/FontLoader.d.ts
CHANGED
@@ -1,9 +1,15 @@
|
|
1
1
|
import { Loader } from 'three';
|
2
2
|
import type { LoadingManager, Shape } from 'three';
|
3
|
+
declare type Options = {
|
4
|
+
lineHeight: number;
|
5
|
+
letterSpacing: number;
|
6
|
+
};
|
3
7
|
export declare class FontLoader extends Loader {
|
8
|
+
options: Options;
|
4
9
|
constructor(manager?: LoadingManager);
|
5
10
|
load(url: string, onLoad?: (responseFont: Font) => void, onProgress?: (event: ProgressEvent) => void, onError?: (event: ErrorEvent) => void): void;
|
6
11
|
parse(json: FontData): Font;
|
12
|
+
setOptions(options: Partial<Options>): void;
|
7
13
|
}
|
8
14
|
declare type Glyph = {
|
9
15
|
_cachedOutline: string[];
|
@@ -24,9 +30,10 @@ declare type FontData = {
|
|
24
30
|
};
|
25
31
|
export declare class Font {
|
26
32
|
data: FontData;
|
33
|
+
options: Options;
|
27
34
|
static isFont: true;
|
28
35
|
static type: 'Font';
|
29
|
-
constructor(data: FontData);
|
36
|
+
constructor(data: FontData, options: Options);
|
30
37
|
generateShapes(text: string, size?: number): Shape[];
|
31
38
|
}
|
32
39
|
export {};
|
package/loaders/FontLoader.js
CHANGED
@@ -4,6 +4,11 @@ import { Loader, FileLoader, ShapePath } from 'three';
|
|
4
4
|
class FontLoader extends Loader {
|
5
5
|
constructor(manager) {
|
6
6
|
super(manager);
|
7
|
+
|
8
|
+
_defineProperty(this, "options", {
|
9
|
+
lineHeight: 1,
|
10
|
+
letterSpacing: 0
|
11
|
+
});
|
7
12
|
}
|
8
13
|
|
9
14
|
load(url, onLoad, onProgress, onError) {
|
@@ -20,20 +25,27 @@ class FontLoader extends Loader {
|
|
20
25
|
}
|
21
26
|
|
22
27
|
parse(json) {
|
23
|
-
return new Font(json);
|
28
|
+
return new Font(json, this.options);
|
29
|
+
}
|
30
|
+
|
31
|
+
setOptions(options) {
|
32
|
+
Object.assign(this.options, options);
|
24
33
|
}
|
25
34
|
|
26
35
|
}
|
27
36
|
class Font {
|
28
|
-
constructor(data) {
|
37
|
+
constructor(data, options) {
|
29
38
|
_defineProperty(this, "data", void 0);
|
30
39
|
|
40
|
+
_defineProperty(this, "options", void 0);
|
41
|
+
|
31
42
|
this.data = data;
|
43
|
+
this.options = options;
|
32
44
|
}
|
33
45
|
|
34
46
|
generateShapes(text, size = 100) {
|
35
47
|
const shapes = [];
|
36
|
-
const paths = createPaths(text, size, this.data);
|
48
|
+
const paths = createPaths(text, size, this.data, this.options);
|
37
49
|
|
38
50
|
for (let p = 0, pl = paths.length; p < pl; p++) {
|
39
51
|
Array.prototype.push.apply(shapes, paths[p].toShapes(false));
|
@@ -48,7 +60,7 @@ _defineProperty(Font, "isFont", void 0);
|
|
48
60
|
|
49
61
|
_defineProperty(Font, "type", void 0);
|
50
62
|
|
51
|
-
function createPaths(text, size, data) {
|
63
|
+
function createPaths(text, size, data, options) {
|
52
64
|
const chars = Array.from(text);
|
53
65
|
const scale = size / data.resolution;
|
54
66
|
const line_height = (data.boundingBox.yMax - data.boundingBox.yMin + data.underlineThickness) * scale;
|
@@ -61,12 +73,12 @@ function createPaths(text, size, data) {
|
|
61
73
|
|
62
74
|
if (char === '\n') {
|
63
75
|
offsetX = 0;
|
64
|
-
offsetY -= line_height;
|
76
|
+
offsetY -= line_height * options.lineHeight;
|
65
77
|
} else {
|
66
78
|
const ret = createPath(char, scale, offsetX, offsetY, data);
|
67
79
|
|
68
80
|
if (ret) {
|
69
|
-
offsetX += ret.offsetX;
|
81
|
+
offsetX += ret.offsetX + options.letterSpacing;
|
70
82
|
paths.push(ret.path);
|
71
83
|
}
|
72
84
|
}
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("three"),r=require("./BasisTextureLoader.cjs.js"),t=require("zstddec"),s=require("ktx-parse");class a extends e.CompressedTextureLoader{constructor(e){super(e),this.basisLoader=new r.BasisTextureLoader(e),this.zstd=new t.ZSTDDecoder,this.zstd.init(),"undefined"!=typeof MSC_TRANSCODER&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(e){return this.basisLoader.setTranscoderPath(e),this}setWorkerLimit(e){return this.basisLoader.setWorkerLimit(e),this}detectSupport(e){return this.basisLoader.detectSupport(e),this}dispose(){return this.basisLoader.dispose(),this}load(r,t,s,a){var o=this,n=new e.CompressedTexture;return new Promise((function(t,a){new e.FileLoader(o.manager).setPath(o.path).setResponseType("arraybuffer").load(r,t,s,a)})).then((function(e){o.parse(e,(function(e){n.copy(e),n.needsUpdate=!0,t&&t(n)}),a)})).catch(a),n}parse(t,a,n){var i=this,l=s.read(new Uint8Array(t));if(l.pixelDepth>0)throw new Error("THREE.KTX2Loader: Only 2D textures are currently supported.");if(l.layerCount>1)throw new Error("THREE.KTX2Loader: Array textures are not currently supported.");if(l.faceCount>1)throw new Error("THREE.KTX2Loader: Cube textures are not currently supported.");var h=o.getBasicDFD(l);return o.createLevels(l,this.zstd).then((function(e){var t=h.colorModel===s.KTX2Model.UASTC?r.BasisTextureLoader.BasisFormat.UASTC_4x4:r.BasisTextureLoader.BasisFormat.ETC1S,a={levels:e,width:l.pixelWidth,height:l.pixelHeight,basisFormat:t,hasAlpha:o.getAlpha(l)};return t===r.BasisTextureLoader.BasisFormat.ETC1S&&(a.globalData=l.globalData),i.basisLoader.parseInternalAsync(a)})).then((function(r){r.encoding=h.transferFunction===s.KTX2Transfer.SRGB?e.sRGBEncoding:e.LinearEncoding,r.premultiplyAlpha=o.getPremultiplyAlpha(l),a(r)})).catch(n),this}}var o={createLevels:async function(e,r){e.supercompressionScheme===s.KTX2SupercompressionScheme.ZSTD&&await r.init();for(var t=[],a=e.pixelWidth,o=e.pixelHeight,n=0;n<e.levels.length;n++){var i=Math.max(1,Math.floor(a/Math.pow(2,n))),l=Math.max(1,Math.floor(o/Math.pow(2,n))),h=e.levels[n].levelData;e.supercompressionScheme===s.KTX2SupercompressionScheme.ZSTD&&(h=r.decode(h,e.levels[n].uncompressedByteLength)),t.push({index:n,width:i,height:l,data:h})}return t},getBasicDFD:function(e){return e.dataFormatDescriptor[0]},getAlpha:function(e){var r=this.getBasicDFD(e);return r.colorModel===s.KTX2Model.UASTC?(15&r.samples[0].channelID)===s.KTX2ChannelUASTC.RGBA:2===r.samples.length&&(15&r.samples[1].channelID)===s.KTX2ChannelETC1S.AAA},getPremultiplyAlpha:function(e){return!!(this.getBasicDFD(e).flags&s.KTX2Flags.ALPHA_PREMULTIPLIED)}};exports.KTX2Loader=a;
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("three"),r=require("../utils/WorkerPool.cjs.js"),t=require("ktx-parse"),o=require("zstddec");const s=new WeakMap;let a,n=0;class i extends e.Loader{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new r.WorkerPool,this.workerSourceURL="",this.workerConfig=null,"undefined"!=typeof MSC_TRANSCODER&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(e){return this.transcoderPath=e,this}setWorkerLimit(e){return this.workerPool.setWorkerLimit(e),this}detectSupport(e){return this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},e.capabilities.isWebGL2&&(this.workerConfig.etc1Supported=!1),this}init(){if(!this.transcoderPending){const r=new e.FileLoader(this.manager);r.setPath(this.transcoderPath),r.setWithCredentials(this.withCredentials);const t=r.loadAsync("basis_transcoder.js"),o=new e.FileLoader(this.manager);o.setPath(this.transcoderPath),o.setResponseType("arraybuffer"),o.setWithCredentials(this.withCredentials);const s=o.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,s]).then((([e,r])=>{const t=i.BasisWorker.toString(),o=["/* constants */","let _EngineFormat = "+JSON.stringify(i.EngineFormat),"let _TranscoderFormat = "+JSON.stringify(i.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(i.BasisFormat),"/* basis_transcoder.js */",e,"/* worker */",t.substring(t.indexOf("{")+1,t.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([o])),this.transcoderBinary=r,this.workerPool.setWorkerCreator((()=>{const e=new Worker(this.workerSourceURL),r=this.transcoderBinary.slice(0);return e.postMessage({type:"init",config:this.workerConfig,transcoderBinary:r},[r]),e}))})),n>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),n++}return this.transcoderPending}load(r,t,o,a){if(null===this.workerConfig)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const n=new e.FileLoader(this.manager);n.setResponseType("arraybuffer"),n.setWithCredentials(this.withCredentials),n.load(r,(e=>{if(s.has(e)){return s.get(e).promise.then(t).catch(a)}this._createTexture(e).then((e=>t?t(e):null)).catch(a)}),o,a)}_createTextureFrom(r){const{mipmaps:o,width:s,height:a,format:n,type:i,error:_,dfdTransferFn:T,dfdFlags:d}=r;if("error"===i)return Promise.reject(_);const R=new e.CompressedTexture(o,s,a,n,e.UnsignedByteType);return R.minFilter=1===o.length?e.LinearFilter:e.LinearMipmapLinearFilter,R.magFilter=e.LinearFilter,R.generateMipmaps=!1,R.needsUpdate=!0,R.encoding=T===t.KHR_DF_TRANSFER_SRGB?e.sRGBEncoding:e.LinearEncoding,R.premultiplyAlpha=!!(d&t.KHR_DF_FLAG_ALPHA_PREMULTIPLIED),R}_createTexture(r,n={}){const i=t.read(new Uint8Array(r));if(i.vkFormat!==t.VK_FORMAT_UNDEFINED)return async function(r){const{vkFormat:s,pixelWidth:n,pixelHeight:i,pixelDepth:R}=r;if(void 0===_[s])throw new Error("THREE.KTX2Loader: Unsupported vkFormat.");const c=r.levels[0];let F,p;if(r.supercompressionScheme===t.KHR_SUPERCOMPRESSION_NONE)F=c.levelData;else{if(r.supercompressionScheme!==t.KHR_SUPERCOMPRESSION_ZSTD)throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");a||(a=new Promise((async e=>{const r=new o.ZSTDDecoder;await r.init(),e(r)}))),F=(await a).decode(c.levelData,c.uncompressedByteLength)}p=T[s]===e.FloatType?new Float32Array(F.buffer,F.byteOffset,F.byteLength/Float32Array.BYTES_PER_ELEMENT):T[s]===e.HalfFloatType?new Uint16Array(F.buffer,F.byteOffset,F.byteLength/Uint16Array.BYTES_PER_ELEMENT):F;const m=0===R?new e.DataTexture(p,n,i):new e.Data3DTexture(p,n,i,R);return m.type=T[s],m.format=_[s],m.encoding=d[s]||e.LinearEncoding,m.needsUpdate=!0,Promise.resolve(m)}(i);const R=n,c=this.init().then((()=>this.workerPool.postMessage({type:"transcode",buffer:r,taskConfig:R},[r]))).then((e=>this._createTextureFrom(e.data)));return s.set(r,{promise:c}),c}dispose(){return this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),n--,this}}i.BasisFormat={ETC1S:0,UASTC_4x4:1},i.TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16},i.EngineFormat={RGBAFormat:e.RGBAFormat,RGBA_ASTC_4x4_Format:e.RGBA_ASTC_4x4_Format,RGBA_BPTC_Format:e.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:e.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:e.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:e.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:e.RGB_ETC1_Format,RGB_ETC2_Format:e.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:e.RGB_PVRTC_4BPPV1_Format,RGB_S3TC_DXT1_Format:e.RGB_S3TC_DXT1_Format},i.BasisWorker=function(){let e,r,t;const o=_EngineFormat,s=_TranscoderFormat,a=_BasisFormat;self.addEventListener("message",(function(n){const d=n.data;switch(d.type){case"init":e=d.config,R=d.transcoderBinary,r=new Promise((e=>{t={wasmBinary:R,onRuntimeInitialized:e},BASIS(t)})).then((()=>{t.initializeBasis(),void 0===t.KTX2File&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")}));break;case"transcode":r.then((()=>{try{const{width:r,height:n,hasAlpha:R,mipmaps:c,format:F,dfdTransferFn:p,dfdFlags:m}=function(r){const n=new t.KTX2File(new Uint8Array(r));function d(){n.close(),n.delete()}if(!n.isValid())throw d(),new Error("THREE.KTX2Loader:\tInvalid or unsupported .ktx2 file");const R=n.isUASTC()?a.UASTC_4x4:a.ETC1S,c=n.getWidth(),F=n.getHeight(),p=n.getLevels(),m=n.getHasAlpha(),l=n.getDFDTransferFunc(),A=n.getDFDFlags(),{transcoderFormat:B,engineFormat:h}=function(r,t,n,d){let R,c;const F=r===a.ETC1S?i:_;for(let o=0;o<F.length;o++){const s=F[o];if(e[s.if]&&(s.basisFormat.includes(r)&&!(d&&s.transcoderFormat.length<2)&&(!s.needsPowerOfTwo||T(t)&&T(n))))return R=s.transcoderFormat[d?1:0],c=s.engineFormat[d?1:0],{transcoderFormat:R,engineFormat:c}}return console.warn("THREE.KTX2Loader: No suitable compressed texture format found. Decoding to RGBA32."),R=s.RGBA32,c=o.RGBAFormat,{transcoderFormat:R,engineFormat:c}}(R,c,F,m);if(!c||!F||!p)throw d(),new Error("THREE.KTX2Loader:\tInvalid texture");if(!n.startTranscoding())throw d(),new Error("THREE.KTX2Loader: .startTranscoding failed");const S=[];for(let e=0;e<p;e++){const r=n.getImageLevelInfo(e,0,0),t=r.origWidth,o=r.origHeight,s=new Uint8Array(n.getImageTranscodedSizeInBytes(e,0,0,B));if(!n.transcodeImage(s,e,0,0,B,0,-1,-1))throw d(),new Error("THREE.KTX2Loader: .transcodeImage failed.");S.push({data:s,width:t,height:o})}return d(),{width:c,height:F,hasAlpha:m,mipmaps:S,format:h,dfdTransferFn:l,dfdFlags:A}}(d.buffer),l=[];for(let e=0;e<c.length;++e)l.push(c[e].data.buffer);self.postMessage({type:"transcode",id:d.id,width:r,height:n,hasAlpha:R,mipmaps:c,format:F,dfdTransferFn:p,dfdFlags:m},l)}catch(e){console.error(e),self.postMessage({type:"error",id:d.id,error:e.message})}}))}var R}));const n=[{if:"astcSupported",basisFormat:[a.UASTC_4x4],transcoderFormat:[s.ASTC_4x4,s.ASTC_4x4],engineFormat:[o.RGBA_ASTC_4x4_Format,o.RGBA_ASTC_4x4_Format],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[a.ETC1S,a.UASTC_4x4],transcoderFormat:[s.BC7_M5,s.BC7_M5],engineFormat:[o.RGBA_BPTC_Format,o.RGBA_BPTC_Format],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[a.ETC1S,a.UASTC_4x4],transcoderFormat:[s.BC1,s.BC3],engineFormat:[o.RGB_S3TC_DXT1_Format,o.RGBA_S3TC_DXT5_Format],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[a.ETC1S,a.UASTC_4x4],transcoderFormat:[s.ETC1,s.ETC2],engineFormat:[o.RGB_ETC2_Format,o.RGBA_ETC2_EAC_Format],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[a.ETC1S,a.UASTC_4x4],transcoderFormat:[s.ETC1],engineFormat:[o.RGB_ETC1_Format],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[a.ETC1S,a.UASTC_4x4],transcoderFormat:[s.PVRTC1_4_RGB,s.PVRTC1_4_RGBA],engineFormat:[o.RGB_PVRTC_4BPPV1_Format,o.RGBA_PVRTC_4BPPV1_Format],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0}],i=n.sort((function(e,r){return e.priorityETC1S-r.priorityETC1S})),_=n.sort((function(e,r){return e.priorityUASTC-r.priorityUASTC}));function T(e){return e<=2||0==(e&e-1)&&0!==e}};const _={[t.VK_FORMAT_R32G32B32A32_SFLOAT]:e.RGBAFormat,[t.VK_FORMAT_R16G16B16A16_SFLOAT]:e.RGBAFormat,[t.VK_FORMAT_R8G8B8A8_UNORM]:e.RGBAFormat,[t.VK_FORMAT_R8G8B8A8_SRGB]:e.RGBAFormat,[t.VK_FORMAT_R32G32_SFLOAT]:e.RGFormat,[t.VK_FORMAT_R16G16_SFLOAT]:e.RGFormat,[t.VK_FORMAT_R8G8_UNORM]:e.RGFormat,[t.VK_FORMAT_R8G8_SRGB]:e.RGFormat,[t.VK_FORMAT_R32_SFLOAT]:e.RedFormat,[t.VK_FORMAT_R16_SFLOAT]:e.RedFormat,[t.VK_FORMAT_R8_SRGB]:e.RedFormat,[t.VK_FORMAT_R8_UNORM]:e.RedFormat},T={[t.VK_FORMAT_R32G32B32A32_SFLOAT]:e.FloatType,[t.VK_FORMAT_R16G16B16A16_SFLOAT]:e.HalfFloatType,[t.VK_FORMAT_R8G8B8A8_UNORM]:e.UnsignedByteType,[t.VK_FORMAT_R8G8B8A8_SRGB]:e.UnsignedByteType,[t.VK_FORMAT_R32G32_SFLOAT]:e.FloatType,[t.VK_FORMAT_R16G16_SFLOAT]:e.HalfFloatType,[t.VK_FORMAT_R8G8_UNORM]:e.UnsignedByteType,[t.VK_FORMAT_R8G8_SRGB]:e.UnsignedByteType,[t.VK_FORMAT_R32_SFLOAT]:e.FloatType,[t.VK_FORMAT_R16_SFLOAT]:e.HalfFloatType,[t.VK_FORMAT_R8_SRGB]:e.UnsignedByteType,[t.VK_FORMAT_R8_UNORM]:e.UnsignedByteType},d={[t.VK_FORMAT_R8G8B8A8_SRGB]:e.sRGBEncoding,[t.VK_FORMAT_R8G8_SRGB]:e.sRGBEncoding,[t.VK_FORMAT_R8_SRGB]:e.sRGBEncoding};exports.KTX2Loader=i;
|