@woosh/meep-engine 3.79.0 → 3.80.0

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 (309) hide show
  1. package/CHANGELOG.md +62 -3
  2. package/README.md +1 -1
  3. package/package.json +1 -1
  4. package/src/format/image/webp/vp8/VP8BoolDecoder.d.ts +45 -0
  5. package/src/format/image/webp/vp8/VP8BoolDecoder.d.ts.map +1 -0
  6. package/src/format/image/webp/vp8/VP8BoolDecoder.js +137 -0
  7. package/src/format/image/webp/vp8/vp8_decode.d.ts +21 -0
  8. package/src/format/image/webp/vp8/vp8_decode.d.ts.map +1 -0
  9. package/src/format/image/webp/vp8/vp8_decode.js +756 -0
  10. package/src/format/image/webp/vp8/vp8_loop_filter.d.ts +31 -0
  11. package/src/format/image/webp/vp8/vp8_loop_filter.d.ts.map +1 -0
  12. package/src/format/image/webp/vp8/vp8_loop_filter.js +189 -0
  13. package/src/format/image/webp/vp8/vp8_predict.d.ts +48 -0
  14. package/src/format/image/webp/vp8/vp8_predict.d.ts.map +1 -0
  15. package/src/format/image/webp/vp8/vp8_predict.js +290 -0
  16. package/src/format/image/webp/vp8/vp8_tables.d.ts +34 -0
  17. package/src/format/image/webp/vp8/vp8_tables.d.ts.map +1 -0
  18. package/src/format/image/webp/vp8/vp8_tables.js +350 -0
  19. package/src/format/image/webp/vp8/vp8_transform.d.ts +22 -0
  20. package/src/format/image/webp/vp8/vp8_transform.d.ts.map +1 -0
  21. package/src/format/image/webp/vp8/vp8_transform.js +114 -0
  22. package/src/format/image/webp/vp8/vp8_yuv_to_rgba.d.ts +23 -0
  23. package/src/format/image/webp/vp8/vp8_yuv_to_rgba.d.ts.map +1 -0
  24. package/src/format/image/webp/vp8/vp8_yuv_to_rgba.js +133 -0
  25. package/src/format/image/webp/vp8l/VP8LBitReader.d.ts +47 -0
  26. package/src/format/image/webp/vp8l/VP8LBitReader.d.ts.map +1 -0
  27. package/src/format/image/webp/vp8l/VP8LBitReader.js +84 -0
  28. package/src/format/image/webp/vp8l/VP8LPrefixCode.d.ts +27 -0
  29. package/src/format/image/webp/vp8l/VP8LPrefixCode.d.ts.map +1 -0
  30. package/src/format/image/webp/vp8l/VP8LPrefixCode.js +184 -0
  31. package/src/format/image/webp/vp8l/vp8l_decode.d.ts +28 -0
  32. package/src/format/image/webp/vp8l/vp8l_decode.d.ts.map +1 -0
  33. package/src/format/image/webp/vp8l/vp8l_decode.js +261 -0
  34. package/src/format/image/webp/vp8l/vp8l_distance.d.ts +22 -0
  35. package/src/format/image/webp/vp8l/vp8l_distance.d.ts.map +1 -0
  36. package/src/format/image/webp/vp8l/vp8l_distance.js +62 -0
  37. package/src/format/image/webp/vp8l/vp8l_inverse_transforms.d.ts +50 -0
  38. package/src/format/image/webp/vp8l/vp8l_inverse_transforms.d.ts.map +1 -0
  39. package/src/format/image/webp/vp8l/vp8l_inverse_transforms.js +267 -0
  40. package/src/format/image/webp/vp8l/vp8l_read_prefix_code.d.ts +14 -0
  41. package/src/format/image/webp/vp8l/vp8l_read_prefix_code.d.ts.map +1 -0
  42. package/src/format/image/webp/vp8l/vp8l_read_prefix_code.js +99 -0
  43. package/src/format/image/webp/webp_decode.d.ts +23 -0
  44. package/src/format/image/webp/webp_decode.d.ts.map +1 -0
  45. package/src/format/image/webp/webp_decode.js +179 -0
  46. package/src/format/image/webp/webp_decode_alpha.d.ts +18 -0
  47. package/src/format/image/webp/webp_decode_alpha.d.ts.map +1 -0
  48. package/src/format/image/webp/webp_decode_alpha.js +84 -0
  49. package/src/format/texture/{basis → astc}/astc_block.d.ts +41 -0
  50. package/src/format/texture/astc/astc_block.d.ts.map +1 -0
  51. package/src/format/texture/{basis → astc}/astc_block.js +284 -164
  52. package/src/format/texture/astc/astc_decode_block.d.ts +68 -0
  53. package/src/format/texture/astc/astc_decode_block.d.ts.map +1 -0
  54. package/src/format/texture/astc/astc_decode_block.js +1119 -0
  55. package/src/format/texture/astc/astc_encode_block_4x4.d.ts +32 -0
  56. package/src/format/texture/astc/astc_encode_block_4x4.d.ts.map +1 -0
  57. package/src/format/texture/astc/astc_encode_block_4x4.js +181 -0
  58. package/src/format/texture/astc/astc_encode_block_4x4_rgba.d.ts +32 -0
  59. package/src/format/texture/astc/astc_encode_block_4x4_rgba.d.ts.map +1 -0
  60. package/src/format/texture/astc/astc_encode_block_4x4_rgba.js +337 -0
  61. package/src/format/texture/astc/astc_integer_sequence.d.ts.map +1 -0
  62. package/src/format/texture/{basis → astc}/astc_integer_sequence.js +251 -251
  63. package/src/format/texture/astc/astc_partition.d.ts.map +1 -0
  64. package/src/format/texture/{basis → astc}/astc_partition.js +199 -199
  65. package/src/format/texture/basis/transcode/etc1s_to_astc.js +329 -329
  66. package/src/format/texture/basis/transcode/etc1s_to_etc2.d.ts.map +1 -1
  67. package/src/format/texture/basis/transcode/etc1s_to_etc2.js +305 -332
  68. package/src/format/texture/basis/transcode/fit_endpoints.d.ts.map +1 -1
  69. package/src/format/texture/basis/transcode/fit_endpoints.js +14 -27
  70. package/src/format/texture/basis/uastc/uastc_bc7_tables.d.ts +66 -0
  71. package/src/format/texture/basis/uastc/uastc_bc7_tables.d.ts.map +1 -0
  72. package/src/format/texture/basis/uastc/uastc_bc7_tables.js +148 -0
  73. package/src/format/texture/basis/uastc/uastc_decode_block.js +463 -463
  74. package/src/format/texture/basis/uastc/uastc_to_astc.js +421 -421
  75. package/src/format/texture/basis/uastc/uastc_to_bc5.d.ts +1 -6
  76. package/src/format/texture/basis/uastc/uastc_to_bc5.d.ts.map +1 -1
  77. package/src/format/texture/basis/uastc/uastc_to_bc5.js +48 -115
  78. package/src/format/texture/basis/uastc/uastc_to_bc7.d.ts.map +1 -1
  79. package/src/format/texture/basis/uastc/uastc_to_bc7.js +604 -602
  80. package/src/format/texture/bc/bc1_decode_block.d.ts +19 -0
  81. package/src/format/texture/bc/bc1_decode_block.d.ts.map +1 -0
  82. package/src/format/texture/bc/bc1_decode_block.js +22 -0
  83. package/src/format/texture/bc/bc1_decode_colors.d.ts +27 -0
  84. package/src/format/texture/bc/bc1_decode_colors.d.ts.map +1 -0
  85. package/src/format/texture/bc/bc1_decode_colors.js +100 -0
  86. package/src/format/texture/bc/bc2_decode_block.d.ts +18 -0
  87. package/src/format/texture/bc/bc2_decode_block.d.ts.map +1 -0
  88. package/src/format/texture/bc/bc2_decode_block.js +28 -0
  89. package/src/format/texture/bc/bc3_decode_block.d.ts +18 -0
  90. package/src/format/texture/bc/bc3_decode_block.d.ts.map +1 -0
  91. package/src/format/texture/bc/bc3_decode_block.js +23 -0
  92. package/src/format/texture/bc/bc4_decode_channel.d.ts +56 -0
  93. package/src/format/texture/bc/bc4_decode_channel.d.ts.map +1 -0
  94. package/src/format/texture/bc/bc4_decode_channel.js +138 -0
  95. package/src/format/texture/bc/bc4_encode_block.d.ts +43 -0
  96. package/src/format/texture/bc/bc4_encode_block.d.ts.map +1 -0
  97. package/src/format/texture/bc/bc4_encode_block.js +324 -0
  98. package/src/format/texture/bc/bc4_snorm_decode_block.d.ts +18 -0
  99. package/src/format/texture/bc/bc4_snorm_decode_block.d.ts.map +1 -0
  100. package/src/format/texture/bc/bc4_snorm_decode_block.js +27 -0
  101. package/src/format/texture/bc/bc4_unorm_decode_block.d.ts +17 -0
  102. package/src/format/texture/bc/bc4_unorm_decode_block.d.ts.map +1 -0
  103. package/src/format/texture/bc/bc4_unorm_decode_block.js +26 -0
  104. package/src/format/texture/bc/bc5_encode_block.d.ts +25 -0
  105. package/src/format/texture/bc/bc5_encode_block.d.ts.map +1 -0
  106. package/src/format/texture/bc/bc5_encode_block.js +34 -0
  107. package/src/format/texture/bc/bc5_snorm_decode_block.d.ts +18 -0
  108. package/src/format/texture/bc/bc5_snorm_decode_block.d.ts.map +1 -0
  109. package/src/format/texture/bc/bc5_snorm_decode_block.js +27 -0
  110. package/src/format/texture/bc/bc5_unorm_decode_block.d.ts +17 -0
  111. package/src/format/texture/bc/bc5_unorm_decode_block.d.ts.map +1 -0
  112. package/src/format/texture/bc/bc5_unorm_decode_block.js +26 -0
  113. package/src/format/texture/bc/bc6h_decode_texels.d.ts +30 -0
  114. package/src/format/texture/bc/bc6h_decode_texels.d.ts.map +1 -0
  115. package/src/format/texture/bc/bc6h_decode_texels.js +430 -0
  116. package/src/format/texture/bc/bc6h_sfloat_decode_block.d.ts +20 -0
  117. package/src/format/texture/bc/bc6h_sfloat_decode_block.d.ts.map +1 -0
  118. package/src/format/texture/bc/bc6h_sfloat_decode_block.js +23 -0
  119. package/src/format/texture/bc/bc6h_ufloat_decode_block.d.ts +18 -0
  120. package/src/format/texture/bc/bc6h_ufloat_decode_block.d.ts.map +1 -0
  121. package/src/format/texture/bc/bc6h_ufloat_decode_block.js +21 -0
  122. package/src/format/texture/bc/bc7_decode_block.d.ts +30 -0
  123. package/src/format/texture/bc/bc7_decode_block.d.ts.map +1 -0
  124. package/src/format/texture/bc/bc7_decode_block.js +232 -0
  125. package/src/format/texture/bc/bc7_encode_block.d.ts +39 -0
  126. package/src/format/texture/bc/bc7_encode_block.d.ts.map +1 -0
  127. package/src/format/texture/bc/bc7_encode_block.js +423 -0
  128. package/src/format/texture/bc/bc7_tables.d.ts +126 -0
  129. package/src/format/texture/bc/bc7_tables.d.ts.map +1 -0
  130. package/src/format/texture/{basis/uastc → bc}/bc7_tables.js +225 -276
  131. package/src/format/texture/bc/bc7_write_block.d.ts +65 -0
  132. package/src/format/texture/bc/bc7_write_block.d.ts.map +1 -0
  133. package/src/format/texture/{basis/uastc → bc}/bc7_write_block.js +185 -227
  134. package/src/format/texture/etc/eac_decode_channel.d.ts +50 -0
  135. package/src/format/texture/etc/eac_decode_channel.d.ts.map +1 -0
  136. package/src/format/texture/etc/eac_decode_channel.js +142 -0
  137. package/src/format/texture/etc/eac_modifiers.d.ts +15 -0
  138. package/src/format/texture/etc/eac_modifiers.d.ts.map +1 -0
  139. package/src/format/texture/etc/eac_modifiers.js +31 -0
  140. package/src/format/texture/etc/eac_r11_snorm_decode_block.d.ts +21 -0
  141. package/src/format/texture/etc/eac_r11_snorm_decode_block.d.ts.map +1 -0
  142. package/src/format/texture/etc/eac_r11_snorm_decode_block.js +30 -0
  143. package/src/format/texture/etc/eac_r11_unorm_decode_block.d.ts +20 -0
  144. package/src/format/texture/etc/eac_r11_unorm_decode_block.d.ts.map +1 -0
  145. package/src/format/texture/etc/eac_r11_unorm_decode_block.js +29 -0
  146. package/src/format/texture/etc/eac_rg11_snorm_decode_block.d.ts +19 -0
  147. package/src/format/texture/etc/eac_rg11_snorm_decode_block.d.ts.map +1 -0
  148. package/src/format/texture/etc/eac_rg11_snorm_decode_block.js +28 -0
  149. package/src/format/texture/etc/eac_rg11_unorm_decode_block.d.ts +19 -0
  150. package/src/format/texture/etc/eac_rg11_unorm_decode_block.d.ts.map +1 -0
  151. package/src/format/texture/etc/eac_rg11_unorm_decode_block.js +28 -0
  152. package/src/format/texture/etc/etc2_decode_color.d.ts +25 -0
  153. package/src/format/texture/etc/etc2_decode_color.d.ts.map +1 -0
  154. package/src/format/texture/etc/etc2_decode_color.js +370 -0
  155. package/src/format/texture/etc/etc2_rgb8_decode_block.d.ts +18 -0
  156. package/src/format/texture/etc/etc2_rgb8_decode_block.d.ts.map +1 -0
  157. package/src/format/texture/etc/etc2_rgb8_decode_block.js +21 -0
  158. package/src/format/texture/etc/etc2_rgb8a1_decode_block.d.ts +21 -0
  159. package/src/format/texture/etc/etc2_rgb8a1_decode_block.d.ts.map +1 -0
  160. package/src/format/texture/etc/etc2_rgb8a1_decode_block.js +24 -0
  161. package/src/format/texture/etc/etc2_rgba8_decode_block.d.ts +18 -0
  162. package/src/format/texture/etc/etc2_rgba8_decode_block.d.ts.map +1 -0
  163. package/src/format/texture/etc/etc2_rgba8_decode_block.js +24 -0
  164. package/src/format/texture/fit/fit_line.d.ts +23 -0
  165. package/src/format/texture/fit/fit_line.d.ts.map +1 -0
  166. package/src/format/texture/fit/fit_line.js +123 -0
  167. package/src/format/texture/fit/fit_line_refine.d.ts +21 -0
  168. package/src/format/texture/fit/fit_line_refine.d.ts.map +1 -0
  169. package/src/format/texture/fit/fit_line_refine.js +69 -0
  170. package/src/format/texture/fit/fit_line_solve.d.ts +23 -0
  171. package/src/format/texture/fit/fit_line_solve.d.ts.map +1 -0
  172. package/src/format/texture/fit/fit_line_solve.js +71 -0
  173. package/src/format/texture/texel_decode_image.d.ts +44 -0
  174. package/src/format/texture/texel_decode_image.d.ts.map +1 -0
  175. package/src/format/texture/texel_decode_image.js +251 -0
  176. package/src/format/texture/texel_encode_image.d.ts +77 -0
  177. package/src/format/texture/texel_encode_image.d.ts.map +1 -0
  178. package/src/format/texture/texel_encode_image.js +187 -0
  179. package/src/shade/renderer/ShadeIndirectLightingMode.js +2 -0
  180. package/src/shade/renderer/acoustics/GPUAcousticLattice.d.ts +1 -1
  181. package/src/shade/renderer/acoustics/GPUAcoustics.d.ts +1 -1
  182. package/src/shade/renderer/loader/mtf/mtf_encode_texture.d.ts +1 -0
  183. package/src/shade/renderer/loader/mtf/mtf_encode_texture.d.ts.map +1 -1
  184. package/src/shade/renderer/loader/mtf/mtf_encode_texture.js +102 -28
  185. package/src/shade/renderer/loader/mtf/mtf_replace_textures.d.ts +19 -0
  186. package/src/shade/renderer/loader/mtf/mtf_replace_textures.d.ts.map +1 -0
  187. package/src/shade/renderer/loader/mtf/mtf_replace_textures.js +60 -0
  188. package/src/shade/renderer/loader/mtf/mtf_write.d.ts.map +1 -1
  189. package/src/shade/renderer/loader/mtf/mtf_write.js +7 -31
  190. package/src/shade/renderer/loader/mtf/mtf_write_collection.d.ts +23 -0
  191. package/src/shade/renderer/loader/mtf/mtf_write_collection.d.ts.map +1 -0
  192. package/src/shade/renderer/loader/mtf/mtf_write_collection.js +36 -0
  193. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4.d.ts +13 -0
  194. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4.d.ts.map +1 -0
  195. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4.js +39 -0
  196. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.d.ts +3 -2
  197. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.d.ts.map +1 -1
  198. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.js +6 -21
  199. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgba.d.ts +42 -0
  200. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgba.d.ts.map +1 -0
  201. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgba.js +612 -0
  202. package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts +5 -4
  203. package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts.map +1 -1
  204. package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.js +8 -25
  205. package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.d.ts.map +1 -1
  206. package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.js +3 -19
  207. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.d.ts +14 -4
  208. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.d.ts.map +1 -1
  209. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.js +65 -54
  210. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts +2 -2
  211. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts.map +1 -1
  212. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.js +5 -22
  213. package/src/shade/renderer/texture/encode/chunk_bc7_partition_2.js +1 -1
  214. package/src/shade/renderer/texture/encode/chunk_scatter_principal_axis.d.ts +27 -0
  215. package/src/shade/renderer/texture/encode/chunk_scatter_principal_axis.d.ts.map +1 -0
  216. package/src/shade/renderer/texture/encode/chunk_scatter_principal_axis.js +147 -0
  217. package/src/shade/renderer/texture/encode/shader_texture_encode_astc_4x4.d.ts +3 -4
  218. package/src/shade/renderer/texture/encode/shader_texture_encode_astc_4x4.d.ts.map +1 -1
  219. package/src/shade/renderer/texture/encode/shader_texture_encode_astc_4x4.js +6 -13
  220. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7_rgb.d.ts +13 -0
  221. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7_rgb.d.ts.map +1 -0
  222. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7_rgb.js +66 -0
  223. package/src/shade/renderer/texture/encode/texture_encode.d.ts +28 -1
  224. package/src/shade/renderer/texture/encode/texture_encode.d.ts.map +1 -1
  225. package/src/shade/renderer/texture/encode/texture_encode.js +202 -168
  226. package/src/shade/renderer/texture/encode/texture_encode_shader.d.ts +13 -1
  227. package/src/shade/renderer/texture/encode/texture_encode_shader.d.ts.map +1 -1
  228. package/src/shade/renderer/texture/encode/texture_encode_shader.js +146 -108
  229. package/src/shade/renderer/texture/format/texture_formats_to_build.d.ts +20 -0
  230. package/src/shade/renderer/texture/format/texture_formats_to_build.d.ts.map +1 -0
  231. package/src/shade/renderer/texture/format/texture_formats_to_build.js +98 -0
  232. package/src/shade/renderer/texture/mipmaps/WebGPUMipmapGenerator.d.ts.map +1 -1
  233. package/src/shade/renderer/texture/mipmaps/WebGPUMipmapGenerator.js +4 -23
  234. package/src/shade/renderer/texture/mipmaps/cpu/MipmapBilinearAxis.d.ts +53 -0
  235. package/src/shade/renderer/texture/mipmaps/cpu/MipmapBilinearAxis.d.ts.map +1 -0
  236. package/src/shade/renderer/texture/mipmaps/cpu/MipmapBilinearAxis.js +76 -0
  237. package/src/shade/renderer/texture/mipmaps/cpu/MipmapKernelAxis.d.ts +40 -0
  238. package/src/shade/renderer/texture/mipmaps/cpu/MipmapKernelAxis.d.ts.map +1 -0
  239. package/src/shade/renderer/texture/mipmaps/cpu/MipmapKernelAxis.js +43 -0
  240. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_centres.d.ts +17 -0
  241. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_centres.d.ts.map +1 -0
  242. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_centres.js +29 -0
  243. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_sample.d.ts +21 -0
  244. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_sample.d.ts.map +1 -0
  245. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_sample.js +91 -0
  246. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_chain_cpu.d.ts +32 -0
  247. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_chain_cpu.d.ts.map +1 -0
  248. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_chain_cpu.js +216 -0
  249. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_cubic_filter_cpu.d.ts +30 -0
  250. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_cubic_filter_cpu.d.ts.map +1 -0
  251. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_cubic_filter_cpu.js +134 -0
  252. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_catmull_rom_cpu.d.ts +16 -0
  253. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_catmull_rom_cpu.d.ts.map +1 -0
  254. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_catmull_rom_cpu.js +33 -0
  255. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_cpu.d.ts +18 -0
  256. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_cpu.d.ts.map +1 -0
  257. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_cpu.js +71 -0
  258. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_normal_cpu.d.ts +20 -0
  259. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_normal_cpu.d.ts.map +1 -0
  260. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_normal_cpu.js +57 -0
  261. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_magic_kernel_cpu.d.ts +18 -0
  262. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_magic_kernel_cpu.d.ts.map +1 -0
  263. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_magic_kernel_cpu.js +111 -0
  264. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mitchell_cpu.d.ts +16 -0
  265. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mitchell_cpu.d.ts.map +1 -0
  266. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mitchell_cpu.js +33 -0
  267. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mks_cpu.d.ts +18 -0
  268. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mks_cpu.d.ts.map +1 -0
  269. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mks_cpu.js +128 -0
  270. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_wronski2021_cpu.d.ts +21 -0
  271. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_wronski2021_cpu.d.ts.map +1 -0
  272. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_wronski2021_cpu.js +169 -0
  273. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_kernel_reduce.d.ts +21 -0
  274. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_kernel_reduce.d.ts.map +1 -0
  275. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_kernel_reduce.js +119 -0
  276. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_source_centre.d.ts +16 -0
  277. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_source_centre.d.ts.map +1 -0
  278. package/src/shade/renderer/texture/mipmaps/cpu/mipmap_source_centre.js +19 -0
  279. package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm.d.ts +24 -0
  280. package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm.d.ts.map +1 -0
  281. package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm.js +41 -0
  282. package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm_srgb.d.ts +24 -0
  283. package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm_srgb.d.ts.map +1 -0
  284. package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm_srgb.js +140 -0
  285. package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_srgb_to_f32.d.ts +21 -0
  286. package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_srgb_to_f32.d.ts.map +1 -0
  287. package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_srgb_to_f32.js +35 -0
  288. package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_to_f32.d.ts +19 -0
  289. package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_to_f32.d.ts.map +1 -0
  290. package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_to_f32.js +27 -0
  291. package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_catmull_rom.js +4 -4
  292. package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_linear.d.ts +13 -0
  293. package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_linear.d.ts.map +1 -1
  294. package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_linear.js +54 -4
  295. package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_mitchell.js +4 -4
  296. package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_mks.d.ts.map +1 -1
  297. package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_mks.js +9 -13
  298. package/src/shade/renderer/texture/texture_block_encodings.d.ts +33 -0
  299. package/src/shade/renderer/texture/texture_block_encodings.d.ts.map +1 -0
  300. package/src/shade/renderer/texture/texture_block_encodings.js +89 -0
  301. package/src/format/texture/basis/astc_block.d.ts.map +0 -1
  302. package/src/format/texture/basis/astc_integer_sequence.d.ts.map +0 -1
  303. package/src/format/texture/basis/astc_partition.d.ts.map +0 -1
  304. package/src/format/texture/basis/uastc/bc7_tables.d.ts +0 -111
  305. package/src/format/texture/basis/uastc/bc7_tables.d.ts.map +0 -1
  306. package/src/format/texture/basis/uastc/bc7_write_block.d.ts +0 -124
  307. package/src/format/texture/basis/uastc/bc7_write_block.d.ts.map +0 -1
  308. /package/src/format/texture/{basis → astc}/astc_integer_sequence.d.ts +0 -0
  309. /package/src/format/texture/{basis → astc}/astc_partition.d.ts +0 -0
@@ -0,0 +1,179 @@
1
+ import { vp8_decode } from "./vp8/vp8_decode.js";
2
+ import { webp_decode_alpha } from "./webp_decode_alpha.js";
3
+ import { vp8l_decode } from "./vp8l/vp8l_decode.js";
4
+
5
+ /**
6
+ * The extended header's flag for an animation (RFC 9649 §2.7).
7
+ *
8
+ * @type {number}
9
+ */
10
+ const FLAG_ANIMATION = 0x02;
11
+
12
+ /**
13
+ * @param {Uint8Array} bytes
14
+ * @param {number} at
15
+ * @returns {string} the four ASCII characters at `at`
16
+ */
17
+ function fourcc(bytes, at) {
18
+ return String.fromCharCode(bytes[at], bytes[at + 1], bytes[at + 2], bytes[at + 3]);
19
+ }
20
+
21
+ /**
22
+ * @param {Uint8Array} bytes
23
+ * @param {number} at
24
+ * @returns {number}
25
+ */
26
+ function u32(bytes, at) {
27
+ return (bytes[at] | (bytes[at + 1] << 8) | (bytes[at + 2] << 16) | (bytes[at + 3] << 24)) >>> 0;
28
+ }
29
+
30
+ /**
31
+ * @param {Uint8Array} bytes
32
+ * @param {number} at
33
+ * @returns {number}
34
+ */
35
+ function u24(bytes, at) {
36
+ return bytes[at] | (bytes[at + 1] << 8) | (bytes[at + 2] << 16);
37
+ }
38
+
39
+ /**
40
+ * The chunks of a WebP file, in order.
41
+ *
42
+ * @param {Uint8Array} bytes
43
+ * @returns {{type: string, payload: Uint8Array}[]}
44
+ */
45
+ function read_chunks(bytes) {
46
+ if (bytes.length < 12 || fourcc(bytes, 0) !== "RIFF" || fourcc(bytes, 8) !== "WEBP") {
47
+ throw new Error("not a WebP file: no RIFF header naming WEBP");
48
+ }
49
+
50
+ const end = 8 + u32(bytes, 4);
51
+
52
+ if (end > bytes.length) {
53
+ throw new Error(`WebP: the file says it is ${end} bytes and is ${bytes.length}`);
54
+ }
55
+
56
+ const chunks = [];
57
+
58
+ let at = 12;
59
+
60
+ while (at + 8 <= end) {
61
+ const type = fourcc(bytes, at);
62
+ const size = u32(bytes, at + 4);
63
+
64
+ if (at + 8 + size > end) {
65
+ throw new Error(`WebP: chunk '${type}' runs past the end of the file`);
66
+ }
67
+
68
+ chunks.push({ type, payload: bytes.subarray(at + 8, at + 8 + size) });
69
+
70
+ // a chunk of odd size is padded to an even one
71
+ at += 8 + size + (size & 1);
72
+ }
73
+
74
+ if (chunks.length === 0) {
75
+ throw new Error("WebP: a file with no chunks");
76
+ }
77
+
78
+ return chunks;
79
+ }
80
+
81
+ /**
82
+ * Lossless pixels as RGBA bytes.
83
+ *
84
+ * @param {Uint32Array} argb
85
+ * @returns {Uint8Array}
86
+ */
87
+ function argb_to_rgba(argb) {
88
+ const out = new Uint8Array(argb.length * 4);
89
+
90
+ for (let i = 0; i < argb.length; i++) {
91
+ const p = argb[i];
92
+
93
+ out[i * 4] = (p >>> 16) & 0xFF;
94
+ out[i * 4 + 1] = (p >>> 8) & 0xFF;
95
+ out[i * 4 + 2] = p & 0xFF;
96
+ out[i * 4 + 3] = p >>> 24;
97
+ }
98
+
99
+ return out;
100
+ }
101
+
102
+ /**
103
+ * A still WebP image's pixels: lossy (`VP8 `), lossless (`VP8L`), and either inside the extended format (`VP8X`), a
104
+ * lossy one with its alpha (`ALPH`).
105
+ *
106
+ * What it decodes to is what libwebp decodes to, sample for sample: a lossy picture's colour is libwebp's conversion
107
+ * from YUV, chroma upsampled by interpolating between the samples around each pixel, as browsers show it. An ICC
108
+ * profile, Exif and XMP are left unread.
109
+ *
110
+ * @param {Uint8Array} bytes the file, whole
111
+ * @returns {{width: number, height: number, has_alpha: boolean, data: Uint8Array}} `data` is RGBA, eight bits a channel,
112
+ * not premultiplied; `has_alpha` is whether the file says the picture has alpha, which is opaque wherever it has none
113
+ * @throws {Error} for bytes that are not a WebP file, a file cut short or damaged, and an animation
114
+ *
115
+ * @author Alex Goldring
116
+ * @copyright Company Named Limited (c) 2026
117
+ */
118
+ export function webp_decode(bytes) {
119
+ const chunks = read_chunks(bytes);
120
+ const first = chunks[0];
121
+
122
+ if (first.type === "VP8L") {
123
+ const image = vp8l_decode(first.payload);
124
+
125
+ return { width: image.width, height: image.height, has_alpha: image.has_alpha, data: argb_to_rgba(image.argb) };
126
+ }
127
+
128
+ if (first.type === "VP8 ") {
129
+ return { ...vp8_decode(first.payload), has_alpha: false };
130
+ }
131
+
132
+ if (first.type !== "VP8X") {
133
+ throw new Error(`WebP: a file opening with a '${first.type}' chunk`);
134
+ }
135
+
136
+ const header = first.payload;
137
+
138
+ if (header.length < 10) {
139
+ throw new Error("WebP: an extended header cut short");
140
+ }
141
+
142
+ if ((header[0] & FLAG_ANIMATION) !== 0) {
143
+ throw new Error("WebP: an animated file; only still images are decoded");
144
+ }
145
+
146
+ const width = u24(header, 4) + 1;
147
+ const height = u24(header, 7) + 1;
148
+
149
+ const alpha = chunks.find(chunk => chunk.type === "ALPH");
150
+ const picture = chunks.find(chunk => chunk.type === "VP8 " || chunk.type === "VP8L");
151
+
152
+ if (picture === undefined) {
153
+ throw new Error("WebP: an extended file with no picture in it");
154
+ }
155
+
156
+ let image;
157
+
158
+ if (picture.type === "VP8L") {
159
+ const lossless = vp8l_decode(picture.payload);
160
+
161
+ image = { width: lossless.width, height: lossless.height, has_alpha: lossless.has_alpha, data: argb_to_rgba(lossless.argb) };
162
+ } else {
163
+ image = { ...vp8_decode(picture.payload), has_alpha: alpha !== undefined };
164
+
165
+ if (alpha !== undefined) {
166
+ const values = webp_decode_alpha(alpha.payload, image.width, image.height);
167
+
168
+ for (let i = 0; i < values.length; i++) {
169
+ image.data[i * 4 + 3] = values[i];
170
+ }
171
+ }
172
+ }
173
+
174
+ if (image.width !== width || image.height !== height) {
175
+ throw new Error(`WebP: a ${image.width}x${image.height} picture on a ${width}x${height} canvas`);
176
+ }
177
+
178
+ return image;
179
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * The alpha of a lossy WebP picture, from its `ALPH` chunk (RFC 9649 §2.7.1.2): a header byte, then the alpha values
3
+ * raw or as the green of a lossless image stream, then undone from whichever of three predictive filters they were
4
+ * written with.
5
+ *
6
+ * The header's pre-processing bits only say that the values were quantized before they were written; there is nothing
7
+ * to undo for it.
8
+ *
9
+ * @param {Uint8Array} payload the chunk's payload
10
+ * @param {number} width of the picture
11
+ * @param {number} height
12
+ * @returns {Uint8Array} one value a pixel
13
+ *
14
+ * @author Alex Goldring
15
+ * @copyright Company Named Limited (c) 2026
16
+ */
17
+ export function webp_decode_alpha(payload: Uint8Array, width: number, height: number): Uint8Array;
18
+ //# sourceMappingURL=webp_decode_alpha.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webp_decode_alpha.d.ts","sourceRoot":"","sources":["../../../../../src/format/image/webp/webp_decode_alpha.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;GAeG;AACH,2CARW,UAAU,SACV,MAAM,UACN,MAAM,GACJ,UAAU,CAqEtB"}
@@ -0,0 +1,84 @@
1
+ import { VP8LBitReader } from "./vp8l/VP8LBitReader.js";
2
+ import { vp8l_decode_image_stream } from "./vp8l/vp8l_decode.js";
3
+
4
+ /**
5
+ * The alpha of a lossy WebP picture, from its `ALPH` chunk (RFC 9649 §2.7.1.2): a header byte, then the alpha values
6
+ * raw or as the green of a lossless image stream, then undone from whichever of three predictive filters they were
7
+ * written with.
8
+ *
9
+ * The header's pre-processing bits only say that the values were quantized before they were written; there is nothing
10
+ * to undo for it.
11
+ *
12
+ * @param {Uint8Array} payload the chunk's payload
13
+ * @param {number} width of the picture
14
+ * @param {number} height
15
+ * @returns {Uint8Array} one value a pixel
16
+ *
17
+ * @author Alex Goldring
18
+ * @copyright Company Named Limited (c) 2026
19
+ */
20
+ export function webp_decode_alpha(payload, width, height) {
21
+ if (payload.length < 1) {
22
+ throw new Error("WebP: an empty ALPH chunk");
23
+ }
24
+
25
+ const header = payload[0];
26
+ const compression = header & 3;
27
+ const filter = (header >> 2) & 3;
28
+
29
+ const count = width * height;
30
+ const values = new Uint8Array(count);
31
+
32
+ if (compression === 0) {
33
+ if (payload.length - 1 < count) {
34
+ throw new Error("WebP: raw alpha cut short");
35
+ }
36
+
37
+ values.set(payload.subarray(1, 1 + count));
38
+ } else if (compression === 1) {
39
+ const reader = new VP8LBitReader(payload.subarray(1));
40
+ const argb = vp8l_decode_image_stream(reader, width, height);
41
+
42
+ for (let i = 0; i < count; i++) {
43
+ values[i] = (argb[i] >>> 8) & 0xFF;
44
+ }
45
+ } else {
46
+ throw new Error(`WebP: alpha compression method ${compression}`);
47
+ }
48
+
49
+ if (filter === 0) {
50
+ return values;
51
+ }
52
+
53
+ // each value was written as its difference from a prediction by its restored neighbours: the first row from the
54
+ // left, the first column from above, the first value from zero
55
+ for (let x = 1; x < width; x++) {
56
+ values[x] = (values[x] + values[x - 1]) & 0xFF;
57
+ }
58
+
59
+ for (let y = 1; y < height; y++) {
60
+ const row = y * width;
61
+
62
+ values[row] = (values[row] + values[row - width]) & 0xFF;
63
+
64
+ for (let x = 1; x < width; x++) {
65
+ const i = row + x;
66
+
67
+ let predicted;
68
+
69
+ if (filter === 1) {
70
+ predicted = values[i - 1];
71
+ } else if (filter === 2) {
72
+ predicted = values[i - width];
73
+ } else {
74
+ const gradient = values[i - 1] + values[i - width] - values[i - width - 1];
75
+
76
+ predicted = gradient < 0 ? 0 : gradient > 255 ? 255 : gradient;
77
+ }
78
+
79
+ values[i] = (values[i] + predicted) & 0xFF;
80
+ }
81
+ }
82
+
83
+ return values;
84
+ }
@@ -43,6 +43,22 @@ export function astc_order_endpoints(endpoints: Int32Array, weights: Uint8Array,
43
43
  * @param {number} weight_bits 2 or 3
44
44
  */
45
45
  export function astc_write_block(out: Uint8Array, offset: number, endpoints: Int32Array, weights: Uint8Array, weight_bits: number): void;
46
+ /**
47
+ * Write one single-partition, mode-12 ASTC block (LDR RGBA, direct), on one plane or with alpha on a second.
48
+ *
49
+ * The endpoints are integer sequences from bit 17; the weights fill the top of the block with the field's bit order
50
+ * reversed, and on two planes alternate texel by texel, colour then alpha, with the colour component selector
51
+ * immediately below them. Mode 12 swaps and blue-contracts a pair whose second end has the smaller colour sum, and
52
+ * which way round the pair goes is the caller's.
53
+ *
54
+ * @param {Uint8Array} out
55
+ * @param {number} offset
56
+ * @param {ArrayLike<number>} endpoints eight integers of the layout's endpoint range, `R0 R1 G0 G1 B0 B1 A0 A1`
57
+ * @param {ArrayLike<number>} weights integers of the layout's weight range: sixteen in raster order, or for two planes
58
+ * thirty-two, each texel's colour weight then its alpha weight
59
+ * @param {boolean} dual whether alpha has a plane of its own
60
+ */
61
+ export function astc_write_block_rgba(out: Uint8Array, offset: number, endpoints: ArrayLike<number>, weights: ArrayLike<number>, dual: boolean): void;
46
62
  /**
47
63
  * Bytes in one ASTC 4x4 block.
48
64
  *
@@ -89,4 +105,29 @@ export const ASTC_BLOCK_MODE: {
89
105
  export const ASTC_WEIGHT_UNQUANTIZED: {
90
106
  [x: number]: number[];
91
107
  };
108
+ /**
109
+ * Colour endpoint mode 12: LDR RGBA, direct. Eight endpoint values, `R0 R1 G0 G1 B0 B1 A0 A1`.
110
+ *
111
+ * @readonly
112
+ * @type {number}
113
+ */
114
+ export const CEM_LDR_RGBA_DIRECT: number;
115
+ /**
116
+ * The single-plane mode-12 block: block mode 0x53, sixteen weights of eight levels (48 bits), which leaves the
117
+ * eight endpoints the range of 192 levels (six bits and a trit each, 61 bits). The ranges are indices into
118
+ * `ASTC_RANGE`.
119
+ *
120
+ * @readonly
121
+ */
122
+ export const ASTC_RGBA_SINGLE_WEIGHT_RANGE: 5;
123
+ export const ASTC_RGBA_SINGLE_ENDPOINT_RANGE: 19;
124
+ /**
125
+ * The dual-plane mode-12 block: block mode 0x452 (the 4x4 grid on two planes), alpha on the second plane (colour
126
+ * component selector 3), thirty-two weights of five levels (quints, 75 bits) and the selector's two bits, which
127
+ * leave the endpoints 16 levels (four bits each). The ranges are indices into `ASTC_RANGE`.
128
+ *
129
+ * @readonly
130
+ */
131
+ export const ASTC_RGBA_DUAL_WEIGHT_RANGE: 3;
132
+ export const ASTC_RGBA_DUAL_ENDPOINT_RANGE: 8;
92
133
  //# sourceMappingURL=astc_block.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"astc_block.d.ts","sourceRoot":"","sources":["../../../../../src/format/texture/astc/astc_block.js"],"names":[],"mappings":"AA8DA;;;;;;;;;;;;;GAaG;AACH,qCALW,MAAM,MACN,MAAM,UACN,MAAM,GACJ,MAAM,CAOlB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,gDAJW,UAAU,WACV,UAAU,OACV,MAAM,QAoBhB;AAED;;;;;;;;;GASG;AACH,sCANW,UAAU,UACV,MAAM,aACN,UAAU,WACV,UAAU,eACV,MAAM,QA8BhB;AAoED;;;;;;;;;;;;;;GAcG;AACH,2CAPW,UAAU,UACV,MAAM,aACN,UAAU,MAAM,CAAC,WACjB,UAAU,MAAM,CAAC,QAEjB,OAAO,QA0BjB;AAxQD;;;;;GAKG;AACH,+BAFU,MAAM,CAEmB;AAEnC;;;;;GAKG;AACH,iCAFU,MAAM,CAEoB;AAUpC;;;;;;;;;;;;;;GAcG;AACH;QAFiB,MAAM,GAAE,MAAM;EAK7B;AAEF;;;;;;;;;;GAUG;AACH;QAFiB,MAAM,GAAE,MAAM,EAAE;EAK/B;AAqGF;;;;;GAKG;AACH,kCAFU,MAAM,CAEsB;AAEtC;;;;;;GAMG;AACH,8CAA+C;AAC/C,iDAAkD;AAElD;;;;;;GAMG;AACH,4CAA6C;AAC7C,8CAA+C"}