d29c71e8d3ea4da150e6ecfe7b77fc8251b552905d4c4e82b1a7eb7605021392.json 4.6 KB

1
  1. {"ast":null,"code":"import { GLTFLoader, ArrayItem } from \"../glTFLoader.js\";\nconst NAME = \"EXT_texture_avif\";\n/**\n * [glTF PR](https://github.com/KhronosGroup/glTF/pull/2235)\n * [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Vendor/EXT_texture_avif/README.md)\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport class EXT_texture_avif {\n /**\n * @internal\n */\n constructor(loader) {\n /** The name of this extension. */\n this.name = NAME;\n this._loader = loader;\n this.enabled = loader.isExtensionUsed(NAME);\n }\n /** @internal */\n dispose() {\n this._loader = null;\n }\n /**\n * @internal\n */\n _loadTextureAsync(context, texture, assign) {\n return GLTFLoader.LoadExtensionAsync(context, texture, this.name, (extensionContext, extension) => {\n const sampler = texture.sampler == undefined ? GLTFLoader.DefaultSampler : ArrayItem.Get(`${context}/sampler`, this._loader.gltf.samplers, texture.sampler);\n const image = ArrayItem.Get(`${extensionContext}/source`, this._loader.gltf.images, extension.source);\n return this._loader._createTextureAsync(context, sampler, image, babylonTexture => {\n assign(babylonTexture);\n }, undefined, !texture._textureInfo.nonColorData);\n });\n }\n}\nGLTFLoader.RegisterExtension(NAME, loader => new EXT_texture_avif(loader));","map":{"version":3,"names":["GLTFLoader","ArrayItem","NAME","EXT_texture_avif","constructor","loader","name","_loader","enabled","isExtensionUsed","dispose","_loadTextureAsync","context","texture","assign","LoadExtensionAsync","extensionContext","extension","sampler","undefined","DefaultSampler","Get","gltf","samplers","image","images","source","_createTextureAsync","babylonTexture","_textureInfo","nonColorData","RegisterExtension"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/loaders/glTF/2.0/Extensions/EXT_texture_avif.js"],"sourcesContent":["import { GLTFLoader, ArrayItem } from \"../glTFLoader.js\";\nconst NAME = \"EXT_texture_avif\";\n/**\n * [glTF PR](https://github.com/KhronosGroup/glTF/pull/2235)\n * [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Vendor/EXT_texture_avif/README.md)\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport class EXT_texture_avif {\n /**\n * @internal\n */\n constructor(loader) {\n /** The name of this extension. */\n this.name = NAME;\n this._loader = loader;\n this.enabled = loader.isExtensionUsed(NAME);\n }\n /** @internal */\n dispose() {\n this._loader = null;\n }\n /**\n * @internal\n */\n _loadTextureAsync(context, texture, assign) {\n return GLTFLoader.LoadExtensionAsync(context, texture, this.name, (extensionContext, extension) => {\n const sampler = texture.sampler == undefined ? GLTFLoader.DefaultSampler : ArrayItem.Get(`${context}/sampler`, this._loader.gltf.samplers, texture.sampler);\n const image = ArrayItem.Get(`${extensionContext}/source`, this._loader.gltf.images, extension.source);\n return this._loader._createTextureAsync(context, sampler, image, (babylonTexture) => {\n assign(babylonTexture);\n }, undefined, !texture._textureInfo.nonColorData);\n });\n }\n}\nGLTFLoader.RegisterExtension(NAME, (loader) => new EXT_texture_avif(loader));\n"],"mappings":"AAAA,SAASA,UAAU,EAAEC,SAAS,QAAQ,kBAAkB;AACxD,MAAMC,IAAI,GAAG,kBAAkB;AAC/B;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,CAAC;EAC1B;AACJ;AACA;EACIC,WAAWA,CAACC,MAAM,EAAE;IAChB;IACA,IAAI,CAACC,IAAI,GAAGJ,IAAI;IAChB,IAAI,CAACK,OAAO,GAAGF,MAAM;IACrB,IAAI,CAACG,OAAO,GAAGH,MAAM,CAACI,eAAe,CAACP,IAAI,CAAC;EAC/C;EACA;EACAQ,OAAOA,CAAA,EAAG;IACN,IAAI,CAACH,OAAO,GAAG,IAAI;EACvB;EACA;AACJ;AACA;EACII,iBAAiBA,CAACC,OAAO,EAAEC,OAAO,EAAEC,MAAM,EAAE;IACxC,OAAOd,UAAU,CAACe,kBAAkB,CAACH,OAAO,EAAEC,OAAO,EAAE,IAAI,CAACP,IAAI,EAA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