@woosh/meep-engine 3.9.0 → 3.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/bundle-worker-image-decoder.js +1 -1
- package/build/bundle-worker-terrain.js +1 -1
- package/package.json +3 -2
- package/src/avif/encode_image_source.d.ts +70 -0
- package/src/avif/encode_image_source.d.ts.map +1 -0
- package/src/avif/encode_image_source.js +117 -0
- package/src/avif/encoder_worker.js +15 -126
- package/src/avif/index.d.ts +4 -2
- package/src/avif/index.js +21 -2
- package/src/avif/native/DECISIONS.md +537 -0
- package/src/avif/native/NOTICE.md +61 -0
- package/src/avif/native/api/AvifDecoder.d.ts +67 -0
- package/src/avif/native/api/AvifDecoder.d.ts.map +1 -0
- package/src/avif/native/api/AvifDecoder.js +121 -0
- package/src/avif/native/api/apply_transformations.d.ts +30 -0
- package/src/avif/native/api/apply_transformations.d.ts.map +1 -0
- package/src/avif/native/api/apply_transformations.js +120 -0
- package/src/avif/native/api/avif_to_sampler2d.d.ts +25 -0
- package/src/avif/native/api/avif_to_sampler2d.d.ts.map +1 -0
- package/src/avif/native/api/avif_to_sampler2d.js +42 -0
- package/src/avif/native/api/convert_to_rgba.d.ts +54 -0
- package/src/avif/native/api/convert_to_rgba.d.ts.map +1 -0
- package/src/avif/native/api/convert_to_rgba.js +204 -0
- package/src/avif/native/api/decode_avif.d.ts +24 -0
- package/src/avif/native/api/decode_avif.d.ts.map +1 -0
- package/src/avif/native/api/decode_avif.js +111 -0
- package/src/avif/native/api/decode_image_item.d.ts +18 -0
- package/src/avif/native/api/decode_image_item.d.ts.map +1 -0
- package/src/avif/native/api/decode_image_item.js +234 -0
- package/src/avif/native/api/encode_avif.d.ts +73 -0
- package/src/avif/native/api/encode_avif.d.ts.map +1 -0
- package/src/avif/native/api/encode_avif.js +488 -0
- package/src/avif/native/api/sampler2d_to_avif.d.ts +22 -0
- package/src/avif/native/api/sampler2d_to_avif.d.ts.map +1 -0
- package/src/avif/native/api/sampler2d_to_avif.js +108 -0
- package/src/avif/native/av1/decode/Av1FrameContext.d.ts +286 -0
- package/src/avif/native/av1/decode/Av1FrameContext.d.ts.map +1 -0
- package/src/avif/native/av1/decode/Av1FrameContext.js +622 -0
- package/src/avif/native/av1/decode/block_decoded.d.ts +27 -0
- package/src/avif/native/av1/decode/block_decoded.d.ts.map +1 -0
- package/src/avif/native/av1/decode/block_decoded.js +59 -0
- package/src/avif/native/av1/decode/decode_av1_still.d.ts +22 -0
- package/src/avif/native/av1/decode/decode_av1_still.d.ts.map +1 -0
- package/src/avif/native/av1/decode/decode_av1_still.js +309 -0
- package/src/avif/native/av1/decode/decode_coefficients.d.ts +20 -0
- package/src/avif/native/av1/decode/decode_coefficients.d.ts.map +1 -0
- package/src/avif/native/av1/decode/decode_coefficients.js +259 -0
- package/src/avif/native/av1/decode/decode_palette.d.ts +28 -0
- package/src/avif/native/av1/decode/decode_palette.d.ts.map +1 -0
- package/src/avif/native/av1/decode/decode_palette.js +442 -0
- package/src/avif/native/av1/decode/decode_tile.d.ts +14 -0
- package/src/avif/native/av1/decode/decode_tile.d.ts.map +1 -0
- package/src/avif/native/av1/decode/decode_tile.js +1213 -0
- package/src/avif/native/av1/decode/get_scan.d.ts +16 -0
- package/src/avif/native/av1/decode/get_scan.d.ts.map +1 -0
- package/src/avif/native/av1/decode/get_scan.js +138 -0
- package/src/avif/native/av1/decode/read_lr.d.ts +35 -0
- package/src/avif/native/av1/decode/read_lr.d.ts.map +1 -0
- package/src/avif/native/av1/decode/read_lr.js +277 -0
- package/src/avif/native/av1/decode/read_transform_type.d.ts +19 -0
- package/src/avif/native/av1/decode/read_transform_type.d.ts.map +1 -0
- package/src/avif/native/av1/decode/read_transform_type.js +92 -0
- package/src/avif/native/av1/decode/reconstruct.d.ts +36 -0
- package/src/avif/native/av1/decode/reconstruct.d.ts.map +1 -0
- package/src/avif/native/av1/decode/reconstruct.js +241 -0
- package/src/avif/native/av1/decode/transform_type.d.ts +49 -0
- package/src/avif/native/av1/decode/transform_type.d.ts.map +1 -0
- package/src/avif/native/av1/decode/transform_type.js +137 -0
- package/src/avif/native/av1/encode/Av1BlockSnapshot.d.ts +81 -0
- package/src/avif/native/av1/encode/Av1BlockSnapshot.d.ts.map +1 -0
- package/src/avif/native/av1/encode/Av1BlockSnapshot.js +299 -0
- package/src/avif/native/av1/encode/Av1EncodeContext.d.ts +384 -0
- package/src/avif/native/av1/encode/Av1EncodeContext.d.ts.map +1 -0
- package/src/avif/native/av1/encode/Av1EncodeContext.js +590 -0
- package/src/avif/native/av1/encode/build_headers.d.ts +50 -0
- package/src/avif/native/av1/encode/build_headers.d.ts.map +1 -0
- package/src/avif/native/av1/encode/build_headers.js +359 -0
- package/src/avif/native/av1/encode/choose_chroma_alpha.d.ts +26 -0
- package/src/avif/native/av1/encode/choose_chroma_alpha.d.ts.map +1 -0
- package/src/avif/native/av1/encode/choose_chroma_alpha.js +90 -0
- package/src/avif/native/av1/encode/choose_filters.d.ts +21 -0
- package/src/avif/native/av1/encode/choose_filters.d.ts.map +1 -0
- package/src/avif/native/av1/encode/choose_filters.js +318 -0
- package/src/avif/native/av1/encode/choose_restoration.d.ts +35 -0
- package/src/avif/native/av1/encode/choose_restoration.d.ts.map +1 -0
- package/src/avif/native/av1/encode/choose_restoration.js +616 -0
- package/src/avif/native/av1/encode/decode_effort.d.ts +57 -0
- package/src/avif/native/av1/encode/decode_effort.d.ts.map +1 -0
- package/src/avif/native/av1/encode/decode_effort.js +59 -0
- package/src/avif/native/av1/encode/encode_av1_still.d.ts +17 -0
- package/src/avif/native/av1/encode/encode_av1_still.d.ts.map +1 -0
- package/src/avif/native/av1/encode/encode_av1_still.js +194 -0
- package/src/avif/native/av1/encode/encode_effort.d.ts +56 -0
- package/src/avif/native/av1/encode/encode_effort.d.ts.map +1 -0
- package/src/avif/native/av1/encode/encode_effort.js +97 -0
- package/src/avif/native/av1/encode/encode_tile.d.ts +26 -0
- package/src/avif/native/av1/encode/encode_tile.d.ts.map +1 -0
- package/src/avif/native/av1/encode/encode_tile.js +2331 -0
- package/src/avif/native/av1/encode/quantise.d.ts +51 -0
- package/src/avif/native/av1/encode/quantise.d.ts.map +1 -0
- package/src/avif/native/av1/encode/quantise.js +212 -0
- package/src/avif/native/av1/encode/write_coefficients.d.ts +42 -0
- package/src/avif/native/av1/encode/write_coefficients.d.ts.map +1 -0
- package/src/avif/native/av1/encode/write_coefficients.js +367 -0
- package/src/avif/native/av1/encode/write_lr.d.ts +33 -0
- package/src/avif/native/av1/encode/write_lr.d.ts.map +1 -0
- package/src/avif/native/av1/encode/write_lr.js +174 -0
- package/src/avif/native/av1/encode/write_transform_type.d.ts +21 -0
- package/src/avif/native/av1/encode/write_transform_type.d.ts.map +1 -0
- package/src/avif/native/av1/encode/write_transform_type.js +70 -0
- package/src/avif/native/av1/entropy/CdfContext.d.ts +167 -0
- package/src/avif/native/av1/entropy/CdfContext.d.ts.map +1 -0
- package/src/avif/native/av1/entropy/CdfContext.js +433 -0
- package/src/avif/native/av1/entropy/SymbolReader.d.ts +103 -0
- package/src/avif/native/av1/entropy/SymbolReader.d.ts.map +1 -0
- package/src/avif/native/av1/entropy/SymbolReader.js +317 -0
- package/src/avif/native/av1/entropy/SymbolWriter.d.ts +107 -0
- package/src/avif/native/av1/entropy/SymbolWriter.d.ts.map +1 -0
- package/src/avif/native/av1/entropy/SymbolWriter.js +352 -0
- package/src/avif/native/av1/entropy/coefficient_context.d.ts +71 -0
- package/src/avif/native/av1/entropy/coefficient_context.d.ts.map +1 -0
- package/src/avif/native/av1/entropy/coefficient_context.js +325 -0
- package/src/avif/native/av1/entropy/partition_cdf.d.ts +54 -0
- package/src/avif/native/av1/entropy/partition_cdf.d.ts.map +1 -0
- package/src/avif/native/av1/entropy/partition_cdf.js +98 -0
- package/src/avif/native/av1/entropy/symbol_cost.d.ts +37 -0
- package/src/avif/native/av1/entropy/symbol_cost.d.ts.map +1 -0
- package/src/avif/native/av1/entropy/symbol_cost.js +76 -0
- package/src/avif/native/av1/filter/cdef.d.ts +15 -0
- package/src/avif/native/av1/filter/cdef.d.ts.map +1 -0
- package/src/avif/native/av1/filter/cdef.js +313 -0
- package/src/avif/native/av1/filter/loop_filter.d.ts +14 -0
- package/src/avif/native/av1/filter/loop_filter.d.ts.map +1 -0
- package/src/avif/native/av1/filter/loop_filter.js +377 -0
- package/src/avif/native/av1/filter/loop_restoration.d.ts +42 -0
- package/src/avif/native/av1/filter/loop_restoration.d.ts.map +1 -0
- package/src/avif/native/av1/filter/loop_restoration.js +451 -0
- package/src/avif/native/av1/filter/superres.d.ts +18 -0
- package/src/avif/native/av1/filter/superres.d.ts.map +1 -0
- package/src/avif/native/av1/filter/superres.js +86 -0
- package/src/avif/native/av1/grain/FilmGrainState.d.ts +62 -0
- package/src/avif/native/av1/grain/FilmGrainState.d.ts.map +1 -0
- package/src/avif/native/av1/grain/FilmGrainState.js +87 -0
- package/src/avif/native/av1/grain/film_grain.d.ts +16 -0
- package/src/avif/native/av1/grain/film_grain.d.ts.map +1 -0
- package/src/avif/native/av1/grain/film_grain.js +623 -0
- package/src/avif/native/av1/obu/FrameHeader.d.ts +248 -0
- package/src/avif/native/av1/obu/FrameHeader.d.ts.map +1 -0
- package/src/avif/native/av1/obu/FrameHeader.js +381 -0
- package/src/avif/native/av1/obu/ObuHeader.d.ts +53 -0
- package/src/avif/native/av1/obu/ObuHeader.d.ts.map +1 -0
- package/src/avif/native/av1/obu/ObuHeader.js +62 -0
- package/src/avif/native/av1/obu/SequenceHeader.d.ts +157 -0
- package/src/avif/native/av1/obu/SequenceHeader.d.ts.map +1 -0
- package/src/avif/native/av1/obu/SequenceHeader.js +225 -0
- package/src/avif/native/av1/obu/for_each_obu.d.ts +24 -0
- package/src/avif/native/av1/obu/for_each_obu.d.ts.map +1 -0
- package/src/avif/native/av1/obu/for_each_obu.js +50 -0
- package/src/avif/native/av1/obu/parse_frame_header.d.ts +18 -0
- package/src/avif/native/av1/obu/parse_frame_header.d.ts.map +1 -0
- package/src/avif/native/av1/obu/parse_frame_header.js +841 -0
- package/src/avif/native/av1/obu/parse_obu_header.d.ts +23 -0
- package/src/avif/native/av1/obu/parse_obu_header.d.ts.map +1 -0
- package/src/avif/native/av1/obu/parse_obu_header.js +69 -0
- package/src/avif/native/av1/obu/parse_sequence_header.d.ts +17 -0
- package/src/avif/native/av1/obu/parse_sequence_header.d.ts.map +1 -0
- package/src/avif/native/av1/obu/parse_sequence_header.js +263 -0
- package/src/avif/native/av1/obu/write_frame_header.d.ts +16 -0
- package/src/avif/native/av1/obu/write_frame_header.d.ts.map +1 -0
- package/src/avif/native/av1/obu/write_frame_header.js +579 -0
- package/src/avif/native/av1/obu/write_sequence_header.d.ts +17 -0
- package/src/avif/native/av1/obu/write_sequence_header.d.ts.map +1 -0
- package/src/avif/native/av1/obu/write_sequence_header.js +189 -0
- package/src/avif/native/av1/predict/IntraPredictionState.d.ts +49 -0
- package/src/avif/native/av1/predict/IntraPredictionState.d.ts.map +1 -0
- package/src/avif/native/av1/predict/IntraPredictionState.js +58 -0
- package/src/avif/native/av1/predict/intra_filter_type.d.ts +17 -0
- package/src/avif/native/av1/predict/intra_filter_type.d.ts.map +1 -0
- package/src/avif/native/av1/predict/intra_filter_type.js +79 -0
- package/src/avif/native/av1/predict/predict_chroma_from_luma.d.ts +50 -0
- package/src/avif/native/av1/predict/predict_chroma_from_luma.d.ts.map +1 -0
- package/src/avif/native/av1/predict/predict_chroma_from_luma.js +153 -0
- package/src/avif/native/av1/predict/predict_intra.d.ts +42 -0
- package/src/avif/native/av1/predict/predict_intra.d.ts.map +1 -0
- package/src/avif/native/av1/predict/predict_intra.js +803 -0
- package/src/avif/native/av1/predict/predict_palette.d.ts +23 -0
- package/src/avif/native/av1/predict/predict_palette.d.ts.map +1 -0
- package/src/avif/native/av1/predict/predict_palette.js +36 -0
- package/src/avif/native/av1/tables/av1_symbols.d.ts +411 -0
- package/src/avif/native/av1/tables/av1_symbols.d.ts.map +1 -0
- package/src/avif/native/av1/tables/av1_symbols.js +419 -0
- package/src/avif/native/av1/tables/block_tables.d.ts +181 -0
- package/src/avif/native/av1/tables/block_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/block_tables.js +270 -0
- package/src/avif/native/av1/tables/cdf_tables.d.ts +961 -0
- package/src/avif/native/av1/tables/cdf_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/cdf_tables.js +1893 -0
- package/src/avif/native/av1/tables/coefficient_tables.d.ts +41 -0
- package/src/avif/native/av1/tables/coefficient_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/coefficient_tables.js +82 -0
- package/src/avif/native/av1/tables/derived_block_tables.d.ts +15 -0
- package/src/avif/native/av1/tables/derived_block_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/derived_block_tables.js +23 -0
- package/src/avif/native/av1/tables/filter_tables.d.ts +171 -0
- package/src/avif/native/av1/tables/filter_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/filter_tables.js +313 -0
- package/src/avif/native/av1/tables/grain_tables.d.ts +11 -0
- package/src/avif/native/av1/tables/grain_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/grain_tables.js +190 -0
- package/src/avif/native/av1/tables/prediction_tables.d.ts +141 -0
- package/src/avif/native/av1/tables/prediction_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/prediction_tables.js +223 -0
- package/src/avif/native/av1/tables/quantizer_matrix_tables.d.ts +21 -0
- package/src/avif/native/av1/tables/quantizer_matrix_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/quantizer_matrix_tables.js +38 -0
- package/src/avif/native/av1/tables/quantizer_tables.d.ts +21 -0
- package/src/avif/native/av1/tables/quantizer_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/quantizer_tables.js +160 -0
- package/src/avif/native/av1/tables/scan_tables.d.ts +321 -0
- package/src/avif/native/av1/tables/scan_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/scan_tables.js +727 -0
- package/src/avif/native/av1/tables/segmentation_tables.d.ts +31 -0
- package/src/avif/native/av1/tables/segmentation_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/segmentation_tables.js +48 -0
- package/src/avif/native/av1/tables/transform_tables.d.ts +91 -0
- package/src/avif/native/av1/tables/transform_tables.d.ts.map +1 -0
- package/src/avif/native/av1/tables/transform_tables.js +140 -0
- package/src/avif/native/av1/tables/unpack_table.d.ts +33 -0
- package/src/avif/native/av1/tables/unpack_table.d.ts.map +1 -0
- package/src/avif/native/av1/tables/unpack_table.js +73 -0
- package/src/avif/native/av1/transform/forward_transform_2d.d.ts +61 -0
- package/src/avif/native/av1/transform/forward_transform_2d.d.ts.map +1 -0
- package/src/avif/native/av1/transform/forward_transform_2d.js +574 -0
- package/src/avif/native/av1/transform/inverse_transform_1d.d.ts +76 -0
- package/src/avif/native/av1/transform/inverse_transform_1d.d.ts.map +1 -0
- package/src/avif/native/av1/transform/inverse_transform_1d.js +590 -0
- package/src/avif/native/av1/transform/inverse_transform_2d.d.ts +46 -0
- package/src/avif/native/av1/transform/inverse_transform_2d.d.ts.map +1 -0
- package/src/avif/native/av1/transform/inverse_transform_2d.js +180 -0
- package/src/avif/native/av1/util/ceil_log2.d.ts +13 -0
- package/src/avif/native/av1/util/ceil_log2.d.ts.map +1 -0
- package/src/avif/native/av1/util/ceil_log2.js +18 -0
- package/src/avif/native/av1/util/floor_log2.d.ts +20 -0
- package/src/avif/native/av1/util/floor_log2.d.ts.map +1 -0
- package/src/avif/native/av1/util/floor_log2.js +20 -0
- package/src/avif/native/av1/util/round2.d.ts +22 -0
- package/src/avif/native/av1/util/round2.d.ts.map +1 -0
- package/src/avif/native/av1/util/round2.js +27 -0
- package/src/avif/native/av1/util/round2_signed.d.ts +14 -0
- package/src/avif/native/av1/util/round2_signed.d.ts.map +1 -0
- package/src/avif/native/av1/util/round2_signed.js +17 -0
- package/src/avif/native/av1/util/tile_log2.d.ts +16 -0
- package/src/avif/native/av1/util/tile_log2.d.ts.map +1 -0
- package/src/avif/native/av1/util/tile_log2.js +23 -0
- package/src/avif/native/bitstream/BitReader.d.ts +174 -0
- package/src/avif/native/bitstream/BitReader.d.ts.map +1 -0
- package/src/avif/native/bitstream/BitReader.js +391 -0
- package/src/avif/native/bitstream/BitWriter.d.ts +122 -0
- package/src/avif/native/bitstream/BitWriter.d.ts.map +1 -0
- package/src/avif/native/bitstream/BitWriter.js +351 -0
- package/src/avif/native/color/ColourTransform.d.ts +62 -0
- package/src/avif/native/color/ColourTransform.d.ts.map +1 -0
- package/src/avif/native/color/ColourTransform.js +189 -0
- package/src/avif/native/color/YuvImage.d.ts +51 -0
- package/src/avif/native/color/YuvImage.d.ts.map +1 -0
- package/src/avif/native/color/YuvImage.js +66 -0
- package/src/avif/native/color/clamp_sample.d.ts +18 -0
- package/src/avif/native/color/clamp_sample.d.ts.map +1 -0
- package/src/avif/native/color/clamp_sample.js +25 -0
- package/src/avif/native/color/linear_to_transfer.d.ts +24 -0
- package/src/avif/native/color/linear_to_transfer.d.ts.map +1 -0
- package/src/avif/native/color/linear_to_transfer.js +126 -0
- package/src/avif/native/color/primaries.d.ts +20 -0
- package/src/avif/native/color/primaries.d.ts.map +1 -0
- package/src/avif/native/color/primaries.js +94 -0
- package/src/avif/native/color/rgb_row_to_ycbcr.d.ts +20 -0
- package/src/avif/native/color/rgb_row_to_ycbcr.d.ts.map +1 -0
- package/src/avif/native/color/rgb_row_to_ycbcr.js +78 -0
- package/src/avif/native/color/transfer_to_linear.d.ts +49 -0
- package/src/avif/native/color/transfer_to_linear.d.ts.map +1 -0
- package/src/avif/native/color/transfer_to_linear.js +171 -0
- package/src/avif/native/color/upsample_chroma_row.d.ts +35 -0
- package/src/avif/native/color/upsample_chroma_row.d.ts.map +1 -0
- package/src/avif/native/color/upsample_chroma_row.js +89 -0
- package/src/avif/native/color/ycbcr_row_to_rgb.d.ts +23 -0
- package/src/avif/native/color/ycbcr_row_to_rgb.d.ts.map +1 -0
- package/src/avif/native/color/ycbcr_row_to_rgb.js +78 -0
- package/src/avif/native/heif/AvifFile.d.ts +112 -0
- package/src/avif/native/heif/AvifFile.d.ts.map +1 -0
- package/src/avif/native/heif/AvifFile.js +142 -0
- package/src/avif/native/heif/ItemProperty.d.ts +244 -0
- package/src/avif/native/heif/ItemProperty.d.ts.map +1 -0
- package/src/avif/native/heif/ItemProperty.js +321 -0
- package/src/avif/native/heif/find_item_property.d.ts +17 -0
- package/src/avif/native/heif/find_item_property.d.ts.map +1 -0
- package/src/avif/native/heif/find_item_property.js +28 -0
- package/src/avif/native/heif/find_item_references.d.ts +16 -0
- package/src/avif/native/heif/find_item_references.d.ts.map +1 -0
- package/src/avif/native/heif/find_item_references.js +29 -0
- package/src/avif/native/heif/find_items_referencing.d.ts +17 -0
- package/src/avif/native/heif/find_items_referencing.d.ts.map +1 -0
- package/src/avif/native/heif/find_items_referencing.js +36 -0
- package/src/avif/native/heif/parse_avif_file.d.ts +15 -0
- package/src/avif/native/heif/parse_avif_file.d.ts.map +1 -0
- package/src/avif/native/heif/parse_avif_file.js +383 -0
- package/src/avif/native/heif/parse_image_grid.d.ts +18 -0
- package/src/avif/native/heif/parse_image_grid.d.ts.map +1 -0
- package/src/avif/native/heif/parse_image_grid.js +48 -0
- package/src/avif/native/heif/parse_item_property.d.ts +18 -0
- package/src/avif/native/heif/parse_item_property.d.ts.map +1 -0
- package/src/avif/native/heif/parse_item_property.js +243 -0
- package/src/avif/native/heif/read_item_data.d.ts +22 -0
- package/src/avif/native/heif/read_item_data.d.ts.map +1 -0
- package/src/avif/native/heif/read_item_data.js +97 -0
- package/src/avif/native/heif/write_avif_file.d.ts +50 -0
- package/src/avif/native/heif/write_avif_file.d.ts.map +1 -0
- package/src/avif/native/heif/write_avif_file.js +348 -0
- package/src/avif/native/heif/write_item_property.d.ts +16 -0
- package/src/avif/native/heif/write_item_property.d.ts.map +1 -0
- package/src/avif/native/heif/write_item_property.js +182 -0
- package/src/avif/native/index.d.ts +14 -0
- package/src/avif/native/index.d.ts.map +1 -0
- package/src/avif/native/index.js +56 -0
- package/src/avif/native/isobmff/BoxHeader.d.ts +50 -0
- package/src/avif/native/isobmff/BoxHeader.d.ts.map +1 -0
- package/src/avif/native/isobmff/BoxHeader.js +57 -0
- package/src/avif/native/isobmff/BoxWriter.d.ts +118 -0
- package/src/avif/native/isobmff/BoxWriter.d.ts.map +1 -0
- package/src/avif/native/isobmff/BoxWriter.js +264 -0
- package/src/avif/native/isobmff/ByteCursor.d.ts +125 -0
- package/src/avif/native/isobmff/ByteCursor.d.ts.map +1 -0
- package/src/avif/native/isobmff/ByteCursor.js +298 -0
- package/src/avif/native/isobmff/for_each_box.d.ts +23 -0
- package/src/avif/native/isobmff/for_each_box.d.ts.map +1 -0
- package/src/avif/native/isobmff/for_each_box.js +39 -0
- package/src/avif/native/isobmff/read_box_header.d.ts +22 -0
- package/src/avif/native/isobmff/read_box_header.d.ts.map +1 -0
- package/src/avif/native/isobmff/read_box_header.js +59 -0
- package/src/avif/native/isobmff/read_full_box_header.d.ts +26 -0
- package/src/avif/native/isobmff/read_full_box_header.d.ts.map +1 -0
- package/src/avif/native/isobmff/read_full_box_header.js +33 -0
- package/src/avif/threaded_image_encoder.d.ts +7 -2
- package/src/avif/threaded_image_encoder.d.ts.map +1 -1
- package/src/avif/threaded_image_encoder.js +107 -21
- package/src/core/binary/BinaryBuffer.d.ts +40 -0
- package/src/core/binary/BinaryBuffer.d.ts.map +1 -1
- package/src/core/binary/BinaryBuffer.js +100 -0
- package/src/core/binary/hash/crc32.d.ts +16 -0
- package/src/core/binary/hash/crc32.d.ts.map +1 -0
- package/src/core/binary/hash/crc32.js +96 -0
- package/src/core/binary/utf8/utf8_decode.d.ts +21 -0
- package/src/core/binary/utf8/utf8_decode.d.ts.map +1 -0
- package/src/core/binary/utf8/utf8_decode.js +43 -0
- package/src/core/binary/utf8/utf8_encode_into.d.ts +20 -0
- package/src/core/binary/utf8/utf8_encode_into.d.ts.map +1 -0
- package/src/core/binary/utf8/utf8_encode_into.js +48 -0
- package/src/core/binary/utf8/utf8_encoded_length.d.ts +14 -0
- package/src/core/binary/utf8/utf8_encoded_length.d.ts.map +1 -0
- package/src/core/binary/utf8/utf8_encoded_length.js +36 -0
- package/src/core/color/COLOR_FIX_PLAN_2026_08_28.md +417 -0
- package/src/core/color/COLOR_REVIEW_2026_08_28.md +779 -0
- package/src/core/color/Color.d.ts +128 -20
- package/src/core/color/Color.d.ts.map +1 -1
- package/src/core/color/Color.js +959 -866
- package/src/core/color/PQ/PQ_constants.d.ts +10 -0
- package/src/core/color/PQ/PQ_constants.d.ts.map +1 -1
- package/src/core/color/PQ/PQ_constants.js +10 -0
- package/src/core/color/PQ/linear_to_PQ.d.ts.map +1 -1
- package/src/core/color/PQ/linear_to_PQ.js +6 -0
- package/src/core/color/REC709_PRIMARIES.d.ts +50 -0
- package/src/core/color/REC709_PRIMARIES.d.ts.map +1 -0
- package/src/core/color/REC709_PRIMARIES.js +53 -0
- package/src/core/color/construct/color_from_hex.d.ts +21 -0
- package/src/core/color/construct/color_from_hex.d.ts.map +1 -0
- package/src/core/color/construct/color_from_hex.js +33 -0
- package/src/core/color/construct/color_from_temperature.d.ts +22 -0
- package/src/core/color/construct/color_from_temperature.d.ts.map +1 -0
- package/src/core/color/construct/color_from_temperature.js +33 -0
- package/src/core/color/construct/color_from_uint24.d.ts +19 -0
- package/src/core/color/construct/color_from_uint24.d.ts.map +1 -0
- package/src/core/color/construct/color_from_uint24.js +26 -0
- package/src/core/color/construct/color_from_uint32.d.ts +20 -0
- package/src/core/color/construct/color_from_uint32.d.ts.map +1 -0
- package/src/core/color/construct/color_from_uint32.js +39 -0
- package/src/core/color/construct/color_gray.d.ts +17 -0
- package/src/core/color/construct/color_gray.d.ts.map +1 -0
- package/src/core/color/construct/color_gray.js +22 -0
- package/src/core/color/hex/hex2rgb.d.ts +1 -11
- package/src/core/color/hex/hex2rgb.d.ts.map +1 -1
- package/src/core/color/hex/hex2rgb.js +7 -24
- package/src/core/color/hex/hex_to_rgb.d.ts +18 -0
- package/src/core/color/hex/hex_to_rgb.d.ts.map +1 -0
- package/src/core/color/hex/hex_to_rgb.js +62 -0
- package/src/core/color/hex/rgb2hex.d.ts +1 -8
- package/src/core/color/hex/rgb2hex.d.ts.map +1 -1
- package/src/core/color/hex/rgb2hex.js +7 -13
- package/src/core/color/hex/rgb_to_hex.d.ts +9 -0
- package/src/core/color/hex/rgb_to_hex.d.ts.map +1 -0
- package/src/core/color/hex/rgb_to_hex.js +13 -0
- package/src/core/color/hex/rgba_to_hex.d.ts +19 -0
- package/src/core/color/hex/rgba_to_hex.d.ts.map +1 -0
- package/src/core/color/hex/rgba_to_hex.js +23 -0
- package/src/core/color/hsv/hsv2rgb.d.ts +1 -12
- package/src/core/color/hsv/hsv2rgb.d.ts.map +1 -1
- package/src/core/color/hsv/hsv2rgb.js +8 -21
- package/src/core/color/hsv/hsv2rgb_float.d.ts +1 -12
- package/src/core/color/hsv/hsv2rgb_float.d.ts.map +1 -1
- package/src/core/color/hsv/hsv2rgb_float.js +8 -56
- package/src/core/color/hsv/hsv_to_rgb.d.ts +13 -0
- package/src/core/color/hsv/hsv_to_rgb.d.ts.map +1 -0
- package/src/core/color/hsv/hsv_to_rgb.js +39 -0
- package/src/core/color/hsv/hsv_to_rgb_uint8.d.ts +13 -0
- package/src/core/color/hsv/hsv_to_rgb_uint8.d.ts.map +1 -0
- package/src/core/color/hsv/hsv_to_rgb_uint8.js +21 -0
- package/src/core/color/hsv/hue_to_rgb_sextant.d.ts +24 -0
- package/src/core/color/hsv/hue_to_rgb_sextant.d.ts.map +1 -0
- package/src/core/color/hsv/hue_to_rgb_sextant.js +67 -0
- package/src/core/color/hsv/rgb2hsv.d.ts +1 -12
- package/src/core/color/hsv/rgb2hsv.d.ts.map +1 -1
- package/src/core/color/hsv/rgb2hsv.js +7 -42
- package/src/core/color/hsv/rgb_to_hsv.d.ts +13 -0
- package/src/core/color/hsv/rgb_to_hsv.d.ts.map +1 -0
- package/src/core/color/hsv/rgb_to_hsv.js +42 -0
- package/src/core/color/hunt/hpe_to_xyz.d.ts +2 -0
- package/src/core/color/hunt/hpe_to_xyz.d.ts.map +1 -0
- package/src/core/color/hunt/hpe_to_xyz.js +4 -0
- package/src/core/color/hunt/xyz_to_hpe.d.ts +1 -6
- package/src/core/color/hunt/xyz_to_hpe.d.ts.map +1 -1
- package/src/core/color/hunt/xyz_to_hpe.js +12 -15
- package/src/core/color/illuminant/D65_spd_tabulated.d.ts.map +1 -1
- package/src/core/color/illuminant/D65_spd_tabulated.js +107 -104
- package/src/core/color/int2rgb.d.ts +1 -10
- package/src/core/color/int2rgb.d.ts.map +1 -1
- package/src/core/color/int2rgb.js +7 -12
- package/src/core/color/int_to_rgb.d.ts +21 -0
- package/src/core/color/int_to_rgb.d.ts.map +1 -0
- package/src/core/color/int_to_rgb.js +33 -0
- package/src/core/color/kelvin/kelvin_to_rgb.d.ts.map +1 -1
- package/src/core/color/kelvin/kelvin_to_rgb.js +22 -2
- package/src/core/color/kelvin/rgb_to_kelvin.d.ts +22 -2
- package/src/core/color/kelvin/rgb_to_kelvin.d.ts.map +1 -1
- package/src/core/color/kelvin/rgb_to_kelvin.js +22 -2
- package/src/core/color/lab/lab_to_xyz.d.ts +20 -0
- package/src/core/color/lab/lab_to_xyz.d.ts.map +1 -0
- package/src/core/color/lab/lab_to_xyz.js +69 -0
- package/src/core/color/oklab/gamut_clip_adaptive_l0.d.ts +34 -0
- package/src/core/color/oklab/gamut_clip_adaptive_l0.d.ts.map +1 -0
- package/src/core/color/oklab/gamut_clip_adaptive_l0.js +46 -0
- package/src/core/color/oklab/gamut_clip_at_l0.d.ts +33 -0
- package/src/core/color/oklab/gamut_clip_at_l0.d.ts.map +1 -0
- package/src/core/color/oklab/gamut_clip_at_l0.js +84 -0
- package/src/core/color/oklab/gamut_clip_preserve_chroma.d.ts +24 -0
- package/src/core/color/oklab/gamut_clip_preserve_chroma.d.ts.map +1 -0
- package/src/core/color/oklab/gamut_clip_preserve_chroma.js +37 -0
- package/src/core/color/oklab/gamut_clip_project_to_lcusp.d.ts +23 -0
- package/src/core/color/oklab/gamut_clip_project_to_lcusp.d.ts.map +1 -0
- package/src/core/color/oklab/gamut_clip_project_to_lcusp.js +46 -0
- package/src/core/color/oklab/linear_srgb_to_okhsl.d.ts +19 -0
- package/src/core/color/oklab/linear_srgb_to_okhsl.d.ts.map +1 -0
- package/src/core/color/oklab/linear_srgb_to_okhsl.js +93 -0
- package/src/core/color/oklab/linear_srgb_to_okhsv.d.ts +12 -4
- package/src/core/color/oklab/linear_srgb_to_okhsv.d.ts.map +1 -1
- package/src/core/color/oklab/linear_srgb_to_okhsv.js +108 -84
- package/src/core/color/oklab/linear_srgb_to_oklab.d.ts +13 -4
- package/src/core/color/oklab/linear_srgb_to_oklab.d.ts.map +1 -1
- package/src/core/color/oklab/linear_srgb_to_oklab.js +28 -19
- package/src/core/color/oklab/okhsl_chroma_bounds.d.ts +51 -0
- package/src/core/color/oklab/okhsl_chroma_bounds.d.ts.map +1 -0
- package/src/core/color/oklab/okhsl_chroma_bounds.js +128 -0
- package/src/core/color/oklab/okhsl_to_linear_srgb.d.ts +19 -0
- package/src/core/color/oklab/okhsl_to_linear_srgb.d.ts.map +1 -0
- package/src/core/color/oklab/okhsl_to_linear_srgb.js +85 -0
- package/src/core/color/oklab/oklab_to_oklch.d.ts +24 -0
- package/src/core/color/oklab/oklab_to_oklch.d.ts.map +1 -0
- package/src/core/color/oklab/oklab_to_oklch.js +35 -0
- package/src/core/color/oklab/oklch_to_oklab.d.ts +18 -0
- package/src/core/color/oklab/oklch_to_oklab.d.ts.map +1 -0
- package/src/core/color/oklab/oklch_to_oklab.js +26 -0
- package/src/core/color/oklab/toe.d.ts +12 -0
- package/src/core/color/oklab/toe.d.ts.map +1 -1
- package/src/core/color/oklab/toe.js +34 -22
- package/src/core/color/operations/color_add.d.ts +21 -0
- package/src/core/color/operations/color_add.d.ts.map +1 -0
- package/src/core/color/operations/color_add.js +23 -0
- package/src/core/color/operations/color_add_scaled.d.ts +20 -0
- package/src/core/color/operations/color_add_scaled.d.ts.map +1 -0
- package/src/core/color/operations/color_add_scaled.js +30 -0
- package/src/core/color/operations/color_clamp.d.ts +22 -0
- package/src/core/color/operations/color_clamp.d.ts.map +1 -0
- package/src/core/color/operations/color_clamp.js +25 -0
- package/src/core/color/operations/color_darken.d.ts +2 -1
- package/src/core/color/operations/color_darken.d.ts.map +1 -1
- package/src/core/color/operations/color_darken.js +25 -24
- package/src/core/color/operations/color_desaturate.d.ts +2 -1
- package/src/core/color/operations/color_desaturate.d.ts.map +1 -1
- package/src/core/color/operations/color_desaturate.js +25 -24
- package/src/core/color/operations/color_get_hsl.d.ts +18 -0
- package/src/core/color/operations/color_get_hsl.d.ts.map +1 -0
- package/src/core/color/operations/color_get_hsl.js +60 -0
- package/src/core/color/operations/color_is_in_gamut.d.ts +20 -0
- package/src/core/color/operations/color_is_in_gamut.d.ts.map +1 -0
- package/src/core/color/operations/color_is_in_gamut.js +30 -0
- package/src/core/color/operations/color_lerp.d.ts +12 -3
- package/src/core/color/operations/color_lerp.d.ts.map +1 -1
- package/src/core/color/operations/color_lerp.js +55 -46
- package/src/core/color/operations/color_lighten.d.ts +9 -5
- package/src/core/color/operations/color_lighten.d.ts.map +1 -1
- package/src/core/color/operations/color_lighten.js +29 -24
- package/src/core/color/operations/color_mix_okhsv_channel.d.ts +24 -0
- package/src/core/color/operations/color_mix_okhsv_channel.d.ts.map +1 -0
- package/src/core/color/operations/color_mix_okhsv_channel.js +48 -0
- package/src/core/color/operations/color_multiply_rgb.d.ts +21 -0
- package/src/core/color/operations/color_multiply_rgb.d.ts.map +1 -0
- package/src/core/color/operations/color_multiply_rgb.js +26 -0
- package/src/core/color/operations/color_saturate.d.ts +9 -5
- package/src/core/color/operations/color_saturate.d.ts.map +1 -1
- package/src/core/color/operations/color_saturate.js +29 -24
- package/src/core/color/operations/color_scale_okhsv_channel.d.ts +1 -1
- package/src/core/color/operations/color_scale_okhsv_channel.d.ts.map +1 -1
- package/src/core/color/operations/color_scale_okhsv_channel.js +58 -45
- package/src/core/color/operations/color_srgb_apply.d.ts +28 -0
- package/src/core/color/operations/color_srgb_apply.d.ts.map +1 -0
- package/src/core/color/operations/color_srgb_apply.js +40 -0
- package/src/core/color/operations/color_sub.d.ts +16 -0
- package/src/core/color/operations/color_sub.d.ts.map +1 -0
- package/src/core/color/operations/color_sub.js +18 -0
- package/src/core/color/parse_color.d.ts +10 -1
- package/src/core/color/parse_color.d.ts.map +1 -1
- package/src/core/color/parse_color.js +100 -84
- package/src/core/color/parse_color_normalized.d.ts +24 -0
- package/src/core/color/parse_color_normalized.d.ts.map +1 -0
- package/src/core/color/parse_color_normalized.js +38 -0
- package/src/core/color/rgb2uint24.d.ts +1 -8
- package/src/core/color/rgb2uint24.d.ts.map +1 -1
- package/src/core/color/rgb2uint24.js +7 -20
- package/src/core/color/rgb2uint32.d.ts +1 -9
- package/src/core/color/rgb2uint32.d.ts.map +1 -1
- package/src/core/color/rgb2uint32.js +7 -18
- package/src/core/color/rgb_to_luminance.d.ts +14 -5
- package/src/core/color/rgb_to_luminance.d.ts.map +1 -1
- package/src/core/color/rgb_to_luminance.js +24 -13
- package/src/core/color/rgb_to_uint24.d.ts +9 -0
- package/src/core/color/rgb_to_uint24.d.ts.map +1 -0
- package/src/core/color/rgb_to_uint24.js +20 -0
- package/src/core/color/rgb_to_uint32.d.ts +10 -0
- package/src/core/color/rgb_to_uint32.d.ts.map +1 -0
- package/src/core/color/rgb_to_uint32.js +21 -0
- package/src/core/color/sRGB/linear_to_sRGB.d.ts +7 -0
- package/src/core/color/sRGB/linear_to_sRGB.d.ts.map +1 -1
- package/src/core/color/sRGB/linear_to_sRGB.js +39 -32
- package/src/core/color/xyz/hpe_to_xyz.d.ts +24 -0
- package/src/core/color/xyz/hpe_to_xyz.d.ts.map +1 -0
- package/src/core/color/xyz/hpe_to_xyz.js +39 -0
- package/src/core/color/xyz/rgb_to_xyz.d.ts +17 -2
- package/src/core/color/xyz/rgb_to_xyz.d.ts.map +1 -1
- package/src/core/color/xyz/rgb_to_xyz.js +44 -18
- package/src/core/color/xyz/xyz_cmf_tabulated.d.ts.map +1 -1
- package/src/core/color/xyz/xyz_cmf_tabulated.js +217 -211
- package/src/core/color/xyz/xyz_cmf_wyman.d.ts +4 -0
- package/src/core/color/xyz/xyz_cmf_wyman.d.ts.map +1 -1
- package/src/core/color/xyz/xyz_cmf_wyman.js +74 -65
- package/src/core/color/xyz/xyz_to_hpe.d.ts +18 -0
- package/src/core/color/xyz/xyz_to_hpe.d.ts.map +1 -0
- package/src/core/color/xyz/xyz_to_hpe.js +33 -0
- package/src/core/color/xyz/xyz_to_rgb.d.ts +17 -2
- package/src/core/color/xyz/xyz_to_rgb.d.ts.map +1 -1
- package/src/core/color/xyz/xyz_to_rgb.js +39 -16
- package/src/core/color/ycxcz/xyz_to_ycxcz.d.ts +7 -2
- package/src/core/color/ycxcz/xyz_to_ycxcz.d.ts.map +1 -1
- package/src/core/color/ycxcz/xyz_to_ycxcz.js +33 -28
- package/src/core/events/signal/Signal.js +820 -820
- package/src/core/math/clamp_index.d.ts +18 -0
- package/src/core/math/clamp_index.d.ts.map +1 -0
- package/src/core/math/clamp_index.js +23 -0
- package/src/engine/asset/loaders/image/IMAGE_CODEC_REVIEW_2026_08_28.md +803 -0
- package/src/engine/asset/loaders/image/jpeg/JpegFrame.d.ts +5 -3
- package/src/engine/asset/loaders/image/jpeg/JpegFrame.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/jpeg/JpegFrame.js +5 -3
- package/src/engine/asset/loaders/image/jpeg/JpegFrameComponent.d.ts +2 -1
- package/src/engine/asset/loaders/image/jpeg/JpegFrameComponent.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/jpeg/JpegFrameComponent.js +2 -1
- package/src/engine/asset/loaders/image/jpeg/JpegImage.d.ts +17 -0
- package/src/engine/asset/loaders/image/jpeg/JpegImage.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/jpeg/JpegImage.js +197 -157
- package/src/engine/asset/loaders/image/jpeg/idct8x8_float.d.ts +0 -1
- package/src/engine/asset/loaders/image/jpeg/idct8x8_float.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/jpeg/idct8x8_float.js +0 -1
- package/src/engine/asset/loaders/image/jpeg/jpeg_component_row.d.ts +28 -0
- package/src/engine/asset/loaders/image/jpeg/jpeg_component_row.d.ts.map +1 -0
- package/src/engine/asset/loaders/image/jpeg/jpeg_component_row.js +31 -0
- package/src/engine/asset/loaders/image/png/PNG.d.ts +3 -18
- package/src/engine/asset/loaders/image/png/PNG.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/png/PNG.js +3 -139
- package/src/engine/asset/loaders/image/png/PNGReader.d.ts +16 -16
- package/src/engine/asset/loaders/image/png/PNGReader.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/png/PNGReader.js +143 -160
- package/src/engine/asset/loaders/image/png/chunk/png_chunk_decode_iTXt.js +3 -3
- package/src/engine/asset/loaders/image/png/chunk/png_chunk_decode_zTXt.js +3 -3
- package/src/engine/asset/loaders/image/png/crc32.d.ts +1 -15
- package/src/engine/asset/loaders/image/png/crc32.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/png/crc32.js +5 -89
- package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterNone.d.ts +12 -10
- package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterNone.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterNone.js +20 -45
- package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterSub.d.ts +2 -1
- package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterSub.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterSub.js +2 -0
- package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterUp.d.ts +2 -1
- package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterUp.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterUp.js +2 -0
- package/src/engine/asset/loaders/image/png/filter/png_unfilter.d.ts +22 -0
- package/src/engine/asset/loaders/image/png/filter/png_unfilter.d.ts.map +1 -0
- package/src/engine/asset/loaders/image/png/filter/png_unfilter.js +68 -0
- package/src/engine/asset/loaders/image/png/png_inflate.d.ts +20 -0
- package/src/engine/asset/loaders/image/png/png_inflate.d.ts.map +1 -0
- package/src/engine/asset/loaders/image/png/png_inflate.js +85 -0
- package/src/engine/asset/loaders/image/png/png_unpack_samples.d.ts +22 -0
- package/src/engine/asset/loaders/image/png/png_unpack_samples.d.ts.map +1 -0
- package/src/engine/asset/loaders/image/png/png_unpack_samples.js +38 -0
- package/src/engine/graphics/ecs/sprite/SpriteSystemPE.d.ts.map +1 -1
- package/src/engine/graphics/ecs/sprite/SpriteSystemPE.js +135 -132
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.d.ts +16 -3
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.js +1157 -1149
- package/src/engine/graphics/render/frame_graph/FrameGraph.js +900 -900
- package/src/engine/physics/ecs/PhysicsSystem.d.ts +72 -81
- package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -1
- package/src/engine/physics/ecs/PhysicsSystem.js +86 -77
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/shade/device/IMMEDIATE_DATA_PLAN_2026_08_28.md +451 -0
- package/src/shade/device/timing/GPU_PROFILER_PROPOSAL_2026_08_28.md +625 -0
- package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
- package/src/shade/renderer/scene/serialization/decode_image_source_hdr.d.ts +14 -3
- package/src/shade/renderer/scene/serialization/decode_image_source_hdr.d.ts.map +1 -1
- package/src/shade/renderer/scene/serialization/decode_image_source_hdr.js +50 -51
- package/src/shade/renderer/scene/serialization/deserialize_scene.d.ts.map +1 -1
- package/src/shade/renderer/scene/serialization/deserialize_scene.js +531 -521
- package/src/shade/renderer/scene/serialization/write_image_source.d.ts.map +1 -1
- package/src/shade/renderer/scene/serialization/write_image_source.js +6 -4
- package/src/shade/renderer/shader/chunk/color/chunk_rgb_to_luminance.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/color/chunk_rgb_to_luminance.js +34 -32
- package/src/shade/renderer/shader/chunk/color/iCtCp/chunk_eotf_st2084.d.ts +31 -0
- package/src/shade/renderer/shader/chunk/color/iCtCp/chunk_eotf_st2084.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/color/iCtCp/chunk_eotf_st2084.js +62 -31
- package/src/shade/renderer/shader/chunk/color/iCtCp/chunk_inverse_eotf_st2084.d.ts +10 -0
- package/src/shade/renderer/shader/chunk/color/iCtCp/chunk_inverse_eotf_st2084.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/color/iCtCp/chunk_inverse_eotf_st2084.js +32 -22
- package/src/shade/renderer/shader/chunk/color/sRGB/chunk_sRGBTransferOETF.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/color/sRGB/chunk_sRGBTransferOETF.js +22 -21
- package/src/shade/renderer/shader/chunk/color/tonemap/gt7/chunk_tonemap_gt7.d.ts +6 -0
- package/src/shade/renderer/shader/chunk/color/tonemap/gt7/chunk_tonemap_gt7.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/color/tonemap/gt7/chunk_tonemap_gt7.js +110 -104
- package/src/shade/renderer/shader/chunk/color/xyz/chunk_rgb_to_xyz.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/color/xyz/chunk_rgb_to_xyz.js +23 -21
- package/src/view/elements/ColorPickerView.js +296 -296
- package/src/avif/codec/dec/Readme.md +0 -14
- package/src/avif/codec/dec/avif_dec.cpp +0 -234
- package/src/avif/codec/dec/avif_dec.d.ts +0 -3
- package/src/avif/codec/dec/avif_dec.d.ts.map +0 -1
- package/src/avif/codec/dec/avif_dec.js +0 -16
- package/src/avif/codec/dec/avif_dec.wasm +0 -0
- package/src/avif/codec/enc/README.md +0 -37
- package/src/avif/codec/enc/avif_enc.cpp +0 -216
- package/src/avif/codec/enc/avif_enc.d.ts +0 -3
- package/src/avif/codec/enc/avif_enc.d.ts.map +0 -1
- package/src/avif/codec/enc/avif_enc.js +0 -6144
- package/src/avif/codec/enc/avif_enc.wasm +0 -0
- package/src/avif/codec/enc/avif_enc_mt.d.ts +0 -3
- package/src/avif/codec/enc/avif_enc_mt.d.ts.map +0 -1
- package/src/avif/codec/enc/avif_enc_mt.js +0 -6811
- package/src/avif/codec/enc/avif_enc_mt.wasm +0 -0
- package/src/avif/codec/enc/avif_enc_mt.worker.d.mts +0 -2
- package/src/avif/codec/enc/avif_enc_mt.worker.d.mts.map +0 -1
- package/src/avif/codec/enc/avif_enc_mt.worker.d.ts +0 -11
- package/src/avif/codec/enc/avif_enc_mt.worker.d.ts.map +0 -1
- package/src/avif/codec/enc/avif_enc_mt.worker.js +0 -171
- package/src/avif/codec/enc/avif_enc_mt.worker.mjs +0 -1
- package/src/avif/decode.d.ts +0 -3
- package/src/avif/decode.d.ts.map +0 -1
- package/src/avif/decode.js +0 -42
- package/src/avif/encode.d.ts +0 -3
- package/src/avif/encode.d.ts.map +0 -1
- package/src/avif/encode.js +0 -75
- package/src/avif/meta.d.ts +0 -24
- package/src/avif/meta.d.ts.map +0 -1
- package/src/avif/meta.js +0 -23
- package/src/avif/tsconfig.tsbuildinfo +0 -1
- package/src/avif/utils.d.ts +0 -17
- package/src/avif/utils.d.ts.map +0 -1
- package/src/avif/utils.js +0 -31
- package/src/engine/asset/loaders/image/jpeg/idct8x8_fixed.d.ts +0 -23
- package/src/engine/asset/loaders/image/jpeg/idct8x8_fixed.d.ts.map +0 -1
- package/src/engine/asset/loaders/image/jpeg/idct8x8_fixed.js +0 -214
- package/src/engine/asset/loaders/image/png/inflate.d.ts +0 -7
- package/src/engine/asset/loaders/image/png/inflate.d.ts.map +0 -1
- package/src/engine/asset/loaders/image/png/inflate.js +0 -20
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AvifDecoder.d.ts","sourceRoot":"","sources":["../../../../../src/avif/native/api/AvifDecoder.js"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH;IACI,4BAA4B;IAC5B,QADW,WAAW,EAAE,CACI;IAE5B,yBAAyB;IACzB,QADW,UAAU,CACM;IAE3B,qBAAqB;IACrB,OADW,MAAM,CACP;IAEV,qBAAqB;IACrB,QADW,MAAM,CACN;IAEX;;;;;;OAMG;IACH,cANW,MAAM,UACN,MAAM,iBACN,MAAM,iBACN,MAAM,cACN,MAAM,QA8BhB;CACJ;AAED;;;;;;;;;GASG;AACH;IACI,8BAA8B;IAC9B,cADW,eAAe,CACW;IAErC,8BAA8B;IAC9B,aADW,eAAe,CACU;IAEpC,yBAAyB;IACzB,cADW,UAAU,CACW;IAEhC,yBAAyB;IACzB,aADW,UAAU,CACU;IAE/B,mCAAmC;IACnC,OADW,QAAQ,CACI;IAEvB,sFAAsF;IACtF,aADW,QAAQ,CACU;IAE7B,8BAA8B;IAC9B,WADW,eAAe,CACQ;IAElC,wDAAwD;IACxD,QADW,YAAY,CACT;IAEd,2BAA2B;IAC3B,QADW,YAAY,CACT;IAEd,0DAA0D;IAC1D,SADW,YAAY,CACR;IAEf,qBAAqB;IACrB,WADW,MAAM,CACH;IAEd;;OAEG;IACH,mBAFW,MAAM,QAYhB;CACJ;gCAxH+B,kCAAkC;yBAEzC,sBAAsB;gCADf,6BAA6B"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { Av1FrameContext } from "../av1/decode/Av1FrameContext.js";
|
|
2
|
+
import { ColourTransform } from "../color/ColourTransform.js";
|
|
3
|
+
import { YuvImage } from "../color/YuvImage.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Somewhere to assemble a grid of tiles, or to hold a frame that outlives the context that decoded
|
|
7
|
+
* it.
|
|
8
|
+
*
|
|
9
|
+
* @author Alex Goldring
|
|
10
|
+
* @copyright Company Named Limited (c) 2026
|
|
11
|
+
*/
|
|
12
|
+
export class PlaneStore {
|
|
13
|
+
/** @type {Uint16Array[]} */
|
|
14
|
+
planes = [null, null, null];
|
|
15
|
+
|
|
16
|
+
/** @type {Int32Array} */
|
|
17
|
+
stride = new Int32Array(3);
|
|
18
|
+
|
|
19
|
+
/** @type {number} */
|
|
20
|
+
width = 0;
|
|
21
|
+
|
|
22
|
+
/** @type {number} */
|
|
23
|
+
height = 0;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @param {number} width
|
|
27
|
+
* @param {number} height
|
|
28
|
+
* @param {number} subsampling_x
|
|
29
|
+
* @param {number} subsampling_y
|
|
30
|
+
* @param {number} num_planes
|
|
31
|
+
*/
|
|
32
|
+
resize(width, height, subsampling_x, subsampling_y, num_planes) {
|
|
33
|
+
this.width = width;
|
|
34
|
+
this.height = height;
|
|
35
|
+
|
|
36
|
+
for (let plane = 0; plane < 3; plane++) {
|
|
37
|
+
if (plane >= num_planes) {
|
|
38
|
+
this.planes[plane] = null;
|
|
39
|
+
this.stride[plane] = 0;
|
|
40
|
+
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const sub_x = plane > 0 ? subsampling_x : 0;
|
|
45
|
+
const sub_y = plane > 0 ? subsampling_y : 0;
|
|
46
|
+
|
|
47
|
+
const stride = (width + sub_x) >> sub_x;
|
|
48
|
+
const rows = (height + sub_y) >> sub_y;
|
|
49
|
+
|
|
50
|
+
const samples = stride * rows;
|
|
51
|
+
|
|
52
|
+
this.stride[plane] = stride;
|
|
53
|
+
|
|
54
|
+
const existing = this.planes[plane];
|
|
55
|
+
|
|
56
|
+
if (existing === null || existing.length < samples) {
|
|
57
|
+
this.planes[plane] = new Uint16Array(samples);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Everything a decode needs beyond the file itself, allocated once and reused.
|
|
65
|
+
*
|
|
66
|
+
* Colour and alpha get a frame context each. They could share one, but then decoding the alpha
|
|
67
|
+
* would overwrite the picture, and every caller would have to copy the picture out first — which is
|
|
68
|
+
* exactly the allocation this is here to avoid.
|
|
69
|
+
*
|
|
70
|
+
* @author Alex Goldring
|
|
71
|
+
* @copyright Company Named Limited (c) 2026
|
|
72
|
+
*/
|
|
73
|
+
export class AvifDecoder {
|
|
74
|
+
/** @type {Av1FrameContext} */
|
|
75
|
+
colour_frame = new Av1FrameContext();
|
|
76
|
+
|
|
77
|
+
/** @type {Av1FrameContext} */
|
|
78
|
+
alpha_frame = new Av1FrameContext();
|
|
79
|
+
|
|
80
|
+
/** @type {PlaneStore} */
|
|
81
|
+
colour_store = new PlaneStore();
|
|
82
|
+
|
|
83
|
+
/** @type {PlaneStore} */
|
|
84
|
+
alpha_store = new PlaneStore();
|
|
85
|
+
|
|
86
|
+
/** @type {YuvImage} the picture */
|
|
87
|
+
image = new YuvImage();
|
|
88
|
+
|
|
89
|
+
/** @type {YuvImage} the alpha plane, which AVIF codes as an image in its own right */
|
|
90
|
+
alpha_image = new YuvImage();
|
|
91
|
+
|
|
92
|
+
/** @type {ColourTransform} */
|
|
93
|
+
transform = new ColourTransform();
|
|
94
|
+
|
|
95
|
+
/** @type {Float32Array} one row of Cb, at full width */
|
|
96
|
+
cb_row = null;
|
|
97
|
+
|
|
98
|
+
/** @type {Float32Array} */
|
|
99
|
+
cr_row = null;
|
|
100
|
+
|
|
101
|
+
/** @type {Float32Array} one row of interleaved R, G, B */
|
|
102
|
+
rgb_row = null;
|
|
103
|
+
|
|
104
|
+
/** @type {number} */
|
|
105
|
+
row_width = 0;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* @param {number} width
|
|
109
|
+
*/
|
|
110
|
+
resize_rows(width) {
|
|
111
|
+
if (this.row_width >= width) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
this.row_width = width;
|
|
116
|
+
|
|
117
|
+
this.cb_row = new Float32Array(width);
|
|
118
|
+
this.cr_row = new Float32Array(width);
|
|
119
|
+
this.rgb_row = new Float32Array(width * 3);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Apply the orientation an item's `irot` and `imir` properties declare, to interleaved RGBA.
|
|
3
|
+
*
|
|
4
|
+
* A camera writes these rather than rotating the samples, so a file that carries them is a picture
|
|
5
|
+
* that is stored one way round and meant to be seen another. libavif hands them to its caller
|
|
6
|
+
* instead of applying them, which is why this is a decode option rather than something the decoder
|
|
7
|
+
* always does — a caller that already honours orientation elsewhere would otherwise apply it twice.
|
|
8
|
+
*
|
|
9
|
+
* `clap`, the clean aperture, is deliberately left alone: it is a crop expressed as four rationals,
|
|
10
|
+
* it is rare, and cropping a picture by a misread fraction is worse than not cropping it.
|
|
11
|
+
*
|
|
12
|
+
* @param {AvifFile} file
|
|
13
|
+
* @param {AvifItem} item
|
|
14
|
+
* @param {{data: (Uint8ClampedArray|Uint16Array), width: number, height: number}} image
|
|
15
|
+
* @returns {{data: (Uint8ClampedArray|Uint16Array), width: number, height: number}}
|
|
16
|
+
* @see ISO/IEC 23008-12 section 6.5.10 "Image rotation" and 6.5.12 "Image mirroring"
|
|
17
|
+
*
|
|
18
|
+
* @author Alex Goldring
|
|
19
|
+
* @copyright Company Named Limited (c) 2026
|
|
20
|
+
*/
|
|
21
|
+
export function apply_transformations(file: AvifFile, item: AvifItem, image: {
|
|
22
|
+
data: (Uint8ClampedArray | Uint16Array);
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
}): {
|
|
26
|
+
data: (Uint8ClampedArray | Uint16Array);
|
|
27
|
+
width: number;
|
|
28
|
+
height: number;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=apply_transformations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply_transformations.d.ts","sourceRoot":"","sources":["../../../../../src/avif/native/api/apply_transformations.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,6EAPW;IAAC,IAAI,EAAE,CAAC,iBAAiB,GAAC,WAAW,CAAC,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAC,GACpE;IAAC,IAAI,EAAE,CAAC,iBAAiB,GAAC,WAAW,CAAC,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAC,CAuBlF"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { find_item_property } from "../heif/find_item_property.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Apply the orientation an item's `irot` and `imir` properties declare, to interleaved RGBA.
|
|
5
|
+
*
|
|
6
|
+
* A camera writes these rather than rotating the samples, so a file that carries them is a picture
|
|
7
|
+
* that is stored one way round and meant to be seen another. libavif hands them to its caller
|
|
8
|
+
* instead of applying them, which is why this is a decode option rather than something the decoder
|
|
9
|
+
* always does — a caller that already honours orientation elsewhere would otherwise apply it twice.
|
|
10
|
+
*
|
|
11
|
+
* `clap`, the clean aperture, is deliberately left alone: it is a crop expressed as four rationals,
|
|
12
|
+
* it is rare, and cropping a picture by a misread fraction is worse than not cropping it.
|
|
13
|
+
*
|
|
14
|
+
* @param {AvifFile} file
|
|
15
|
+
* @param {AvifItem} item
|
|
16
|
+
* @param {{data: (Uint8ClampedArray|Uint16Array), width: number, height: number}} image
|
|
17
|
+
* @returns {{data: (Uint8ClampedArray|Uint16Array), width: number, height: number}}
|
|
18
|
+
* @see ISO/IEC 23008-12 section 6.5.10 "Image rotation" and 6.5.12 "Image mirroring"
|
|
19
|
+
*
|
|
20
|
+
* @author Alex Goldring
|
|
21
|
+
* @copyright Company Named Limited (c) 2026
|
|
22
|
+
*/
|
|
23
|
+
export function apply_transformations(file, item, image) {
|
|
24
|
+
const mirror = find_item_property(file, item, "imir");
|
|
25
|
+
const rotation = find_item_property(file, item, "irot");
|
|
26
|
+
|
|
27
|
+
let result = image;
|
|
28
|
+
|
|
29
|
+
// the properties apply in the order they are associated, and the association order for these
|
|
30
|
+
// two is fixed by the format: mirroring first, then rotation
|
|
31
|
+
if (mirror !== null) {
|
|
32
|
+
result = mirror_image(result, mirror.axis);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (rotation !== null && rotation.angle !== 0) {
|
|
36
|
+
result = rotate_image(result, rotation.angle);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return result;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @param {{data: (Uint8ClampedArray|Uint16Array), width: number, height: number}} image
|
|
44
|
+
* @param {number} axis `0` about a horizontal axis, `1` about a vertical one
|
|
45
|
+
* @returns {{data: (Uint8ClampedArray|Uint16Array), width: number, height: number}}
|
|
46
|
+
*/
|
|
47
|
+
function mirror_image(image, axis) {
|
|
48
|
+
const width = image.width;
|
|
49
|
+
const height = image.height;
|
|
50
|
+
|
|
51
|
+
const source = image.data;
|
|
52
|
+
|
|
53
|
+
const out = new source.constructor(source.length);
|
|
54
|
+
|
|
55
|
+
for (let y = 0; y < height; y++) {
|
|
56
|
+
const source_y = axis === 0 ? height - 1 - y : y;
|
|
57
|
+
|
|
58
|
+
for (let x = 0; x < width; x++) {
|
|
59
|
+
const source_x = axis === 0 ? x : width - 1 - x;
|
|
60
|
+
|
|
61
|
+
const from = (source_y * width + source_x) * 4;
|
|
62
|
+
const to = (y * width + x) * 4;
|
|
63
|
+
|
|
64
|
+
out[to] = source[from];
|
|
65
|
+
out[to + 1] = source[from + 1];
|
|
66
|
+
out[to + 2] = source[from + 2];
|
|
67
|
+
out[to + 3] = source[from + 3];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return { data: out, width, height };
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @param {{data: (Uint8ClampedArray|Uint16Array), width: number, height: number}} image
|
|
76
|
+
* @param {number} angle in units of ninety degrees anticlockwise
|
|
77
|
+
* @returns {{data: (Uint8ClampedArray|Uint16Array), width: number, height: number}}
|
|
78
|
+
*/
|
|
79
|
+
function rotate_image(image, angle) {
|
|
80
|
+
const width = image.width;
|
|
81
|
+
const height = image.height;
|
|
82
|
+
|
|
83
|
+
const source = image.data;
|
|
84
|
+
|
|
85
|
+
const turned = (angle & 1) === 1;
|
|
86
|
+
|
|
87
|
+
const out_width = turned ? height : width;
|
|
88
|
+
const out_height = turned ? width : height;
|
|
89
|
+
|
|
90
|
+
const out = new source.constructor(source.length);
|
|
91
|
+
|
|
92
|
+
for (let y = 0; y < out_height; y++) {
|
|
93
|
+
for (let x = 0; x < out_width; x++) {
|
|
94
|
+
let source_x;
|
|
95
|
+
let source_y;
|
|
96
|
+
|
|
97
|
+
if (angle === 1) {
|
|
98
|
+
// ninety degrees anticlockwise: the right hand column becomes the top row
|
|
99
|
+
source_x = out_height - 1 - y;
|
|
100
|
+
source_y = x;
|
|
101
|
+
} else if (angle === 2) {
|
|
102
|
+
source_x = width - 1 - x;
|
|
103
|
+
source_y = height - 1 - y;
|
|
104
|
+
} else {
|
|
105
|
+
source_x = y;
|
|
106
|
+
source_y = out_width - 1 - x;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const from = (source_y * width + source_x) * 4;
|
|
110
|
+
const to = (y * out_width + x) * 4;
|
|
111
|
+
|
|
112
|
+
out[to] = source[from];
|
|
113
|
+
out[to + 1] = source[from + 1];
|
|
114
|
+
out[to + 2] = source[from + 2];
|
|
115
|
+
out[to + 3] = source[from + 3];
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return { data: out, width: out_width, height: out_height };
|
|
120
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decode an AVIF file into a sampler the renderer can use.
|
|
3
|
+
*
|
|
4
|
+
* High dynamic range images come back as half floats holding linear light, which is what the
|
|
5
|
+
* renderer's textures are; everything else comes back as eight bit samples.
|
|
6
|
+
*
|
|
7
|
+
* The linear normalisation is the renderer's: `1.0` is SDR reference white,
|
|
8
|
+
* {@link SDR_WHITE_NITS} nits per ITU-R BT.2408, which is the unit every sampler in the engine is
|
|
9
|
+
* already in. Naming it to the decoder is what makes this the exact inverse of
|
|
10
|
+
* {@link sampler2d_to_avif}, which names the same white to the encoder.
|
|
11
|
+
*
|
|
12
|
+
* @param {ArrayBuffer|Uint8Array} buffer
|
|
13
|
+
* @param {object} [options]
|
|
14
|
+
* @param {boolean} [options.hdr] decode to linear half floats rather than eight bit samples
|
|
15
|
+
* @param {AvifDecoder} [decoder] pass one back in to decode many images without reallocating
|
|
16
|
+
* @returns {Sampler2D}
|
|
17
|
+
*
|
|
18
|
+
* @author Alex Goldring
|
|
19
|
+
* @copyright Company Named Limited (c) 2026
|
|
20
|
+
*/
|
|
21
|
+
export function avif_to_sampler2d(buffer: ArrayBuffer | Uint8Array, options?: {
|
|
22
|
+
hdr?: boolean;
|
|
23
|
+
}, decoder?: AvifDecoder): Sampler2D;
|
|
24
|
+
import { Sampler2D } from "../../../engine/graphics/texture/sampler/Sampler2D.js";
|
|
25
|
+
//# sourceMappingURL=avif_to_sampler2d.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avif_to_sampler2d.d.ts","sourceRoot":"","sources":["../../../../../src/avif/native/api/avif_to_sampler2d.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,0CATW,WAAW,GAAC,UAAU;IAEJ,GAAG,GAArB,OAAO;2BAEL,SAAS,CAqBrB;0BAvCyB,uDAAuD"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { COLOUR_SPACE_LINEAR, COLOUR_SPACE_SIGNAL, CHROMA_UPSAMPLING_BEST } from "./convert_to_rgba.js";
|
|
2
|
+
import { SDR_WHITE_NITS } from "../../../core/color/PQ/PQ_constants.js";
|
|
3
|
+
import { Sampler2D } from "../../../engine/graphics/texture/sampler/Sampler2D.js";
|
|
4
|
+
import { decode_avif } from "./decode_avif.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Decode an AVIF file into a sampler the renderer can use.
|
|
8
|
+
*
|
|
9
|
+
* High dynamic range images come back as half floats holding linear light, which is what the
|
|
10
|
+
* renderer's textures are; everything else comes back as eight bit samples.
|
|
11
|
+
*
|
|
12
|
+
* The linear normalisation is the renderer's: `1.0` is SDR reference white,
|
|
13
|
+
* {@link SDR_WHITE_NITS} nits per ITU-R BT.2408, which is the unit every sampler in the engine is
|
|
14
|
+
* already in. Naming it to the decoder is what makes this the exact inverse of
|
|
15
|
+
* {@link sampler2d_to_avif}, which names the same white to the encoder.
|
|
16
|
+
*
|
|
17
|
+
* @param {ArrayBuffer|Uint8Array} buffer
|
|
18
|
+
* @param {object} [options]
|
|
19
|
+
* @param {boolean} [options.hdr] decode to linear half floats rather than eight bit samples
|
|
20
|
+
* @param {AvifDecoder} [decoder] pass one back in to decode many images without reallocating
|
|
21
|
+
* @returns {Sampler2D}
|
|
22
|
+
*
|
|
23
|
+
* @author Alex Goldring
|
|
24
|
+
* @copyright Company Named Limited (c) 2026
|
|
25
|
+
*/
|
|
26
|
+
export function avif_to_sampler2d(buffer, options = {}, decoder = undefined) {
|
|
27
|
+
const hdr = options.hdr === true;
|
|
28
|
+
|
|
29
|
+
const decoded = decode_avif(
|
|
30
|
+
buffer,
|
|
31
|
+
{
|
|
32
|
+
bit_depth: hdr ? 12 : 8,
|
|
33
|
+
output_float16: hdr,
|
|
34
|
+
output_colour_space: hdr ? COLOUR_SPACE_LINEAR : COLOUR_SPACE_SIGNAL,
|
|
35
|
+
linear_reference_nits: SDR_WHITE_NITS,
|
|
36
|
+
chroma_upsampling: CHROMA_UPSAMPLING_BEST
|
|
37
|
+
},
|
|
38
|
+
decoder
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
return new Sampler2D(decoded.data, 4, decoded.width, decoded.height);
|
|
42
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert a decoded image to interleaved RGBA.
|
|
3
|
+
*
|
|
4
|
+
* Works a row at a time through buffers on the decoder, so the only allocation is the output
|
|
5
|
+
* itself — which the caller owns and this cannot reuse.
|
|
6
|
+
*
|
|
7
|
+
* @param {AvifDecoder} decoder
|
|
8
|
+
* @param {YuvImage} image
|
|
9
|
+
* @param {object} [options]
|
|
10
|
+
* @param {number} [options.bit_depth] `8`, `10` or `12`; ignored when the output is float
|
|
11
|
+
* @param {boolean} [options.output_float16] half floats rather than integers
|
|
12
|
+
* @param {number} [options.output_colour_space] one of the `COLOUR_SPACE_*` constants
|
|
13
|
+
* @param {number} [options.linear_reference_nits] luminance a linear `1.0` in the *output* stands
|
|
14
|
+
* for, in nits; defaults to {@link LINEAR_REFERENCE_NITS}. Only read for `COLOUR_SPACE_LINEAR`,
|
|
15
|
+
* and the exact counterpart of {@link encode_avif}'s option of the same name
|
|
16
|
+
* @param {number} [options.chroma_upsampling] one of the `CHROMA_UPSAMPLING_*` constants
|
|
17
|
+
* @returns {{data: (Uint8ClampedArray|Uint16Array), width: number, height: number}}
|
|
18
|
+
*
|
|
19
|
+
* @author Alex Goldring
|
|
20
|
+
* @copyright Company Named Limited (c) 2026
|
|
21
|
+
*/
|
|
22
|
+
export function convert_to_rgba(decoder: AvifDecoder, image: YuvImage, options?: {
|
|
23
|
+
bit_depth?: number;
|
|
24
|
+
output_float16?: boolean;
|
|
25
|
+
output_colour_space?: number;
|
|
26
|
+
linear_reference_nits?: number;
|
|
27
|
+
chroma_upsampling?: number;
|
|
28
|
+
}): {
|
|
29
|
+
data: (Uint8ClampedArray | Uint16Array);
|
|
30
|
+
width: number;
|
|
31
|
+
height: number;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Hand back the samples as they were coded, gamma and all.
|
|
35
|
+
* @type {number}
|
|
36
|
+
*/
|
|
37
|
+
export const COLOUR_SPACE_SIGNAL: number;
|
|
38
|
+
/**
|
|
39
|
+
* Undo the transfer function, so that the output is linear light with `1.0` at
|
|
40
|
+
* {@link LINEAR_REFERENCE_NITS}, or at whatever `linear_reference_nits` names instead. Only useful
|
|
41
|
+
* with a float output: HDR content goes well above one.
|
|
42
|
+
* @type {number}
|
|
43
|
+
*/
|
|
44
|
+
export const COLOUR_SPACE_LINEAR: number;
|
|
45
|
+
/**
|
|
46
|
+
* Let the decoder pick, which means interpolating whenever chroma is subsampled.
|
|
47
|
+
* @type {number}
|
|
48
|
+
*/
|
|
49
|
+
export const CHROMA_UPSAMPLING_AUTOMATIC: number;
|
|
50
|
+
/** @type {number} nearest neighbour */
|
|
51
|
+
export const CHROMA_UPSAMPLING_FASTEST: number;
|
|
52
|
+
/** @type {number} bilinear */
|
|
53
|
+
export const CHROMA_UPSAMPLING_BEST: number;
|
|
54
|
+
//# sourceMappingURL=convert_to_rgba.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert_to_rgba.d.ts","sourceRoot":"","sources":["../../../../../src/avif/native/api/convert_to_rgba.js"],"names":[],"mappings":"AAoCA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH;IAZ4B,SAAS,GAA1B,MAAM;IACY,cAAc,GAAhC,OAAO;IACU,mBAAmB,GAApC,MAAM;IACW,qBAAqB,GAAtC,MAAM;IAGW,iBAAiB,GAAlC,MAAM;;UACG,CAAC,iBAAiB,GAAC,WAAW,CAAC;WAAS,MAAM;YAAU,MAAM;EAiHjF;AA3JD;;;GAGG;AACH,kCAFU,MAAM,CAEqB;AAErC;;;;;GAKG;AACH,kCAFU,MAAM,CAEqB;AAErC;;;GAGG;AACH,0CAFU,MAAM,CAE6B;AAE7C,uCAAuC;AACvC,wCADW,MAAM,CAC0B;AAE3C,8BAA8B;AAC9B,qCADW,MAAM,CACuB"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { clamp01 } from "../../../core/math/clamp01.js";
|
|
2
|
+
import { clamp_sample } from "../color/clamp_sample.js";
|
|
3
|
+
import { colour_transform_init } from "../color/ColourTransform.js";
|
|
4
|
+
import { LINEAR_REFERENCE_NITS } from "../color/transfer_to_linear.js";
|
|
5
|
+
import { MC_BT_601 } from "../av1/tables/av1_symbols.js";
|
|
6
|
+
import { to_half_float_uint16 } from "../../../core/binary/to_half_float_uint16.js";
|
|
7
|
+
import { transfer_row_to_linear } from "../color/transfer_to_linear.js";
|
|
8
|
+
import { UPSAMPLE_BILINEAR, UPSAMPLE_NEAREST, upsample_chroma_row } from "../color/upsample_chroma_row.js";
|
|
9
|
+
import { ycbcr_row_to_rgb } from "../color/ycbcr_row_to_rgb.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Hand back the samples as they were coded, gamma and all.
|
|
13
|
+
* @type {number}
|
|
14
|
+
*/
|
|
15
|
+
export const COLOUR_SPACE_SIGNAL = 0;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Undo the transfer function, so that the output is linear light with `1.0` at
|
|
19
|
+
* {@link LINEAR_REFERENCE_NITS}, or at whatever `linear_reference_nits` names instead. Only useful
|
|
20
|
+
* with a float output: HDR content goes well above one.
|
|
21
|
+
* @type {number}
|
|
22
|
+
*/
|
|
23
|
+
export const COLOUR_SPACE_LINEAR = 1;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Let the decoder pick, which means interpolating whenever chroma is subsampled.
|
|
27
|
+
* @type {number}
|
|
28
|
+
*/
|
|
29
|
+
export const CHROMA_UPSAMPLING_AUTOMATIC = 0;
|
|
30
|
+
|
|
31
|
+
/** @type {number} nearest neighbour */
|
|
32
|
+
export const CHROMA_UPSAMPLING_FASTEST = 1;
|
|
33
|
+
|
|
34
|
+
/** @type {number} bilinear */
|
|
35
|
+
export const CHROMA_UPSAMPLING_BEST = 2;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Convert a decoded image to interleaved RGBA.
|
|
39
|
+
*
|
|
40
|
+
* Works a row at a time through buffers on the decoder, so the only allocation is the output
|
|
41
|
+
* itself — which the caller owns and this cannot reuse.
|
|
42
|
+
*
|
|
43
|
+
* @param {AvifDecoder} decoder
|
|
44
|
+
* @param {YuvImage} image
|
|
45
|
+
* @param {object} [options]
|
|
46
|
+
* @param {number} [options.bit_depth] `8`, `10` or `12`; ignored when the output is float
|
|
47
|
+
* @param {boolean} [options.output_float16] half floats rather than integers
|
|
48
|
+
* @param {number} [options.output_colour_space] one of the `COLOUR_SPACE_*` constants
|
|
49
|
+
* @param {number} [options.linear_reference_nits] luminance a linear `1.0` in the *output* stands
|
|
50
|
+
* for, in nits; defaults to {@link LINEAR_REFERENCE_NITS}. Only read for `COLOUR_SPACE_LINEAR`,
|
|
51
|
+
* and the exact counterpart of {@link encode_avif}'s option of the same name
|
|
52
|
+
* @param {number} [options.chroma_upsampling] one of the `CHROMA_UPSAMPLING_*` constants
|
|
53
|
+
* @returns {{data: (Uint8ClampedArray|Uint16Array), width: number, height: number}}
|
|
54
|
+
*
|
|
55
|
+
* @author Alex Goldring
|
|
56
|
+
* @copyright Company Named Limited (c) 2026
|
|
57
|
+
*/
|
|
58
|
+
export function convert_to_rgba(decoder, image, options = {}) {
|
|
59
|
+
const width = image.width;
|
|
60
|
+
const height = image.height;
|
|
61
|
+
|
|
62
|
+
const output_bit_depth = options.bit_depth ?? 8;
|
|
63
|
+
const output_float16 = options.output_float16 === true;
|
|
64
|
+
const colour_space = options.output_colour_space ?? COLOUR_SPACE_SIGNAL;
|
|
65
|
+
|
|
66
|
+
// the colour module decodes to LINEAR_REFERENCE_NITS to the unit; a caller that counts in some
|
|
67
|
+
// other white asks for it here, and pays one multiply a sample for it
|
|
68
|
+
const linear_scale = LINEAR_REFERENCE_NITS / (options.linear_reference_nits ?? LINEAR_REFERENCE_NITS);
|
|
69
|
+
|
|
70
|
+
if (output_bit_depth !== 8 && output_bit_depth !== 10 && output_bit_depth !== 12) {
|
|
71
|
+
throw new Error(`unsupported output bit depth ${output_bit_depth}`);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const upsampling = choose_upsampling(options.chroma_upsampling ?? CHROMA_UPSAMPLING_AUTOMATIC);
|
|
75
|
+
|
|
76
|
+
decoder.resize_rows(width);
|
|
77
|
+
|
|
78
|
+
const transform = decoder.transform;
|
|
79
|
+
|
|
80
|
+
// a monochrome image has no matrix to speak of: neutral chroma through any of them is grey,
|
|
81
|
+
// and going through one keeps the range handling in a single place
|
|
82
|
+
colour_transform_init(
|
|
83
|
+
transform,
|
|
84
|
+
image.num_planes === 1 ? MC_BT_601 : image.matrix_coefficients,
|
|
85
|
+
image.color_primaries,
|
|
86
|
+
image.color_range,
|
|
87
|
+
image.bit_depth
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
const cb_row = decoder.cb_row;
|
|
91
|
+
const cr_row = decoder.cr_row;
|
|
92
|
+
const rgb_row = decoder.rgb_row;
|
|
93
|
+
|
|
94
|
+
if (image.num_planes === 1) {
|
|
95
|
+
cb_row.fill(transform.c_offset, 0, width);
|
|
96
|
+
cr_row.fill(transform.c_offset, 0, width);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const samples = width * height * 4;
|
|
100
|
+
|
|
101
|
+
const data = output_float16 || output_bit_depth > 8
|
|
102
|
+
? new Uint16Array(samples)
|
|
103
|
+
: new Uint8ClampedArray(samples);
|
|
104
|
+
|
|
105
|
+
const maximum = (1 << output_bit_depth) - 1;
|
|
106
|
+
|
|
107
|
+
const alpha_scale = alpha_normalisation(image);
|
|
108
|
+
const alpha_offset = image.alpha_range === 1 ? 0 : 16 << (image.alpha_bit_depth - 8);
|
|
109
|
+
|
|
110
|
+
const chroma_width = (image.width + image.subsampling_x) >> image.subsampling_x;
|
|
111
|
+
const chroma_height = (image.height + image.subsampling_y) >> image.subsampling_y;
|
|
112
|
+
|
|
113
|
+
for (let y = 0; y < height; y++) {
|
|
114
|
+
if (image.num_planes > 1) {
|
|
115
|
+
upsample_chroma_row(
|
|
116
|
+
image.planes[1], image.stride[1], chroma_width, chroma_height,
|
|
117
|
+
image.subsampling_x, image.subsampling_y, y, width, upsampling, cb_row
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
upsample_chroma_row(
|
|
121
|
+
image.planes[2], image.stride[2], chroma_width, chroma_height,
|
|
122
|
+
image.subsampling_x, image.subsampling_y, y, width, upsampling, cr_row
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
ycbcr_row_to_rgb(transform, image.planes[0], y * image.stride[0], cb_row, cr_row, width, rgb_row);
|
|
127
|
+
|
|
128
|
+
if (colour_space === COLOUR_SPACE_LINEAR) {
|
|
129
|
+
transfer_row_to_linear(image.transfer_characteristics, rgb_row, width);
|
|
130
|
+
|
|
131
|
+
if (linear_scale !== 1) {
|
|
132
|
+
for (let i = 0, count = width * 3; i < count; i++) {
|
|
133
|
+
rgb_row[i] *= linear_scale;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const alpha_row = image.alpha === null ? 0 : y * image.alpha_stride;
|
|
139
|
+
|
|
140
|
+
let out = y * width * 4;
|
|
141
|
+
|
|
142
|
+
for (let x = 0; x < width; x++) {
|
|
143
|
+
const i = x * 3;
|
|
144
|
+
|
|
145
|
+
const alpha = image.alpha === null
|
|
146
|
+
? 1
|
|
147
|
+
: clamp01((image.alpha[alpha_row + x] - alpha_offset) * alpha_scale);
|
|
148
|
+
|
|
149
|
+
if (output_float16) {
|
|
150
|
+
data[out] = to_half_float_uint16(rgb_row[i]);
|
|
151
|
+
data[out + 1] = to_half_float_uint16(rgb_row[i + 1]);
|
|
152
|
+
data[out + 2] = to_half_float_uint16(rgb_row[i + 2]);
|
|
153
|
+
data[out + 3] = to_half_float_uint16(alpha);
|
|
154
|
+
} else {
|
|
155
|
+
data[out] = quantise(rgb_row[i], maximum);
|
|
156
|
+
data[out + 1] = quantise(rgb_row[i + 1], maximum);
|
|
157
|
+
data[out + 2] = quantise(rgb_row[i + 2], maximum);
|
|
158
|
+
data[out + 3] = quantise(alpha, maximum);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
out += 4;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
return { data, width, height };
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* @param {number} requested
|
|
170
|
+
* @returns {number} one of the `UPSAMPLE_*` constants
|
|
171
|
+
*/
|
|
172
|
+
function choose_upsampling(requested) {
|
|
173
|
+
if (requested === CHROMA_UPSAMPLING_FASTEST) {
|
|
174
|
+
return UPSAMPLE_NEAREST;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return UPSAMPLE_BILINEAR;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* @param {YuvImage} image
|
|
182
|
+
* @returns {number}
|
|
183
|
+
*/
|
|
184
|
+
function alpha_normalisation(image) {
|
|
185
|
+
if (image.alpha === null) {
|
|
186
|
+
return 1;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
if (image.alpha_range === 1) {
|
|
190
|
+
return 1 / ((1 << image.alpha_bit_depth) - 1);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
return 1 / (219 << (image.alpha_bit_depth - 8));
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* A normalised `0 .. 1` value as a coded sample of the output depth.
|
|
198
|
+
* @param {number} value
|
|
199
|
+
* @param {number} maximum
|
|
200
|
+
* @returns {number}
|
|
201
|
+
*/
|
|
202
|
+
function quantise(value, maximum) {
|
|
203
|
+
return clamp_sample(value * maximum, maximum);
|
|
204
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decode an AVIF file to interleaved RGBA.
|
|
3
|
+
*
|
|
4
|
+
* Synchronous by design: there is no worker, no WebAssembly and nothing to wait for, so a promise
|
|
5
|
+
* would only be ceremony. A caller that does not want to block should call this from a worker it
|
|
6
|
+
* controls, which is the arrangement meep already has for encoding.
|
|
7
|
+
*
|
|
8
|
+
* @param {ArrayBuffer|Uint8Array} buffer
|
|
9
|
+
* @param {object} [options] see {@link convert_to_rgba}, plus `apply_transformations` to honour the
|
|
10
|
+
* file's declared orientation — off by default, because the decoder this replaces left it to its
|
|
11
|
+
* caller and a caller that already handles orientation would otherwise apply it twice
|
|
12
|
+
* @param {AvifDecoder} [decoder] pass one back in to decode many images without reallocating
|
|
13
|
+
* @returns {{data: (Uint8ClampedArray|Uint16Array), width: number, height: number}}
|
|
14
|
+
*
|
|
15
|
+
* @author Alex Goldring
|
|
16
|
+
* @copyright Company Named Limited (c) 2026
|
|
17
|
+
*/
|
|
18
|
+
export function decode_avif(buffer: ArrayBuffer | Uint8Array, options?: object, decoder?: AvifDecoder): {
|
|
19
|
+
data: (Uint8ClampedArray | Uint16Array);
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
};
|
|
23
|
+
import { AvifDecoder } from "./AvifDecoder.js";
|
|
24
|
+
//# sourceMappingURL=decode_avif.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decode_avif.d.ts","sourceRoot":"","sources":["../../../../../src/avif/native/api/decode_avif.js"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;;;;;GAgBG;AACH,oCAVW,WAAW,GAAC,UAAU,YACtB,MAAM,YAGN,WAAW,GACT;IAAC,IAAI,EAAE,CAAC,iBAAiB,GAAC,WAAW,CAAC,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAC,CAmClF;4BA/D2B,kBAAkB"}
|