@woosh/meep-engine 3.79.0 → 3.80.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +62 -3
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/format/image/webp/vp8/VP8BoolDecoder.d.ts +45 -0
- package/src/format/image/webp/vp8/VP8BoolDecoder.d.ts.map +1 -0
- package/src/format/image/webp/vp8/VP8BoolDecoder.js +137 -0
- package/src/format/image/webp/vp8/vp8_decode.d.ts +21 -0
- package/src/format/image/webp/vp8/vp8_decode.d.ts.map +1 -0
- package/src/format/image/webp/vp8/vp8_decode.js +756 -0
- package/src/format/image/webp/vp8/vp8_loop_filter.d.ts +31 -0
- package/src/format/image/webp/vp8/vp8_loop_filter.d.ts.map +1 -0
- package/src/format/image/webp/vp8/vp8_loop_filter.js +189 -0
- package/src/format/image/webp/vp8/vp8_predict.d.ts +48 -0
- package/src/format/image/webp/vp8/vp8_predict.d.ts.map +1 -0
- package/src/format/image/webp/vp8/vp8_predict.js +290 -0
- package/src/format/image/webp/vp8/vp8_tables.d.ts +34 -0
- package/src/format/image/webp/vp8/vp8_tables.d.ts.map +1 -0
- package/src/format/image/webp/vp8/vp8_tables.js +350 -0
- package/src/format/image/webp/vp8/vp8_transform.d.ts +22 -0
- package/src/format/image/webp/vp8/vp8_transform.d.ts.map +1 -0
- package/src/format/image/webp/vp8/vp8_transform.js +114 -0
- package/src/format/image/webp/vp8/vp8_yuv_to_rgba.d.ts +23 -0
- package/src/format/image/webp/vp8/vp8_yuv_to_rgba.d.ts.map +1 -0
- package/src/format/image/webp/vp8/vp8_yuv_to_rgba.js +133 -0
- package/src/format/image/webp/vp8l/VP8LBitReader.d.ts +47 -0
- package/src/format/image/webp/vp8l/VP8LBitReader.d.ts.map +1 -0
- package/src/format/image/webp/vp8l/VP8LBitReader.js +84 -0
- package/src/format/image/webp/vp8l/VP8LPrefixCode.d.ts +27 -0
- package/src/format/image/webp/vp8l/VP8LPrefixCode.d.ts.map +1 -0
- package/src/format/image/webp/vp8l/VP8LPrefixCode.js +184 -0
- package/src/format/image/webp/vp8l/vp8l_decode.d.ts +28 -0
- package/src/format/image/webp/vp8l/vp8l_decode.d.ts.map +1 -0
- package/src/format/image/webp/vp8l/vp8l_decode.js +261 -0
- package/src/format/image/webp/vp8l/vp8l_distance.d.ts +22 -0
- package/src/format/image/webp/vp8l/vp8l_distance.d.ts.map +1 -0
- package/src/format/image/webp/vp8l/vp8l_distance.js +62 -0
- package/src/format/image/webp/vp8l/vp8l_inverse_transforms.d.ts +50 -0
- package/src/format/image/webp/vp8l/vp8l_inverse_transforms.d.ts.map +1 -0
- package/src/format/image/webp/vp8l/vp8l_inverse_transforms.js +267 -0
- package/src/format/image/webp/vp8l/vp8l_read_prefix_code.d.ts +14 -0
- package/src/format/image/webp/vp8l/vp8l_read_prefix_code.d.ts.map +1 -0
- package/src/format/image/webp/vp8l/vp8l_read_prefix_code.js +99 -0
- package/src/format/image/webp/webp_decode.d.ts +23 -0
- package/src/format/image/webp/webp_decode.d.ts.map +1 -0
- package/src/format/image/webp/webp_decode.js +179 -0
- package/src/format/image/webp/webp_decode_alpha.d.ts +18 -0
- package/src/format/image/webp/webp_decode_alpha.d.ts.map +1 -0
- package/src/format/image/webp/webp_decode_alpha.js +84 -0
- package/src/format/texture/{basis → astc}/astc_block.d.ts +41 -0
- package/src/format/texture/astc/astc_block.d.ts.map +1 -0
- package/src/format/texture/{basis → astc}/astc_block.js +284 -164
- package/src/format/texture/astc/astc_decode_block.d.ts +68 -0
- package/src/format/texture/astc/astc_decode_block.d.ts.map +1 -0
- package/src/format/texture/astc/astc_decode_block.js +1119 -0
- package/src/format/texture/astc/astc_encode_block_4x4.d.ts +32 -0
- package/src/format/texture/astc/astc_encode_block_4x4.d.ts.map +1 -0
- package/src/format/texture/astc/astc_encode_block_4x4.js +181 -0
- package/src/format/texture/astc/astc_encode_block_4x4_rgba.d.ts +32 -0
- package/src/format/texture/astc/astc_encode_block_4x4_rgba.d.ts.map +1 -0
- package/src/format/texture/astc/astc_encode_block_4x4_rgba.js +337 -0
- package/src/format/texture/astc/astc_integer_sequence.d.ts.map +1 -0
- package/src/format/texture/{basis → astc}/astc_integer_sequence.js +251 -251
- package/src/format/texture/astc/astc_partition.d.ts.map +1 -0
- package/src/format/texture/{basis → astc}/astc_partition.js +199 -199
- package/src/format/texture/basis/transcode/etc1s_to_astc.js +329 -329
- package/src/format/texture/basis/transcode/etc1s_to_etc2.d.ts.map +1 -1
- package/src/format/texture/basis/transcode/etc1s_to_etc2.js +305 -332
- package/src/format/texture/basis/transcode/fit_endpoints.d.ts.map +1 -1
- package/src/format/texture/basis/transcode/fit_endpoints.js +14 -27
- package/src/format/texture/basis/uastc/uastc_bc7_tables.d.ts +66 -0
- package/src/format/texture/basis/uastc/uastc_bc7_tables.d.ts.map +1 -0
- package/src/format/texture/basis/uastc/uastc_bc7_tables.js +148 -0
- package/src/format/texture/basis/uastc/uastc_decode_block.js +463 -463
- package/src/format/texture/basis/uastc/uastc_to_astc.js +421 -421
- package/src/format/texture/basis/uastc/uastc_to_bc5.d.ts +1 -6
- package/src/format/texture/basis/uastc/uastc_to_bc5.d.ts.map +1 -1
- package/src/format/texture/basis/uastc/uastc_to_bc5.js +48 -115
- package/src/format/texture/basis/uastc/uastc_to_bc7.d.ts.map +1 -1
- package/src/format/texture/basis/uastc/uastc_to_bc7.js +604 -602
- package/src/format/texture/bc/bc1_decode_block.d.ts +19 -0
- package/src/format/texture/bc/bc1_decode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc1_decode_block.js +22 -0
- package/src/format/texture/bc/bc1_decode_colors.d.ts +27 -0
- package/src/format/texture/bc/bc1_decode_colors.d.ts.map +1 -0
- package/src/format/texture/bc/bc1_decode_colors.js +100 -0
- package/src/format/texture/bc/bc2_decode_block.d.ts +18 -0
- package/src/format/texture/bc/bc2_decode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc2_decode_block.js +28 -0
- package/src/format/texture/bc/bc3_decode_block.d.ts +18 -0
- package/src/format/texture/bc/bc3_decode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc3_decode_block.js +23 -0
- package/src/format/texture/bc/bc4_decode_channel.d.ts +56 -0
- package/src/format/texture/bc/bc4_decode_channel.d.ts.map +1 -0
- package/src/format/texture/bc/bc4_decode_channel.js +138 -0
- package/src/format/texture/bc/bc4_encode_block.d.ts +43 -0
- package/src/format/texture/bc/bc4_encode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc4_encode_block.js +324 -0
- package/src/format/texture/bc/bc4_snorm_decode_block.d.ts +18 -0
- package/src/format/texture/bc/bc4_snorm_decode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc4_snorm_decode_block.js +27 -0
- package/src/format/texture/bc/bc4_unorm_decode_block.d.ts +17 -0
- package/src/format/texture/bc/bc4_unorm_decode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc4_unorm_decode_block.js +26 -0
- package/src/format/texture/bc/bc5_encode_block.d.ts +25 -0
- package/src/format/texture/bc/bc5_encode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc5_encode_block.js +34 -0
- package/src/format/texture/bc/bc5_snorm_decode_block.d.ts +18 -0
- package/src/format/texture/bc/bc5_snorm_decode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc5_snorm_decode_block.js +27 -0
- package/src/format/texture/bc/bc5_unorm_decode_block.d.ts +17 -0
- package/src/format/texture/bc/bc5_unorm_decode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc5_unorm_decode_block.js +26 -0
- package/src/format/texture/bc/bc6h_decode_texels.d.ts +30 -0
- package/src/format/texture/bc/bc6h_decode_texels.d.ts.map +1 -0
- package/src/format/texture/bc/bc6h_decode_texels.js +430 -0
- package/src/format/texture/bc/bc6h_sfloat_decode_block.d.ts +20 -0
- package/src/format/texture/bc/bc6h_sfloat_decode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc6h_sfloat_decode_block.js +23 -0
- package/src/format/texture/bc/bc6h_ufloat_decode_block.d.ts +18 -0
- package/src/format/texture/bc/bc6h_ufloat_decode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc6h_ufloat_decode_block.js +21 -0
- package/src/format/texture/bc/bc7_decode_block.d.ts +30 -0
- package/src/format/texture/bc/bc7_decode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc7_decode_block.js +232 -0
- package/src/format/texture/bc/bc7_encode_block.d.ts +39 -0
- package/src/format/texture/bc/bc7_encode_block.d.ts.map +1 -0
- package/src/format/texture/bc/bc7_encode_block.js +423 -0
- package/src/format/texture/bc/bc7_tables.d.ts +126 -0
- package/src/format/texture/bc/bc7_tables.d.ts.map +1 -0
- package/src/format/texture/{basis/uastc → bc}/bc7_tables.js +225 -276
- package/src/format/texture/bc/bc7_write_block.d.ts +65 -0
- package/src/format/texture/bc/bc7_write_block.d.ts.map +1 -0
- package/src/format/texture/{basis/uastc → bc}/bc7_write_block.js +185 -227
- package/src/format/texture/etc/eac_decode_channel.d.ts +50 -0
- package/src/format/texture/etc/eac_decode_channel.d.ts.map +1 -0
- package/src/format/texture/etc/eac_decode_channel.js +142 -0
- package/src/format/texture/etc/eac_modifiers.d.ts +15 -0
- package/src/format/texture/etc/eac_modifiers.d.ts.map +1 -0
- package/src/format/texture/etc/eac_modifiers.js +31 -0
- package/src/format/texture/etc/eac_r11_snorm_decode_block.d.ts +21 -0
- package/src/format/texture/etc/eac_r11_snorm_decode_block.d.ts.map +1 -0
- package/src/format/texture/etc/eac_r11_snorm_decode_block.js +30 -0
- package/src/format/texture/etc/eac_r11_unorm_decode_block.d.ts +20 -0
- package/src/format/texture/etc/eac_r11_unorm_decode_block.d.ts.map +1 -0
- package/src/format/texture/etc/eac_r11_unorm_decode_block.js +29 -0
- package/src/format/texture/etc/eac_rg11_snorm_decode_block.d.ts +19 -0
- package/src/format/texture/etc/eac_rg11_snorm_decode_block.d.ts.map +1 -0
- package/src/format/texture/etc/eac_rg11_snorm_decode_block.js +28 -0
- package/src/format/texture/etc/eac_rg11_unorm_decode_block.d.ts +19 -0
- package/src/format/texture/etc/eac_rg11_unorm_decode_block.d.ts.map +1 -0
- package/src/format/texture/etc/eac_rg11_unorm_decode_block.js +28 -0
- package/src/format/texture/etc/etc2_decode_color.d.ts +25 -0
- package/src/format/texture/etc/etc2_decode_color.d.ts.map +1 -0
- package/src/format/texture/etc/etc2_decode_color.js +370 -0
- package/src/format/texture/etc/etc2_rgb8_decode_block.d.ts +18 -0
- package/src/format/texture/etc/etc2_rgb8_decode_block.d.ts.map +1 -0
- package/src/format/texture/etc/etc2_rgb8_decode_block.js +21 -0
- package/src/format/texture/etc/etc2_rgb8a1_decode_block.d.ts +21 -0
- package/src/format/texture/etc/etc2_rgb8a1_decode_block.d.ts.map +1 -0
- package/src/format/texture/etc/etc2_rgb8a1_decode_block.js +24 -0
- package/src/format/texture/etc/etc2_rgba8_decode_block.d.ts +18 -0
- package/src/format/texture/etc/etc2_rgba8_decode_block.d.ts.map +1 -0
- package/src/format/texture/etc/etc2_rgba8_decode_block.js +24 -0
- package/src/format/texture/fit/fit_line.d.ts +23 -0
- package/src/format/texture/fit/fit_line.d.ts.map +1 -0
- package/src/format/texture/fit/fit_line.js +123 -0
- package/src/format/texture/fit/fit_line_refine.d.ts +21 -0
- package/src/format/texture/fit/fit_line_refine.d.ts.map +1 -0
- package/src/format/texture/fit/fit_line_refine.js +69 -0
- package/src/format/texture/fit/fit_line_solve.d.ts +23 -0
- package/src/format/texture/fit/fit_line_solve.d.ts.map +1 -0
- package/src/format/texture/fit/fit_line_solve.js +71 -0
- package/src/format/texture/texel_decode_image.d.ts +44 -0
- package/src/format/texture/texel_decode_image.d.ts.map +1 -0
- package/src/format/texture/texel_decode_image.js +251 -0
- package/src/format/texture/texel_encode_image.d.ts +77 -0
- package/src/format/texture/texel_encode_image.d.ts.map +1 -0
- package/src/format/texture/texel_encode_image.js +187 -0
- package/src/shade/renderer/ShadeIndirectLightingMode.js +2 -0
- package/src/shade/renderer/acoustics/GPUAcousticLattice.d.ts +1 -1
- package/src/shade/renderer/acoustics/GPUAcoustics.d.ts +1 -1
- package/src/shade/renderer/loader/mtf/mtf_encode_texture.d.ts +1 -0
- package/src/shade/renderer/loader/mtf/mtf_encode_texture.d.ts.map +1 -1
- package/src/shade/renderer/loader/mtf/mtf_encode_texture.js +102 -28
- package/src/shade/renderer/loader/mtf/mtf_replace_textures.d.ts +19 -0
- package/src/shade/renderer/loader/mtf/mtf_replace_textures.d.ts.map +1 -0
- package/src/shade/renderer/loader/mtf/mtf_replace_textures.js +60 -0
- package/src/shade/renderer/loader/mtf/mtf_write.d.ts.map +1 -1
- package/src/shade/renderer/loader/mtf/mtf_write.js +7 -31
- package/src/shade/renderer/loader/mtf/mtf_write_collection.d.ts +23 -0
- package/src/shade/renderer/loader/mtf/mtf_write_collection.d.ts.map +1 -0
- package/src/shade/renderer/loader/mtf/mtf_write_collection.js +36 -0
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4.d.ts +13 -0
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4.js +39 -0
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.d.ts +3 -2
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.js +6 -21
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgba.d.ts +42 -0
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgba.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgba.js +612 -0
- package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts +5 -4
- package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.js +8 -25
- package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.js +3 -19
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.d.ts +14 -4
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.js +65 -54
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts +2 -2
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.js +5 -22
- package/src/shade/renderer/texture/encode/chunk_bc7_partition_2.js +1 -1
- package/src/shade/renderer/texture/encode/chunk_scatter_principal_axis.d.ts +27 -0
- package/src/shade/renderer/texture/encode/chunk_scatter_principal_axis.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/chunk_scatter_principal_axis.js +147 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_astc_4x4.d.ts +3 -4
- package/src/shade/renderer/texture/encode/shader_texture_encode_astc_4x4.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/shader_texture_encode_astc_4x4.js +6 -13
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc7_rgb.d.ts +13 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc7_rgb.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc7_rgb.js +66 -0
- package/src/shade/renderer/texture/encode/texture_encode.d.ts +28 -1
- package/src/shade/renderer/texture/encode/texture_encode.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/texture_encode.js +202 -168
- package/src/shade/renderer/texture/encode/texture_encode_shader.d.ts +13 -1
- package/src/shade/renderer/texture/encode/texture_encode_shader.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/texture_encode_shader.js +146 -108
- package/src/shade/renderer/texture/format/texture_formats_to_build.d.ts +20 -0
- package/src/shade/renderer/texture/format/texture_formats_to_build.d.ts.map +1 -0
- package/src/shade/renderer/texture/format/texture_formats_to_build.js +98 -0
- package/src/shade/renderer/texture/mipmaps/WebGPUMipmapGenerator.d.ts.map +1 -1
- package/src/shade/renderer/texture/mipmaps/WebGPUMipmapGenerator.js +4 -23
- package/src/shade/renderer/texture/mipmaps/cpu/MipmapBilinearAxis.d.ts +53 -0
- package/src/shade/renderer/texture/mipmaps/cpu/MipmapBilinearAxis.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/MipmapBilinearAxis.js +76 -0
- package/src/shade/renderer/texture/mipmaps/cpu/MipmapKernelAxis.d.ts +40 -0
- package/src/shade/renderer/texture/mipmaps/cpu/MipmapKernelAxis.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/MipmapKernelAxis.js +43 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_centres.d.ts +17 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_centres.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_centres.js +29 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_sample.d.ts +21 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_sample.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_bilinear_sample.js +91 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_chain_cpu.d.ts +32 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_chain_cpu.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_chain_cpu.js +216 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_cubic_filter_cpu.d.ts +30 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_cubic_filter_cpu.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_cubic_filter_cpu.js +134 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_catmull_rom_cpu.d.ts +16 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_catmull_rom_cpu.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_catmull_rom_cpu.js +33 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_cpu.d.ts +18 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_cpu.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_cpu.js +71 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_normal_cpu.d.ts +20 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_normal_cpu.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_linear_normal_cpu.js +57 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_magic_kernel_cpu.d.ts +18 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_magic_kernel_cpu.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_magic_kernel_cpu.js +111 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mitchell_cpu.d.ts +16 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mitchell_cpu.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mitchell_cpu.js +33 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mks_cpu.d.ts +18 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mks_cpu.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_mks_cpu.js +128 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_wronski2021_cpu.d.ts +21 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_wronski2021_cpu.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_filter_wronski2021_cpu.js +169 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_kernel_reduce.d.ts +21 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_kernel_reduce.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_kernel_reduce.js +119 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_source_centre.d.ts +16 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_source_centre.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/mipmap_source_centre.js +19 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm.d.ts +24 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm.js +41 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm_srgb.d.ts +24 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm_srgb.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_f32_to_rgba8unorm_srgb.js +140 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_srgb_to_f32.d.ts +21 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_srgb_to_f32.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_srgb_to_f32.js +35 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_to_f32.d.ts +19 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_to_f32.d.ts.map +1 -0
- package/src/shade/renderer/texture/mipmaps/cpu/texels_rgba8unorm_to_f32.js +27 -0
- package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_catmull_rom.js +4 -4
- package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_linear.d.ts +13 -0
- package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_linear.d.ts.map +1 -1
- package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_linear.js +54 -4
- package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_mitchell.js +4 -4
- package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_mks.d.ts.map +1 -1
- package/src/shade/renderer/texture/mipmaps/filters/mipmap_shader_code_mks.js +9 -13
- package/src/shade/renderer/texture/texture_block_encodings.d.ts +33 -0
- package/src/shade/renderer/texture/texture_block_encodings.d.ts.map +1 -0
- package/src/shade/renderer/texture/texture_block_encodings.js +89 -0
- package/src/format/texture/basis/astc_block.d.ts.map +0 -1
- package/src/format/texture/basis/astc_integer_sequence.d.ts.map +0 -1
- package/src/format/texture/basis/astc_partition.d.ts.map +0 -1
- package/src/format/texture/basis/uastc/bc7_tables.d.ts +0 -111
- package/src/format/texture/basis/uastc/bc7_tables.d.ts.map +0 -1
- package/src/format/texture/basis/uastc/bc7_write_block.d.ts +0 -124
- package/src/format/texture/basis/uastc/bc7_write_block.d.ts.map +0 -1
- /package/src/format/texture/{basis → astc}/astc_integer_sequence.d.ts +0 -0
- /package/src/format/texture/{basis → astc}/astc_partition.d.ts +0 -0
|
@@ -1,164 +1,284 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
* @param {number}
|
|
73
|
-
* @
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
* @param {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
* @param {
|
|
127
|
-
* @param {
|
|
128
|
-
* @param {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
for (let texel = 0; texel < 16; texel++) {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
1
|
+
import { astc_write_integer_sequence } from "./astc_integer_sequence.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Bytes in one ASTC 4x4 block.
|
|
5
|
+
*
|
|
6
|
+
* @readonly
|
|
7
|
+
* @type {number}
|
|
8
|
+
*/
|
|
9
|
+
export const ASTC_BLOCK_BYTES = 16;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Colour endpoint mode 8: LDR RGB, direct. Six endpoint values, `R0 R1 G0 G1 B0 B1`.
|
|
13
|
+
*
|
|
14
|
+
* @readonly
|
|
15
|
+
* @type {number}
|
|
16
|
+
*/
|
|
17
|
+
export const CEM_LDR_RGB_DIRECT = 8;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Where the endpoint values begin: eleven bits of block mode, two of partition count, four of CEM.
|
|
21
|
+
*
|
|
22
|
+
* @readonly
|
|
23
|
+
* @type {number}
|
|
24
|
+
*/
|
|
25
|
+
const ENDPOINT_BIT = 17;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The two single-plane 4x4 block modes this tree writes, by how many bits a weight takes.
|
|
29
|
+
*
|
|
30
|
+
* **Read out of the specification's block-mode layout, and confirmed against the reference.** The
|
|
31
|
+
* low-precision row packs `D` at bit 10, `H` at 9, the height term `B` at 8:7, the width term `A` at
|
|
32
|
+
* 6:5, `R0` at 4, two zero bits, then `R2` and `R1` at 1:0 — with the grid `A+2` wide by `B+4` high
|
|
33
|
+
* and the weight range read from `R = R2·4 + R1·2 + R0`. So `A = 2`, `B = 0`, `D = H = 0` is a 4x4
|
|
34
|
+
* grid on one plane, and `R` picks the range: 4 gives four levels and 7 gives eight.
|
|
35
|
+
*
|
|
36
|
+
* Both appear in `basisu`'s own output for these files, which is what turns a derivation into a
|
|
37
|
+
* check.
|
|
38
|
+
*
|
|
39
|
+
* @readonly
|
|
40
|
+
* @type {Object<number, number>}
|
|
41
|
+
*/
|
|
42
|
+
export const ASTC_BLOCK_MODE = {
|
|
43
|
+
2: 0x42,
|
|
44
|
+
3: 0x53,
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* What a weight unquantizes to, out of 64, for each weight-bit count this writes.
|
|
49
|
+
*
|
|
50
|
+
* **Not evenly spaced, and not a rounding of `v / levels`.** A pure-bit weight is replicated up to
|
|
51
|
+
* six bits and then nudged: `if (T > 32) T += 1`, which is what turns the top of the range into
|
|
52
|
+
* exactly 64 rather than 63. Two bits gives `0, 21, 43, 64` and three gives `0, 9, 18, 27, 37, 46,
|
|
53
|
+
* 55, 64` — note 36 becoming 37, which a thirds-and-sevenths formula does not produce.
|
|
54
|
+
*
|
|
55
|
+
* @readonly
|
|
56
|
+
* @type {Object<number, number[]>}
|
|
57
|
+
*/
|
|
58
|
+
export const ASTC_WEIGHT_UNQUANTIZED = {
|
|
59
|
+
2: [0, 21, 43, 64],
|
|
60
|
+
3: [0, 9, 18, 27, 37, 46, 55, 64],
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Decode one channel the way the format does.
|
|
65
|
+
*
|
|
66
|
+
* **This is not `c0 + (c1 - c0) * w / 64`.** ASTC widens each 8-bit endpoint to sixteen bits by bit
|
|
67
|
+
* replication first, interpolates there with a rounding `+32`, and takes the top eight bits of the
|
|
68
|
+
* result — which disagrees with the direct form on about one texel in twenty, always by a level.
|
|
69
|
+
* Fitting endpoints against the direct form and letting hardware decode with this one puts that
|
|
70
|
+
* disagreement into the output for nothing, so every encoder here scores against this.
|
|
71
|
+
*
|
|
72
|
+
* @param {number} c0 eight bits
|
|
73
|
+
* @param {number} c1 eight bits
|
|
74
|
+
* @param {number} weight unquantized, `0..64`
|
|
75
|
+
* @returns {number} eight bits
|
|
76
|
+
*/
|
|
77
|
+
export function astc_interpolate(c0, c1, weight) {
|
|
78
|
+
const wide0 = (c0 << 8) | c0;
|
|
79
|
+
const wide1 = (c1 << 8) | c1;
|
|
80
|
+
|
|
81
|
+
return Math.floor((wide0 * (64 - weight) + wide1 * weight + 32) / 64) >> 8;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Put the endpoints the way round colour endpoint mode 8 requires, inverting the weights to match.
|
|
86
|
+
*
|
|
87
|
+
* **The rule that makes a wrong-way-round block decode as the wrong colours rather than as a
|
|
88
|
+
* mirror.** Mode 8 compares the endpoints by the sum of their channels: with `s1 >= s0` they are
|
|
89
|
+
* taken as written, and otherwise the decoder *swaps* them and applies blue contraction —
|
|
90
|
+
* `r = (r + b) >> 1`, `g = (g + b) >> 1` — to both. That second path is a different picture, not an
|
|
91
|
+
* inverted one, and no bit in the block records that it happened.
|
|
92
|
+
*
|
|
93
|
+
* A least-squares fit puts the first endpoint at the darker end, so this is nearly always already
|
|
94
|
+
* satisfied; nearly is not a guarantee once rounding and clamping have run, and a block that trips
|
|
95
|
+
* it is not one any test would think to construct. Swapping the pair and inverting the weights
|
|
96
|
+
* leaves the decoded block identical, so it costs nothing where it does nothing.
|
|
97
|
+
*
|
|
98
|
+
* @param {Int32Array} endpoints six values, `R0 R1 G0 G1 B0 B1`, modified in place
|
|
99
|
+
* @param {Uint8Array} weights sixteen weight *levels* (not unquantized), modified in place
|
|
100
|
+
* @param {number} top the highest weight level, so the inversion knows its own range
|
|
101
|
+
*/
|
|
102
|
+
export function astc_order_endpoints(endpoints, weights, top) {
|
|
103
|
+
const first = endpoints[0] + endpoints[2] + endpoints[4];
|
|
104
|
+
const second = endpoints[1] + endpoints[3] + endpoints[5];
|
|
105
|
+
|
|
106
|
+
if (second >= first) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
for (let channel = 0; channel < 3; channel++) {
|
|
111
|
+
const swap = endpoints[channel * 2];
|
|
112
|
+
|
|
113
|
+
endpoints[channel * 2] = endpoints[channel * 2 + 1];
|
|
114
|
+
endpoints[channel * 2 + 1] = swap;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
for (let texel = 0; texel < 16; texel++) {
|
|
118
|
+
weights[texel] = top - weights[texel];
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Write one single-partition, mode-8 ASTC block: header and endpoints from the bottom, weights from
|
|
124
|
+
* the top.
|
|
125
|
+
*
|
|
126
|
+
* @param {Uint8Array} out
|
|
127
|
+
* @param {number} offset
|
|
128
|
+
* @param {Int32Array} endpoints six values, `R0 R1 G0 G1 B0 B1`
|
|
129
|
+
* @param {Uint8Array} weights sixteen weight levels, in raster order
|
|
130
|
+
* @param {number} weight_bits 2 or 3
|
|
131
|
+
*/
|
|
132
|
+
export function astc_write_block(out, offset, endpoints, weights, weight_bits) {
|
|
133
|
+
out.fill(0, offset, offset + ASTC_BLOCK_BYTES);
|
|
134
|
+
|
|
135
|
+
set_bits(out, offset, 0, ASTC_BLOCK_MODE[weight_bits], 11);
|
|
136
|
+
|
|
137
|
+
// partition count - 1, at bits 11..12, is zero: one partition
|
|
138
|
+
|
|
139
|
+
set_bits(out, offset, 13, CEM_LDR_RGB_DIRECT, 4);
|
|
140
|
+
|
|
141
|
+
for (let i = 0; i < 6; i++) {
|
|
142
|
+
set_bits(out, offset, ENDPOINT_BIT + i * 8, endpoints[i], 8);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/*
|
|
146
|
+
The weights fill the top of the block with the whole field's bit order reversed: bit `i` of the field, which
|
|
147
|
+
holds texel `i / weight_bits`'s weight from its lowest bit up, is the block's bit `127 - i`.
|
|
148
|
+
*/
|
|
149
|
+
for (let texel = 0; texel < 16; texel++) {
|
|
150
|
+
const weight = weights[texel];
|
|
151
|
+
|
|
152
|
+
for (let b = 0; b < weight_bits; b++) {
|
|
153
|
+
if (((weight >> b) & 1) !== 0) {
|
|
154
|
+
const bit = 127 - (texel * weight_bits + b);
|
|
155
|
+
|
|
156
|
+
out[offset + (bit >> 3)] |= 1 << (bit & 7);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Colour endpoint mode 12: LDR RGBA, direct. Eight endpoint values, `R0 R1 G0 G1 B0 B1 A0 A1`.
|
|
164
|
+
*
|
|
165
|
+
* @readonly
|
|
166
|
+
* @type {number}
|
|
167
|
+
*/
|
|
168
|
+
export const CEM_LDR_RGBA_DIRECT = 12;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* The single-plane mode-12 block: block mode 0x53, sixteen weights of eight levels (48 bits), which leaves the
|
|
172
|
+
* eight endpoints the range of 192 levels (six bits and a trit each, 61 bits). The ranges are indices into
|
|
173
|
+
* `ASTC_RANGE`.
|
|
174
|
+
*
|
|
175
|
+
* @readonly
|
|
176
|
+
*/
|
|
177
|
+
export const ASTC_RGBA_SINGLE_WEIGHT_RANGE = 5;
|
|
178
|
+
export const ASTC_RGBA_SINGLE_ENDPOINT_RANGE = 19;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* The dual-plane mode-12 block: block mode 0x452 (the 4x4 grid on two planes), alpha on the second plane (colour
|
|
182
|
+
* component selector 3), thirty-two weights of five levels (quints, 75 bits) and the selector's two bits, which
|
|
183
|
+
* leave the endpoints 16 levels (four bits each). The ranges are indices into `ASTC_RANGE`.
|
|
184
|
+
*
|
|
185
|
+
* @readonly
|
|
186
|
+
*/
|
|
187
|
+
export const ASTC_RGBA_DUAL_WEIGHT_RANGE = 3;
|
|
188
|
+
export const ASTC_RGBA_DUAL_ENDPOINT_RANGE = 8;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Where {@link astc_write_block_rgba} is writing: the block and the next bit of the sequence being written.
|
|
192
|
+
*/
|
|
193
|
+
let write_out = null;
|
|
194
|
+
let write_offset = 0;
|
|
195
|
+
let write_cursor = 0;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Append bits upward from the cursor: the endpoint sequence.
|
|
199
|
+
*
|
|
200
|
+
* @param {number} value
|
|
201
|
+
* @param {number} width
|
|
202
|
+
*/
|
|
203
|
+
function write_upward(value, width) {
|
|
204
|
+
set_bits(write_out, write_offset, write_cursor, value, width);
|
|
205
|
+
|
|
206
|
+
write_cursor += width;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Append bits to the weight field, which fills the top of the block with its bit order reversed: field bit `i` is
|
|
211
|
+
* block bit `127 - i`.
|
|
212
|
+
*
|
|
213
|
+
* @param {number} value
|
|
214
|
+
* @param {number} width
|
|
215
|
+
*/
|
|
216
|
+
function write_downward(value, width) {
|
|
217
|
+
for (let i = 0; i < width; i++) {
|
|
218
|
+
if (((value >> i) & 1) !== 0) {
|
|
219
|
+
const bit = 127 - (write_cursor + i);
|
|
220
|
+
|
|
221
|
+
write_out[write_offset + (bit >> 3)] |= 1 << (bit & 7);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
write_cursor += width;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Write one single-partition, mode-12 ASTC block (LDR RGBA, direct), on one plane or with alpha on a second.
|
|
230
|
+
*
|
|
231
|
+
* The endpoints are integer sequences from bit 17; the weights fill the top of the block with the field's bit order
|
|
232
|
+
* reversed, and on two planes alternate texel by texel, colour then alpha, with the colour component selector
|
|
233
|
+
* immediately below them. Mode 12 swaps and blue-contracts a pair whose second end has the smaller colour sum, and
|
|
234
|
+
* which way round the pair goes is the caller's.
|
|
235
|
+
*
|
|
236
|
+
* @param {Uint8Array} out
|
|
237
|
+
* @param {number} offset
|
|
238
|
+
* @param {ArrayLike<number>} endpoints eight integers of the layout's endpoint range, `R0 R1 G0 G1 B0 B1 A0 A1`
|
|
239
|
+
* @param {ArrayLike<number>} weights integers of the layout's weight range: sixteen in raster order, or for two planes
|
|
240
|
+
* thirty-two, each texel's colour weight then its alpha weight
|
|
241
|
+
* @param {boolean} dual whether alpha has a plane of its own
|
|
242
|
+
*/
|
|
243
|
+
export function astc_write_block_rgba(out, offset, endpoints, weights, dual) {
|
|
244
|
+
out.fill(0, offset, offset + ASTC_BLOCK_BYTES);
|
|
245
|
+
|
|
246
|
+
set_bits(out, offset, 0, dual ? 0x452 : ASTC_BLOCK_MODE[3], 11);
|
|
247
|
+
|
|
248
|
+
// partition count - 1, at bits 11..12, is zero: one partition
|
|
249
|
+
|
|
250
|
+
set_bits(out, offset, 13, CEM_LDR_RGBA_DIRECT, 4);
|
|
251
|
+
|
|
252
|
+
write_out = out;
|
|
253
|
+
write_offset = offset;
|
|
254
|
+
|
|
255
|
+
write_cursor = ENDPOINT_BIT;
|
|
256
|
+
astc_write_integer_sequence(write_upward, endpoints, dual ? ASTC_RGBA_DUAL_ENDPOINT_RANGE : ASTC_RGBA_SINGLE_ENDPOINT_RANGE);
|
|
257
|
+
|
|
258
|
+
write_cursor = 0;
|
|
259
|
+
astc_write_integer_sequence(write_downward, weights, dual ? ASTC_RGBA_DUAL_WEIGHT_RANGE : ASTC_RGBA_SINGLE_WEIGHT_RANGE);
|
|
260
|
+
|
|
261
|
+
if (dual) {
|
|
262
|
+
// selector 3, alpha, below the 75 bits of weights; the last quint group's padding wrote only zeros there
|
|
263
|
+
set_bits(out, offset, 128 - 75 - 2, 3, 2);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
write_out = null;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Set the bits of a field in a zeroed block, lowest bit first, the block's bits counted little-endian.
|
|
271
|
+
*
|
|
272
|
+
* @param {Uint8Array} out
|
|
273
|
+
* @param {number} offset of the block
|
|
274
|
+
* @param {number} position of the field's lowest bit
|
|
275
|
+
* @param {number} value
|
|
276
|
+
* @param {number} count
|
|
277
|
+
*/
|
|
278
|
+
function set_bits(out, offset, position, value, count) {
|
|
279
|
+
for (let i = 0; i < count; i++) {
|
|
280
|
+
if (((value >> i) & 1) !== 0) {
|
|
281
|
+
out[offset + ((position + i) >> 3)] |= 1 << ((position + i) & 7);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a colour endpoint integer unquantizes to, by the decoder's own table.
|
|
3
|
+
*
|
|
4
|
+
* @param {number} range an index into {@link ASTC_RANGE} an endpoint can take, `4` upward
|
|
5
|
+
* @param {number} integer below the range's level count
|
|
6
|
+
* @returns {number} eight bits
|
|
7
|
+
*/
|
|
8
|
+
export function astc_unquantize_endpoint(range: number, integer: number): number;
|
|
9
|
+
/**
|
|
10
|
+
* What a weight integer unquantizes to, by the decoder's own table.
|
|
11
|
+
*
|
|
12
|
+
* @param {number} range an index into {@link ASTC_RANGE} a weight can take, `0..11`
|
|
13
|
+
* @param {number} integer below the range's level count
|
|
14
|
+
* @returns {number} `0..64`
|
|
15
|
+
*/
|
|
16
|
+
export function astc_unquantize_weight(range: number, integer: number): number;
|
|
17
|
+
/**
|
|
18
|
+
* Decode one ASTC block of a linear (`astc-*-unorm`) texture, in the LDR profile.
|
|
19
|
+
*
|
|
20
|
+
* Complete for the 2D format: every block mode (dual plane included), one to four partitions by the
|
|
21
|
+
* partition hash, every LDR colour endpoint mode with its unquantization and its endpoint-swap and
|
|
22
|
+
* blue-contraction rules, integer sequences at every range, weight unquantization and the bilinear
|
|
23
|
+
* infill of a grid smaller than the block, and void-extent blocks.
|
|
24
|
+
*
|
|
25
|
+
* Endpoints widen to sixteen bits by bit replication and interpolate there; the eight-bit result is
|
|
26
|
+
* the top eight bits of that sixteen-bit value, which is the specification's rule for an eight-bit
|
|
27
|
+
* (`decode_unorm8`) result.
|
|
28
|
+
*
|
|
29
|
+
* Every illegal encoding — a reserved block mode, a weight grid larger than the footprint, more than
|
|
30
|
+
* 64 weights, a weight sequence outside 24 to 96 bits, dual plane with four partitions, more than 18
|
|
31
|
+
* endpoint integers or too few bits for them, a void-extent block breaking its rules — decodes to
|
|
32
|
+
* the error colour, opaque magenta, in every texel. An HDR endpoint mode, or an HDR void-extent
|
|
33
|
+
* block, is outside the LDR profile and decodes to the error colour too: for an endpoint mode, only
|
|
34
|
+
* in the texels of the partition that uses it.
|
|
35
|
+
*
|
|
36
|
+
* @param {Uint8Array} source
|
|
37
|
+
* @param {number} offset byte offset of the block in `source`
|
|
38
|
+
* @param {number} block_width the footprint: 4, 5, 6, 8, 10 or 12
|
|
39
|
+
* @param {number} block_height 4, 5, 6, 8, 10 or 12
|
|
40
|
+
* @param {Uint8Array} out receives `block_width * block_height` texels, RGBA, raster order, from index 0
|
|
41
|
+
*
|
|
42
|
+
* @see Khronos Data Format Specification, "ASTC Compressed Texture Image Formats"
|
|
43
|
+
* @author Alex Goldring
|
|
44
|
+
* @copyright Company Named Limited (c) 2026
|
|
45
|
+
*/
|
|
46
|
+
export function astc_decode_block(source: Uint8Array, offset: number, block_width: number, block_height: number, out: Uint8Array): void;
|
|
47
|
+
/**
|
|
48
|
+
* Decode one ASTC block of an sRGB (`astc-*-unorm-srgb`) texture, in the LDR profile, to the
|
|
49
|
+
* sRGB-encoded bytes such a texture holds.
|
|
50
|
+
*
|
|
51
|
+
* Everything as {@link astc_decode_block} except the arithmetic: each eight-bit R, G and B endpoint
|
|
52
|
+
* widens to sixteen bits as `(e << 8) | 0x80` rather than by replication, while alpha is replicated
|
|
53
|
+
* as in the linear arithmetic (KHR_texture_compression_astc_hdr, "Weight Application"), and the result
|
|
54
|
+
* is the top eight bits of the interpolation: the value passed to the sRGB conversion for R, G and B,
|
|
55
|
+
* and used directly for alpha. A void-extent colour is its top eight bits, as for the linear arithmetic.
|
|
56
|
+
*
|
|
57
|
+
* @param {Uint8Array} source
|
|
58
|
+
* @param {number} offset byte offset of the block in `source`
|
|
59
|
+
* @param {number} block_width the footprint: 4, 5, 6, 8, 10 or 12
|
|
60
|
+
* @param {number} block_height 4, 5, 6, 8, 10 or 12
|
|
61
|
+
* @param {Uint8Array} out receives `block_width * block_height` texels, RGBA, raster order, from index 0
|
|
62
|
+
*
|
|
63
|
+
* @see Khronos Data Format Specification, "ASTC Compressed Texture Image Formats"
|
|
64
|
+
* @author Alex Goldring
|
|
65
|
+
* @copyright Company Named Limited (c) 2026
|
|
66
|
+
*/
|
|
67
|
+
export function astc_srgb_decode_block(source: Uint8Array, offset: number, block_width: number, block_height: number, out: Uint8Array): void;
|
|
68
|
+
//# sourceMappingURL=astc_decode_block.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"astc_decode_block.d.ts","sourceRoot":"","sources":["../../../../../src/format/texture/astc/astc_decode_block.js"],"names":[],"mappings":"AAiPA;;;;;;GAMG;AACH,gDAJW,MAAM,WACN,MAAM,GACJ,MAAM,CAIlB;AAED;;;;;;GAMG;AACH,8CAJW,MAAM,WACN,MAAM,GACJ,MAAM,CAIlB;AAkyBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,0CAVW,UAAU,UACV,MAAM,eACN,MAAM,gBACN,MAAM,OACN,UAAU,QAQpB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,+CAVW,UAAU,UACV,MAAM,eACN,MAAM,gBACN,MAAM,OACN,UAAU,QAQpB"}
|