@babylonjs/viewer 7.41.0 → 7.41.1-alpha

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.
Files changed (619) hide show
  1. package/assets/photoStudio.env +0 -0
  2. package/dist/babylon-viewer.esm.js +2 -0
  3. package/dist/babylon-viewer.esm.js.map +1 -0
  4. package/dist/babylon-viewer.esm.min.js +2 -0
  5. package/dist/babylon-viewer.esm.min.js.map +1 -0
  6. package/dist/chunks/EXT_lights_ies-BS2USlck.esm.min.js +2 -0
  7. package/dist/chunks/EXT_lights_ies-BS2USlck.esm.min.js.map +1 -0
  8. package/dist/chunks/EXT_lights_ies-C-joQ5O4.esm.js +84 -0
  9. package/dist/chunks/EXT_lights_ies-C-joQ5O4.esm.js.map +1 -0
  10. package/dist/chunks/EXT_lights_image_based-C3wbbb5Z.esm.js +171 -0
  11. package/dist/chunks/EXT_lights_image_based-C3wbbb5Z.esm.js.map +1 -0
  12. package/dist/chunks/EXT_lights_image_based-DDdRDnM2.esm.min.js +2 -0
  13. package/dist/chunks/EXT_lights_image_based-DDdRDnM2.esm.min.js.map +1 -0
  14. package/dist/chunks/EXT_mesh_gpu_instancing-AXAnRQN7.esm.js +86 -0
  15. package/dist/chunks/EXT_mesh_gpu_instancing-AXAnRQN7.esm.js.map +1 -0
  16. package/dist/chunks/EXT_mesh_gpu_instancing-BcjPo6uC.esm.min.js +2 -0
  17. package/dist/chunks/EXT_mesh_gpu_instancing-BcjPo6uC.esm.min.js.map +1 -0
  18. package/dist/chunks/EXT_meshopt_compression-DlUkQB2P.esm.js +134 -0
  19. package/dist/chunks/EXT_meshopt_compression-DlUkQB2P.esm.js.map +1 -0
  20. package/dist/chunks/EXT_meshopt_compression-yJ4OpORd.esm.min.js +2 -0
  21. package/dist/chunks/EXT_meshopt_compression-yJ4OpORd.esm.min.js.map +1 -0
  22. package/dist/chunks/EXT_texture_avif-BQWbvJfK.esm.min.js +2 -0
  23. package/dist/chunks/EXT_texture_avif-BQWbvJfK.esm.min.js.map +1 -0
  24. package/dist/chunks/EXT_texture_avif-C0pGpnGv.esm.js +44 -0
  25. package/dist/chunks/EXT_texture_avif-C0pGpnGv.esm.js.map +1 -0
  26. package/dist/chunks/EXT_texture_webp-Dd7Uqtmh.esm.min.js +2 -0
  27. package/dist/chunks/EXT_texture_webp-Dd7Uqtmh.esm.min.js.map +1 -0
  28. package/dist/chunks/EXT_texture_webp-DehlrnW-.esm.js +43 -0
  29. package/dist/chunks/EXT_texture_webp-DehlrnW-.esm.js.map +1 -0
  30. package/dist/chunks/ExtrasAsMetadata-C5NMuDj4.esm.js +64 -0
  31. package/dist/chunks/ExtrasAsMetadata-C5NMuDj4.esm.js.map +1 -0
  32. package/dist/chunks/ExtrasAsMetadata-Cp3LHdoG.esm.min.js +2 -0
  33. package/dist/chunks/ExtrasAsMetadata-Cp3LHdoG.esm.min.js.map +1 -0
  34. package/dist/chunks/KHR_animation_pointer-DEBOwDXh.esm.min.js +2 -0
  35. package/dist/chunks/KHR_animation_pointer-DEBOwDXh.esm.min.js.map +1 -0
  36. package/dist/chunks/KHR_animation_pointer-Dx1OeG2b.esm.js +352 -0
  37. package/dist/chunks/KHR_animation_pointer-Dx1OeG2b.esm.js.map +1 -0
  38. package/dist/chunks/KHR_draco_mesh_compression-Ch0QOlBL.esm.min.js +2 -0
  39. package/dist/chunks/KHR_draco_mesh_compression-Ch0QOlBL.esm.min.js.map +1 -0
  40. package/dist/chunks/KHR_draco_mesh_compression-D59SFLyo.esm.js +610 -0
  41. package/dist/chunks/KHR_draco_mesh_compression-D59SFLyo.esm.js.map +1 -0
  42. package/dist/chunks/KHR_interactivity-Blj_9jts.esm.min.js +2 -0
  43. package/dist/chunks/KHR_interactivity-Blj_9jts.esm.min.js.map +1 -0
  44. package/dist/chunks/KHR_interactivity-CR0LYUa7.esm.js +4033 -0
  45. package/dist/chunks/KHR_interactivity-CR0LYUa7.esm.js.map +1 -0
  46. package/dist/chunks/KHR_lights_punctual--w0a62AP.esm.js +581 -0
  47. package/dist/chunks/KHR_lights_punctual--w0a62AP.esm.js.map +1 -0
  48. package/dist/chunks/KHR_lights_punctual-BojffBbG.esm.min.js +2 -0
  49. package/dist/chunks/KHR_lights_punctual-BojffBbG.esm.min.js.map +1 -0
  50. package/dist/chunks/KHR_materials_anisotropy-BPtHWkOQ.esm.js +65 -0
  51. package/dist/chunks/KHR_materials_anisotropy-BPtHWkOQ.esm.js.map +1 -0
  52. package/dist/chunks/KHR_materials_anisotropy-DU5_bnCL.esm.min.js +2 -0
  53. package/dist/chunks/KHR_materials_anisotropy-DU5_bnCL.esm.min.js.map +1 -0
  54. package/dist/chunks/KHR_materials_clearcoat-BBuRlPhc.esm.min.js +2 -0
  55. package/dist/chunks/KHR_materials_clearcoat-BBuRlPhc.esm.min.js.map +1 -0
  56. package/dist/chunks/KHR_materials_clearcoat-Eg0xbuWN.esm.js +96 -0
  57. package/dist/chunks/KHR_materials_clearcoat-Eg0xbuWN.esm.js.map +1 -0
  58. package/dist/chunks/KHR_materials_diffuse_transmission-Bkzk60Y5.esm.min.js +2 -0
  59. package/dist/chunks/KHR_materials_diffuse_transmission-Bkzk60Y5.esm.min.js.map +1 -0
  60. package/dist/chunks/KHR_materials_diffuse_transmission-C3DaLgRY.esm.js +97 -0
  61. package/dist/chunks/KHR_materials_diffuse_transmission-C3DaLgRY.esm.js.map +1 -0
  62. package/dist/chunks/KHR_materials_dispersion-DL_XFhxj.esm.js +62 -0
  63. package/dist/chunks/KHR_materials_dispersion-DL_XFhxj.esm.js.map +1 -0
  64. package/dist/chunks/KHR_materials_dispersion-DbMQPBgM.esm.min.js +2 -0
  65. package/dist/chunks/KHR_materials_dispersion-DbMQPBgM.esm.min.js.map +1 -0
  66. package/dist/chunks/KHR_materials_emissive_strength-BuHyjtBD.esm.js +55 -0
  67. package/dist/chunks/KHR_materials_emissive_strength-BuHyjtBD.esm.js.map +1 -0
  68. package/dist/chunks/KHR_materials_emissive_strength-Djlr_ul3.esm.min.js +2 -0
  69. package/dist/chunks/KHR_materials_emissive_strength-Djlr_ul3.esm.min.js.map +1 -0
  70. package/dist/chunks/KHR_materials_ior-BIe6qBOo.esm.js +64 -0
  71. package/dist/chunks/KHR_materials_ior-BIe6qBOo.esm.js.map +1 -0
  72. package/dist/chunks/KHR_materials_ior-DOfaAmNY.esm.min.js +2 -0
  73. package/dist/chunks/KHR_materials_ior-DOfaAmNY.esm.min.js.map +1 -0
  74. package/dist/chunks/KHR_materials_iridescence-BgElZgUu.esm.js +72 -0
  75. package/dist/chunks/KHR_materials_iridescence-BgElZgUu.esm.js.map +1 -0
  76. package/dist/chunks/KHR_materials_iridescence-lUeo07SZ.esm.min.js +2 -0
  77. package/dist/chunks/KHR_materials_iridescence-lUeo07SZ.esm.min.js.map +1 -0
  78. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-9ShQyhJ6.esm.min.js +2 -0
  79. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-9ShQyhJ6.esm.min.js.map +1 -0
  80. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-DE5LjLg6.esm.js +81 -0
  81. package/dist/chunks/KHR_materials_pbrSpecularGlossiness-DE5LjLg6.esm.js.map +1 -0
  82. package/dist/chunks/KHR_materials_sheen-BfZe6ZFu.esm.js +85 -0
  83. package/dist/chunks/KHR_materials_sheen-BfZe6ZFu.esm.js.map +1 -0
  84. package/dist/chunks/KHR_materials_sheen-OWjuK2V4.esm.min.js +2 -0
  85. package/dist/chunks/KHR_materials_sheen-OWjuK2V4.esm.min.js.map +1 -0
  86. package/dist/chunks/KHR_materials_specular-dowPxbW3.esm.js +75 -0
  87. package/dist/chunks/KHR_materials_specular-dowPxbW3.esm.js.map +1 -0
  88. package/dist/chunks/KHR_materials_specular-nWeBZu0R.esm.min.js +2 -0
  89. package/dist/chunks/KHR_materials_specular-nWeBZu0R.esm.min.js.map +1 -0
  90. package/dist/chunks/KHR_materials_transmission-BPNQkK0O.esm.min.js +2 -0
  91. package/dist/chunks/KHR_materials_transmission-BPNQkK0O.esm.min.js.map +1 -0
  92. package/dist/chunks/KHR_materials_transmission-CHr_yLLX.esm.js +307 -0
  93. package/dist/chunks/KHR_materials_transmission-CHr_yLLX.esm.js.map +1 -0
  94. package/dist/chunks/KHR_materials_unlit-BYXpcsdj.esm.min.js +2 -0
  95. package/dist/chunks/KHR_materials_unlit-BYXpcsdj.esm.min.js.map +1 -0
  96. package/dist/chunks/KHR_materials_unlit-Cr7YsDHT.esm.js +74 -0
  97. package/dist/chunks/KHR_materials_unlit-Cr7YsDHT.esm.js.map +1 -0
  98. package/dist/chunks/KHR_materials_variants-BCVX3sJa.esm.js +262 -0
  99. package/dist/chunks/KHR_materials_variants-BCVX3sJa.esm.js.map +1 -0
  100. package/dist/chunks/KHR_materials_variants-BXzl6KpJ.esm.min.js +2 -0
  101. package/dist/chunks/KHR_materials_variants-BXzl6KpJ.esm.min.js.map +1 -0
  102. package/dist/chunks/KHR_materials_volume-BD9KEaJz.esm.min.js +2 -0
  103. package/dist/chunks/KHR_materials_volume-BD9KEaJz.esm.min.js.map +1 -0
  104. package/dist/chunks/KHR_materials_volume-DrqGUGW6.esm.js +87 -0
  105. package/dist/chunks/KHR_materials_volume-DrqGUGW6.esm.js.map +1 -0
  106. package/dist/chunks/KHR_mesh_quantization-Dg22auJA.esm.min.js +2 -0
  107. package/dist/chunks/KHR_mesh_quantization-Dg22auJA.esm.min.js.map +1 -0
  108. package/dist/chunks/KHR_mesh_quantization-hvxpvTbe.esm.js +26 -0
  109. package/dist/chunks/KHR_mesh_quantization-hvxpvTbe.esm.js.map +1 -0
  110. package/dist/chunks/KHR_node_hoverability-BDiqFmBB.esm.js +39 -0
  111. package/dist/chunks/KHR_node_hoverability-BDiqFmBB.esm.js.map +1 -0
  112. package/dist/chunks/KHR_node_hoverability-CumkOtZM.esm.min.js +2 -0
  113. package/dist/chunks/KHR_node_hoverability-CumkOtZM.esm.min.js.map +1 -0
  114. package/dist/chunks/KHR_node_visibility-BKEa-Yfj.esm.min.js +2 -0
  115. package/dist/chunks/KHR_node_visibility-BKEa-Yfj.esm.min.js.map +1 -0
  116. package/dist/chunks/KHR_node_visibility-K0fsD4Vv.esm.js +46 -0
  117. package/dist/chunks/KHR_node_visibility-K0fsD4Vv.esm.js.map +1 -0
  118. package/dist/chunks/KHR_texture_basisu-8YVY1pKo.esm.js +43 -0
  119. package/dist/chunks/KHR_texture_basisu-8YVY1pKo.esm.js.map +1 -0
  120. package/dist/chunks/KHR_texture_basisu-BM__NeSW.esm.min.js +2 -0
  121. package/dist/chunks/KHR_texture_basisu-BM__NeSW.esm.min.js.map +1 -0
  122. package/dist/chunks/KHR_texture_transform--qxpdvRw.esm.js +63 -0
  123. package/dist/chunks/KHR_texture_transform--qxpdvRw.esm.js.map +1 -0
  124. package/dist/chunks/KHR_texture_transform-C0MO-oJp.esm.min.js +2 -0
  125. package/dist/chunks/KHR_texture_transform-C0MO-oJp.esm.min.js.map +1 -0
  126. package/dist/chunks/KHR_xmp_json_ld-D9FpHvJo.esm.js +51 -0
  127. package/dist/chunks/KHR_xmp_json_ld-D9FpHvJo.esm.js.map +1 -0
  128. package/dist/chunks/KHR_xmp_json_ld-DeXPWWQE.esm.min.js +2 -0
  129. package/dist/chunks/KHR_xmp_json_ld-DeXPWWQE.esm.min.js.map +1 -0
  130. package/dist/chunks/MSFT_audio_emitter-BbICSwFH.esm.min.js +2 -0
  131. package/dist/chunks/MSFT_audio_emitter-BbICSwFH.esm.min.js.map +1 -0
  132. package/dist/chunks/MSFT_audio_emitter-Dd5lbfUc.esm.js +2201 -0
  133. package/dist/chunks/MSFT_audio_emitter-Dd5lbfUc.esm.js.map +1 -0
  134. package/dist/chunks/MSFT_lod-B0zrRF3s.esm.js +337 -0
  135. package/dist/chunks/MSFT_lod-B0zrRF3s.esm.js.map +1 -0
  136. package/dist/chunks/MSFT_lod-Bd4znUfD.esm.min.js +2 -0
  137. package/dist/chunks/MSFT_lod-Bd4znUfD.esm.min.js.map +1 -0
  138. package/dist/chunks/MSFT_minecraftMesh-CdIpMgsb.esm.min.js +2 -0
  139. package/dist/chunks/MSFT_minecraftMesh-CdIpMgsb.esm.min.js.map +1 -0
  140. package/dist/chunks/MSFT_minecraftMesh-WFc8m_Ka.esm.js +46 -0
  141. package/dist/chunks/MSFT_minecraftMesh-WFc8m_Ka.esm.js.map +1 -0
  142. package/dist/chunks/MSFT_sRGBFactors-CTbtGna8.esm.js +47 -0
  143. package/dist/chunks/MSFT_sRGBFactors-CTbtGna8.esm.js.map +1 -0
  144. package/dist/chunks/MSFT_sRGBFactors-yTSoBQJx.esm.min.js +2 -0
  145. package/dist/chunks/MSFT_sRGBFactors-yTSoBQJx.esm.min.js.map +1 -0
  146. package/dist/chunks/animationGroup-8TJDgymS.esm.js +2482 -0
  147. package/dist/chunks/animationGroup-8TJDgymS.esm.js.map +1 -0
  148. package/dist/chunks/animationGroup-toXtd3a1.esm.min.js +2 -0
  149. package/dist/chunks/animationGroup-toXtd3a1.esm.min.js.map +1 -0
  150. package/dist/chunks/assetContainer-7pMDUaac.esm.min.js +2 -0
  151. package/dist/chunks/assetContainer-7pMDUaac.esm.min.js.map +1 -0
  152. package/dist/chunks/assetContainer-DYzO0AbX.esm.js +1720 -0
  153. package/dist/chunks/assetContainer-DYzO0AbX.esm.js.map +1 -0
  154. package/dist/chunks/audioEngine-Kz4HSEXd.esm.min.js +2 -0
  155. package/dist/chunks/audioEngine-Kz4HSEXd.esm.min.js.map +1 -0
  156. package/dist/chunks/audioEngine-peiGqjr6.esm.js +305 -0
  157. package/dist/chunks/audioEngine-peiGqjr6.esm.js.map +1 -0
  158. package/dist/chunks/bakedVertexAnimation-BZvcL01J.esm.min.js +2 -0
  159. package/dist/chunks/bakedVertexAnimation-BZvcL01J.esm.min.js.map +1 -0
  160. package/dist/chunks/bakedVertexAnimation-CPflSjER.esm.js +114 -0
  161. package/dist/chunks/bakedVertexAnimation-CPflSjER.esm.js.map +1 -0
  162. package/dist/chunks/basisTextureLoader-CR0XhSAg.esm.js +600 -0
  163. package/dist/chunks/basisTextureLoader-CR0XhSAg.esm.js.map +1 -0
  164. package/dist/chunks/basisTextureLoader-DVJdcB62.esm.min.js +2 -0
  165. package/dist/chunks/basisTextureLoader-DVJdcB62.esm.min.js.map +1 -0
  166. package/dist/chunks/dds-6EdM5O6M.esm.js +540 -0
  167. package/dist/chunks/dds-6EdM5O6M.esm.js.map +1 -0
  168. package/dist/chunks/dds-DVX_K9B3.esm.min.js +2 -0
  169. package/dist/chunks/dds-DVX_K9B3.esm.min.js.map +1 -0
  170. package/dist/chunks/ddsTextureLoader-BAK7Ib2Z.esm.min.js +2 -0
  171. package/dist/chunks/ddsTextureLoader-BAK7Ib2Z.esm.min.js.map +1 -0
  172. package/dist/chunks/ddsTextureLoader-_nktVxwZ.esm.js +88 -0
  173. package/dist/chunks/ddsTextureLoader-_nktVxwZ.esm.js.map +1 -0
  174. package/dist/chunks/decalFragment-C_Cews3-.esm.js +18 -0
  175. package/dist/chunks/decalFragment-C_Cews3-.esm.js.map +1 -0
  176. package/dist/chunks/decalFragment-Dmj88EX9.esm.min.js +2 -0
  177. package/dist/chunks/decalFragment-Dmj88EX9.esm.min.js.map +1 -0
  178. package/dist/chunks/default.fragment-Bv_nR7po.esm.min.js +2 -0
  179. package/dist/chunks/default.fragment-Bv_nR7po.esm.min.js.map +1 -0
  180. package/dist/chunks/default.fragment-CkZQyJVM.esm.min.js +2 -0
  181. package/dist/chunks/default.fragment-CkZQyJVM.esm.min.js.map +1 -0
  182. package/dist/chunks/default.fragment-CyFHDykY.esm.js +446 -0
  183. package/dist/chunks/default.fragment-CyFHDykY.esm.js.map +1 -0
  184. package/dist/chunks/default.fragment-ej-2z5tS.esm.js +515 -0
  185. package/dist/chunks/default.fragment-ej-2z5tS.esm.js.map +1 -0
  186. package/dist/chunks/default.vertex-16mVOFgT.esm.js +211 -0
  187. package/dist/chunks/default.vertex-16mVOFgT.esm.js.map +1 -0
  188. package/dist/chunks/default.vertex-D--q2At3.esm.min.js +2 -0
  189. package/dist/chunks/default.vertex-D--q2At3.esm.min.js.map +1 -0
  190. package/dist/chunks/default.vertex-DDlgZTrR.esm.js +190 -0
  191. package/dist/chunks/default.vertex-DDlgZTrR.esm.js.map +1 -0
  192. package/dist/chunks/default.vertex-_jqs3KiZ.esm.min.js +2 -0
  193. package/dist/chunks/default.vertex-_jqs3KiZ.esm.min.js.map +1 -0
  194. package/dist/chunks/defaultUboDeclaration-8YG0iNg8.esm.js +15 -0
  195. package/dist/chunks/defaultUboDeclaration-8YG0iNg8.esm.js.map +1 -0
  196. package/dist/chunks/defaultUboDeclaration-BoBSRTbi.esm.js +13 -0
  197. package/dist/chunks/defaultUboDeclaration-BoBSRTbi.esm.js.map +1 -0
  198. package/dist/chunks/defaultUboDeclaration-Dt_5vo1d.esm.min.js +2 -0
  199. package/dist/chunks/defaultUboDeclaration-Dt_5vo1d.esm.min.js.map +1 -0
  200. package/dist/chunks/defaultUboDeclaration-R6gGjkAM.esm.min.js +2 -0
  201. package/dist/chunks/defaultUboDeclaration-R6gGjkAM.esm.min.js.map +1 -0
  202. package/dist/chunks/drawWrapper.functions-CKg3_9x4.esm.js +11 -0
  203. package/dist/chunks/drawWrapper.functions-CKg3_9x4.esm.js.map +1 -0
  204. package/dist/chunks/drawWrapper.functions-ng7lvueZ.esm.min.js +2 -0
  205. package/dist/chunks/drawWrapper.functions-ng7lvueZ.esm.min.js.map +1 -0
  206. package/dist/chunks/dumpTools-Bhux0wvM.esm.js +200 -0
  207. package/dist/chunks/dumpTools-Bhux0wvM.esm.js.map +1 -0
  208. package/dist/chunks/dumpTools-CHCb2UkY.esm.min.js +2 -0
  209. package/dist/chunks/dumpTools-CHCb2UkY.esm.min.js.map +1 -0
  210. package/dist/chunks/engine-DF_zE4qj.esm.js +2213 -0
  211. package/dist/chunks/engine-DF_zE4qj.esm.js.map +1 -0
  212. package/dist/chunks/engine-DVmdDcyP.esm.min.js +2 -0
  213. package/dist/chunks/engine-DVmdDcyP.esm.min.js.map +1 -0
  214. package/dist/chunks/engine.common-CvOmoKru.esm.js +1162 -0
  215. package/dist/chunks/engine.common-CvOmoKru.esm.js.map +1 -0
  216. package/dist/chunks/engine.common-DpTzktQJ.esm.min.js +2 -0
  217. package/dist/chunks/engine.common-DpTzktQJ.esm.min.js.map +1 -0
  218. package/dist/chunks/envTextureLoader-4YxGm-Px.esm.js +64 -0
  219. package/dist/chunks/envTextureLoader-4YxGm-Px.esm.js.map +1 -0
  220. package/dist/chunks/envTextureLoader-DMQui088.esm.min.js +2 -0
  221. package/dist/chunks/envTextureLoader-DMQui088.esm.min.js.map +1 -0
  222. package/dist/chunks/environmentTextureTools-BPGrTBPI.esm.min.js +2 -0
  223. package/dist/chunks/environmentTextureTools-BPGrTBPI.esm.min.js.map +1 -0
  224. package/dist/chunks/environmentTextureTools-DvkpsqkN.esm.js +382 -0
  225. package/dist/chunks/environmentTextureTools-DvkpsqkN.esm.js.map +1 -0
  226. package/dist/chunks/exrTextureLoader-BRkB54sO.esm.js +1683 -0
  227. package/dist/chunks/exrTextureLoader-BRkB54sO.esm.js.map +1 -0
  228. package/dist/chunks/exrTextureLoader-BtN7_zst.esm.min.js +2 -0
  229. package/dist/chunks/exrTextureLoader-BtN7_zst.esm.min.js.map +1 -0
  230. package/dist/chunks/fogFragment-BrGGFaiu.esm.js +101 -0
  231. package/dist/chunks/fogFragment-BrGGFaiu.esm.js.map +1 -0
  232. package/dist/chunks/fogFragment-ByOwwQur.esm.min.js +2 -0
  233. package/dist/chunks/fogFragment-ByOwwQur.esm.min.js.map +1 -0
  234. package/dist/chunks/fogFragment-Chod24nu.esm.min.js +2 -0
  235. package/dist/chunks/fogFragment-Chod24nu.esm.min.js.map +1 -0
  236. package/dist/chunks/fogFragment-gZfybCpt.esm.js +102 -0
  237. package/dist/chunks/fogFragment-gZfybCpt.esm.js.map +1 -0
  238. package/dist/chunks/fresnelFunction-BdEia8ob.esm.min.js +2 -0
  239. package/dist/chunks/fresnelFunction-BdEia8ob.esm.min.js.map +1 -0
  240. package/dist/chunks/fresnelFunction-DBlxfmri.esm.js +12 -0
  241. package/dist/chunks/fresnelFunction-DBlxfmri.esm.js.map +1 -0
  242. package/dist/chunks/glTFLoader-D4C1IGb3.esm.min.js +2 -0
  243. package/dist/chunks/glTFLoader-D4C1IGb3.esm.min.js.map +1 -0
  244. package/dist/chunks/glTFLoader-fUFiWvYb.esm.js +7693 -0
  245. package/dist/chunks/glTFLoader-fUFiWvYb.esm.js.map +1 -0
  246. package/dist/chunks/glTFLoaderAnimation-BB_Vw079.esm.min.js +2 -0
  247. package/dist/chunks/glTFLoaderAnimation-BB_Vw079.esm.min.js.map +1 -0
  248. package/dist/chunks/glTFLoaderAnimation-CttmY50U.esm.js +77 -0
  249. package/dist/chunks/glTFLoaderAnimation-CttmY50U.esm.js.map +1 -0
  250. package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js +2 -0
  251. package/dist/chunks/gltfPathToObjectConverter-Dyt_Y9jE.esm.min.js.map +1 -0
  252. package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js +67 -0
  253. package/dist/chunks/gltfPathToObjectConverter-GcUmfOyo.esm.js.map +1 -0
  254. package/dist/chunks/harmonicsFunctions-B0Rp1hEo.esm.min.js +2 -0
  255. package/dist/chunks/harmonicsFunctions-B0Rp1hEo.esm.min.js.map +1 -0
  256. package/dist/chunks/harmonicsFunctions-Cca_z552.esm.js +34 -0
  257. package/dist/chunks/harmonicsFunctions-Cca_z552.esm.js.map +1 -0
  258. package/dist/chunks/harmonicsFunctions-D4ID83NC.esm.min.js +2 -0
  259. package/dist/chunks/harmonicsFunctions-D4ID83NC.esm.min.js.map +1 -0
  260. package/dist/chunks/harmonicsFunctions-HJ5dbl0w.esm.js +35 -0
  261. package/dist/chunks/harmonicsFunctions-HJ5dbl0w.esm.js.map +1 -0
  262. package/dist/chunks/hdrTextureLoader-C3kqy6YV.esm.js +253 -0
  263. package/dist/chunks/hdrTextureLoader-C3kqy6YV.esm.js.map +1 -0
  264. package/dist/chunks/hdrTextureLoader-Dhlluz4z.esm.min.js +2 -0
  265. package/dist/chunks/hdrTextureLoader-Dhlluz4z.esm.min.js.map +1 -0
  266. package/dist/chunks/helperFunctions-BJotVqUd.esm.min.js +2 -0
  267. package/dist/chunks/helperFunctions-BJotVqUd.esm.min.js.map +1 -0
  268. package/dist/chunks/helperFunctions-C66wRWtu.esm.js +110 -0
  269. package/dist/chunks/helperFunctions-C66wRWtu.esm.js.map +1 -0
  270. package/dist/chunks/helperFunctions-DwEZ9rqh.esm.min.js +2 -0
  271. package/dist/chunks/helperFunctions-DwEZ9rqh.esm.min.js.map +1 -0
  272. package/dist/chunks/helperFunctions-gnki_9Kj.esm.js +83 -0
  273. package/dist/chunks/helperFunctions-gnki_9Kj.esm.js.map +1 -0
  274. package/dist/chunks/iesTextureLoader-QDs2Cwy5.esm.js +189 -0
  275. package/dist/chunks/iesTextureLoader-QDs2Cwy5.esm.js.map +1 -0
  276. package/dist/chunks/iesTextureLoader-pwA6Q4HK.esm.min.js +2 -0
  277. package/dist/chunks/iesTextureLoader-pwA6Q4HK.esm.min.js.map +1 -0
  278. package/dist/chunks/index-C6hXZyZb.esm.js +74889 -0
  279. package/dist/chunks/index-C6hXZyZb.esm.js.map +1 -0
  280. package/dist/chunks/index-rZVkfTE6.esm.min.js +57 -0
  281. package/dist/chunks/index-rZVkfTE6.esm.min.js.map +1 -0
  282. package/dist/chunks/ktxTextureLoader-jVu-Sj-0.esm.js +814 -0
  283. package/dist/chunks/ktxTextureLoader-jVu-Sj-0.esm.js.map +1 -0
  284. package/dist/chunks/ktxTextureLoader-zG9azrZF.esm.min.js +2 -0
  285. package/dist/chunks/ktxTextureLoader-zG9azrZF.esm.min.js.map +1 -0
  286. package/dist/chunks/logDepthDeclaration-0cA1pTvQ.esm.min.js +2 -0
  287. package/dist/chunks/logDepthDeclaration-0cA1pTvQ.esm.min.js.map +1 -0
  288. package/dist/chunks/logDepthDeclaration-CYxYhXIS.esm.js +11 -0
  289. package/dist/chunks/logDepthDeclaration-CYxYhXIS.esm.js.map +1 -0
  290. package/dist/chunks/logDepthDeclaration-D4KGxdX-.esm.min.js +2 -0
  291. package/dist/chunks/logDepthDeclaration-D4KGxdX-.esm.min.js.map +1 -0
  292. package/dist/chunks/logDepthDeclaration-DJlt2-H5.esm.js +35 -0
  293. package/dist/chunks/logDepthDeclaration-DJlt2-H5.esm.js.map +1 -0
  294. package/dist/chunks/logDepthVertex-BS2JEtXA.esm.min.js +2 -0
  295. package/dist/chunks/logDepthVertex-BS2JEtXA.esm.min.js.map +1 -0
  296. package/dist/chunks/logDepthVertex-DKPfA10X.esm.js +81 -0
  297. package/dist/chunks/logDepthVertex-DKPfA10X.esm.js.map +1 -0
  298. package/dist/chunks/logDepthVertex-ojTShW5I.esm.js +77 -0
  299. package/dist/chunks/logDepthVertex-ojTShW5I.esm.js.map +1 -0
  300. package/dist/chunks/logDepthVertex-v-0pHNc-.esm.min.js +2 -0
  301. package/dist/chunks/logDepthVertex-v-0pHNc-.esm.min.js.map +1 -0
  302. package/dist/chunks/mainUVVaryingDeclaration-BAzmbS0W.esm.min.js +2 -0
  303. package/dist/chunks/mainUVVaryingDeclaration-BAzmbS0W.esm.min.js.map +1 -0
  304. package/dist/chunks/mainUVVaryingDeclaration-Cnux1jkK.esm.js +11 -0
  305. package/dist/chunks/mainUVVaryingDeclaration-Cnux1jkK.esm.js.map +1 -0
  306. package/dist/chunks/mainUVVaryingDeclaration-CwS0hUUZ.esm.min.js +2 -0
  307. package/dist/chunks/mainUVVaryingDeclaration-CwS0hUUZ.esm.min.js.map +1 -0
  308. package/dist/chunks/mainUVVaryingDeclaration-DCawby1A.esm.js +11 -0
  309. package/dist/chunks/mainUVVaryingDeclaration-DCawby1A.esm.js.map +1 -0
  310. package/dist/chunks/mesh.vertexData.functions-B_pMCAzZ.esm.js +119 -0
  311. package/dist/chunks/mesh.vertexData.functions-B_pMCAzZ.esm.js.map +1 -0
  312. package/dist/chunks/mesh.vertexData.functions-Bo7e6Of9.esm.min.js +2 -0
  313. package/dist/chunks/mesh.vertexData.functions-Bo7e6Of9.esm.min.js.map +1 -0
  314. package/dist/chunks/meshUboDeclaration-QvH0RgeZ.esm.js +26 -0
  315. package/dist/chunks/meshUboDeclaration-QvH0RgeZ.esm.js.map +1 -0
  316. package/dist/chunks/meshUboDeclaration-g2s_cYI1.esm.min.js +2 -0
  317. package/dist/chunks/meshUboDeclaration-g2s_cYI1.esm.min.js.map +1 -0
  318. package/dist/chunks/objFileLoader-BOutXdVR.esm.min.js +2 -0
  319. package/dist/chunks/objFileLoader-BOutXdVR.esm.min.js.map +1 -0
  320. package/dist/chunks/objFileLoader-BPwrX8RK.esm.js +1338 -0
  321. package/dist/chunks/objFileLoader-BPwrX8RK.esm.js.map +1 -0
  322. package/dist/chunks/oitFragment-CmcWUhsZ.esm.js +1240 -0
  323. package/dist/chunks/oitFragment-CmcWUhsZ.esm.js.map +1 -0
  324. package/dist/chunks/oitFragment-D8XBQ6Wa.esm.js +1078 -0
  325. package/dist/chunks/oitFragment-D8XBQ6Wa.esm.js.map +1 -0
  326. package/dist/chunks/oitFragment-DgAlmoHs.esm.min.js +2 -0
  327. package/dist/chunks/oitFragment-DgAlmoHs.esm.min.js.map +1 -0
  328. package/dist/chunks/oitFragment-DpJ5xGhy.esm.min.js +2 -0
  329. package/dist/chunks/oitFragment-DpJ5xGhy.esm.min.js.map +1 -0
  330. package/dist/chunks/pass.fragment--XRaXRhU.esm.js +15 -0
  331. package/dist/chunks/pass.fragment--XRaXRhU.esm.js.map +1 -0
  332. package/dist/chunks/pass.fragment-5Q3qXxDe.esm.min.js +2 -0
  333. package/dist/chunks/pass.fragment-5Q3qXxDe.esm.min.js.map +1 -0
  334. package/dist/chunks/pass.fragment-BBLiyU_i.esm.min.js +2 -0
  335. package/dist/chunks/pass.fragment-BBLiyU_i.esm.min.js.map +1 -0
  336. package/dist/chunks/pass.fragment-DI4ZYZJe.esm.js +15 -0
  337. package/dist/chunks/pass.fragment-DI4ZYZJe.esm.js.map +1 -0
  338. package/dist/chunks/pbr.fragment-C7xQS4ZJ.esm.js +3269 -0
  339. package/dist/chunks/pbr.fragment-C7xQS4ZJ.esm.js.map +1 -0
  340. package/dist/chunks/pbr.fragment-Ddxaik8T.esm.min.js +2 -0
  341. package/dist/chunks/pbr.fragment-Ddxaik8T.esm.min.js.map +1 -0
  342. package/dist/chunks/pbr.fragment-fky04gH_.esm.js +3222 -0
  343. package/dist/chunks/pbr.fragment-fky04gH_.esm.js.map +1 -0
  344. package/dist/chunks/pbr.fragment-ya1zai4w.esm.min.js +2 -0
  345. package/dist/chunks/pbr.fragment-ya1zai4w.esm.min.js.map +1 -0
  346. package/dist/chunks/pbr.vertex-BPEYHoRM.esm.js +223 -0
  347. package/dist/chunks/pbr.vertex-BPEYHoRM.esm.js.map +1 -0
  348. package/dist/chunks/pbr.vertex-BXcMYADF.esm.js +348 -0
  349. package/dist/chunks/pbr.vertex-BXcMYADF.esm.js.map +1 -0
  350. package/dist/chunks/pbr.vertex-BjA08auU.esm.min.js +2 -0
  351. package/dist/chunks/pbr.vertex-BjA08auU.esm.min.js.map +1 -0
  352. package/dist/chunks/pbr.vertex-Cx2V3lNf.esm.min.js +2 -0
  353. package/dist/chunks/pbr.vertex-Cx2V3lNf.esm.min.js.map +1 -0
  354. package/dist/chunks/postprocess.vertex-BHpQrNSx.esm.min.js +2 -0
  355. package/dist/chunks/postprocess.vertex-BHpQrNSx.esm.min.js.map +1 -0
  356. package/dist/chunks/postprocess.vertex-DnDbk0tq.esm.js +20 -0
  357. package/dist/chunks/postprocess.vertex-DnDbk0tq.esm.js.map +1 -0
  358. package/dist/chunks/rawTexture-CWiRIto8.esm.js +191 -0
  359. package/dist/chunks/rawTexture-CWiRIto8.esm.js.map +1 -0
  360. package/dist/chunks/rawTexture-DX8V9PEj.esm.min.js +2 -0
  361. package/dist/chunks/rawTexture-DX8V9PEj.esm.min.js.map +1 -0
  362. package/dist/chunks/ray-ix7SqYNQ.esm.min.js +2 -0
  363. package/dist/chunks/ray-ix7SqYNQ.esm.min.js.map +1 -0
  364. package/dist/chunks/ray-nTZBkOil.esm.js +946 -0
  365. package/dist/chunks/ray-nTZBkOil.esm.js.map +1 -0
  366. package/dist/chunks/rgbdDecode.fragment-Be3ofvlt.esm.min.js +2 -0
  367. package/dist/chunks/rgbdDecode.fragment-Be3ofvlt.esm.min.js.map +1 -0
  368. package/dist/chunks/rgbdDecode.fragment-C05QJpT2.esm.js +13 -0
  369. package/dist/chunks/rgbdDecode.fragment-C05QJpT2.esm.js.map +1 -0
  370. package/dist/chunks/rgbdDecode.fragment-D3SYBclQ.esm.min.js +2 -0
  371. package/dist/chunks/rgbdDecode.fragment-D3SYBclQ.esm.min.js.map +1 -0
  372. package/dist/chunks/rgbdDecode.fragment-DBG6KfKF.esm.js +13 -0
  373. package/dist/chunks/rgbdDecode.fragment-DBG6KfKF.esm.js.map +1 -0
  374. package/dist/chunks/rgbdEncode.fragment-BlhtohrO.esm.js +13 -0
  375. package/dist/chunks/rgbdEncode.fragment-BlhtohrO.esm.js.map +1 -0
  376. package/dist/chunks/rgbdEncode.fragment-BmJKYw6A.esm.min.js +2 -0
  377. package/dist/chunks/rgbdEncode.fragment-BmJKYw6A.esm.min.js.map +1 -0
  378. package/dist/chunks/rgbdEncode.fragment-dr2kGjSO.esm.js +13 -0
  379. package/dist/chunks/rgbdEncode.fragment-dr2kGjSO.esm.js.map +1 -0
  380. package/dist/chunks/rgbdEncode.fragment-hXPzg1p5.esm.min.js +2 -0
  381. package/dist/chunks/rgbdEncode.fragment-hXPzg1p5.esm.min.js.map +1 -0
  382. package/dist/chunks/splatFileLoader-Bs42LtsP.esm.min.js +2 -0
  383. package/dist/chunks/splatFileLoader-Bs42LtsP.esm.min.js.map +1 -0
  384. package/dist/chunks/splatFileLoader-Dp33YOem.esm.js +3379 -0
  385. package/dist/chunks/splatFileLoader-Dp33YOem.esm.js.map +1 -0
  386. package/dist/chunks/spotLight-C0NmKeem.esm.js +701 -0
  387. package/dist/chunks/spotLight-C0NmKeem.esm.js.map +1 -0
  388. package/dist/chunks/spotLight-CcuCNdES.esm.min.js +2 -0
  389. package/dist/chunks/spotLight-CcuCNdES.esm.min.js.map +1 -0
  390. package/dist/chunks/standardMaterial-C1E5n_4w.esm.min.js +2 -0
  391. package/dist/chunks/standardMaterial-C1E5n_4w.esm.min.js.map +1 -0
  392. package/dist/chunks/standardMaterial-v_D8QA4q.esm.js +1807 -0
  393. package/dist/chunks/standardMaterial-v_D8QA4q.esm.js.map +1 -0
  394. package/dist/chunks/stlFileLoader-DC2IRQDj.esm.min.js +2 -0
  395. package/dist/chunks/stlFileLoader-DC2IRQDj.esm.min.js.map +1 -0
  396. package/dist/chunks/stlFileLoader-LRHEIFfU.esm.js +238 -0
  397. package/dist/chunks/stlFileLoader-LRHEIFfU.esm.js.map +1 -0
  398. package/dist/chunks/tgaTextureLoader-2ekJC0En.esm.js +349 -0
  399. package/dist/chunks/tgaTextureLoader-2ekJC0En.esm.js.map +1 -0
  400. package/dist/chunks/tgaTextureLoader-Clj6zUK-.esm.min.js +2 -0
  401. package/dist/chunks/tgaTextureLoader-Clj6zUK-.esm.min.js.map +1 -0
  402. package/dist/chunks/thinEngine-DksimP2U.esm.js +3848 -0
  403. package/dist/chunks/thinEngine-DksimP2U.esm.js.map +1 -0
  404. package/dist/chunks/thinEngine-tsALaFYH.esm.min.js +2 -0
  405. package/dist/chunks/thinEngine-tsALaFYH.esm.min.js.map +1 -0
  406. package/dist/chunks/thinInstanceMesh-B8AW0Oa2.esm.js +314 -0
  407. package/dist/chunks/thinInstanceMesh-B8AW0Oa2.esm.js.map +1 -0
  408. package/dist/chunks/thinInstanceMesh-kCGEJ0-e.esm.min.js +2 -0
  409. package/dist/chunks/thinInstanceMesh-kCGEJ0-e.esm.min.js.map +1 -0
  410. package/dist/chunks/vertexColorMixing-Bjijk3lU.esm.min.js +2 -0
  411. package/dist/chunks/vertexColorMixing-Bjijk3lU.esm.min.js.map +1 -0
  412. package/dist/chunks/vertexColorMixing-D9917nJN.esm.js +428 -0
  413. package/dist/chunks/vertexColorMixing-D9917nJN.esm.js.map +1 -0
  414. package/dist/chunks/vertexColorMixing-DgthWrKf.esm.min.js +2 -0
  415. package/dist/chunks/vertexColorMixing-DgthWrKf.esm.min.js.map +1 -0
  416. package/dist/chunks/vertexColorMixing-U1SA6UK3.esm.js +538 -0
  417. package/dist/chunks/vertexColorMixing-U1SA6UK3.esm.js.map +1 -0
  418. package/dist/chunks/webgpuEngine-BOGR1D8F.esm.min.js +2 -0
  419. package/dist/chunks/webgpuEngine-BOGR1D8F.esm.min.js.map +1 -0
  420. package/dist/chunks/webgpuEngine-BrzOpZ-2.esm.js +11533 -0
  421. package/dist/chunks/webgpuEngine-BrzOpZ-2.esm.js.map +1 -0
  422. package/dist/chunks/workerPool-BUOov2K1.esm.js +122 -0
  423. package/dist/chunks/workerPool-BUOov2K1.esm.js.map +1 -0
  424. package/dist/chunks/workerPool-BWHiDmEZ.esm.min.js +2 -0
  425. package/dist/chunks/workerPool-BWHiDmEZ.esm.min.js.map +1 -0
  426. package/lib/index.d.ts +591 -0
  427. package/lib/index.js +2165 -0
  428. package/lib/index.js.map +1 -0
  429. package/package.json +19 -28
  430. package/readme.md +28 -28
  431. package/configuration/configuration.d.ts +0 -107
  432. package/configuration/configuration.js +0 -16
  433. package/configuration/configuration.js.map +0 -1
  434. package/configuration/configurationCompatibility.d.ts +0 -8
  435. package/configuration/configurationCompatibility.js +0 -66
  436. package/configuration/configurationCompatibility.js.map +0 -1
  437. package/configuration/configurationContainer.d.ts +0 -10
  438. package/configuration/configurationContainer.js +0 -10
  439. package/configuration/configurationContainer.js.map +0 -1
  440. package/configuration/globals.d.ts +0 -6
  441. package/configuration/globals.js +0 -18
  442. package/configuration/globals.js.map +0 -1
  443. package/configuration/index.d.ts +0 -2
  444. package/configuration/index.js +0 -4
  445. package/configuration/index.js.map +0 -1
  446. package/configuration/interfaces/cameraConfiguration.d.ts +0 -31
  447. package/configuration/interfaces/cameraConfiguration.js +0 -2
  448. package/configuration/interfaces/cameraConfiguration.js.map +0 -1
  449. package/configuration/interfaces/colorGradingConfiguration.d.ts +0 -81
  450. package/configuration/interfaces/colorGradingConfiguration.js +0 -2
  451. package/configuration/interfaces/colorGradingConfiguration.js.map +0 -1
  452. package/configuration/interfaces/defaultRenderingPipelineConfiguration.d.ts +0 -20
  453. package/configuration/interfaces/defaultRenderingPipelineConfiguration.js +0 -2
  454. package/configuration/interfaces/defaultRenderingPipelineConfiguration.js.map +0 -1
  455. package/configuration/interfaces/environmentMapConfiguration.d.ts +0 -22
  456. package/configuration/interfaces/environmentMapConfiguration.js +0 -2
  457. package/configuration/interfaces/environmentMapConfiguration.js.map +0 -1
  458. package/configuration/interfaces/groundConfiguration.d.ts +0 -24
  459. package/configuration/interfaces/groundConfiguration.js +0 -2
  460. package/configuration/interfaces/groundConfiguration.js.map +0 -1
  461. package/configuration/interfaces/imageProcessingConfiguration.d.ts +0 -45
  462. package/configuration/interfaces/imageProcessingConfiguration.js +0 -2
  463. package/configuration/interfaces/imageProcessingConfiguration.js.map +0 -1
  464. package/configuration/interfaces/index.d.ts +0 -15
  465. package/configuration/interfaces/index.js +0 -16
  466. package/configuration/interfaces/index.js.map +0 -1
  467. package/configuration/interfaces/lightConfiguration.d.ts +0 -60
  468. package/configuration/interfaces/lightConfiguration.js +0 -2
  469. package/configuration/interfaces/lightConfiguration.js.map +0 -1
  470. package/configuration/interfaces/modelAnimationConfiguration.d.ts +0 -26
  471. package/configuration/interfaces/modelAnimationConfiguration.js +0 -2
  472. package/configuration/interfaces/modelAnimationConfiguration.js.map +0 -1
  473. package/configuration/interfaces/modelConfiguration.d.ts +0 -65
  474. package/configuration/interfaces/modelConfiguration.js +0 -2
  475. package/configuration/interfaces/modelConfiguration.js.map +0 -1
  476. package/configuration/interfaces/observersConfiguration.d.ts +0 -5
  477. package/configuration/interfaces/observersConfiguration.js +0 -2
  478. package/configuration/interfaces/observersConfiguration.js.map +0 -1
  479. package/configuration/interfaces/sceneConfiguration.d.ts +0 -48
  480. package/configuration/interfaces/sceneConfiguration.js +0 -2
  481. package/configuration/interfaces/sceneConfiguration.js.map +0 -1
  482. package/configuration/interfaces/sceneOptimizerConfiguration.d.ts +0 -23
  483. package/configuration/interfaces/sceneOptimizerConfiguration.js +0 -2
  484. package/configuration/interfaces/sceneOptimizerConfiguration.js.map +0 -1
  485. package/configuration/interfaces/skyboxConfiguration.d.ts +0 -21
  486. package/configuration/interfaces/skyboxConfiguration.js +0 -2
  487. package/configuration/interfaces/skyboxConfiguration.js.map +0 -1
  488. package/configuration/interfaces/templateConfiguration.d.ts +0 -67
  489. package/configuration/interfaces/templateConfiguration.js +0 -2
  490. package/configuration/interfaces/templateConfiguration.js.map +0 -1
  491. package/configuration/interfaces/vrConfiguration.d.ts +0 -16
  492. package/configuration/interfaces/vrConfiguration.js +0 -2
  493. package/configuration/interfaces/vrConfiguration.js.map +0 -1
  494. package/configuration/loader.d.ts +0 -4
  495. package/configuration/loader.js +0 -17
  496. package/configuration/loader.js.map +0 -1
  497. package/configuration/mappers.d.ts +0 -43
  498. package/configuration/mappers.js +0 -193
  499. package/configuration/mappers.js.map +0 -1
  500. package/configuration/renderOnlyLoader.d.ts +0 -33
  501. package/configuration/renderOnlyLoader.js +0 -162
  502. package/configuration/renderOnlyLoader.js.map +0 -1
  503. package/configuration/types/default.d.ts +0 -6
  504. package/configuration/types/default.js +0 -121
  505. package/configuration/types/default.js.map +0 -1
  506. package/configuration/types/environmentMap.d.ts +0 -5
  507. package/configuration/types/environmentMap.js +0 -14
  508. package/configuration/types/environmentMap.js.map +0 -1
  509. package/configuration/types/extended.d.ts +0 -6
  510. package/configuration/types/extended.js +0 -317
  511. package/configuration/types/extended.js.map +0 -1
  512. package/configuration/types/index.d.ts +0 -14
  513. package/configuration/types/index.js +0 -51
  514. package/configuration/types/index.js.map +0 -1
  515. package/configuration/types/minimal.d.ts +0 -6
  516. package/configuration/types/minimal.js +0 -43
  517. package/configuration/types/minimal.js.map +0 -1
  518. package/configuration/types/renderOnlyDefault.d.ts +0 -30
  519. package/configuration/types/renderOnlyDefault.js +0 -31
  520. package/configuration/types/renderOnlyDefault.js.map +0 -1
  521. package/configuration/types/shadowLight.d.ts +0 -9
  522. package/configuration/types/shadowLight.js +0 -64
  523. package/configuration/types/shadowLight.js.map +0 -1
  524. package/helper/index.d.ts +0 -29
  525. package/helper/index.js +0 -66
  526. package/helper/index.js.map +0 -1
  527. package/index.d.ts +0 -30
  528. package/index.js +0 -46
  529. package/index.js.map +0 -1
  530. package/initializer.d.ts +0 -11
  531. package/initializer.js +0 -35
  532. package/initializer.js.map +0 -1
  533. package/interfaces.d.ts +0 -5
  534. package/interfaces.js +0 -7
  535. package/interfaces.js.map +0 -1
  536. package/labs/environmentSerializer.d.ts +0 -126
  537. package/labs/environmentSerializer.js +0 -191
  538. package/labs/environmentSerializer.js.map +0 -1
  539. package/labs/texture.d.ts +0 -183
  540. package/labs/texture.js +0 -351
  541. package/labs/texture.js.map +0 -1
  542. package/labs/viewerLabs.d.ts +0 -51
  543. package/labs/viewerLabs.js +0 -134
  544. package/labs/viewerLabs.js.map +0 -1
  545. package/loader/modelLoader.d.ts +0 -56
  546. package/loader/modelLoader.js +0 -202
  547. package/loader/modelLoader.js.map +0 -1
  548. package/loader/plugins/applyMaterialConfig.d.ts +0 -12
  549. package/loader/plugins/applyMaterialConfig.js +0 -16
  550. package/loader/plugins/applyMaterialConfig.js.map +0 -1
  551. package/loader/plugins/extendedMaterialLoaderPlugin.d.ts +0 -9
  552. package/loader/plugins/extendedMaterialLoaderPlugin.js +0 -16
  553. package/loader/plugins/extendedMaterialLoaderPlugin.js.map +0 -1
  554. package/loader/plugins/index.d.ts +0 -19
  555. package/loader/plugins/index.js +0 -44
  556. package/loader/plugins/index.js.map +0 -1
  557. package/loader/plugins/loaderPlugin.d.ts +0 -24
  558. package/loader/plugins/loaderPlugin.js +0 -2
  559. package/loader/plugins/loaderPlugin.js.map +0 -1
  560. package/loader/plugins/msftLodLoaderPlugin.d.ts +0 -12
  561. package/loader/plugins/msftLodLoaderPlugin.js +0 -21
  562. package/loader/plugins/msftLodLoaderPlugin.js.map +0 -1
  563. package/loader/plugins/telemetryLoaderPlugin.d.ts +0 -12
  564. package/loader/plugins/telemetryLoaderPlugin.js +0 -36
  565. package/loader/plugins/telemetryLoaderPlugin.js.map +0 -1
  566. package/managers/observablesManager.d.ts +0 -66
  567. package/managers/observablesManager.js +0 -35
  568. package/managers/observablesManager.js.map +0 -1
  569. package/managers/sceneManager.d.ts +0 -245
  570. package/managers/sceneManager.js +0 -1375
  571. package/managers/sceneManager.js.map +0 -1
  572. package/managers/telemetryManager.d.ts +0 -78
  573. package/managers/telemetryManager.js +0 -117
  574. package/managers/telemetryManager.js.map +0 -1
  575. package/model/modelAnimation.d.ts +0 -215
  576. package/model/modelAnimation.js +0 -237
  577. package/model/modelAnimation.js.map +0 -1
  578. package/model/viewerModel.d.ts +0 -233
  579. package/model/viewerModel.js +0 -673
  580. package/model/viewerModel.js.map +0 -1
  581. package/optimizer/custom/extended.d.ts +0 -13
  582. package/optimizer/custom/extended.js +0 -101
  583. package/optimizer/custom/extended.js.map +0 -1
  584. package/optimizer/custom/index.d.ts +0 -9
  585. package/optimizer/custom/index.js +0 -26
  586. package/optimizer/custom/index.js.map +0 -1
  587. package/renderOnlyIndex.d.ts +0 -11
  588. package/renderOnlyIndex.js +0 -18
  589. package/renderOnlyIndex.js.map +0 -1
  590. package/templating/eventManager.d.ts +0 -35
  591. package/templating/eventManager.js +0 -66
  592. package/templating/eventManager.js.map +0 -1
  593. package/templating/plugins/hdButtonPlugin.d.ts +0 -9
  594. package/templating/plugins/hdButtonPlugin.js +0 -22
  595. package/templating/plugins/hdButtonPlugin.js.map +0 -1
  596. package/templating/plugins/printButton.d.ts +0 -9
  597. package/templating/plugins/printButton.js +0 -41
  598. package/templating/plugins/printButton.js.map +0 -1
  599. package/templating/templateManager.d.ts +0 -197
  600. package/templating/templateManager.js +0 -561
  601. package/templating/templateManager.js.map +0 -1
  602. package/templating/viewerTemplatePlugin.d.ts +0 -21
  603. package/templating/viewerTemplatePlugin.js +0 -69
  604. package/templating/viewerTemplatePlugin.js.map +0 -1
  605. package/viewer/defaultViewer.d.ts +0 -130
  606. package/viewer/defaultViewer.js +0 -672
  607. package/viewer/defaultViewer.js.map +0 -1
  608. package/viewer/renderOnlyViewer.d.ts +0 -9
  609. package/viewer/renderOnlyViewer.js +0 -46
  610. package/viewer/renderOnlyViewer.js.map +0 -1
  611. package/viewer/viewer.d.ts +0 -258
  612. package/viewer/viewer.js +0 -783
  613. package/viewer/viewer.js.map +0 -1
  614. package/viewer/viewerManager.d.ts +0 -58
  615. package/viewer/viewerManager.js +0 -91
  616. package/viewer/viewerManager.js.map +0 -1
  617. package/viewer/viewerWithTemplate.d.ts +0 -9
  618. package/viewer/viewerWithTemplate.js +0 -20
  619. package/viewer/viewerWithTemplate.js.map +0 -1
@@ -0,0 +1,1683 @@
1
+ import { bz as Clamp, L as Logger, C as Constants, T as Tools } from './index-C6hXZyZb.esm.js';
2
+
3
+ const INT32_SIZE = 4;
4
+ const FLOAT32_SIZE = 4;
5
+ const INT8_SIZE = 1;
6
+ const INT16_SIZE = 2;
7
+ const ULONG_SIZE = 8;
8
+ const USHORT_RANGE = 1 << 16;
9
+ const BITMAP_SIZE = USHORT_RANGE >> 3;
10
+ const HUF_ENCBITS = 16;
11
+ const HUF_DECBITS = 14;
12
+ const HUF_ENCSIZE = (1 << HUF_ENCBITS) + 1;
13
+ const HUF_DECSIZE = 1 << HUF_DECBITS;
14
+ const HUF_DECMASK = HUF_DECSIZE - 1;
15
+ const SHORT_ZEROCODE_RUN = 59;
16
+ const LONG_ZEROCODE_RUN = 63;
17
+ const SHORTEST_LONG_RUN = 2 + LONG_ZEROCODE_RUN - SHORT_ZEROCODE_RUN;
18
+
19
+ /**
20
+ * Inspired by https://github.com/sciecode/three.js/blob/dev/examples/jsm/loaders/EXRLoader.js
21
+ * Referred to the original Industrial Light & Magic OpenEXR implementation and the TinyEXR / Syoyo Fujita
22
+ * implementation.
23
+ */
24
+ // /*
25
+ // Copyright (c) 2014 - 2017, Syoyo Fujita
26
+ // All rights reserved.
27
+ // Redistribution and use in source and binary forms, with or without
28
+ // modification, are permitted provided that the following conditions are met:
29
+ // * Redistributions of source code must retain the above copyright
30
+ // notice, this list of conditions and the following disclaimer.
31
+ // * Redistributions in binary form must reproduce the above copyright
32
+ // notice, this list of conditions and the following disclaimer in the
33
+ // documentation and/or other materials provided with the distribution.
34
+ // * Neither the name of the Syoyo Fujita nor the
35
+ // names of its contributors may be used to endorse or promote products
36
+ // derived from this software without specific prior written permission.
37
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
38
+ // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
39
+ // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
40
+ // DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
41
+ // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
42
+ // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
43
+ // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
44
+ // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
45
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
46
+ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
47
+ // */
48
+ // // TinyEXR contains some OpenEXR code, which is licensed under ------------
49
+ // ///////////////////////////////////////////////////////////////////////////
50
+ // //
51
+ // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas
52
+ // // Digital Ltd. LLC
53
+ // //
54
+ // // All rights reserved.
55
+ // //
56
+ // // Redistribution and use in source and binary forms, with or without
57
+ // // modification, are permitted provided that the following conditions are
58
+ // // met:
59
+ // // * Redistributions of source code must retain the above copyright
60
+ // // notice, this list of conditions and the following disclaimer.
61
+ // // * Redistributions in binary form must reproduce the above
62
+ // // copyright notice, this list of conditions and the following disclaimer
63
+ // // in the documentation and/or other materials provided with the
64
+ // // distribution.
65
+ // // * Neither the name of Industrial Light & Magic nor the names of
66
+ // // its contributors may be used to endorse or promote products derived
67
+ // // from this software without specific prior written permission.
68
+ // //
69
+ // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
70
+ // // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
71
+ // // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
72
+ // // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
73
+ // // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
74
+ // // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
75
+ // // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
76
+ // // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
77
+ // // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
78
+ // // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
79
+ // // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
80
+ // //
81
+ // ///////////////////////////////////////////////////////////////////////////
82
+ // // End of OpenEXR license -------------------------------------------------
83
+ var CompressionCodes;
84
+ (function (CompressionCodes) {
85
+ CompressionCodes[CompressionCodes["NO_COMPRESSION"] = 0] = "NO_COMPRESSION";
86
+ CompressionCodes[CompressionCodes["RLE_COMPRESSION"] = 1] = "RLE_COMPRESSION";
87
+ CompressionCodes[CompressionCodes["ZIPS_COMPRESSION"] = 2] = "ZIPS_COMPRESSION";
88
+ CompressionCodes[CompressionCodes["ZIP_COMPRESSION"] = 3] = "ZIP_COMPRESSION";
89
+ CompressionCodes[CompressionCodes["PIZ_COMPRESSION"] = 4] = "PIZ_COMPRESSION";
90
+ CompressionCodes[CompressionCodes["PXR24_COMPRESSION"] = 5] = "PXR24_COMPRESSION";
91
+ })(CompressionCodes || (CompressionCodes = {}));
92
+ var LineOrders;
93
+ (function (LineOrders) {
94
+ LineOrders[LineOrders["INCREASING_Y"] = 0] = "INCREASING_Y";
95
+ LineOrders[LineOrders["DECREASING_Y"] = 1] = "DECREASING_Y";
96
+ })(LineOrders || (LineOrders = {}));
97
+ const _tables = _GenerateTables();
98
+ // Fast Half Float Conversions, http://www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf
99
+ function _GenerateTables() {
100
+ // float32 to float16 helpers
101
+ const buffer = new ArrayBuffer(4);
102
+ const floatView = new Float32Array(buffer);
103
+ const uint32View = new Uint32Array(buffer);
104
+ const baseTable = new Uint32Array(512);
105
+ const shiftTable = new Uint32Array(512);
106
+ for (let i = 0; i < 256; ++i) {
107
+ const e = i - 127;
108
+ // very small number (0, -0)
109
+ if (e < -27) {
110
+ baseTable[i] = 0x0000;
111
+ baseTable[i | 0x100] = 0x8000;
112
+ shiftTable[i] = 24;
113
+ shiftTable[i | 0x100] = 24;
114
+ // small number (denorm)
115
+ }
116
+ else if (e < -14) {
117
+ baseTable[i] = 0x0400 >> (-e - 14);
118
+ baseTable[i | 0x100] = (0x0400 >> (-e - 14)) | 0x8000;
119
+ shiftTable[i] = -e - 1;
120
+ shiftTable[i | 0x100] = -e - 1;
121
+ // normal number
122
+ }
123
+ else if (e <= 15) {
124
+ baseTable[i] = (e + 15) << 10;
125
+ baseTable[i | 0x100] = ((e + 15) << 10) | 0x8000;
126
+ shiftTable[i] = 13;
127
+ shiftTable[i | 0x100] = 13;
128
+ // large number (Infinity, -Infinity)
129
+ }
130
+ else if (e < 128) {
131
+ baseTable[i] = 0x7c00;
132
+ baseTable[i | 0x100] = 0xfc00;
133
+ shiftTable[i] = 24;
134
+ shiftTable[i | 0x100] = 24;
135
+ // stay (NaN, Infinity, -Infinity)
136
+ }
137
+ else {
138
+ baseTable[i] = 0x7c00;
139
+ baseTable[i | 0x100] = 0xfc00;
140
+ shiftTable[i] = 13;
141
+ shiftTable[i | 0x100] = 13;
142
+ }
143
+ }
144
+ // float16 to float32 helpers
145
+ const mantissaTable = new Uint32Array(2048);
146
+ const exponentTable = new Uint32Array(64);
147
+ const offsetTable = new Uint32Array(64);
148
+ for (let i = 1; i < 1024; ++i) {
149
+ let m = i << 13; // zero pad mantissa bits
150
+ let e = 0; // zero exponent
151
+ // normalized
152
+ while ((m & 0x00800000) === 0) {
153
+ m <<= 1;
154
+ e -= 0x00800000; // decrement exponent
155
+ }
156
+ m &= ~0x00800000; // clear leading 1 bit
157
+ e += 0x38800000; // adjust bias
158
+ mantissaTable[i] = m | e;
159
+ }
160
+ for (let i = 1024; i < 2048; ++i) {
161
+ mantissaTable[i] = 0x38000000 + ((i - 1024) << 13);
162
+ }
163
+ for (let i = 1; i < 31; ++i) {
164
+ exponentTable[i] = i << 23;
165
+ }
166
+ exponentTable[31] = 0x47800000;
167
+ exponentTable[32] = 0x80000000;
168
+ for (let i = 33; i < 63; ++i) {
169
+ exponentTable[i] = 0x80000000 + ((i - 32) << 23);
170
+ }
171
+ exponentTable[63] = 0xc7800000;
172
+ for (let i = 1; i < 64; ++i) {
173
+ if (i !== 32) {
174
+ offsetTable[i] = 1024;
175
+ }
176
+ }
177
+ return {
178
+ floatView: floatView,
179
+ uint32View: uint32View,
180
+ baseTable: baseTable,
181
+ shiftTable: shiftTable,
182
+ mantissaTable: mantissaTable,
183
+ exponentTable: exponentTable,
184
+ offsetTable: offsetTable,
185
+ };
186
+ }
187
+ /**
188
+ * Parse a null terminated string from the buffer
189
+ * @param buffer buffer to read from
190
+ * @param offset current offset in the buffer
191
+ * @returns a string
192
+ */
193
+ function ParseNullTerminatedString(buffer, offset) {
194
+ const uintBuffer = new Uint8Array(buffer);
195
+ let endOffset = 0;
196
+ while (uintBuffer[offset.value + endOffset] != 0) {
197
+ endOffset += 1;
198
+ }
199
+ const stringValue = new TextDecoder().decode(uintBuffer.slice(offset.value, offset.value + endOffset));
200
+ offset.value = offset.value + endOffset + 1;
201
+ return stringValue;
202
+ }
203
+ /**
204
+ * Parse an int32 from the buffer
205
+ * @param dataView dataview on the data
206
+ * @param offset current offset in the data view
207
+ * @returns an int32
208
+ */
209
+ function ParseInt32(dataView, offset) {
210
+ const value = dataView.getInt32(offset.value, true);
211
+ offset.value += INT32_SIZE;
212
+ return value;
213
+ }
214
+ /**
215
+ * Parse an uint32 from the buffer
216
+ * @param dataView data view to read from
217
+ * @param offset offset in the data view
218
+ * @returns an uint32
219
+ */
220
+ function ParseUint32(dataView, offset) {
221
+ const value = dataView.getUint32(offset.value, true);
222
+ offset.value += INT32_SIZE;
223
+ return value;
224
+ }
225
+ /**
226
+ * Parse an uint8 from the buffer
227
+ * @param dataView dataview on the data
228
+ * @param offset current offset in the data view
229
+ * @returns an uint8
230
+ */
231
+ function ParseUint8(dataView, offset) {
232
+ const value = dataView.getUint8(offset.value);
233
+ offset.value += INT8_SIZE;
234
+ return value;
235
+ }
236
+ /**
237
+ * Parse an uint16 from the buffer
238
+ * @param dataView dataview on the data
239
+ * @param offset current offset in the data view
240
+ * @returns an uint16
241
+ */
242
+ function ParseUint16(dataView, offset) {
243
+ const value = dataView.getUint16(offset.value, true);
244
+ offset.value += INT16_SIZE;
245
+ return value;
246
+ }
247
+ /**
248
+ * Parse an uint8 from an array buffer
249
+ * @param array array buffer
250
+ * @param offset current offset in the data view
251
+ * @returns an uint16
252
+ */
253
+ function ParseUint8Array(array, offset) {
254
+ const value = array[offset.value];
255
+ offset.value += INT8_SIZE;
256
+ return value;
257
+ }
258
+ /**
259
+ * Parse an int64 from the buffer
260
+ * @param dataView dataview on the data
261
+ * @param offset current offset in the data view
262
+ * @returns an int64
263
+ */
264
+ function ParseInt64(dataView, offset) {
265
+ let int;
266
+ if ("getBigInt64" in DataView.prototype) {
267
+ int = Number(dataView.getBigInt64(offset.value, true));
268
+ }
269
+ else {
270
+ int = dataView.getUint32(offset.value + 4, true) + Number(dataView.getUint32(offset.value, true) << 32);
271
+ }
272
+ offset.value += ULONG_SIZE;
273
+ return int;
274
+ }
275
+ /**
276
+ * Parse a float32 from the buffer
277
+ * @param dataView dataview on the data
278
+ * @param offset current offset in the data view
279
+ * @returns a float32
280
+ */
281
+ function ParseFloat32(dataView, offset) {
282
+ const value = dataView.getFloat32(offset.value, true);
283
+ offset.value += FLOAT32_SIZE;
284
+ return value;
285
+ }
286
+ /**
287
+ * Parse a float16 from the buffer
288
+ * @param dataView dataview on the data
289
+ * @param offset current offset in the data view
290
+ * @returns a float16
291
+ */
292
+ function ParseFloat16(dataView, offset) {
293
+ return DecodeFloat16(ParseUint16(dataView, offset));
294
+ }
295
+ function DecodeFloat16(binary) {
296
+ const exponent = (binary & 0x7c00) >> 10;
297
+ const fraction = binary & 0x03ff;
298
+ return ((binary >> 15 ? -1 : 1) *
299
+ (exponent ? (exponent === 0x1f ? (fraction ? NaN : Infinity) : Math.pow(2, exponent - 15) * (1 + fraction / 0x400)) : 6.103515625e-5 * (fraction / 0x400)));
300
+ }
301
+ function ToHalfFloat(value) {
302
+ if (Math.abs(value) > 65504) {
303
+ throw new Error("Value out of range.Consider using float instead of half-float.");
304
+ }
305
+ value = Clamp(value, -65504, 65504);
306
+ _tables.floatView[0] = value;
307
+ const f = _tables.uint32View[0];
308
+ const e = (f >> 23) & 0x1ff;
309
+ return _tables.baseTable[e] + ((f & 0x007fffff) >> _tables.shiftTable[e]);
310
+ }
311
+ /**
312
+ * Decode a float32 from the buffer
313
+ * @param dataView dataview on the data
314
+ * @param offset current offset in the data view
315
+ * @returns a float32
316
+ */
317
+ function DecodeFloat32(dataView, offset) {
318
+ return ToHalfFloat(ParseFloat32(dataView, offset));
319
+ }
320
+ function ParseFixedLengthString(buffer, offset, size) {
321
+ const stringValue = new TextDecoder().decode(new Uint8Array(buffer).slice(offset.value, offset.value + size));
322
+ offset.value = offset.value + size;
323
+ return stringValue;
324
+ }
325
+ function ParseRational(dataView, offset) {
326
+ const x = ParseInt32(dataView, offset);
327
+ const y = ParseUint32(dataView, offset);
328
+ return [x, y];
329
+ }
330
+ function ParseTimecode(dataView, offset) {
331
+ const x = ParseUint32(dataView, offset);
332
+ const y = ParseUint32(dataView, offset);
333
+ return [x, y];
334
+ }
335
+ function ParseV2f(dataView, offset) {
336
+ const x = ParseFloat32(dataView, offset);
337
+ const y = ParseFloat32(dataView, offset);
338
+ return [x, y];
339
+ }
340
+ function ParseV3f(dataView, offset) {
341
+ const x = ParseFloat32(dataView, offset);
342
+ const y = ParseFloat32(dataView, offset);
343
+ const z = ParseFloat32(dataView, offset);
344
+ return [x, y, z];
345
+ }
346
+ function ParseChlist(dataView, offset, size) {
347
+ const startOffset = offset.value;
348
+ const channels = [];
349
+ while (offset.value < startOffset + size - 1) {
350
+ const name = ParseNullTerminatedString(dataView.buffer, offset);
351
+ const pixelType = ParseInt32(dataView, offset);
352
+ const pLinear = ParseUint8(dataView, offset);
353
+ offset.value += 3; // reserved, three chars
354
+ const xSampling = ParseInt32(dataView, offset);
355
+ const ySampling = ParseInt32(dataView, offset);
356
+ channels.push({
357
+ name: name,
358
+ pixelType: pixelType,
359
+ pLinear: pLinear,
360
+ xSampling: xSampling,
361
+ ySampling: ySampling,
362
+ });
363
+ }
364
+ offset.value += 1;
365
+ return channels;
366
+ }
367
+ function ParseChromaticities(dataView, offset) {
368
+ const redX = ParseFloat32(dataView, offset);
369
+ const redY = ParseFloat32(dataView, offset);
370
+ const greenX = ParseFloat32(dataView, offset);
371
+ const greenY = ParseFloat32(dataView, offset);
372
+ const blueX = ParseFloat32(dataView, offset);
373
+ const blueY = ParseFloat32(dataView, offset);
374
+ const whiteX = ParseFloat32(dataView, offset);
375
+ const whiteY = ParseFloat32(dataView, offset);
376
+ return { redX: redX, redY: redY, greenX: greenX, greenY: greenY, blueX: blueX, blueY: blueY, whiteX: whiteX, whiteY: whiteY };
377
+ }
378
+ function ParseCompression(dataView, offset) {
379
+ return ParseUint8(dataView, offset);
380
+ }
381
+ function ParseBox2i(dataView, offset) {
382
+ const xMin = ParseInt32(dataView, offset);
383
+ const yMin = ParseInt32(dataView, offset);
384
+ const xMax = ParseInt32(dataView, offset);
385
+ const yMax = ParseInt32(dataView, offset);
386
+ return { xMin: xMin, yMin: yMin, xMax: xMax, yMax: yMax };
387
+ }
388
+ function ParseLineOrder(dataView, offset) {
389
+ const lineOrder = ParseUint8(dataView, offset);
390
+ return LineOrders[lineOrder];
391
+ }
392
+ /**
393
+ * Parse a value from the data view
394
+ * @param dataView defines the data view to read from
395
+ * @param offset defines the current offset in the data view
396
+ * @param type defines the type of the value to read
397
+ * @param size defines the size of the value to read
398
+ * @returns the parsed value
399
+ */
400
+ function ParseValue(dataView, offset, type, size) {
401
+ switch (type) {
402
+ case "string":
403
+ case "stringvector":
404
+ case "iccProfile":
405
+ return ParseFixedLengthString(dataView.buffer, offset, size);
406
+ case "chlist":
407
+ return ParseChlist(dataView, offset, size);
408
+ case "chromaticities":
409
+ return ParseChromaticities(dataView, offset);
410
+ case "compression":
411
+ return ParseCompression(dataView, offset);
412
+ case "box2i":
413
+ return ParseBox2i(dataView, offset);
414
+ case "lineOrder":
415
+ return ParseLineOrder(dataView, offset);
416
+ case "float":
417
+ return ParseFloat32(dataView, offset);
418
+ case "v2f":
419
+ return ParseV2f(dataView, offset);
420
+ case "v3f":
421
+ return ParseV3f(dataView, offset);
422
+ case "int":
423
+ return ParseInt32(dataView, offset);
424
+ case "rational":
425
+ return ParseRational(dataView, offset);
426
+ case "timecode":
427
+ return ParseTimecode(dataView, offset);
428
+ case "preview":
429
+ offset.value += size;
430
+ return "skipped";
431
+ default:
432
+ offset.value += size;
433
+ return undefined;
434
+ }
435
+ }
436
+ /**
437
+ * Revert the endianness of the data
438
+ * @param source defines the source
439
+ */
440
+ function Predictor(source) {
441
+ for (let t = 1; t < source.length; t++) {
442
+ const d = source[t - 1] + source[t] - 128;
443
+ source[t] = d;
444
+ }
445
+ }
446
+ /**
447
+ * Interleave pixels
448
+ * @param source defines the data source
449
+ * @param out defines the output
450
+ */
451
+ function InterleaveScalar(source, out) {
452
+ let t1 = 0;
453
+ let t2 = Math.floor((source.length + 1) / 2);
454
+ let s = 0;
455
+ const stop = source.length - 1;
456
+ // eslint-disable-next-line no-constant-condition
457
+ while (true) {
458
+ if (s > stop) {
459
+ break;
460
+ }
461
+ out[s++] = source[t1++];
462
+ if (s > stop) {
463
+ break;
464
+ }
465
+ out[s++] = source[t2++];
466
+ }
467
+ }
468
+
469
+ /* eslint-disable @typescript-eslint/naming-convention */
470
+ /**
471
+ * Inspired by https://github.com/sciecode/three.js/blob/dev/examples/jsm/loaders/EXRLoader.js
472
+ * Referred to the original Industrial Light & Magic OpenEXR implementation and the TinyEXR / Syoyo Fujita
473
+ * implementation.
474
+ */
475
+ // /*
476
+ // Copyright (c) 2014 - 2017, Syoyo Fujita
477
+ // All rights reserved.
478
+ // Redistribution and use in source and binary forms, with or without
479
+ // modification, are permitted provided that the following conditions are met:
480
+ // * Redistributions of source code must retain the above copyright
481
+ // notice, this list of conditions and the following disclaimer.
482
+ // * Redistributions in binary form must reproduce the above copyright
483
+ // notice, this list of conditions and the following disclaimer in the
484
+ // documentation and/or other materials provided with the distribution.
485
+ // * Neither the name of the Syoyo Fujita nor the
486
+ // names of its contributors may be used to endorse or promote products
487
+ // derived from this software without specific prior written permission.
488
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
489
+ // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
490
+ // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
491
+ // DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
492
+ // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
493
+ // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
494
+ // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
495
+ // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
496
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
497
+ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
498
+ // */
499
+ // // TinyEXR contains some OpenEXR code, which is licensed under ------------
500
+ // ///////////////////////////////////////////////////////////////////////////
501
+ // //
502
+ // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas
503
+ // // Digital Ltd. LLC
504
+ // //
505
+ // // All rights reserved.
506
+ // //
507
+ // // Redistribution and use in source and binary forms, with or without
508
+ // // modification, are permitted provided that the following conditions are
509
+ // // met:
510
+ // // * Redistributions of source code must retain the above copyright
511
+ // // notice, this list of conditions and the following disclaimer.
512
+ // // * Redistributions in binary form must reproduce the above
513
+ // // copyright notice, this list of conditions and the following disclaimer
514
+ // // in the documentation and/or other materials provided with the
515
+ // // distribution.
516
+ // // * Neither the name of Industrial Light & Magic nor the names of
517
+ // // its contributors may be used to endorse or promote products derived
518
+ // // from this software without specific prior written permission.
519
+ // //
520
+ // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
521
+ // // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
522
+ // // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
523
+ // // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
524
+ // // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
525
+ // // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
526
+ // // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
527
+ // // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
528
+ // // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
529
+ // // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
530
+ // // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
531
+ // //
532
+ // ///////////////////////////////////////////////////////////////////////////
533
+ // // End of OpenEXR license -------------------------------------------------
534
+ const EXR_MAGIC = 20000630;
535
+ /**
536
+ * Gets the EXR header
537
+ * @param dataView defines the data view to read from
538
+ * @param offset defines the offset to start reading from
539
+ * @returns the header
540
+ */
541
+ function GetExrHeader(dataView, offset) {
542
+ if (dataView.getUint32(0, true) != EXR_MAGIC) {
543
+ throw new Error("Incorrect OpenEXR format");
544
+ }
545
+ const version = dataView.getUint8(4);
546
+ const specData = dataView.getUint8(5); // fullMask
547
+ const spec = {
548
+ singleTile: !!(specData & 2),
549
+ longName: !!(specData & 4),
550
+ deepFormat: !!(specData & 8),
551
+ multiPart: !!(specData & 16),
552
+ };
553
+ offset.value = 8;
554
+ const headerData = {};
555
+ let keepReading = true;
556
+ while (keepReading) {
557
+ const attributeName = ParseNullTerminatedString(dataView.buffer, offset);
558
+ if (!attributeName) {
559
+ keepReading = false;
560
+ }
561
+ else {
562
+ const attributeType = ParseNullTerminatedString(dataView.buffer, offset);
563
+ const attributeSize = ParseUint32(dataView, offset);
564
+ const attributeValue = ParseValue(dataView, offset, attributeType, attributeSize);
565
+ if (attributeValue === undefined) {
566
+ Logger.Warn(`Unknown header attribute type ${attributeType}'.`);
567
+ }
568
+ else {
569
+ headerData[attributeName] = attributeValue;
570
+ }
571
+ }
572
+ }
573
+ if ((specData & ~0x04) != 0) {
574
+ throw new Error("Unsupported file format");
575
+ }
576
+ return { version: version, spec: spec, ...headerData };
577
+ }
578
+
579
+ /**
580
+ * Inspired by https://github.com/sciecode/three.js/blob/dev/examples/jsm/loaders/EXRLoader.js
581
+ * Referred to the original Industrial Light & Magic OpenEXR implementation and the TinyEXR / Syoyo Fujita
582
+ * implementation.
583
+ */
584
+ // /*
585
+ // Copyright (c) 2014 - 2017, Syoyo Fujita
586
+ // All rights reserved.
587
+ // Redistribution and use in source and binary forms, with or without
588
+ // modification, are permitted provided that the following conditions are met:
589
+ // * Redistributions of source code must retain the above copyright
590
+ // notice, this list of conditions and the following disclaimer.
591
+ // * Redistributions in binary form must reproduce the above copyright
592
+ // notice, this list of conditions and the following disclaimer in the
593
+ // documentation and/or other materials provided with the distribution.
594
+ // * Neither the name of the Syoyo Fujita nor the
595
+ // names of its contributors may be used to endorse or promote products
596
+ // derived from this software without specific prior written permission.
597
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
598
+ // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
599
+ // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
600
+ // DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
601
+ // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
602
+ // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
603
+ // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
604
+ // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
605
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
606
+ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
607
+ // */
608
+ // // TinyEXR contains some OpenEXR code, which is licensed under ------------
609
+ // ///////////////////////////////////////////////////////////////////////////
610
+ // //
611
+ // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas
612
+ // // Digital Ltd. LLC
613
+ // //
614
+ // // All rights reserved.
615
+ // //
616
+ // // Redistribution and use in source and binary forms, with or without
617
+ // // modification, are permitted provided that the following conditions are
618
+ // // met:
619
+ // // * Redistributions of source code must retain the above copyright
620
+ // // notice, this list of conditions and the following disclaimer.
621
+ // // * Redistributions in binary form must reproduce the above
622
+ // // copyright notice, this list of conditions and the following disclaimer
623
+ // // in the documentation and/or other materials provided with the
624
+ // // distribution.
625
+ // // * Neither the name of Industrial Light & Magic nor the names of
626
+ // // its contributors may be used to endorse or promote products derived
627
+ // // from this software without specific prior written permission.
628
+ // //
629
+ // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
630
+ // // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
631
+ // // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
632
+ // // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
633
+ // // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
634
+ // // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
635
+ // // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
636
+ // // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
637
+ // // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
638
+ // // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
639
+ // // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
640
+ // //
641
+ // ///////////////////////////////////////////////////////////////////////////
642
+ // // End of OpenEXR license -------------------------------------------------
643
+ const NBITS = 16;
644
+ const A_OFFSET = 1 << (NBITS - 1);
645
+ const MOD_MASK = (1 << NBITS) - 1;
646
+ /** @internal */
647
+ function ReverseLutFromBitmap(bitmap, lut) {
648
+ let k = 0;
649
+ for (let i = 0; i < USHORT_RANGE; ++i) {
650
+ if (i == 0 || bitmap[i >> 3] & (1 << (i & 7))) {
651
+ lut[k++] = i;
652
+ }
653
+ }
654
+ const n = k - 1;
655
+ while (k < USHORT_RANGE)
656
+ lut[k++] = 0;
657
+ return n;
658
+ }
659
+ function HufClearDecTable(hdec) {
660
+ for (let i = 0; i < HUF_DECSIZE; i++) {
661
+ hdec[i] = {};
662
+ hdec[i].len = 0;
663
+ hdec[i].lit = 0;
664
+ hdec[i].p = null;
665
+ }
666
+ }
667
+ function GetBits(nBits, c, lc, array, offset) {
668
+ while (lc < nBits) {
669
+ c = (c << 8) | ParseUint8Array(array, offset);
670
+ lc += 8;
671
+ }
672
+ lc -= nBits;
673
+ return {
674
+ l: (c >> lc) & ((1 << nBits) - 1),
675
+ c,
676
+ lc,
677
+ };
678
+ }
679
+ function GetChar(c, lc, array, offset) {
680
+ c = (c << 8) | ParseUint8Array(array, offset);
681
+ lc += 8;
682
+ return {
683
+ c,
684
+ lc,
685
+ };
686
+ }
687
+ function GetCode(po, rlc, c, lc, array, offset, outBuffer, outBufferOffset, outBufferEndOffset) {
688
+ if (po == rlc) {
689
+ if (lc < 8) {
690
+ const gc = GetChar(c, lc, array, offset);
691
+ c = gc.c;
692
+ lc = gc.lc;
693
+ }
694
+ lc -= 8;
695
+ let cs = c >> lc;
696
+ cs = new Uint8Array([cs])[0];
697
+ if (outBufferOffset.value + cs > outBufferEndOffset) {
698
+ return null;
699
+ }
700
+ const s = outBuffer[outBufferOffset.value - 1];
701
+ while (cs-- > 0) {
702
+ outBuffer[outBufferOffset.value++] = s;
703
+ }
704
+ }
705
+ else if (outBufferOffset.value < outBufferEndOffset) {
706
+ outBuffer[outBufferOffset.value++] = po;
707
+ }
708
+ else {
709
+ return null;
710
+ }
711
+ return { c, lc };
712
+ }
713
+ const HufTableBuffer = new Array(59);
714
+ function HufCanonicalCodeTable(hcode) {
715
+ for (let i = 0; i <= 58; ++i)
716
+ HufTableBuffer[i] = 0;
717
+ for (let i = 0; i < HUF_ENCSIZE; ++i)
718
+ HufTableBuffer[hcode[i]] += 1;
719
+ let c = 0;
720
+ for (let i = 58; i > 0; --i) {
721
+ const nc = (c + HufTableBuffer[i]) >> 1;
722
+ HufTableBuffer[i] = c;
723
+ c = nc;
724
+ }
725
+ for (let i = 0; i < HUF_ENCSIZE; ++i) {
726
+ const l = hcode[i];
727
+ if (l > 0)
728
+ hcode[i] = l | (HufTableBuffer[l]++ << 6);
729
+ }
730
+ }
731
+ function HufUnpackEncTable(array, offset, ni, im, iM, hcode) {
732
+ const p = offset;
733
+ let c = 0;
734
+ let lc = 0;
735
+ for (; im <= iM; im++) {
736
+ if (p.value - offset.value > ni) {
737
+ return;
738
+ }
739
+ let gb = GetBits(6, c, lc, array, p);
740
+ const l = gb.l;
741
+ c = gb.c;
742
+ lc = gb.lc;
743
+ hcode[im] = l;
744
+ if (l == LONG_ZEROCODE_RUN) {
745
+ if (p.value - offset.value > ni) {
746
+ throw new Error("Error in HufUnpackEncTable");
747
+ }
748
+ gb = GetBits(8, c, lc, array, p);
749
+ let zerun = gb.l + SHORTEST_LONG_RUN;
750
+ c = gb.c;
751
+ lc = gb.lc;
752
+ if (im + zerun > iM + 1) {
753
+ throw new Error("Error in HufUnpackEncTable");
754
+ }
755
+ while (zerun--)
756
+ hcode[im++] = 0;
757
+ im--;
758
+ }
759
+ else if (l >= SHORT_ZEROCODE_RUN) {
760
+ let zerun = l - SHORT_ZEROCODE_RUN + 2;
761
+ if (im + zerun > iM + 1) {
762
+ throw new Error("Error in HufUnpackEncTable");
763
+ }
764
+ while (zerun--)
765
+ hcode[im++] = 0;
766
+ im--;
767
+ }
768
+ }
769
+ HufCanonicalCodeTable(hcode);
770
+ }
771
+ function HufLength(code) {
772
+ return code & 63;
773
+ }
774
+ function HufCode(code) {
775
+ return code >> 6;
776
+ }
777
+ function HufBuildDecTable(hcode, im, iM, hdecod) {
778
+ for (; im <= iM; im++) {
779
+ const c = HufCode(hcode[im]);
780
+ const l = HufLength(hcode[im]);
781
+ if (c >> l) {
782
+ throw new Error("Invalid table entry");
783
+ }
784
+ if (l > HUF_DECBITS) {
785
+ const pl = hdecod[c >> (l - HUF_DECBITS)];
786
+ if (pl.len) {
787
+ throw new Error("Invalid table entry");
788
+ }
789
+ pl.lit++;
790
+ if (pl.p) {
791
+ const p = pl.p;
792
+ pl.p = new Array(pl.lit);
793
+ for (let i = 0; i < pl.lit - 1; ++i) {
794
+ pl.p[i] = p[i];
795
+ }
796
+ }
797
+ else {
798
+ pl.p = new Array(1);
799
+ }
800
+ pl.p[pl.lit - 1] = im;
801
+ }
802
+ else if (l) {
803
+ let plOffset = 0;
804
+ for (let i = 1 << (HUF_DECBITS - l); i > 0; i--) {
805
+ const pl = hdecod[(c << (HUF_DECBITS - l)) + plOffset];
806
+ if (pl.len || pl.p) {
807
+ throw new Error("Invalid table entry");
808
+ }
809
+ pl.len = l;
810
+ pl.lit = im;
811
+ plOffset++;
812
+ }
813
+ }
814
+ }
815
+ return true;
816
+ }
817
+ function HufDecode(encodingTable, decodingTable, array, offset, ni, rlc, no, outBuffer, outOffset) {
818
+ let c = 0;
819
+ let lc = 0;
820
+ const outBufferEndOffset = no;
821
+ const inOffsetEnd = Math.trunc(offset.value + (ni + 7) / 8);
822
+ while (offset.value < inOffsetEnd) {
823
+ let gc = GetChar(c, lc, array, offset);
824
+ c = gc.c;
825
+ lc = gc.lc;
826
+ while (lc >= HUF_DECBITS) {
827
+ const index = (c >> (lc - HUF_DECBITS)) & HUF_DECMASK;
828
+ const pl = decodingTable[index];
829
+ if (pl.len) {
830
+ lc -= pl.len;
831
+ const gCode = GetCode(pl.lit, rlc, c, lc, array, offset, outBuffer, outOffset, outBufferEndOffset);
832
+ if (gCode) {
833
+ c = gCode.c;
834
+ lc = gCode.lc;
835
+ }
836
+ }
837
+ else {
838
+ if (!pl.p) {
839
+ throw new Error("hufDecode issues");
840
+ }
841
+ let j;
842
+ for (j = 0; j < pl.lit; j++) {
843
+ const l = HufLength(encodingTable[pl.p[j]]);
844
+ while (lc < l && offset.value < inOffsetEnd) {
845
+ gc = GetChar(c, lc, array, offset);
846
+ c = gc.c;
847
+ lc = gc.lc;
848
+ }
849
+ if (lc >= l) {
850
+ if (HufCode(encodingTable[pl.p[j]]) == ((c >> (lc - l)) & ((1 << l) - 1))) {
851
+ lc -= l;
852
+ const gCode = GetCode(pl.p[j], rlc, c, lc, array, offset, outBuffer, outOffset, outBufferEndOffset);
853
+ if (gCode) {
854
+ c = gCode.c;
855
+ lc = gCode.lc;
856
+ }
857
+ break;
858
+ }
859
+ }
860
+ }
861
+ if (j == pl.lit) {
862
+ throw new Error("HufDecode issues");
863
+ }
864
+ }
865
+ }
866
+ }
867
+ const i = (8 - ni) & 7;
868
+ c >>= i;
869
+ lc -= i;
870
+ while (lc > 0) {
871
+ const pl = decodingTable[(c << (HUF_DECBITS - lc)) & HUF_DECMASK];
872
+ if (pl.len) {
873
+ lc -= pl.len;
874
+ const gCode = GetCode(pl.lit, rlc, c, lc, array, offset, outBuffer, outOffset, outBufferEndOffset);
875
+ if (gCode) {
876
+ c = gCode.c;
877
+ lc = gCode.lc;
878
+ }
879
+ }
880
+ else {
881
+ throw new Error("HufDecode issues");
882
+ }
883
+ }
884
+ return true;
885
+ }
886
+ /** @internal */
887
+ function HufUncompress(array, dataView, offset, nCompressed, outBuffer, nRaw) {
888
+ const outOffset = { value: 0 };
889
+ const initialInOffset = offset.value;
890
+ const im = ParseUint32(dataView, offset);
891
+ const iM = ParseUint32(dataView, offset);
892
+ offset.value += 4;
893
+ const nBits = ParseUint32(dataView, offset);
894
+ offset.value += 4;
895
+ if (im < 0 || im >= HUF_ENCSIZE || iM < 0 || iM >= HUF_ENCSIZE) {
896
+ throw new Error("Wrong HUF_ENCSIZE");
897
+ }
898
+ const freq = new Array(HUF_ENCSIZE);
899
+ const hdec = new Array(HUF_DECSIZE);
900
+ HufClearDecTable(hdec);
901
+ const ni = nCompressed - (offset.value - initialInOffset);
902
+ HufUnpackEncTable(array, offset, ni, im, iM, freq);
903
+ if (nBits > 8 * (nCompressed - (offset.value - initialInOffset))) {
904
+ throw new Error("Wrong hufUncompress");
905
+ }
906
+ HufBuildDecTable(freq, im, iM, hdec);
907
+ HufDecode(freq, hdec, array, offset, nBits, iM, nRaw, outBuffer, outOffset);
908
+ }
909
+ function UInt16(value) {
910
+ return value & 0xffff;
911
+ }
912
+ function Int16(value) {
913
+ const ref = UInt16(value);
914
+ return ref > 0x7fff ? ref - 0x10000 : ref;
915
+ }
916
+ function Wdec14(l, h) {
917
+ const ls = Int16(l);
918
+ const hs = Int16(h);
919
+ const hi = hs;
920
+ const ai = ls + (hi & 1) + (hi >> 1);
921
+ const as = ai;
922
+ const bs = ai - hi;
923
+ return { a: as, b: bs };
924
+ }
925
+ function Wdec16(l, h) {
926
+ const m = UInt16(l);
927
+ const d = UInt16(h);
928
+ const bb = (m - (d >> 1)) & MOD_MASK;
929
+ const aa = (d + bb - A_OFFSET) & MOD_MASK;
930
+ return { a: aa, b: bb };
931
+ }
932
+ /** @internal */
933
+ function Wav2Decode(buffer, j, nx, ox, ny, oy, mx) {
934
+ const w14 = mx < 1 << 14;
935
+ const n = nx > ny ? ny : nx;
936
+ let p = 1;
937
+ let p2;
938
+ let py;
939
+ while (p <= n)
940
+ p <<= 1;
941
+ p >>= 1;
942
+ p2 = p;
943
+ p >>= 1;
944
+ while (p >= 1) {
945
+ py = 0;
946
+ const ey = py + oy * (ny - p2);
947
+ const oy1 = oy * p;
948
+ const oy2 = oy * p2;
949
+ const ox1 = ox * p;
950
+ const ox2 = ox * p2;
951
+ let i00, i01, i10, i11;
952
+ for (; py <= ey; py += oy2) {
953
+ let px = py;
954
+ const ex = py + ox * (nx - p2);
955
+ for (; px <= ex; px += ox2) {
956
+ const p01 = px + ox1;
957
+ const p10 = px + oy1;
958
+ const p11 = p10 + ox1;
959
+ if (w14) {
960
+ let result = Wdec14(buffer[px + j], buffer[p10 + j]);
961
+ i00 = result.a;
962
+ i10 = result.b;
963
+ result = Wdec14(buffer[p01 + j], buffer[p11 + j]);
964
+ i01 = result.a;
965
+ i11 = result.b;
966
+ result = Wdec14(i00, i01);
967
+ buffer[px + j] = result.a;
968
+ buffer[p01 + j] = result.b;
969
+ result = Wdec14(i10, i11);
970
+ buffer[p10 + j] = result.a;
971
+ buffer[p11 + j] = result.b;
972
+ }
973
+ else {
974
+ let result = Wdec16(buffer[px + j], buffer[p10 + j]);
975
+ i00 = result.a;
976
+ i10 = result.b;
977
+ result = Wdec16(buffer[p01 + j], buffer[p11 + j]);
978
+ i01 = result.a;
979
+ i11 = result.b;
980
+ result = Wdec16(i00, i01);
981
+ buffer[px + j] = result.a;
982
+ buffer[p01 + j] = result.b;
983
+ result = Wdec16(i10, i11);
984
+ buffer[p10 + j] = result.a;
985
+ buffer[p11 + j] = result.b;
986
+ }
987
+ }
988
+ if (nx & p) {
989
+ const p10 = px + oy1;
990
+ let result;
991
+ if (w14) {
992
+ result = Wdec14(buffer[px + j], buffer[p10 + j]);
993
+ }
994
+ else {
995
+ result = Wdec16(buffer[px + j], buffer[p10 + j]);
996
+ }
997
+ i00 = result.a;
998
+ buffer[p10 + j] = result.b;
999
+ buffer[px + j] = i00;
1000
+ }
1001
+ }
1002
+ if (ny & p) {
1003
+ let px = py;
1004
+ const ex = py + ox * (nx - p2);
1005
+ for (; px <= ex; px += ox2) {
1006
+ const p01 = px + ox1;
1007
+ let result;
1008
+ if (w14) {
1009
+ result = Wdec14(buffer[px + j], buffer[p01 + j]);
1010
+ }
1011
+ else {
1012
+ result = Wdec16(buffer[px + j], buffer[p01 + j]);
1013
+ }
1014
+ i00 = result.a;
1015
+ buffer[p01 + j] = result.b;
1016
+ buffer[px + j] = i00;
1017
+ }
1018
+ }
1019
+ p2 = p;
1020
+ p >>= 1;
1021
+ }
1022
+ return py;
1023
+ }
1024
+ /** @internal */
1025
+ function ApplyLut(lut, data, nData) {
1026
+ for (let i = 0; i < nData; ++i) {
1027
+ data[i] = lut[data[i]];
1028
+ }
1029
+ }
1030
+
1031
+ /**
1032
+ * Inspired by https://github.com/sciecode/three.js/blob/dev/examples/jsm/loaders/EXRLoader.js
1033
+ * Referred to the original Industrial Light & Magic OpenEXR implementation and the TinyEXR / Syoyo Fujita
1034
+ * implementation.
1035
+ */
1036
+ // /*
1037
+ // Copyright (c) 2014 - 2017, Syoyo Fujita
1038
+ // All rights reserved.
1039
+ // Redistribution and use in source and binary forms, with or without
1040
+ // modification, are permitted provided that the following conditions are met:
1041
+ // * Redistributions of source code must retain the above copyright
1042
+ // notice, this list of conditions and the following disclaimer.
1043
+ // * Redistributions in binary form must reproduce the above copyright
1044
+ // notice, this list of conditions and the following disclaimer in the
1045
+ // documentation and/or other materials provided with the distribution.
1046
+ // * Neither the name of the Syoyo Fujita nor the
1047
+ // names of its contributors may be used to endorse or promote products
1048
+ // derived from this software without specific prior written permission.
1049
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1050
+ // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1051
+ // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
1052
+ // DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
1053
+ // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
1054
+ // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
1055
+ // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
1056
+ // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1057
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
1058
+ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1059
+ // */
1060
+ // // TinyEXR contains some OpenEXR code, which is licensed under ------------
1061
+ // ///////////////////////////////////////////////////////////////////////////
1062
+ // //
1063
+ // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas
1064
+ // // Digital Ltd. LLC
1065
+ // //
1066
+ // // All rights reserved.
1067
+ // //
1068
+ // // Redistribution and use in source and binary forms, with or without
1069
+ // // modification, are permitted provided that the following conditions are
1070
+ // // met:
1071
+ // // * Redistributions of source code must retain the above copyright
1072
+ // // notice, this list of conditions and the following disclaimer.
1073
+ // // * Redistributions in binary form must reproduce the above
1074
+ // // copyright notice, this list of conditions and the following disclaimer
1075
+ // // in the documentation and/or other materials provided with the
1076
+ // // distribution.
1077
+ // // * Neither the name of Industrial Light & Magic nor the names of
1078
+ // // its contributors may be used to endorse or promote products derived
1079
+ // // from this software without specific prior written permission.
1080
+ // //
1081
+ // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1082
+ // // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1083
+ // // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1084
+ // // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1085
+ // // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
1086
+ // // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
1087
+ // // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
1088
+ // // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
1089
+ // // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1090
+ // // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
1091
+ // // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1092
+ // //
1093
+ // ///////////////////////////////////////////////////////////////////////////
1094
+ // // End of OpenEXR license -------------------------------------------------
1095
+ /** @internal */
1096
+ function DecodeRunLength(source) {
1097
+ let size = source.byteLength;
1098
+ const out = new Array();
1099
+ let p = 0;
1100
+ const reader = new DataView(source);
1101
+ while (size > 0) {
1102
+ const l = reader.getInt8(p++);
1103
+ if (l < 0) {
1104
+ const count = -l;
1105
+ size -= count + 1;
1106
+ for (let i = 0; i < count; i++) {
1107
+ out.push(reader.getUint8(p++));
1108
+ }
1109
+ }
1110
+ else {
1111
+ const count = l;
1112
+ size -= 2;
1113
+ const value = reader.getUint8(p++);
1114
+ for (let i = 0; i < count + 1; i++) {
1115
+ out.push(value);
1116
+ }
1117
+ }
1118
+ }
1119
+ return out;
1120
+ }
1121
+
1122
+ /**
1123
+ * No compression
1124
+ * @param decoder defines the decoder to use
1125
+ * @returns a decompressed data view
1126
+ */
1127
+ function UncompressRAW(decoder) {
1128
+ return new DataView(decoder.array.buffer, decoder.offset.value, decoder.size);
1129
+ }
1130
+ /**
1131
+ * RLE compression
1132
+ * @param decoder defines the decoder to use
1133
+ * @returns a decompressed data view
1134
+ */
1135
+ function UncompressRLE(decoder) {
1136
+ const compressed = decoder.viewer.buffer.slice(decoder.offset.value, decoder.offset.value + decoder.size);
1137
+ const rawBuffer = new Uint8Array(DecodeRunLength(compressed));
1138
+ const tmpBuffer = new Uint8Array(rawBuffer.length);
1139
+ Predictor(rawBuffer);
1140
+ InterleaveScalar(rawBuffer, tmpBuffer);
1141
+ return new DataView(tmpBuffer.buffer);
1142
+ }
1143
+ /**
1144
+ * Zip compression
1145
+ * @param decoder defines the decoder to use
1146
+ * @returns a decompressed data view
1147
+ */
1148
+ function UncompressZIP(decoder) {
1149
+ const compressed = decoder.array.slice(decoder.offset.value, decoder.offset.value + decoder.size);
1150
+ const rawBuffer = fflate.unzlibSync(compressed);
1151
+ const tmpBuffer = new Uint8Array(rawBuffer.length);
1152
+ Predictor(rawBuffer);
1153
+ InterleaveScalar(rawBuffer, tmpBuffer);
1154
+ return new DataView(tmpBuffer.buffer);
1155
+ }
1156
+ /**
1157
+ * PXR compression
1158
+ * @param decoder defines the decoder to use
1159
+ * @returns a decompressed data view
1160
+ */
1161
+ function UncompressPXR(decoder) {
1162
+ const compressed = decoder.array.slice(decoder.offset.value, decoder.offset.value + decoder.size);
1163
+ const rawBuffer = fflate.unzlibSync(compressed);
1164
+ const sz = decoder.lines * decoder.channels * decoder.width;
1165
+ const tmpBuffer = decoder.type == 1 ? new Uint16Array(sz) : new Uint32Array(sz);
1166
+ let tmpBufferEnd = 0;
1167
+ let writePtr = 0;
1168
+ const ptr = new Array(4);
1169
+ for (let y = 0; y < decoder.lines; y++) {
1170
+ for (let c = 0; c < decoder.channels; c++) {
1171
+ let pixel = 0;
1172
+ switch (decoder.type) {
1173
+ case 1:
1174
+ ptr[0] = tmpBufferEnd;
1175
+ ptr[1] = ptr[0] + decoder.width;
1176
+ tmpBufferEnd = ptr[1] + decoder.width;
1177
+ for (let j = 0; j < decoder.width; ++j) {
1178
+ const diff = (rawBuffer[ptr[0]++] << 8) | rawBuffer[ptr[1]++];
1179
+ pixel += diff;
1180
+ tmpBuffer[writePtr] = pixel;
1181
+ writePtr++;
1182
+ }
1183
+ break;
1184
+ case 2:
1185
+ ptr[0] = tmpBufferEnd;
1186
+ ptr[1] = ptr[0] + decoder.width;
1187
+ ptr[2] = ptr[1] + decoder.width;
1188
+ tmpBufferEnd = ptr[2] + decoder.width;
1189
+ for (let j = 0; j < decoder.width; ++j) {
1190
+ const diff = (rawBuffer[ptr[0]++] << 24) | (rawBuffer[ptr[1]++] << 16) | (rawBuffer[ptr[2]++] << 8);
1191
+ pixel += diff;
1192
+ tmpBuffer[writePtr] = pixel;
1193
+ writePtr++;
1194
+ }
1195
+ break;
1196
+ }
1197
+ }
1198
+ }
1199
+ return new DataView(tmpBuffer.buffer);
1200
+ }
1201
+ /**
1202
+ * PIZ compression
1203
+ * @param decoder defines the decoder to use
1204
+ * @returns a decompressed data view
1205
+ */
1206
+ function UncompressPIZ(decoder) {
1207
+ const inDataView = decoder.viewer;
1208
+ const inOffset = { value: decoder.offset.value };
1209
+ const outBuffer = new Uint16Array(decoder.width * decoder.scanlineBlockSize * (decoder.channels * decoder.type));
1210
+ const bitmap = new Uint8Array(BITMAP_SIZE);
1211
+ // Setup channel info
1212
+ let outBufferEnd = 0;
1213
+ const pizChannelData = new Array(decoder.channels);
1214
+ for (let i = 0; i < decoder.channels; i++) {
1215
+ pizChannelData[i] = {};
1216
+ pizChannelData[i]["start"] = outBufferEnd;
1217
+ pizChannelData[i]["end"] = pizChannelData[i]["start"];
1218
+ pizChannelData[i]["nx"] = decoder.width;
1219
+ pizChannelData[i]["ny"] = decoder.lines;
1220
+ pizChannelData[i]["size"] = decoder.type;
1221
+ outBufferEnd += pizChannelData[i].nx * pizChannelData[i].ny * pizChannelData[i].size;
1222
+ }
1223
+ // Read range compression data
1224
+ const minNonZero = ParseUint16(inDataView, inOffset);
1225
+ const maxNonZero = ParseUint16(inDataView, inOffset);
1226
+ if (maxNonZero >= BITMAP_SIZE) {
1227
+ throw new Error("Wrong PIZ_COMPRESSION BITMAP_SIZE");
1228
+ }
1229
+ if (minNonZero <= maxNonZero) {
1230
+ for (let i = 0; i < maxNonZero - minNonZero + 1; i++) {
1231
+ bitmap[i + minNonZero] = ParseUint8(inDataView, inOffset);
1232
+ }
1233
+ }
1234
+ // Reverse LUT
1235
+ const lut = new Uint16Array(USHORT_RANGE);
1236
+ const maxValue = ReverseLutFromBitmap(bitmap, lut);
1237
+ const length = ParseUint32(inDataView, inOffset);
1238
+ // Huffman decoding
1239
+ HufUncompress(decoder.array, inDataView, inOffset, length, outBuffer, outBufferEnd);
1240
+ // Wavelet decoding
1241
+ for (let i = 0; i < decoder.channels; ++i) {
1242
+ const cd = pizChannelData[i];
1243
+ for (let j = 0; j < pizChannelData[i].size; ++j) {
1244
+ Wav2Decode(outBuffer, cd.start + j, cd.nx, cd.size, cd.ny, cd.nx * cd.size, maxValue);
1245
+ }
1246
+ }
1247
+ // Expand the pixel data to their original range
1248
+ ApplyLut(lut, outBuffer, outBufferEnd);
1249
+ // Rearrange the pixel data into the format expected by the caller.
1250
+ let tmpOffset = 0;
1251
+ const tmpBuffer = new Uint8Array(outBuffer.buffer.byteLength);
1252
+ for (let y = 0; y < decoder.lines; y++) {
1253
+ for (let c = 0; c < decoder.channels; c++) {
1254
+ const cd = pizChannelData[c];
1255
+ const n = cd.nx * cd.size;
1256
+ const cp = new Uint8Array(outBuffer.buffer, cd.end * INT16_SIZE, n * INT16_SIZE);
1257
+ tmpBuffer.set(cp, tmpOffset);
1258
+ tmpOffset += n * INT16_SIZE;
1259
+ cd.end += n;
1260
+ }
1261
+ }
1262
+ return new DataView(tmpBuffer.buffer);
1263
+ }
1264
+
1265
+ var EXROutputType;
1266
+ (function (EXROutputType) {
1267
+ EXROutputType[EXROutputType["Float"] = 0] = "Float";
1268
+ EXROutputType[EXROutputType["HalfFloat"] = 1] = "HalfFloat";
1269
+ })(EXROutputType || (EXROutputType = {}));
1270
+ /**
1271
+ * Class used to store configuration of the exr loader
1272
+ */
1273
+ class ExrLoaderGlobalConfiguration {
1274
+ }
1275
+ /**
1276
+ * Defines the default output type to use (Half float by default)
1277
+ */
1278
+ ExrLoaderGlobalConfiguration.DefaultOutputType = EXROutputType.HalfFloat;
1279
+ /**
1280
+ * Url to use to load the fflate library (for zip decompression)
1281
+ */
1282
+ ExrLoaderGlobalConfiguration.FFLATEUrl = "https://unpkg.com/fflate@0.8.2";
1283
+
1284
+ /**
1285
+ * Inspired by https://github.com/sciecode/three.js/blob/dev/examples/jsm/loaders/EXRLoader.js
1286
+ * Referred to the original Industrial Light & Magic OpenEXR implementation and the TinyEXR / Syoyo Fujita
1287
+ * implementation.
1288
+ */
1289
+ // /*
1290
+ // Copyright (c) 2014 - 2017, Syoyo Fujita
1291
+ // All rights reserved.
1292
+ // Redistribution and use in source and binary forms, with or without
1293
+ // modification, are permitted provided that the following conditions are met:
1294
+ // * Redistributions of source code must retain the above copyright
1295
+ // notice, this list of conditions and the following disclaimer.
1296
+ // * Redistributions in binary form must reproduce the above copyright
1297
+ // notice, this list of conditions and the following disclaimer in the
1298
+ // documentation and/or other materials provided with the distribution.
1299
+ // * Neither the name of the Syoyo Fujita nor the
1300
+ // names of its contributors may be used to endorse or promote products
1301
+ // derived from this software without specific prior written permission.
1302
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1303
+ // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1304
+ // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
1305
+ // DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
1306
+ // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
1307
+ // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
1308
+ // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
1309
+ // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1310
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
1311
+ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1312
+ // */
1313
+ // // TinyEXR contains some OpenEXR code, which is licensed under ------------
1314
+ // ///////////////////////////////////////////////////////////////////////////
1315
+ // //
1316
+ // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas
1317
+ // // Digital Ltd. LLC
1318
+ // //
1319
+ // // All rights reserved.
1320
+ // //
1321
+ // // Redistribution and use in source and binary forms, with or without
1322
+ // // modification, are permitted provided that the following conditions are
1323
+ // // met:
1324
+ // // * Redistributions of source code must retain the above copyright
1325
+ // // notice, this list of conditions and the following disclaimer.
1326
+ // // * Redistributions in binary form must reproduce the above
1327
+ // // copyright notice, this list of conditions and the following disclaimer
1328
+ // // in the documentation and/or other materials provided with the
1329
+ // // distribution.
1330
+ // // * Neither the name of Industrial Light & Magic nor the names of
1331
+ // // its contributors may be used to endorse or promote products derived
1332
+ // // from this software without specific prior written permission.
1333
+ // //
1334
+ // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1335
+ // // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1336
+ // // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1337
+ // // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1338
+ // // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
1339
+ // // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
1340
+ // // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
1341
+ // // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
1342
+ // // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1343
+ // // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
1344
+ // // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1345
+ // //
1346
+ // ///////////////////////////////////////////////////////////////////////////
1347
+ // // End of OpenEXR license -------------------------------------------------
1348
+ /**
1349
+ * Create a decoder for the exr file
1350
+ * @param header header of the exr file
1351
+ * @param dataView dataview of the exr file
1352
+ * @param offset current offset
1353
+ * @param outputType expected output type (float or half float)
1354
+ * @returns a promise that resolves with the decoder
1355
+ */
1356
+ async function CreateDecoderAsync(header, dataView, offset, outputType) {
1357
+ const decoder = {
1358
+ size: 0,
1359
+ viewer: dataView,
1360
+ array: new Uint8Array(dataView.buffer),
1361
+ offset: offset,
1362
+ width: header.dataWindow.xMax - header.dataWindow.xMin + 1,
1363
+ height: header.dataWindow.yMax - header.dataWindow.yMin + 1,
1364
+ channels: header.channels.length,
1365
+ channelLineOffsets: {},
1366
+ scanOrder: () => 0,
1367
+ bytesPerLine: 0,
1368
+ outLineWidth: 0,
1369
+ lines: 0,
1370
+ scanlineBlockSize: 0,
1371
+ inputSize: null,
1372
+ type: 0,
1373
+ uncompress: null,
1374
+ getter: () => 0,
1375
+ format: Constants.TEXTUREFORMAT_RGBA,
1376
+ outputChannels: 0,
1377
+ decodeChannels: {},
1378
+ blockCount: null,
1379
+ byteArray: null,
1380
+ linearSpace: false,
1381
+ textureType: 0,
1382
+ };
1383
+ switch (header.compression) {
1384
+ case CompressionCodes.NO_COMPRESSION:
1385
+ decoder.lines = 1;
1386
+ decoder.uncompress = UncompressRAW;
1387
+ break;
1388
+ case CompressionCodes.RLE_COMPRESSION:
1389
+ decoder.lines = 1;
1390
+ decoder.uncompress = UncompressRLE;
1391
+ break;
1392
+ case CompressionCodes.ZIPS_COMPRESSION:
1393
+ decoder.lines = 1;
1394
+ decoder.uncompress = UncompressZIP;
1395
+ await Tools.LoadScriptAsync(ExrLoaderGlobalConfiguration.FFLATEUrl);
1396
+ break;
1397
+ case CompressionCodes.ZIP_COMPRESSION:
1398
+ decoder.lines = 16;
1399
+ decoder.uncompress = UncompressZIP;
1400
+ await Tools.LoadScriptAsync(ExrLoaderGlobalConfiguration.FFLATEUrl);
1401
+ break;
1402
+ case CompressionCodes.PIZ_COMPRESSION:
1403
+ decoder.lines = 32;
1404
+ decoder.uncompress = UncompressPIZ;
1405
+ break;
1406
+ case CompressionCodes.PXR24_COMPRESSION:
1407
+ decoder.lines = 16;
1408
+ decoder.uncompress = UncompressPXR;
1409
+ await Tools.LoadScriptAsync(ExrLoaderGlobalConfiguration.FFLATEUrl);
1410
+ break;
1411
+ default:
1412
+ throw new Error(CompressionCodes[header.compression] + " is unsupported");
1413
+ }
1414
+ decoder.scanlineBlockSize = decoder.lines;
1415
+ const channels = {};
1416
+ for (const channel of header.channels) {
1417
+ switch (channel.name) {
1418
+ case "Y":
1419
+ case "R":
1420
+ case "G":
1421
+ case "B":
1422
+ case "A":
1423
+ channels[channel.name] = true;
1424
+ decoder.type = channel.pixelType;
1425
+ }
1426
+ }
1427
+ // RGB images will be converted to RGBA format, preventing software emulation in select devices.
1428
+ let fillAlpha = false;
1429
+ if (channels.R && channels.G && channels.B) {
1430
+ fillAlpha = !channels.A;
1431
+ decoder.outputChannels = 4;
1432
+ decoder.decodeChannels = { R: 0, G: 1, B: 2, A: 3 };
1433
+ }
1434
+ else if (channels.Y) {
1435
+ decoder.outputChannels = 1;
1436
+ decoder.decodeChannels = { Y: 0 };
1437
+ }
1438
+ else {
1439
+ throw new Error("EXRLoader.parse: file contains unsupported data channels.");
1440
+ }
1441
+ if (decoder.type === 1) {
1442
+ // half
1443
+ switch (outputType) {
1444
+ case EXROutputType.Float:
1445
+ decoder.getter = ParseFloat16;
1446
+ decoder.inputSize = INT16_SIZE;
1447
+ break;
1448
+ case EXROutputType.HalfFloat:
1449
+ decoder.getter = ParseUint16;
1450
+ decoder.inputSize = INT16_SIZE;
1451
+ break;
1452
+ }
1453
+ }
1454
+ else if (decoder.type === 2) {
1455
+ // float
1456
+ switch (outputType) {
1457
+ case EXROutputType.Float:
1458
+ decoder.getter = ParseFloat32;
1459
+ decoder.inputSize = FLOAT32_SIZE;
1460
+ break;
1461
+ case EXROutputType.HalfFloat:
1462
+ decoder.getter = DecodeFloat32;
1463
+ decoder.inputSize = FLOAT32_SIZE;
1464
+ }
1465
+ }
1466
+ else {
1467
+ throw new Error("Unsupported pixelType " + decoder.type + " for " + header.compression);
1468
+ }
1469
+ decoder.blockCount = decoder.height / decoder.scanlineBlockSize;
1470
+ for (let i = 0; i < decoder.blockCount; i++) {
1471
+ ParseInt64(dataView, offset); // scanlineOffset
1472
+ }
1473
+ // we should be passed the scanline offset table, ready to start reading pixel data.
1474
+ const size = decoder.width * decoder.height * decoder.outputChannels;
1475
+ switch (outputType) {
1476
+ case EXROutputType.Float:
1477
+ decoder.byteArray = new Float32Array(size);
1478
+ decoder.textureType = Constants.TEXTURETYPE_FLOAT;
1479
+ // Fill initially with 1s for the alpha value if the texture is not RGBA, RGB values will be overwritten
1480
+ if (fillAlpha) {
1481
+ decoder.byteArray.fill(1, 0, size);
1482
+ }
1483
+ break;
1484
+ case EXROutputType.HalfFloat:
1485
+ decoder.byteArray = new Uint16Array(size);
1486
+ decoder.textureType = Constants.TEXTURETYPE_HALF_FLOAT;
1487
+ if (fillAlpha) {
1488
+ decoder.byteArray.fill(0x3c00, 0, size); // Uint16Array holds half float data, 0x3C00 is 1
1489
+ }
1490
+ break;
1491
+ default:
1492
+ throw new Error("Unsupported type: " + outputType);
1493
+ }
1494
+ let byteOffset = 0;
1495
+ for (const channel of header.channels) {
1496
+ if (decoder.decodeChannels[channel.name] !== undefined) {
1497
+ decoder.channelLineOffsets[channel.name] = byteOffset * decoder.width;
1498
+ }
1499
+ byteOffset += channel.pixelType * 2;
1500
+ }
1501
+ decoder.bytesPerLine = decoder.width * byteOffset;
1502
+ decoder.outLineWidth = decoder.width * decoder.outputChannels;
1503
+ if (header.lineOrder === "INCREASING_Y") {
1504
+ decoder.scanOrder = (y) => y;
1505
+ }
1506
+ else {
1507
+ decoder.scanOrder = (y) => decoder.height - 1 - y;
1508
+ }
1509
+ if (decoder.outputChannels == 4) {
1510
+ decoder.format = Constants.TEXTUREFORMAT_RGBA;
1511
+ decoder.linearSpace = true;
1512
+ }
1513
+ else {
1514
+ decoder.format = Constants.TEXTUREFORMAT_R;
1515
+ decoder.linearSpace = false;
1516
+ }
1517
+ return decoder;
1518
+ }
1519
+ /**
1520
+ * Scan the data of the exr file
1521
+ * @param decoder decoder to use
1522
+ * @param header header of the exr file
1523
+ * @param dataView dataview of the exr file
1524
+ * @param offset current offset
1525
+ */
1526
+ function ScanData(decoder, header, dataView, offset) {
1527
+ const tmpOffset = { value: 0 };
1528
+ for (let scanlineBlockIdx = 0; scanlineBlockIdx < decoder.height / decoder.scanlineBlockSize; scanlineBlockIdx++) {
1529
+ const line = ParseInt32(dataView, offset) - header.dataWindow.yMin; // line_no
1530
+ decoder.size = ParseUint32(dataView, offset); // data_len
1531
+ decoder.lines = line + decoder.scanlineBlockSize > decoder.height ? decoder.height - line : decoder.scanlineBlockSize;
1532
+ const isCompressed = decoder.size < decoder.lines * decoder.bytesPerLine;
1533
+ const viewer = isCompressed && decoder.uncompress ? decoder.uncompress(decoder) : UncompressRAW(decoder);
1534
+ offset.value += decoder.size;
1535
+ for (let line_y = 0; line_y < decoder.scanlineBlockSize; line_y++) {
1536
+ const scan_y = scanlineBlockIdx * decoder.scanlineBlockSize;
1537
+ const true_y = line_y + decoder.scanOrder(scan_y);
1538
+ if (true_y >= decoder.height) {
1539
+ continue;
1540
+ }
1541
+ const lineOffset = line_y * decoder.bytesPerLine;
1542
+ const outLineOffset = (decoder.height - 1 - true_y) * decoder.outLineWidth;
1543
+ for (let channelID = 0; channelID < decoder.channels; channelID++) {
1544
+ const name = header.channels[channelID].name;
1545
+ const lOff = decoder.channelLineOffsets[name];
1546
+ const cOff = decoder.decodeChannels[name];
1547
+ if (cOff === undefined) {
1548
+ continue;
1549
+ }
1550
+ tmpOffset.value = lineOffset + lOff;
1551
+ for (let x = 0; x < decoder.width; x++) {
1552
+ const outIndex = outLineOffset + x * decoder.outputChannels + cOff;
1553
+ if (decoder.byteArray) {
1554
+ decoder.byteArray[outIndex] = decoder.getter(viewer, tmpOffset);
1555
+ }
1556
+ }
1557
+ }
1558
+ }
1559
+ }
1560
+ }
1561
+
1562
+ /**
1563
+ * Inspired by https://github.com/sciecode/three.js/blob/dev/examples/jsm/loaders/EXRLoader.js
1564
+ * Referred to the original Industrial Light & Magic OpenEXR implementation and the TinyEXR / Syoyo Fujita
1565
+ * implementation.
1566
+ */
1567
+ // /*
1568
+ // Copyright (c) 2014 - 2017, Syoyo Fujita
1569
+ // All rights reserved.
1570
+ // Redistribution and use in source and binary forms, with or without
1571
+ // modification, are permitted provided that the following conditions are met:
1572
+ // * Redistributions of source code must retain the above copyright
1573
+ // notice, this list of conditions and the following disclaimer.
1574
+ // * Redistributions in binary form must reproduce the above copyright
1575
+ // notice, this list of conditions and the following disclaimer in the
1576
+ // documentation and/or other materials provided with the distribution.
1577
+ // * Neither the name of the Syoyo Fujita nor the
1578
+ // names of its contributors may be used to endorse or promote products
1579
+ // derived from this software without specific prior written permission.
1580
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1581
+ // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1582
+ // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
1583
+ // DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
1584
+ // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
1585
+ // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
1586
+ // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
1587
+ // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1588
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
1589
+ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1590
+ // */
1591
+ // // TinyEXR contains some OpenEXR code, which is licensed under ------------
1592
+ // ///////////////////////////////////////////////////////////////////////////
1593
+ // //
1594
+ // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas
1595
+ // // Digital Ltd. LLC
1596
+ // //
1597
+ // // All rights reserved.
1598
+ // //
1599
+ // // Redistribution and use in source and binary forms, with or without
1600
+ // // modification, are permitted provided that the following conditions are
1601
+ // // met:
1602
+ // // * Redistributions of source code must retain the above copyright
1603
+ // // notice, this list of conditions and the following disclaimer.
1604
+ // // * Redistributions in binary form must reproduce the above
1605
+ // // copyright notice, this list of conditions and the following disclaimer
1606
+ // // in the documentation and/or other materials provided with the
1607
+ // // distribution.
1608
+ // // * Neither the name of Industrial Light & Magic nor the names of
1609
+ // // its contributors may be used to endorse or promote products derived
1610
+ // // from this software without specific prior written permission.
1611
+ // //
1612
+ // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1613
+ // // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1614
+ // // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1615
+ // // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1616
+ // // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
1617
+ // // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
1618
+ // // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
1619
+ // // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
1620
+ // // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1621
+ // // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
1622
+ // // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1623
+ // //
1624
+ // ///////////////////////////////////////////////////////////////////////////
1625
+ // // End of OpenEXR license -------------------------------------------------
1626
+ /**
1627
+ * Loader for .exr file format
1628
+ * #4RN0VF#151: PIZ compression
1629
+ * #4RN0VF#146: ZIP compression
1630
+ * #4RN0VF#149: RLE compression
1631
+ * #4RN0VF#150: PXR24 compression
1632
+ */
1633
+ // eslint-disable-next-line @typescript-eslint/naming-convention
1634
+ class _ExrTextureLoader {
1635
+ constructor() {
1636
+ /**
1637
+ * Defines whether the loader supports cascade loading the different faces.
1638
+ */
1639
+ this.supportCascades = false;
1640
+ }
1641
+ /**
1642
+ * Uploads the cube texture data to the WebGL texture. It has already been bound.
1643
+ * @param _data contains the texture data
1644
+ * @param _texture defines the BabylonJS internal texture
1645
+ * @param _createPolynomials will be true if polynomials have been requested
1646
+ * @param _onLoad defines the callback to trigger once the texture is ready
1647
+ * @param _onError defines the callback to trigger in case of error
1648
+ * Cube texture are not supported by .exr files
1649
+ */
1650
+ loadCubeData(_data, _texture, _createPolynomials, _onLoad, _onError) {
1651
+ // eslint-disable-next-line no-throw-literal
1652
+ throw ".exr not supported in Cube.";
1653
+ }
1654
+ /**
1655
+ * Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.
1656
+ * @param data contains the texture data
1657
+ * @param texture defines the BabylonJS internal texture
1658
+ * @param callback defines the method to call once ready to upload
1659
+ */
1660
+ async loadData(data, texture, callback) {
1661
+ const dataView = new DataView(data.buffer);
1662
+ const offset = { value: 0 };
1663
+ const header = GetExrHeader(dataView, offset);
1664
+ const decoder = await CreateDecoderAsync(header, dataView, offset, ExrLoaderGlobalConfiguration.DefaultOutputType);
1665
+ ScanData(decoder, header, dataView, offset);
1666
+ // Updating texture
1667
+ const width = header.dataWindow.xMax - header.dataWindow.xMin + 1;
1668
+ const height = header.dataWindow.yMax - header.dataWindow.yMin + 1;
1669
+ callback(width, height, texture.generateMipMaps, false, () => {
1670
+ const engine = texture.getEngine();
1671
+ texture.format = header.format;
1672
+ texture.type = decoder.textureType;
1673
+ texture.invertY = false;
1674
+ texture._gammaSpace = !header.linearSpace;
1675
+ if (decoder.byteArray) {
1676
+ engine._uploadDataToTextureDirectly(texture, decoder.byteArray, 0, 0, undefined, true);
1677
+ }
1678
+ });
1679
+ }
1680
+ }
1681
+
1682
+ export { _ExrTextureLoader };
1683
+ //# sourceMappingURL=exrTextureLoader-BRkB54sO.esm.js.map