three-stdlib 2.13.0 → 2.14.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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("three");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=r(e);class a extends t.Loader{constructor(e){super(e)}load(e,r,s,a){const n=new t.FileLoader(this.manager);n.setPath(this.path),n.setRequestHeader(this.requestHeader),n.setWithCredentials(this.withCredentials),n.load(e,(e=>{if("string"!=typeof e)throw new Error("unsupported data type");const t=JSON.parse(e),s=this.parse(t);r&&r(s)}),s,a)}parse(e){return new n(e)}}class n{constructor(e){s.default(this,"data",void 0),this.data=e}generateShapes(e,t=100){const r=[],s=function(e,t,r){const s=Array.from(e),a=t/r.resolution,n=(r.boundingBox.yMax-r.boundingBox.yMin+r.underlineThickness)*a,i=[];let p=0,l=0;for(let e=0;e<s.length;e++){const t=s[e];if("\n"===t)p=0,l-=n;else{const e=o(t,a,p,l,r);e&&(p+=e.offsetX,i.push(e.path))}}return i}(e,t,this.data);for(let e=0,t=s.length;e<t;e++)Array.prototype.push.apply(r,s[e].toShapes(!1));return r}}function o(e,r,s,a,n){const o=n.glyphs[e]||n.glyphs["?"];if(!o)return void console.error('THREE.Font: character "'+e+'" does not exists in font family '+n.familyName+".");const i=new t.ShapePath;let p,l,u,c,d,h,f,y;if(o.o){const e=o._cachedOutline||(o._cachedOutline=o.o.split(" "));for(let t=0,n=e.length;t<n;){switch(e[t++]){case"m":p=parseInt(e[t++])*r+s,l=parseInt(e[t++])*r+a,i.moveTo(p,l);break;case"l":p=parseInt(e[t++])*r+s,l=parseInt(e[t++])*r+a,i.lineTo(p,l);break;case"q":u=parseInt(e[t++])*r+s,c=parseInt(e[t++])*r+a,d=parseInt(e[t++])*r+s,h=parseInt(e[t++])*r+a,i.quadraticCurveTo(d,h,u,c);break;case"b":u=parseInt(e[t++])*r+s,c=parseInt(e[t++])*r+a,d=parseInt(e[t++])*r+s,h=parseInt(e[t++])*r+a,f=parseInt(e[t++])*r+s,y=parseInt(e[t++])*r+a,i.bezierCurveTo(d,h,f,y,u,c)}}}return{offsetX:o.ha*r,path:i}}s.default(n,"isFont",void 0),s.default(n,"type",void 0),exports.Font=n,exports.FontLoader=a;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("three");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=r(e);class n extends t.Loader{constructor(e){super(e)}load(e,r,s,n){const a=new t.FileLoader(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(e=>{if("string"!=typeof e)throw new Error("unsupported data type");const t=JSON.parse(e),s=this.parse(t);r&&r(s)}),s,n)}parse(e){return new a(e)}}class a{constructor(e){s.default(this,"data",void 0),this.data=e}generateShapes(e,t=100,r){const s=[],n={letterSpacing:0,lineHeight:1,...r},a=function(e,t,r,s){const n=Array.from(e),a=t/r.resolution,i=(r.boundingBox.yMax-r.boundingBox.yMin+r.underlineThickness)*a,p=[];let l=0,u=0;for(let e=0;e<n.length;e++){const t=n[e];if("\n"===t)l=0,u-=i*s.lineHeight;else{const e=o(t,a,l,u,r);e&&(l+=e.offsetX+s.letterSpacing,p.push(e.path))}}return p}(e,t,this.data,n);for(let e=0,t=a.length;e<t;e++)Array.prototype.push.apply(s,a[e].toShapes(!1));return s}}function o(e,r,s,n,a){const o=a.glyphs[e]||a.glyphs["?"];if(!o)return void console.error('THREE.Font: character "'+e+'" does not exists in font family '+a.familyName+".");const i=new t.ShapePath;let p,l,u,c,h,d,f,y;if(o.o){const e=o._cachedOutline||(o._cachedOutline=o.o.split(" "));for(let t=0,a=e.length;t<a;){switch(e[t++]){case"m":p=parseInt(e[t++])*r+s,l=parseInt(e[t++])*r+n,i.moveTo(p,l);break;case"l":p=parseInt(e[t++])*r+s,l=parseInt(e[t++])*r+n,i.lineTo(p,l);break;case"q":u=parseInt(e[t++])*r+s,c=parseInt(e[t++])*r+n,h=parseInt(e[t++])*r+s,d=parseInt(e[t++])*r+n,i.quadraticCurveTo(h,d,u,c);break;case"b":u=parseInt(e[t++])*r+s,c=parseInt(e[t++])*r+n,h=parseInt(e[t++])*r+s,d=parseInt(e[t++])*r+n,f=parseInt(e[t++])*r+s,y=parseInt(e[t++])*r+n,i.bezierCurveTo(h,d,f,y,u,c)}}}return{offsetX:o.ha*r,path:i}}s.default(a,"isFont",void 0),s.default(a,"type",void 0),exports.Font=a,exports.FontLoader=n;
@@ -1,5 +1,9 @@
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 {
4
8
  constructor(manager?: LoadingManager);
5
9
  load(url: string, onLoad?: (responseFont: Font) => void, onProgress?: (event: ProgressEvent) => void, onError?: (event: ErrorEvent) => void): void;
@@ -27,6 +31,6 @@ export declare class Font {
27
31
  static isFont: true;
28
32
  static type: 'Font';
29
33
  constructor(data: FontData);
30
- generateShapes(text: string, size?: number): Shape[];
34
+ generateShapes(text: string, size?: number, _options?: Partial<Options>): Shape[];
31
35
  }
32
36
  export {};
@@ -31,9 +31,14 @@ class Font {
31
31
  this.data = data;
32
32
  }
33
33
 
34
- generateShapes(text, size = 100) {
34
+ generateShapes(text, size = 100, _options) {
35
35
  const shapes = [];
36
- const paths = createPaths(text, size, this.data);
36
+ const options = {
37
+ letterSpacing: 0,
38
+ lineHeight: 1,
39
+ ..._options
40
+ };
41
+ const paths = createPaths(text, size, this.data, options);
37
42
 
38
43
  for (let p = 0, pl = paths.length; p < pl; p++) {
39
44
  Array.prototype.push.apply(shapes, paths[p].toShapes(false));
@@ -48,7 +53,7 @@ _defineProperty(Font, "isFont", void 0);
48
53
 
49
54
  _defineProperty(Font, "type", void 0);
50
55
 
51
- function createPaths(text, size, data) {
56
+ function createPaths(text, size, data, options) {
52
57
  const chars = Array.from(text);
53
58
  const scale = size / data.resolution;
54
59
  const line_height = (data.boundingBox.yMax - data.boundingBox.yMin + data.underlineThickness) * scale;
@@ -61,12 +66,12 @@ function createPaths(text, size, data) {
61
66
 
62
67
  if (char === '\n') {
63
68
  offsetX = 0;
64
- offsetY -= line_height;
69
+ offsetY -= line_height * options.lineHeight;
65
70
  } else {
66
71
  const ret = createPath(char, scale, offsetX, offsetY, data);
67
72
 
68
73
  if (ret) {
69
- offsetX += ret.offsetX;
74
+ offsetX += ret.offsetX + options.letterSpacing;
70
75
  paths.push(ret.path);
71
76
  }
72
77
  }
@@ -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;