@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
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
import { fit_line_refine } from "../fit/fit_line_refine.js";
|
|
2
|
+
import { bc4_snorm_palette, bc4_unorm_palette } from "./bc4_decode_channel.js";
|
|
3
|
+
import { bc4_write_block } from "./bc4_write_block.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Where along the line from the first endpoint to the second each mode can put a value: eight evenly spaced for the
|
|
7
|
+
* eight-value mode, six for the six-value one (whose other two codes are the domain's extremes).
|
|
8
|
+
*
|
|
9
|
+
* @readonly
|
|
10
|
+
* @type {Float64Array}
|
|
11
|
+
*/
|
|
12
|
+
const LEVELS_8 = Float64Array.from({ length: 8 }, (_, k) => k / 7);
|
|
13
|
+
const LEVELS_6 = Float64Array.from({ length: 6 }, (_, k) => k / 5);
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The block's sixteen values, in the domain's whole numbers.
|
|
17
|
+
*
|
|
18
|
+
* @type {Float64Array}
|
|
19
|
+
*/
|
|
20
|
+
const values = new Float64Array(16);
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The values a line is fitted to: all of them for the eight-value mode, those between the extremes for the six.
|
|
24
|
+
*
|
|
25
|
+
* @type {Float64Array}
|
|
26
|
+
*/
|
|
27
|
+
const fitted = new Float64Array(16);
|
|
28
|
+
|
|
29
|
+
const line_low = new Float64Array(1);
|
|
30
|
+
const line_high = new Float64Array(1);
|
|
31
|
+
|
|
32
|
+
const palette = new Int32Array(8);
|
|
33
|
+
const indices = new Uint8Array(16);
|
|
34
|
+
const best_indices = new Uint8Array(16);
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The block's squared error against the palette two endpoints select, each value at its nearest code, which is
|
|
38
|
+
* written to {@link indices}.
|
|
39
|
+
*
|
|
40
|
+
* @param {number} red0
|
|
41
|
+
* @param {number} red1
|
|
42
|
+
* @param {function(number, number, Int32Array): void} make_palette the decoder's
|
|
43
|
+
* @returns {number}
|
|
44
|
+
*/
|
|
45
|
+
function score(red0, red1, make_palette) {
|
|
46
|
+
make_palette(red0, red1, palette);
|
|
47
|
+
|
|
48
|
+
let error = 0;
|
|
49
|
+
|
|
50
|
+
for (let i = 0; i < 16; i++) {
|
|
51
|
+
const v = values[i];
|
|
52
|
+
|
|
53
|
+
let nearest = 0;
|
|
54
|
+
let nearest_error = Infinity;
|
|
55
|
+
|
|
56
|
+
for (let code = 0; code < 8; code++) {
|
|
57
|
+
const d = palette[code] - v;
|
|
58
|
+
|
|
59
|
+
if (d * d < nearest_error) {
|
|
60
|
+
nearest_error = d * d;
|
|
61
|
+
nearest = code;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
indices[i] = nearest;
|
|
66
|
+
error += nearest_error;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return error;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* The pair {@link search} found, and its codes.
|
|
74
|
+
*/
|
|
75
|
+
let found0 = 0;
|
|
76
|
+
let found1 = 0;
|
|
77
|
+
const mode_indices = new Uint8Array(16);
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* The best pair of endpoints near a seed, for one mode: the seed itself, then five by five candidates around the
|
|
81
|
+
* best so far, at a spacing of eight, then two, then one, each scored against the palette the decoder builds. A
|
|
82
|
+
* candidate replaces the best only when it is strictly better, so the seed stands until something beats it. The
|
|
83
|
+
* order of a pair selects the mode, so a pair of the other order is not a candidate.
|
|
84
|
+
*
|
|
85
|
+
* @param {number} seed0 of the mode's order
|
|
86
|
+
* @param {number} seed1
|
|
87
|
+
* @param {boolean} eight the eight-value mode (`red0 > red1`), or the six (`red0 <= red1`)
|
|
88
|
+
* @param {number} floor the domain's least value
|
|
89
|
+
* @param {number} ceil the domain's greatest
|
|
90
|
+
* @param {function(number, number, Int32Array): void} make_palette
|
|
91
|
+
* @returns {number} the error of the pair found, which is {@link found0} and {@link found1}, its codes in
|
|
92
|
+
* {@link mode_indices}
|
|
93
|
+
*/
|
|
94
|
+
function search(seed0, seed1, eight, floor, ceil, make_palette) {
|
|
95
|
+
let centre0 = seed0;
|
|
96
|
+
let centre1 = seed1;
|
|
97
|
+
let centre_error = score(seed0, seed1, make_palette);
|
|
98
|
+
|
|
99
|
+
mode_indices.set(indices);
|
|
100
|
+
|
|
101
|
+
for (const spacing of [8, 2, 1]) {
|
|
102
|
+
const around0 = centre0;
|
|
103
|
+
const around1 = centre1;
|
|
104
|
+
|
|
105
|
+
for (let d0 = -2; d0 <= 2; d0++) {
|
|
106
|
+
for (let d1 = -2; d1 <= 2; d1++) {
|
|
107
|
+
const red0 = around0 + d0 * spacing;
|
|
108
|
+
const red1 = around1 + d1 * spacing;
|
|
109
|
+
|
|
110
|
+
if (red0 < floor || red0 > ceil || red1 < floor || red1 > ceil || (red0 > red1) !== eight) {
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const error = score(red0, red1, make_palette);
|
|
115
|
+
|
|
116
|
+
if (error < centre_error) {
|
|
117
|
+
centre0 = red0;
|
|
118
|
+
centre1 = red1;
|
|
119
|
+
centre_error = error;
|
|
120
|
+
mode_indices.set(indices);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
found0 = centre0;
|
|
127
|
+
found1 = centre1;
|
|
128
|
+
|
|
129
|
+
return centre_error;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* @param {number} value
|
|
134
|
+
* @param {number} floor
|
|
135
|
+
* @param {number} ceil
|
|
136
|
+
* @returns {number} the nearest whole value in the domain
|
|
137
|
+
*/
|
|
138
|
+
function to_domain(value, floor, ceil) {
|
|
139
|
+
return Math.min(ceil, Math.max(floor, Math.round(value)));
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const best = new Float64Array(3);
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Fit and write one BC4 block over values already read into {@link values}.
|
|
146
|
+
*
|
|
147
|
+
* Both modes are fitted and the better is written. Each is seeded by a line through the values it serves — its
|
|
148
|
+
* outermost values, refined twice by least squares at the levels the mode interpolates at — and finished by a search
|
|
149
|
+
* of the whole-number endpoint pairs around that seed, scored against the decoder's own palette. The six-value
|
|
150
|
+
* mode's line is fitted to the values between the domain's extremes alone, which its two extra codes serve exactly.
|
|
151
|
+
*
|
|
152
|
+
* @param {Uint8Array} out
|
|
153
|
+
* @param {number} offset
|
|
154
|
+
* @param {number} floor the domain's least value
|
|
155
|
+
* @param {number} ceil the domain's greatest
|
|
156
|
+
* @param {function(number, number, Int32Array): void} make_palette the decoder's palette for the domain
|
|
157
|
+
*/
|
|
158
|
+
function encode_values(out, offset, floor, ceil, make_palette) {
|
|
159
|
+
let low = ceil;
|
|
160
|
+
let high = floor;
|
|
161
|
+
|
|
162
|
+
let interior = 0;
|
|
163
|
+
let interior_low = ceil;
|
|
164
|
+
let interior_high = floor;
|
|
165
|
+
|
|
166
|
+
for (let i = 0; i < 16; i++) {
|
|
167
|
+
const v = values[i];
|
|
168
|
+
|
|
169
|
+
low = Math.min(low, v);
|
|
170
|
+
high = Math.max(high, v);
|
|
171
|
+
|
|
172
|
+
if (v > floor && v < ceil) {
|
|
173
|
+
fitted[interior++] = v;
|
|
174
|
+
interior_low = Math.min(interior_low, v);
|
|
175
|
+
interior_high = Math.max(interior_high, v);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// one value: equal endpoints are the six-value mode, whose first code is the endpoint itself
|
|
180
|
+
if (low === high) {
|
|
181
|
+
indices.fill(0);
|
|
182
|
+
bc4_write_block(out, offset, low & 255, low & 255, indices);
|
|
183
|
+
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
best[2] = Infinity;
|
|
188
|
+
|
|
189
|
+
// the eight-value mode: a line over every value, from the greatest down to the least
|
|
190
|
+
fit_mode(values, 16, LEVELS_8, high, low, true, floor, ceil, make_palette);
|
|
191
|
+
|
|
192
|
+
// the six-value mode: a line over the values between the extremes, upwards
|
|
193
|
+
if (interior > 0) {
|
|
194
|
+
fit_mode(fitted, interior, LEVELS_6, interior_low, interior_high, false, floor, ceil, make_palette);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// stored as bytes: two's complement for the signed domain
|
|
198
|
+
bc4_write_block(out, offset, best[0] & 255, best[1] & 255, best_indices);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Fit one mode and keep it in {@link best} if it beats what is there: a line from the given ends, refined twice by
|
|
203
|
+
* least squares at the mode's levels, rounded, and searched around; then the same again from the pair the search
|
|
204
|
+
* found, for as long as that lowers the mode's error. The error is a whole number that falls with every round
|
|
205
|
+
* taken, so this ends.
|
|
206
|
+
*
|
|
207
|
+
* @param {Float64Array} points the values the mode's line serves
|
|
208
|
+
* @param {number} count
|
|
209
|
+
* @param {Float64Array} levels the mode's levels along its line
|
|
210
|
+
* @param {number} start0 the line's first end
|
|
211
|
+
* @param {number} start1 its second
|
|
212
|
+
* @param {boolean} eight the eight-value mode (`red0 > red1`), or the six (`red0 <= red1`)
|
|
213
|
+
* @param {number} floor
|
|
214
|
+
* @param {number} ceil
|
|
215
|
+
* @param {function(number, number, Int32Array): void} make_palette
|
|
216
|
+
*/
|
|
217
|
+
function fit_mode(points, count, levels, start0, start1, eight, floor, ceil, make_palette) {
|
|
218
|
+
line_low[0] = start0;
|
|
219
|
+
line_high[0] = start1;
|
|
220
|
+
|
|
221
|
+
let mode_error = Infinity;
|
|
222
|
+
|
|
223
|
+
for (; ;) {
|
|
224
|
+
for (let round = 0; round < 2; round++) {
|
|
225
|
+
if (!fit_line_refine(points, 1, 0, count, levels, line_low, line_high)) {
|
|
226
|
+
break;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
let seed0 = to_domain(line_low[0], floor, ceil);
|
|
231
|
+
let seed1 = to_domain(line_high[0], floor, ceil);
|
|
232
|
+
|
|
233
|
+
// the order selects the mode: start from the nearest pair of the mode's order
|
|
234
|
+
if (eight && seed0 <= seed1) {
|
|
235
|
+
seed0 = Math.min(ceil, Math.max(seed0, seed1 + 1));
|
|
236
|
+
seed1 = seed0 - 1;
|
|
237
|
+
} else if (!eight && seed0 > seed1) {
|
|
238
|
+
const swap = seed0;
|
|
239
|
+
|
|
240
|
+
seed0 = seed1;
|
|
241
|
+
seed1 = swap;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
const error = search(seed0, seed1, eight, floor, ceil, make_palette);
|
|
245
|
+
|
|
246
|
+
if (error >= mode_error) {
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
mode_error = error;
|
|
251
|
+
|
|
252
|
+
if (error < best[2]) {
|
|
253
|
+
best[0] = found0;
|
|
254
|
+
best[1] = found1;
|
|
255
|
+
best[2] = error;
|
|
256
|
+
best_indices.set(mode_indices);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
line_low[0] = found0;
|
|
260
|
+
line_high[0] = found1;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Encode one channel of sixteen RGBA texels as an unsigned BC4 block (`bc4-r-unorm`), the red half or the green half
|
|
266
|
+
* of a BC5 block.
|
|
267
|
+
*
|
|
268
|
+
* @param {Uint8Array} texels sixty-four bytes: sixteen RGBA texels in raster order
|
|
269
|
+
* @param {number} channel which channel is encoded, `0` to `3`
|
|
270
|
+
* @param {Uint8Array} out
|
|
271
|
+
* @param {number} offset of the block's eight bytes in `out`
|
|
272
|
+
*/
|
|
273
|
+
export function bc4_unorm_encode_channel(texels, channel, out, offset) {
|
|
274
|
+
for (let i = 0; i < 16; i++) {
|
|
275
|
+
values[i] = texels[i * 4 + channel];
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
encode_values(out, offset, 0, 255, bc4_unorm_palette);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Encode one channel of sixteen RGBA texels as a signed BC4 block (`bc4-r-snorm`), the red half or the green half of
|
|
283
|
+
* a BC5 block. A value of -128 is taken as the -127 it samples as.
|
|
284
|
+
*
|
|
285
|
+
* @param {Int8Array} texels sixty-four signed bytes: sixteen RGBA texels in raster order
|
|
286
|
+
* @param {number} channel which channel is encoded, `0` to `3`
|
|
287
|
+
* @param {Uint8Array} out
|
|
288
|
+
* @param {number} offset of the block's eight bytes in `out`
|
|
289
|
+
*/
|
|
290
|
+
export function bc4_snorm_encode_channel(texels, channel, out, offset) {
|
|
291
|
+
for (let i = 0; i < 16; i++) {
|
|
292
|
+
values[i] = Math.max(texels[i * 4 + channel], -127);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
encode_values(out, offset, -127, 127, bc4_snorm_palette);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Encode sixteen RGBA texels' red as one `bc4-r-unorm` block.
|
|
300
|
+
*
|
|
301
|
+
* @param {Uint8Array} texels sixty-four bytes: sixteen RGBA texels in raster order
|
|
302
|
+
* @param {Uint8Array} out
|
|
303
|
+
* @param {number} offset of the block's eight bytes in `out`
|
|
304
|
+
*
|
|
305
|
+
* @author Alex Goldring
|
|
306
|
+
* @copyright Company Named Limited (c) 2026
|
|
307
|
+
*/
|
|
308
|
+
export function bc4_unorm_encode_block(texels, out, offset) {
|
|
309
|
+
bc4_unorm_encode_channel(texels, 0, out, offset);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Encode sixteen RGBA texels' red as one `bc4-r-snorm` block.
|
|
314
|
+
*
|
|
315
|
+
* @param {Int8Array} texels sixty-four signed bytes: sixteen RGBA texels in raster order
|
|
316
|
+
* @param {Uint8Array} out
|
|
317
|
+
* @param {number} offset of the block's eight bytes in `out`
|
|
318
|
+
*
|
|
319
|
+
* @author Alex Goldring
|
|
320
|
+
* @copyright Company Named Limited (c) 2026
|
|
321
|
+
*/
|
|
322
|
+
export function bc4_snorm_encode_block(texels, out, offset) {
|
|
323
|
+
bc4_snorm_encode_channel(texels, 0, out, offset);
|
|
324
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decode one signed BC4 block (`bc4-r-snorm`) into sixteen RGBA texels, `(r, 0, 0, 127)` as a device
|
|
3
|
+
* samples a red texture, with 127 standing for 1.
|
|
4
|
+
*
|
|
5
|
+
* Both modes, including the six-value mode's hard -127 and 127, and -128 read as -127. See
|
|
6
|
+
* {@link bc4_snorm_decode_channel} for the arithmetic, the mode comparison and how a value reaches
|
|
7
|
+
* -127..127. Any eight bytes are a valid block.
|
|
8
|
+
*
|
|
9
|
+
* @param {Uint8Array} source
|
|
10
|
+
* @param {number} offset of the eight-byte block in `source`
|
|
11
|
+
* @param {Int8Array} out sixteen RGBA texels, raster order, written from index 0
|
|
12
|
+
*
|
|
13
|
+
* @see Khronos Data Format Specification, RGTC, "BC4 signed"
|
|
14
|
+
* @author Alex Goldring
|
|
15
|
+
* @copyright Company Named Limited (c) 2026
|
|
16
|
+
*/
|
|
17
|
+
export function bc4_snorm_decode_block(source: Uint8Array, offset: number, out: Int8Array): void;
|
|
18
|
+
//# sourceMappingURL=bc4_snorm_decode_block.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bc4_snorm_decode_block.d.ts","sourceRoot":"","sources":["../../../../../src/format/texture/bc/bc4_snorm_decode_block.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AACH,+CARW,UAAU,UACV,MAAM,OACN,SAAS,QAcnB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { bc4_snorm_decode_channel } from "./bc4_decode_channel.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Decode one signed BC4 block (`bc4-r-snorm`) into sixteen RGBA texels, `(r, 0, 0, 127)` as a device
|
|
5
|
+
* samples a red texture, with 127 standing for 1.
|
|
6
|
+
*
|
|
7
|
+
* Both modes, including the six-value mode's hard -127 and 127, and -128 read as -127. See
|
|
8
|
+
* {@link bc4_snorm_decode_channel} for the arithmetic, the mode comparison and how a value reaches
|
|
9
|
+
* -127..127. Any eight bytes are a valid block.
|
|
10
|
+
*
|
|
11
|
+
* @param {Uint8Array} source
|
|
12
|
+
* @param {number} offset of the eight-byte block in `source`
|
|
13
|
+
* @param {Int8Array} out sixteen RGBA texels, raster order, written from index 0
|
|
14
|
+
*
|
|
15
|
+
* @see Khronos Data Format Specification, RGTC, "BC4 signed"
|
|
16
|
+
* @author Alex Goldring
|
|
17
|
+
* @copyright Company Named Limited (c) 2026
|
|
18
|
+
*/
|
|
19
|
+
export function bc4_snorm_decode_block(source, offset, out) {
|
|
20
|
+
bc4_snorm_decode_channel(source, offset, out, 0);
|
|
21
|
+
|
|
22
|
+
for (let t = 0; t < 16; t++) {
|
|
23
|
+
out[t * 4 + 1] = 0;
|
|
24
|
+
out[t * 4 + 2] = 0;
|
|
25
|
+
out[t * 4 + 3] = 127;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decode one unsigned BC4 block (`bc4-r-unorm`) into sixteen RGBA texels, `(r, 0, 0, 255)` as a
|
|
3
|
+
* device samples a red texture.
|
|
4
|
+
*
|
|
5
|
+
* Both modes, including the six-value mode's hard 0 and 255. See {@link bc4_unorm_decode_channel}
|
|
6
|
+
* for the arithmetic and how a value reaches a byte. Any eight bytes are a valid block.
|
|
7
|
+
*
|
|
8
|
+
* @param {Uint8Array} source
|
|
9
|
+
* @param {number} offset of the eight-byte block in `source`
|
|
10
|
+
* @param {Uint8Array} out sixteen RGBA texels, raster order, written from index 0
|
|
11
|
+
*
|
|
12
|
+
* @see Khronos Data Format Specification, RGTC, "BC4 unsigned"
|
|
13
|
+
* @author Alex Goldring
|
|
14
|
+
* @copyright Company Named Limited (c) 2026
|
|
15
|
+
*/
|
|
16
|
+
export function bc4_unorm_decode_block(source: Uint8Array, offset: number, out: Uint8Array): void;
|
|
17
|
+
//# sourceMappingURL=bc4_unorm_decode_block.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bc4_unorm_decode_block.d.ts","sourceRoot":"","sources":["../../../../../src/format/texture/bc/bc4_unorm_decode_block.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,+CARW,UAAU,UACV,MAAM,OACN,UAAU,QAcpB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { bc4_unorm_decode_channel } from "./bc4_decode_channel.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Decode one unsigned BC4 block (`bc4-r-unorm`) into sixteen RGBA texels, `(r, 0, 0, 255)` as a
|
|
5
|
+
* device samples a red texture.
|
|
6
|
+
*
|
|
7
|
+
* Both modes, including the six-value mode's hard 0 and 255. See {@link bc4_unorm_decode_channel}
|
|
8
|
+
* for the arithmetic and how a value reaches a byte. Any eight bytes are a valid block.
|
|
9
|
+
*
|
|
10
|
+
* @param {Uint8Array} source
|
|
11
|
+
* @param {number} offset of the eight-byte block in `source`
|
|
12
|
+
* @param {Uint8Array} out sixteen RGBA texels, raster order, written from index 0
|
|
13
|
+
*
|
|
14
|
+
* @see Khronos Data Format Specification, RGTC, "BC4 unsigned"
|
|
15
|
+
* @author Alex Goldring
|
|
16
|
+
* @copyright Company Named Limited (c) 2026
|
|
17
|
+
*/
|
|
18
|
+
export function bc4_unorm_decode_block(source, offset, out) {
|
|
19
|
+
bc4_unorm_decode_channel(source, offset, out, 0);
|
|
20
|
+
|
|
21
|
+
for (let t = 0; t < 16; t++) {
|
|
22
|
+
out[t * 4 + 1] = 0;
|
|
23
|
+
out[t * 4 + 2] = 0;
|
|
24
|
+
out[t * 4 + 3] = 255;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Encode sixteen RGBA texels' red and green as one `bc5-rg-unorm` block: a BC4 block of red, then one of green, each
|
|
3
|
+
* fitted on its own.
|
|
4
|
+
*
|
|
5
|
+
* @param {Uint8Array} texels sixty-four bytes: sixteen RGBA texels in raster order
|
|
6
|
+
* @param {Uint8Array} out
|
|
7
|
+
* @param {number} offset of the block's sixteen bytes in `out`
|
|
8
|
+
*
|
|
9
|
+
* @author Alex Goldring
|
|
10
|
+
* @copyright Company Named Limited (c) 2026
|
|
11
|
+
*/
|
|
12
|
+
export function bc5_unorm_encode_block(texels: Uint8Array, out: Uint8Array, offset: number): void;
|
|
13
|
+
/**
|
|
14
|
+
* Encode sixteen RGBA texels' red and green as one `bc5-rg-snorm` block: a signed BC4 block of red, then one of
|
|
15
|
+
* green, each fitted on its own.
|
|
16
|
+
*
|
|
17
|
+
* @param {Int8Array} texels sixty-four signed bytes: sixteen RGBA texels in raster order
|
|
18
|
+
* @param {Uint8Array} out
|
|
19
|
+
* @param {number} offset of the block's sixteen bytes in `out`
|
|
20
|
+
*
|
|
21
|
+
* @author Alex Goldring
|
|
22
|
+
* @copyright Company Named Limited (c) 2026
|
|
23
|
+
*/
|
|
24
|
+
export function bc5_snorm_encode_block(texels: Int8Array, out: Uint8Array, offset: number): void;
|
|
25
|
+
//# sourceMappingURL=bc5_encode_block.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bc5_encode_block.d.ts","sourceRoot":"","sources":["../../../../../src/format/texture/bc/bc5_encode_block.js"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,+CAPW,UAAU,OACV,UAAU,UACV,MAAM,QAQhB;AAED;;;;;;;;;;GAUG;AACH,+CAPW,SAAS,OACT,UAAU,UACV,MAAM,QAQhB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { BC4_BLOCK_BYTES } from "./bc4_write_block.js";
|
|
2
|
+
import { bc4_snorm_encode_channel, bc4_unorm_encode_channel } from "./bc4_encode_block.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Encode sixteen RGBA texels' red and green as one `bc5-rg-unorm` block: a BC4 block of red, then one of green, each
|
|
6
|
+
* fitted on its own.
|
|
7
|
+
*
|
|
8
|
+
* @param {Uint8Array} texels sixty-four bytes: sixteen RGBA texels in raster order
|
|
9
|
+
* @param {Uint8Array} out
|
|
10
|
+
* @param {number} offset of the block's sixteen bytes in `out`
|
|
11
|
+
*
|
|
12
|
+
* @author Alex Goldring
|
|
13
|
+
* @copyright Company Named Limited (c) 2026
|
|
14
|
+
*/
|
|
15
|
+
export function bc5_unorm_encode_block(texels, out, offset) {
|
|
16
|
+
bc4_unorm_encode_channel(texels, 0, out, offset);
|
|
17
|
+
bc4_unorm_encode_channel(texels, 1, out, offset + BC4_BLOCK_BYTES);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Encode sixteen RGBA texels' red and green as one `bc5-rg-snorm` block: a signed BC4 block of red, then one of
|
|
22
|
+
* green, each fitted on its own.
|
|
23
|
+
*
|
|
24
|
+
* @param {Int8Array} texels sixty-four signed bytes: sixteen RGBA texels in raster order
|
|
25
|
+
* @param {Uint8Array} out
|
|
26
|
+
* @param {number} offset of the block's sixteen bytes in `out`
|
|
27
|
+
*
|
|
28
|
+
* @author Alex Goldring
|
|
29
|
+
* @copyright Company Named Limited (c) 2026
|
|
30
|
+
*/
|
|
31
|
+
export function bc5_snorm_encode_block(texels, out, offset) {
|
|
32
|
+
bc4_snorm_encode_channel(texels, 0, out, offset);
|
|
33
|
+
bc4_snorm_encode_channel(texels, 1, out, offset + BC4_BLOCK_BYTES);
|
|
34
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decode one signed BC5 block (`bc5-rg-snorm`) into sixteen RGBA texels, `(r, g, 0, 127)` as a
|
|
3
|
+
* device samples a red-green texture, with 127 standing for 1.
|
|
4
|
+
*
|
|
5
|
+
* Two signed BC4 blocks side by side, red first. See {@link bc4_snorm_decode_channel} for the
|
|
6
|
+
* arithmetic, the mode comparison and how a value reaches -127..127. Any sixteen bytes are a valid
|
|
7
|
+
* block.
|
|
8
|
+
*
|
|
9
|
+
* @param {Uint8Array} source
|
|
10
|
+
* @param {number} offset of the sixteen-byte block in `source`
|
|
11
|
+
* @param {Int8Array} out sixteen RGBA texels, raster order, written from index 0
|
|
12
|
+
*
|
|
13
|
+
* @see Khronos Data Format Specification, RGTC, "BC5 signed"
|
|
14
|
+
* @author Alex Goldring
|
|
15
|
+
* @copyright Company Named Limited (c) 2026
|
|
16
|
+
*/
|
|
17
|
+
export function bc5_snorm_decode_block(source: Uint8Array, offset: number, out: Int8Array): void;
|
|
18
|
+
//# sourceMappingURL=bc5_snorm_decode_block.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bc5_snorm_decode_block.d.ts","sourceRoot":"","sources":["../../../../../src/format/texture/bc/bc5_snorm_decode_block.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AACH,+CARW,UAAU,UACV,MAAM,OACN,SAAS,QAcnB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { bc4_snorm_decode_channel } from "./bc4_decode_channel.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Decode one signed BC5 block (`bc5-rg-snorm`) into sixteen RGBA texels, `(r, g, 0, 127)` as a
|
|
5
|
+
* device samples a red-green texture, with 127 standing for 1.
|
|
6
|
+
*
|
|
7
|
+
* Two signed BC4 blocks side by side, red first. See {@link bc4_snorm_decode_channel} for the
|
|
8
|
+
* arithmetic, the mode comparison and how a value reaches -127..127. Any sixteen bytes are a valid
|
|
9
|
+
* block.
|
|
10
|
+
*
|
|
11
|
+
* @param {Uint8Array} source
|
|
12
|
+
* @param {number} offset of the sixteen-byte block in `source`
|
|
13
|
+
* @param {Int8Array} out sixteen RGBA texels, raster order, written from index 0
|
|
14
|
+
*
|
|
15
|
+
* @see Khronos Data Format Specification, RGTC, "BC5 signed"
|
|
16
|
+
* @author Alex Goldring
|
|
17
|
+
* @copyright Company Named Limited (c) 2026
|
|
18
|
+
*/
|
|
19
|
+
export function bc5_snorm_decode_block(source, offset, out) {
|
|
20
|
+
bc4_snorm_decode_channel(source, offset, out, 0);
|
|
21
|
+
bc4_snorm_decode_channel(source, offset + 8, out, 1);
|
|
22
|
+
|
|
23
|
+
for (let t = 0; t < 16; t++) {
|
|
24
|
+
out[t * 4 + 2] = 0;
|
|
25
|
+
out[t * 4 + 3] = 127;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decode one unsigned BC5 block (`bc5-rg-unorm`) into sixteen RGBA texels, `(r, g, 0, 255)` as a
|
|
3
|
+
* device samples a red-green texture.
|
|
4
|
+
*
|
|
5
|
+
* Two unsigned BC4 blocks side by side, red first. See {@link bc4_unorm_decode_channel} for the
|
|
6
|
+
* arithmetic and how a value reaches a byte. Any sixteen bytes are a valid block.
|
|
7
|
+
*
|
|
8
|
+
* @param {Uint8Array} source
|
|
9
|
+
* @param {number} offset of the sixteen-byte block in `source`
|
|
10
|
+
* @param {Uint8Array} out sixteen RGBA texels, raster order, written from index 0
|
|
11
|
+
*
|
|
12
|
+
* @see Khronos Data Format Specification, RGTC, "BC5 unsigned"
|
|
13
|
+
* @author Alex Goldring
|
|
14
|
+
* @copyright Company Named Limited (c) 2026
|
|
15
|
+
*/
|
|
16
|
+
export function bc5_unorm_decode_block(source: Uint8Array, offset: number, out: Uint8Array): void;
|
|
17
|
+
//# sourceMappingURL=bc5_unorm_decode_block.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bc5_unorm_decode_block.d.ts","sourceRoot":"","sources":["../../../../../src/format/texture/bc/bc5_unorm_decode_block.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,+CARW,UAAU,UACV,MAAM,OACN,UAAU,QAcpB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { bc4_unorm_decode_channel } from "./bc4_decode_channel.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Decode one unsigned BC5 block (`bc5-rg-unorm`) into sixteen RGBA texels, `(r, g, 0, 255)` as a
|
|
5
|
+
* device samples a red-green texture.
|
|
6
|
+
*
|
|
7
|
+
* Two unsigned BC4 blocks side by side, red first. See {@link bc4_unorm_decode_channel} for the
|
|
8
|
+
* arithmetic and how a value reaches a byte. Any sixteen bytes are a valid block.
|
|
9
|
+
*
|
|
10
|
+
* @param {Uint8Array} source
|
|
11
|
+
* @param {number} offset of the sixteen-byte block in `source`
|
|
12
|
+
* @param {Uint8Array} out sixteen RGBA texels, raster order, written from index 0
|
|
13
|
+
*
|
|
14
|
+
* @see Khronos Data Format Specification, RGTC, "BC5 unsigned"
|
|
15
|
+
* @author Alex Goldring
|
|
16
|
+
* @copyright Company Named Limited (c) 2026
|
|
17
|
+
*/
|
|
18
|
+
export function bc5_unorm_decode_block(source, offset, out) {
|
|
19
|
+
bc4_unorm_decode_channel(source, offset, out, 0);
|
|
20
|
+
bc4_unorm_decode_channel(source, offset + 8, out, 1);
|
|
21
|
+
|
|
22
|
+
for (let t = 0; t < 16; t++) {
|
|
23
|
+
out[t * 4 + 2] = 0;
|
|
24
|
+
out[t * 4 + 3] = 255;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decode one BC6H block into sixteen RGBA texels, signed or unsigned. The shared body of
|
|
3
|
+
* `bc6h_ufloat_decode_block` and `bc6h_sfloat_decode_block`, which a caller uses instead.
|
|
4
|
+
*
|
|
5
|
+
* Bit-exact to the BPTC specification, which requires that of a decoder. The mode is the low two
|
|
6
|
+
* bits when they are below two, otherwise the low five. Its endpoints are gathered from the layout,
|
|
7
|
+
* then: the first endpoint is sign-extended at the endpoint bits if the format is signed; the others
|
|
8
|
+
* are sign-extended at the delta bits if the format is signed or the mode transformed; in a
|
|
9
|
+
* transformed mode they are added to the first endpoint and wrapped at the endpoint bits, then
|
|
10
|
+
* sign-extended again if the format is signed. Each endpoint is unquantised, the texels interpolate
|
|
11
|
+
* as `(a * (64 - w) + b * w + 32) >> 6` with three-bit indices over two regions (the first 32
|
|
12
|
+
* partitions of BC7's two-subset table, with its anchors) or four-bit indices over one, and the
|
|
13
|
+
* result is scaled by 31/64 unsigned, or in magnitude by 31/32 with the sign bit set where the
|
|
14
|
+
* interpolated value is negative, and read as a half. Alpha is 1.
|
|
15
|
+
*
|
|
16
|
+
* A reserved mode (19, 23, 27, 31) decodes to (0, 0, 0, 1) at every texel, as the specification
|
|
17
|
+
* says. Any other sixteen bytes are a valid block.
|
|
18
|
+
*
|
|
19
|
+
* @param {Uint8Array} source
|
|
20
|
+
* @param {number} offset of the sixteen-byte block in `source`
|
|
21
|
+
* @param {Float32Array} out sixteen RGBA texels, raster order, written from index 0
|
|
22
|
+
* @param {boolean} signed `true` for `bc6h-rgb-float`, `false` for `bc6h-rgb-ufloat`
|
|
23
|
+
*
|
|
24
|
+
* @see the BPTC specification (ARB_texture_compression_bptc), and the BPTC section of the Khronos
|
|
25
|
+
* Data Format Specification
|
|
26
|
+
* @author Alex Goldring
|
|
27
|
+
* @copyright Company Named Limited (c) 2026
|
|
28
|
+
*/
|
|
29
|
+
export function bc6h_decode_texels(source: Uint8Array, offset: number, out: Float32Array, signed: boolean): void;
|
|
30
|
+
//# sourceMappingURL=bc6h_decode_texels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bc6h_decode_texels.d.ts","sourceRoot":"","sources":["../../../../../src/format/texture/bc/bc6h_decode_texels.js"],"names":[],"mappings":"AAqSA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,2CAVW,UAAU,UACV,MAAM,OACN,YAAY,UACZ,OAAO,QAmHjB"}
|