1 |
- {"ast":null,"code":"import _asyncToGenerator from \"F:/workspace/202226701027/huinongbao-app/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\nimport { GetExrHeader } from \"./EXR/exrLoader.header.js\";\nimport { CreateDecoderAsync, ScanData } from \"./EXR/exrLoader.decoder.js\";\nimport { ExrLoaderGlobalConfiguration } from \"./EXR/exrLoader.configuration.js\";\n/**\n * Inspired by https://github.com/sciecode/three.js/blob/dev/examples/jsm/loaders/EXRLoader.js\n * Referred to the original Industrial Light & Magic OpenEXR implementation and the TinyEXR / Syoyo Fujita\n * implementation.\n */\n// /*\n// Copyright (c) 2014 - 2017, Syoyo Fujita\n// All rights reserved.\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are met:\n// * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// * Redistributions in binary form must reproduce the above copyright\n// notice, this list of conditions and the following disclaimer in the\n// documentation and/or other materials provided with the distribution.\n// * Neither the name of the Syoyo Fujita nor the\n// names of its contributors may be used to endorse or promote products\n// derived from this software without specific prior written permission.\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n// DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY\n// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n// */\n// // TinyEXR contains some OpenEXR code, which is licensed under ------------\n// ///////////////////////////////////////////////////////////////////////////\n// //\n// // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas\n// // Digital Ltd. LLC\n// //\n// // All rights reserved.\n// //\n// // Redistribution and use in source and binary forms, with or without\n// // modification, are permitted provided that the following conditions are\n// // met:\n// // * Redistributions of source code must retain the above copyright\n// // notice, this list of conditions and the following disclaimer.\n// // * Redistributions in binary form must reproduce the above\n// // copyright notice, this list of conditions and the following disclaimer\n// // in the documentation and/or other materials provided with the\n// // distribution.\n// // * Neither the name of Industrial Light & Magic nor the names of\n// // its contributors may be used to endorse or promote products derived\n// // from this software without specific prior written permission.\n// //\n// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// // \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n// //\n// ///////////////////////////////////////////////////////////////////////////\n// // End of OpenEXR license -------------------------------------------------\n/**\n * Loader for .exr file format\n * #4RN0VF#151: PIZ compression\n * #4RN0VF#146: ZIP compression\n * #4RN0VF#149: RLE compression\n * #4RN0VF#150: PXR24 compression\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport class _ExrTextureLoader {\n constructor() {\n /**\n * Defines whether the loader supports cascade loading the different faces.\n */\n this.supportCascades = false;\n }\n /**\n * Uploads the cube texture data to the WebGL texture. It has already been bound.\n * @param _data contains the texture data\n * @param _texture defines the BabylonJS internal texture\n * @param _createPolynomials will be true if polynomials have been requested\n * @param _onLoad defines the callback to trigger once the texture is ready\n * @param _onError defines the callback to trigger in case of error\n */\n loadCubeData(_data, _texture, _createPolynomials, _onLoad, _onError) {\n // eslint-disable-next-line no-throw-literal\n throw \".exr not supported in Cube.\";\n }\n /**\n * Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.\n * @param data contains the texture data\n * @param texture defines the BabylonJS internal texture\n * @param callback defines the method to call once ready to upload\n */\n loadData(data, texture, callback) {\n return _asyncToGenerator(function* () {\n const dataView = new DataView(data.buffer);\n const offset = {\n value: 0\n };\n const header = GetExrHeader(dataView, offset);\n const decoder = yield CreateDecoderAsync(header, dataView, offset, ExrLoaderGlobalConfiguration.DefaultOutputType);\n ScanData(decoder, header, dataView, offset);\n // Updating texture\n const width = header.dataWindow.xMax - header.dataWindow.xMin + 1;\n const height = header.dataWindow.yMax - header.dataWindow.yMin + 1;\n callback(width, height, texture.generateMipMaps, false, () => {\n const engine = texture.getEngine();\n texture.format = header.format;\n texture.type = decoder.textureType;\n texture.invertY = false;\n texture._gammaSpace = !header.linearSpace;\n if (decoder.byteArray) {\n engine._uploadDataToTextureDirectly(texture, decoder.byteArray, 0, 0, undefined, true);\n }\n });\n })();\n }\n}","map":{"version":3,"names":["GetExrHeader","CreateDecoderAsync","ScanData","ExrLoaderGlobalConfiguration","_ExrTextureLoader","constructor","supportCascades","loadCubeData","_data","_texture","_createPolynomials","_onLoad","_onError","loadData","data","texture","callback","_asyncToGenerator","dataView","DataView","buffer","offset","value","header","decoder","DefaultOutputType","width","dataWindow","xMax","xMin","height","yMax","yMin","generateMipMaps","engine","getEngine","format","type","textureType","invertY","_gammaSpace","linearSpace","byteArray","_uploadDataToTextureDirectly","undefined"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Materials/Textures/Loaders/exrTextureLoader.js"],"sourcesContent":["import { GetExrHeader } from \"./EXR/exrLoader.header.js\";\nimport { CreateDecoderAsync, ScanData } from \"./EXR/exrLoader.decoder.js\";\nimport { ExrLoaderGlobalConfiguration } from \"./EXR/exrLoader.configuration.js\";\n/**\n * Inspired by https://github.com/sciecode/three.js/blob/dev/examples/jsm/loaders/EXRLoader.js\n * Referred to the original Industrial Light & Magic OpenEXR implementation and the TinyEXR / Syoyo Fujita\n * implementation.\n */\n// /*\n// Copyright (c) 2014 - 2017, Syoyo Fujita\n// All rights reserved.\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are met:\n// * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// * Redistributions in binary form must reproduce the above copyright\n// notice, this list of conditions and the following disclaimer in the\n// documentation and/or other materials provided with the distribution.\n// * Neither the name of the Syoyo Fujita nor the\n// names of its contributors may be used to endorse or promote products\n// derived from this software without specific prior written permission.\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n// DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY\n// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n// */\n// // TinyEXR contains some OpenEXR code, which is licensed under ------------\n// ///////////////////////////////////////////////////////////////////////////\n// //\n// // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas\n// // Digital Ltd. LLC\n// //\n// // All rights reserved.\n// //\n// // Redistribution and use in source and binary forms, with or without\n// // modification, are permitted provided that the following conditions are\n// // met:\n// // * Redistributions of source code must retain the above copyright\n// // notice, this list of conditions and the following disclaimer.\n// // * Redistributions in binary form must reproduce the above\n// // copyright notice, this list of conditions and the following disclaimer\n// // in the documentation and/or other materials provided with the\n// // distribution.\n// // * Neither the name of Industrial Light & Magic nor the names of\n// // its contributors may be used to endorse or promote products derived\n// // from this software without specific prior written permission.\n// //\n// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// // \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n// //\n// ///////////////////////////////////////////////////////////////////////////\n// // End of OpenEXR license -------------------------------------------------\n/**\n * Loader for .exr file format\n * #4RN0VF#151: PIZ compression\n * #4RN0VF#146: ZIP compression\n * #4RN0VF#149: RLE compression\n * #4RN0VF#150: PXR24 compression\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport class _ExrTextureLoader {\n constructor() {\n /**\n * Defines whether the loader supports cascade loading the different faces.\n */\n this.supportCascades = false;\n }\n /**\n * Uploads the cube texture data to the WebGL texture. It has already been bound.\n * @param _data contains the texture data\n * @param _texture defines the BabylonJS internal texture\n * @param _createPolynomials will be true if polynomials have been requested\n * @param _onLoad defines the callback to trigger once the texture is ready\n * @param _onError defines the callback to trigger in case of error\n */\n loadCubeData(_data, _texture, _createPolynomials, _onLoad, _onError) {\n // eslint-disable-next-line no-throw-literal\n throw \".exr not supported in Cube.\";\n }\n /**\n * Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.\n * @param data contains the texture data\n * @param texture defines the BabylonJS internal texture\n * @param callback defines the method to call once ready to upload\n */\n async loadData(data, texture, callback) {\n const dataView = new DataView(data.buffer);\n const offset = { value: 0 };\n const header = GetExrHeader(dataView, offset);\n const decoder = await CreateDecoderAsync(header, dataView, offset, ExrLoaderGlobalConfiguration.DefaultOutputType);\n ScanData(decoder, header, dataView, offset);\n // Updating texture\n const width = header.dataWindow.xMax - header.dataWindow.xMin + 1;\n const height = header.dataWindow.yMax - header.dataWindow.yMin + 1;\n callback(width, height, texture.generateMipMaps, false, () => {\n const engine = texture.getEngine();\n texture.format = header.format;\n texture.type = decoder.textureType;\n texture.invertY = false;\n texture._gammaSpace = !header.linearSpace;\n if (decoder.byteArray) {\n engine._uploadDataToTextureDirectly(texture, decoder.byteArray, 0, 0, undefined, true);\n }\n });\n }\n}\n"],"mappings":";AAAA,SAASA,YAAY,QAAQ,2BAA2B;AACxD,SAASC,kBAAkB,EAAEC,QAAQ,QAAQ,4BAA4B;AACzE,SAASC,4BAA4B,QAAQ,kCAAkC;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,iBAAiB,CAAC;EAC3BC,WAAWA,CAAA,EAAG;IACV;AACR;AACA;IACQ,IAAI,CAACC,eAAe,GAAG,KAAK;EAChC;EACA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;EACIC,YAAYA,CAACC,KAAK,EAAEC,QAAQ,EAAEC,kBAAkB,EAAEC,OAAO,EAAEC,QAAQ,EAAE;IACjE;IACA,MAAM,6BAA6B;EACvC;EACA;AACJ;AACA;AACA;AACA;AACA;EACUC,QAAQA,CAACC,IAAI,EAAEC,OAAO,EAAEC,QAAQ,EAAE;IAAA,OAAAC,iBAAA;MACpC,MAAMC,QAAQ,GAAG,IAAIC,QAAQ,CAACL,IAAI,CAACM,MAAM,CAAC;MAC1C,MAAMC,MAAM,GAAG;QAAEC,KAAK,EAAE;MAAE,CAAC;MAC3B,MAAMC,MAAM,GAAGvB,YAAY,CAACkB,QAAQ,EAAEG,MAAM,CAAC;MAC7C,MAAMG,OAAO,SAASvB,kBAAkB,CAACsB,MAAM,EAAEL,QAAQ,EAAEG,MAAM,EAAElB,4BAA4B,CAACsB,iBAAiB,CAAC;MAClHvB,QAAQ,CAACsB,OAAO,EAAED,MAAM,EAAEL,QAAQ,EAAEG,MAAM,CAAC;MAC3C;MACA,MAAMK,KAAK,GAAGH,MAAM,CAACI,UAAU,CAACC,IAAI,GAAGL,MAAM,CAACI,UAAU,CAACE,IAAI,GAAG,CAAC;MACjE,MAAMC,MAAM,GAAGP,MAAM,CAACI,UAAU,CAACI,IAAI,GAAGR,MAAM,CAACI,UAAU,CAACK,IAAI,GAAG,CAAC;MAClEhB,QAAQ,CAACU,KAAK,EAAEI,MAAM,EAAEf,OAAO,CAACkB,eAAe,EAAE,KAAK,EAAE,MAAM;QAC1D,MAAMC,MAAM,GAAGnB,OAAO,CAACoB,SAAS,CAAC,CAAC;QAClCpB,OAAO,CAACqB,MAAM,GAAGb,MAAM,CAACa,MAAM;QAC9BrB,OAAO,CAACsB,IAAI,GAAGb,OAAO,CAACc,WAAW;QAClCvB,OAAO,CAACwB,OAAO,GAAG,KAAK;QACvBxB,OAAO,CAACyB,WAAW,GAAG,CAACjB,MAAM,CAACkB,WAAW;QACzC,IAAIjB,OAAO,CAACkB,SAAS,EAAE;UACnBR,MAAM,CAACS,4BAA4B,CAAC5B,OAAO,EAAES,OAAO,CAACkB,SAAS,EAAE,CAAC,EAAE,CAAC,EAAEE,SAAS,EAAE,IAAI,CAAC;QAC1F;MACJ,CAAC,CAAC;IAAC;EACP;AACJ","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
|