@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
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
/*global Uint8Array:true ArrayBuffer:true */
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
import zlib from 'pako';
|
|
5
|
-
import { assert } from "../../../../../core/assert.js";
|
|
6
4
|
import { BinaryBuffer } from "../../../../../core/binary/BinaryBuffer.js";
|
|
7
5
|
import { EndianType } from "../../../../../core/binary/EndianType.js";
|
|
8
6
|
import { platform_compute_endianness } from "../../../../../core/binary/platform_compute_endianness.js";
|
|
9
7
|
import { isArrayEqualStrict } from "../../../../../core/collection/array/isArrayEqualStrict.js";
|
|
10
8
|
import { png_chunk_decode_iTXt } from "./chunk/png_chunk_decode_iTXt.js";
|
|
9
|
+
import { png_inflate } from "./png_inflate.js";
|
|
11
10
|
import { png_chunk_decode_zTXt } from "./chunk/png_chunk_decode_zTXt.js";
|
|
12
|
-
import { crc32 } from "
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { png_filter_unFilterPaeth } from "./filter/png_filter_unFilterPaeth.js";
|
|
16
|
-
import { png_filter_unFilterSub } from "./filter/png_filter_unFilterSub.js";
|
|
17
|
-
import { png_filter_unFilterUp } from "./filter/png_filter_unFilterUp.js";
|
|
11
|
+
import { crc32 } from "../../../../../core/binary/hash/crc32.js";
|
|
12
|
+
import { png_unfilter } from "./filter/png_unfilter.js";
|
|
13
|
+
import { png_unpack_samples } from "./png_unpack_samples.js";
|
|
18
14
|
|
|
19
15
|
import { PNG } from './PNG.js';
|
|
20
16
|
import { PNG_HEADER_BYTES } from "./PNG_HEADER_BYTES.js";
|
|
@@ -49,18 +45,6 @@ function readUInt8(buffer, offset) {
|
|
|
49
45
|
* @constructor
|
|
50
46
|
*/
|
|
51
47
|
export function PNGReader(bytes) {
|
|
52
|
-
/**
|
|
53
|
-
* current pointer
|
|
54
|
-
* @type {number}
|
|
55
|
-
*/
|
|
56
|
-
this.i = 0;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* bytes buffer
|
|
60
|
-
* @type {Uint8Array}
|
|
61
|
-
*/
|
|
62
|
-
this.bytes = new Uint8Array(bytes);
|
|
63
|
-
|
|
64
48
|
/**
|
|
65
49
|
* Output object
|
|
66
50
|
* @type {PNG}
|
|
@@ -89,12 +73,6 @@ export function PNGReader(bytes) {
|
|
|
89
73
|
* @type {boolean}
|
|
90
74
|
*/
|
|
91
75
|
this.crc_enabled = false;
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
*
|
|
95
|
-
* @type {Uint8Array}
|
|
96
|
-
*/
|
|
97
|
-
this.header = new Uint8Array(8);
|
|
98
76
|
}
|
|
99
77
|
|
|
100
78
|
/**
|
|
@@ -120,15 +98,11 @@ PNGReader.prototype.readBytes = function (length) {
|
|
|
120
98
|
*/
|
|
121
99
|
PNGReader.prototype.decodeHeader = function () {
|
|
122
100
|
|
|
123
|
-
if (this.i !== 0) {
|
|
124
|
-
throw new Error('file pointer should be at 0 to read the header');
|
|
125
|
-
}
|
|
126
|
-
|
|
127
101
|
const buffer = this.buffer;
|
|
128
102
|
|
|
129
|
-
const header =
|
|
103
|
+
const header = new Uint8Array(PNG_HEADER_BYTES.length);
|
|
130
104
|
|
|
131
|
-
buffer.readBytes(header, 0,
|
|
105
|
+
buffer.readBytes(header, 0, header.length);
|
|
132
106
|
|
|
133
107
|
// see https://www.w3.org/TR/PNG-Structure.html
|
|
134
108
|
if (!isArrayEqualStrict(header, PNG_HEADER_BYTES)) {
|
|
@@ -356,41 +330,10 @@ PNGReader.prototype.decodeIEND = function () {
|
|
|
356
330
|
PNGReader.prototype.decodePixels = function () {
|
|
357
331
|
const png = this.png;
|
|
358
332
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
// which is the right behaviour for spec-compliant PNGs.
|
|
364
|
-
const inflator = new zlib.Inflate();
|
|
365
|
-
for (let i = 0; i < chunk_count; i++) {
|
|
366
|
-
inflator.push(chunks[i]);
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
let decompressed_data;
|
|
370
|
-
|
|
371
|
-
if (inflator.err === 0) {
|
|
372
|
-
decompressed_data = inflator.result;
|
|
373
|
-
} else {
|
|
374
|
-
// Some real-world encoders emit IDAT streams with a corrupt adler32 trailer
|
|
375
|
-
// (the deflate payload itself is fine). Chrome and libpng accept these, so
|
|
376
|
-
// we mirror that leniency: concatenate the IDAT bytes, strip the 2-byte
|
|
377
|
-
// zlib header, and inflate as raw deflate (which doesn't check the trailer).
|
|
378
|
-
let total = 0;
|
|
379
|
-
for (let i = 0; i < chunk_count; i++) total += chunks[i].length;
|
|
380
|
-
const concatenated = new Uint8Array(total);
|
|
381
|
-
let off = 0;
|
|
382
|
-
for (let i = 0; i < chunk_count; i++) {
|
|
383
|
-
concatenated.set(chunks[i], off);
|
|
384
|
-
off += chunks[i].length;
|
|
385
|
-
}
|
|
386
|
-
try {
|
|
387
|
-
decompressed_data = zlib.inflateRaw(concatenated.subarray(2));
|
|
388
|
-
} catch (raw_err) {
|
|
389
|
-
// The deflate payload itself is broken; re-throw with the original
|
|
390
|
-
// pako message for diagnostics.
|
|
391
|
-
throw new Error(`Failed to inflate IDAT stream: ${inflator.msg || inflator.err}`);
|
|
392
|
-
}
|
|
393
|
-
}
|
|
333
|
+
// leniently: a corrupt adler32 trailer over a sound deflate payload is common enough in the
|
|
334
|
+
// wild that Chrome and libpng both accept it, and a texture that refuses to load is worse than
|
|
335
|
+
// one whose checksum nobody reads
|
|
336
|
+
const decompressed_data = png_inflate(this.dataChunks, true);
|
|
394
337
|
|
|
395
338
|
// https://www.w3.org/TR/png-3/#8InterlaceMethods
|
|
396
339
|
if (png.getInterlaceMethod() === 0) {
|
|
@@ -415,48 +358,58 @@ PNGReader.prototype.decodePixels = function () {
|
|
|
415
358
|
// Different interlace methods
|
|
416
359
|
|
|
417
360
|
/**
|
|
361
|
+
* Reconstruct a non-interlaced image.
|
|
362
|
+
*
|
|
363
|
+
* Filtering is byte-wise, so at bit depths below eight the reconstructed scanline is still packed
|
|
364
|
+
* and has to be unpacked into the output separately. At eight bits and above the two are the same
|
|
365
|
+
* thing, and the reconstruction is written straight into the output with no intermediate row.
|
|
366
|
+
*
|
|
418
367
|
* @param {Uint8Array} data
|
|
368
|
+
* @returns {Uint8Array}
|
|
419
369
|
*/
|
|
420
370
|
PNGReader.prototype.interlaceNone = function (data) {
|
|
421
371
|
|
|
422
372
|
const png = this.png;
|
|
423
373
|
|
|
424
374
|
const depth = png.bitDepth;
|
|
425
|
-
const
|
|
426
|
-
const bytes_per_pixel = bits_per_line / 8;
|
|
375
|
+
const channels = png.colors;
|
|
427
376
|
|
|
428
377
|
const width = png.width;
|
|
429
378
|
const height = png.height;
|
|
430
379
|
|
|
431
|
-
//
|
|
432
|
-
const
|
|
380
|
+
// the specification's `bpp`: whole bytes per pixel, and never less than one
|
|
381
|
+
const bytes_per_pixel = Math.max(1, Math.ceil(channels * depth / 8));
|
|
382
|
+
|
|
383
|
+
const bytes_per_row = Math.ceil(channels * depth * width / 8);
|
|
433
384
|
|
|
434
|
-
|
|
385
|
+
if (depth < 8) {
|
|
386
|
+
return interlace_none_packed(data, depth, channels * width, bytes_per_pixel, bytes_per_row, height);
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
const pixels = new Uint8Array(bytes_per_row * height);
|
|
435
390
|
|
|
436
391
|
let offset = 0;
|
|
437
392
|
|
|
438
393
|
const data_length = data.length;
|
|
439
394
|
|
|
440
|
-
for (let i = 0; i < data_length; i +=
|
|
395
|
+
for (let i = 0; i < data_length; i += bytes_per_row + 1) {
|
|
441
396
|
|
|
442
397
|
const scanline_address = i + 1;
|
|
443
398
|
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
const filter_type = readUInt8(data, i);
|
|
399
|
+
const filter_type = data[i];
|
|
447
400
|
|
|
448
|
-
|
|
401
|
+
png_unfilter(
|
|
449
402
|
filter_type,
|
|
450
403
|
data,
|
|
451
404
|
scanline_address,
|
|
452
405
|
pixels,
|
|
453
|
-
|
|
406
|
+
bytes_per_pixel,
|
|
454
407
|
offset,
|
|
455
|
-
offset -
|
|
456
|
-
|
|
408
|
+
offset - bytes_per_row,
|
|
409
|
+
bytes_per_row
|
|
457
410
|
);
|
|
458
411
|
|
|
459
|
-
offset +=
|
|
412
|
+
offset += bytes_per_row;
|
|
460
413
|
|
|
461
414
|
}
|
|
462
415
|
|
|
@@ -464,18 +417,87 @@ PNGReader.prototype.interlaceNone = function (data) {
|
|
|
464
417
|
|
|
465
418
|
};
|
|
466
419
|
|
|
420
|
+
/**
|
|
421
|
+
* The sub-byte half of {@link PNGReader#interlaceNone}.
|
|
422
|
+
*
|
|
423
|
+
* Two packed rows are kept, alternating, because the `Up`, `Average` and `Paeth` filters predict
|
|
424
|
+
* from the previous scanline as it was *packed*, not as it was unpacked.
|
|
425
|
+
*
|
|
426
|
+
* @param {Uint8Array} data
|
|
427
|
+
* @param {number} depth `1`, `2` or `4`
|
|
428
|
+
* @param {number} samples_per_row
|
|
429
|
+
* @param {number} bytes_per_pixel
|
|
430
|
+
* @param {number} bytes_per_row packed
|
|
431
|
+
* @param {number} height
|
|
432
|
+
* @returns {Uint8Array} one byte per sample
|
|
433
|
+
*/
|
|
434
|
+
function interlace_none_packed(data, depth, samples_per_row, bytes_per_pixel, bytes_per_row, height) {
|
|
435
|
+
const pixels = new Uint8Array(samples_per_row * height);
|
|
436
|
+
|
|
437
|
+
const rows = new Uint8Array(bytes_per_row * 2);
|
|
438
|
+
|
|
439
|
+
const rows_available = Math.floor(data.length / (bytes_per_row + 1));
|
|
440
|
+
const row_count = height < rows_available ? height : rows_available;
|
|
441
|
+
|
|
442
|
+
let at = 0;
|
|
443
|
+
let previous_row_offset = -1;
|
|
444
|
+
|
|
445
|
+
for (let y = 0; y < row_count; y++) {
|
|
446
|
+
const filter_type = data[at++];
|
|
447
|
+
|
|
448
|
+
const row_offset = (y & 1) * bytes_per_row;
|
|
449
|
+
|
|
450
|
+
png_unfilter(
|
|
451
|
+
filter_type,
|
|
452
|
+
data,
|
|
453
|
+
at,
|
|
454
|
+
rows,
|
|
455
|
+
bytes_per_pixel,
|
|
456
|
+
row_offset,
|
|
457
|
+
previous_row_offset,
|
|
458
|
+
bytes_per_row
|
|
459
|
+
);
|
|
460
|
+
|
|
461
|
+
at += bytes_per_row;
|
|
462
|
+
|
|
463
|
+
png_unpack_samples(rows, row_offset, depth, samples_per_row, pixels, y * samples_per_row);
|
|
464
|
+
|
|
465
|
+
previous_row_offset = row_offset;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
return pixels;
|
|
469
|
+
}
|
|
470
|
+
|
|
467
471
|
|
|
468
472
|
/**
|
|
469
|
-
* De-interlace image according to
|
|
473
|
+
* De-interlace an image according to the Adam7 scheme.
|
|
474
|
+
*
|
|
475
|
+
* Each of the seven passes is its own little image with its own scanline width, so its own
|
|
476
|
+
* filtering and — below eight bits — its own packing. Reconstructed rows land in a two-row scratch
|
|
477
|
+
* (the filters predict from the previous row of the same pass) and are scattered into the output.
|
|
478
|
+
*
|
|
470
479
|
* @param {Uint8Array} data
|
|
480
|
+
* @returns {Uint8Array}
|
|
471
481
|
*/
|
|
472
482
|
PNGReader.prototype.interlaceAdam7 = function (data) {
|
|
473
483
|
|
|
474
484
|
const png = this.png;
|
|
475
485
|
|
|
476
|
-
const
|
|
486
|
+
const depth = png.bitDepth;
|
|
487
|
+
const channels = png.colors;
|
|
488
|
+
|
|
489
|
+
const width = png.width;
|
|
490
|
+
const height = png.height;
|
|
491
|
+
|
|
492
|
+
const packed = depth < 8;
|
|
477
493
|
|
|
478
|
-
|
|
494
|
+
// the specification's `bpp`, used for filtering
|
|
495
|
+
const bytes_per_pixel = Math.max(1, Math.ceil(channels * depth / 8));
|
|
496
|
+
|
|
497
|
+
// bytes a pixel occupies in the *output*, where sub-byte samples have been expanded
|
|
498
|
+
const output_pixel_bytes = channels * (depth === 16 ? 2 : 1);
|
|
499
|
+
|
|
500
|
+
const pixels = new Uint8Array(output_pixel_bytes * width * height);
|
|
479
501
|
|
|
480
502
|
// Adam7 interlacing pattern
|
|
481
503
|
const passes = [
|
|
@@ -488,13 +510,13 @@ PNGReader.prototype.interlaceAdam7 = function (data) {
|
|
|
488
510
|
{ x: 0, y: 1, xStep: 1, yStep: 2 }, // Pass 7
|
|
489
511
|
];
|
|
490
512
|
|
|
491
|
-
const width = png.width;
|
|
492
|
-
const height = png.height;
|
|
493
|
-
|
|
494
513
|
let offset = 0;
|
|
495
514
|
|
|
496
|
-
//
|
|
497
|
-
const line_bytes_buffer = new Uint8Array(width *
|
|
515
|
+
// two reconstructed rows, alternating, so that the previous one is still there to predict from
|
|
516
|
+
const line_bytes_buffer = new Uint8Array(Math.ceil(channels * depth * width / 8) * 2);
|
|
517
|
+
|
|
518
|
+
// one unpacked row, used only below eight bits
|
|
519
|
+
const sample_buffer = packed ? new Uint8Array(channels * width) : null;
|
|
498
520
|
|
|
499
521
|
// Process each pass
|
|
500
522
|
for (let passIndex = 0; passIndex < 7; passIndex++) {
|
|
@@ -508,7 +530,8 @@ PNGReader.prototype.interlaceAdam7 = function (data) {
|
|
|
508
530
|
continue;
|
|
509
531
|
}
|
|
510
532
|
|
|
511
|
-
const
|
|
533
|
+
const pass_samples = channels * pass_width;
|
|
534
|
+
const pass_line_bytes = Math.ceil(pass_samples * depth / 8);
|
|
512
535
|
|
|
513
536
|
// Indicate to unfiltering that this is the first line (no previous line)
|
|
514
537
|
let previous_line_offset = -1;
|
|
@@ -520,10 +543,9 @@ PNGReader.prototype.interlaceAdam7 = function (data) {
|
|
|
520
543
|
const filter_type = data[offset++];
|
|
521
544
|
|
|
522
545
|
// we use alternating line offsets to save on memory allocations
|
|
523
|
-
const line_offset = (y % 2) *
|
|
546
|
+
const line_offset = (y % 2) * pass_line_bytes;
|
|
524
547
|
|
|
525
|
-
|
|
526
|
-
this.unFilter(
|
|
548
|
+
png_unfilter(
|
|
527
549
|
filter_type,
|
|
528
550
|
data,
|
|
529
551
|
offset,
|
|
@@ -531,12 +553,23 @@ PNGReader.prototype.interlaceAdam7 = function (data) {
|
|
|
531
553
|
bytes_per_pixel,
|
|
532
554
|
line_offset,
|
|
533
555
|
previous_line_offset,
|
|
534
|
-
|
|
556
|
+
pass_line_bytes
|
|
535
557
|
);
|
|
536
558
|
|
|
537
|
-
offset +=
|
|
559
|
+
offset += pass_line_bytes;
|
|
538
560
|
previous_line_offset = line_offset;
|
|
539
561
|
|
|
562
|
+
// below eight bits the reconstruction is still packed, so expand it before scattering
|
|
563
|
+
let source = line_bytes_buffer;
|
|
564
|
+
let source_offset = line_offset;
|
|
565
|
+
|
|
566
|
+
if (packed) {
|
|
567
|
+
png_unpack_samples(line_bytes_buffer, line_offset, depth, pass_samples, sample_buffer, 0);
|
|
568
|
+
|
|
569
|
+
source = sample_buffer;
|
|
570
|
+
source_offset = 0;
|
|
571
|
+
}
|
|
572
|
+
|
|
540
573
|
for (let x = 0; x < pass_width; x++) {
|
|
541
574
|
|
|
542
575
|
const outputX = pass.x + x * pass.xStep;
|
|
@@ -546,10 +579,10 @@ PNGReader.prototype.interlaceAdam7 = function (data) {
|
|
|
546
579
|
continue;
|
|
547
580
|
}
|
|
548
581
|
|
|
549
|
-
for (let i = 0; i <
|
|
550
|
-
const out_offset = (outputY * width + outputX) *
|
|
582
|
+
for (let i = 0; i < output_pixel_bytes; i++) {
|
|
583
|
+
const out_offset = (outputY * width + outputX) * output_pixel_bytes + i;
|
|
551
584
|
|
|
552
|
-
pixels[out_offset] =
|
|
585
|
+
pixels[out_offset] = source[source_offset + x * output_pixel_bytes + i];
|
|
553
586
|
}
|
|
554
587
|
}
|
|
555
588
|
}
|
|
@@ -561,6 +594,8 @@ PNGReader.prototype.interlaceAdam7 = function (data) {
|
|
|
561
594
|
// Unfiltering
|
|
562
595
|
|
|
563
596
|
/**
|
|
597
|
+
* Reconstruct one filtered scanline. Kept as a method so the reader's surface is unchanged; the
|
|
598
|
+
* dispatch itself lives in {@link png_unfilter}.
|
|
564
599
|
*
|
|
565
600
|
* @param {number} filter_type
|
|
566
601
|
* @param {Uint8Array} data
|
|
@@ -583,68 +618,16 @@ PNGReader.prototype.unFilter = function (
|
|
|
583
618
|
output_offset_previous,
|
|
584
619
|
length
|
|
585
620
|
) {
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
scanline_address,
|
|
597
|
-
output,
|
|
598
|
-
output_offset,
|
|
599
|
-
length,
|
|
600
|
-
this.png.bitDepth
|
|
601
|
-
);
|
|
602
|
-
break;
|
|
603
|
-
case 1:
|
|
604
|
-
png_filter_unFilterSub(
|
|
605
|
-
data,
|
|
606
|
-
scanline_address,
|
|
607
|
-
output,
|
|
608
|
-
bytes_per_pixel,
|
|
609
|
-
output_offset,
|
|
610
|
-
length
|
|
611
|
-
);
|
|
612
|
-
break;
|
|
613
|
-
case 2:
|
|
614
|
-
png_filter_unFilterUp(
|
|
615
|
-
data,
|
|
616
|
-
scanline_address,
|
|
617
|
-
output,
|
|
618
|
-
output_offset,
|
|
619
|
-
output_offset_previous,
|
|
620
|
-
length
|
|
621
|
-
);
|
|
622
|
-
break;
|
|
623
|
-
case 3:
|
|
624
|
-
png_filter_unFilterAverage(
|
|
625
|
-
data,
|
|
626
|
-
scanline_address,
|
|
627
|
-
output,
|
|
628
|
-
bytes_per_pixel,
|
|
629
|
-
output_offset,
|
|
630
|
-
output_offset_previous,
|
|
631
|
-
length
|
|
632
|
-
);
|
|
633
|
-
break;
|
|
634
|
-
case 4:
|
|
635
|
-
png_filter_unFilterPaeth(
|
|
636
|
-
data,
|
|
637
|
-
scanline_address,
|
|
638
|
-
output,
|
|
639
|
-
bytes_per_pixel,
|
|
640
|
-
output_offset,
|
|
641
|
-
output_offset_previous,
|
|
642
|
-
length
|
|
643
|
-
);
|
|
644
|
-
break;
|
|
645
|
-
default:
|
|
646
|
-
throw new Error(`unknown filtered scanline type '${filter_type}'`);
|
|
647
|
-
}
|
|
621
|
+
png_unfilter(
|
|
622
|
+
filter_type,
|
|
623
|
+
data,
|
|
624
|
+
scanline_address,
|
|
625
|
+
output,
|
|
626
|
+
bytes_per_pixel,
|
|
627
|
+
output_offset,
|
|
628
|
+
output_offset_previous,
|
|
629
|
+
length
|
|
630
|
+
);
|
|
648
631
|
}
|
|
649
632
|
|
|
650
633
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BinaryBuffer } from "../../../../../../core/binary/BinaryBuffer.js";
|
|
2
|
-
import {
|
|
2
|
+
import { png_inflate } from "../png_inflate.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* International textual data
|
|
@@ -35,9 +35,9 @@ export function png_chunk_decode_iTXt(chunk) {
|
|
|
35
35
|
throw new Error('only compression_method 0 is supported');
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
const decoded =
|
|
38
|
+
const decoded = png_inflate([new Uint8Array(buffer.data, buffer.position, remaining_bytes)]);
|
|
39
39
|
|
|
40
|
-
buffer.fromArrayBuffer(decoded);
|
|
40
|
+
buffer.fromArrayBuffer(decoded.buffer);
|
|
41
41
|
|
|
42
42
|
text = buffer.readASCIICharacters(decoded.byteLength);
|
|
43
43
|
} else {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BinaryBuffer } from "../../../../../../core/binary/BinaryBuffer.js";
|
|
2
|
-
import {
|
|
2
|
+
import { png_inflate } from "../png_inflate.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Compressed textual data
|
|
@@ -26,9 +26,9 @@ export function png_chunk_decode_zTXt(chunk) {
|
|
|
26
26
|
const local_offset = buffer.position - chunk_byte_offset;
|
|
27
27
|
const encoded_chunk = new Uint8Array(chunk_buffer, buffer.position, chunk_size - local_offset);
|
|
28
28
|
|
|
29
|
-
const decompressed_data =
|
|
29
|
+
const decompressed_data = png_inflate([encoded_chunk]);
|
|
30
30
|
|
|
31
|
-
buffer.fromArrayBuffer(decompressed_data);
|
|
31
|
+
buffer.fromArrayBuffer(decompressed_data.buffer);
|
|
32
32
|
|
|
33
33
|
value = buffer.readASCIICharacters(decompressed_data.byteLength);
|
|
34
34
|
} else {
|
|
@@ -1,16 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* 32-bit Cyclic Redundancy Checksum.
|
|
3
|
-
* @see https://en.wikipedia.org/wiki/Cyclic_redundancy_check
|
|
4
|
-
* @param {Uint8Array} buffer byte buffer
|
|
5
|
-
* @param {number} [offset=0] where to start in the input buffer
|
|
6
|
-
* @param {number} [length=buffer.length] how many bytes to include in checksum calculation
|
|
7
|
-
* @return {number} Unsigned 32-bit integer value
|
|
8
|
-
* @copyright Company Named Limited (c) 2026
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* const buffer = new BinaryBuffer();
|
|
12
|
-
* buffer.writeASCIIString("Hello World");
|
|
13
|
-
* const checksum = crc32(buffer.raw_bytes, 0, buffer.position);
|
|
14
|
-
*/
|
|
15
|
-
export function crc32(buffer: Uint8Array, offset?: number, length?: number): number;
|
|
1
|
+
export { crc32 } from "../../../../../core/binary/hash/crc32.js";
|
|
16
2
|
//# sourceMappingURL=crc32.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crc32.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/asset/loaders/image/png/crc32.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"crc32.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/asset/loaders/image/png/crc32.js"],"names":[],"mappings":""}
|
|
@@ -1,92 +1,8 @@
|
|
|
1
|
-
import { assert } from "../../../../../core/assert.js";
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
* Ported from C source at https://www.w3.org/TR/PNG-CRCAppendix.html
|
|
5
|
-
* See also ISO 3309 [ISO-3309] or ITU-T V.42 [ITU-V42] for a formal specification
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
* @type {Uint32Array}
|
|
11
|
-
*/
|
|
12
|
-
const crc_table = new Uint32Array(256);
|
|
13
|
-
|
|
14
|
-
// Precompute checksum table
|
|
15
|
-
for (let n = 0; n < 256; n++) {
|
|
16
|
-
let c = n;
|
|
17
|
-
|
|
18
|
-
for (let k = 0; k < 8; k++) {
|
|
19
|
-
|
|
20
|
-
if ((c & 1) !== 0) {
|
|
21
|
-
// CRC32b polynomial
|
|
22
|
-
c = 0xedb88320 ^ (c >>> 1);
|
|
23
|
-
} else {
|
|
24
|
-
c = c >>> 1;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
crc_table[n] = c;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const INITIAL = 0xffffffff;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Update a running CRC with the bytes buf[0..len-1]--the CRC
|
|
36
|
-
* should be initialized to all 1's, and the transmitted value
|
|
37
|
-
* is the 1's complement of the final running CRC (see the crc32() routine below)).
|
|
38
|
-
* @param {number} input_crc starting CRC value
|
|
39
|
-
* @param {Uint8Array} buffer
|
|
40
|
-
* @param {number} offset
|
|
41
|
-
* @param {number} length
|
|
42
|
-
* @return {number}
|
|
43
|
-
*/
|
|
44
|
-
function update_crc(
|
|
45
|
-
input_crc,
|
|
46
|
-
buffer,
|
|
47
|
-
offset,
|
|
48
|
-
length,
|
|
49
|
-
) {
|
|
50
|
-
assert.isNonNegativeInteger(input_crc, 'input_crc');
|
|
51
|
-
assert.defined(buffer, 'buffer');
|
|
52
|
-
assert.isNonNegativeInteger(offset, 'offset');
|
|
53
|
-
assert.isNonNegativeInteger(length, 'length');
|
|
54
|
-
|
|
55
|
-
let crc = input_crc;
|
|
56
|
-
|
|
57
|
-
const end = offset + length;
|
|
58
|
-
|
|
59
|
-
for (let n = offset; n < end; n++) {
|
|
60
|
-
|
|
61
|
-
const byte = buffer[n];
|
|
62
|
-
|
|
63
|
-
const lookup_index = (crc ^ byte) & 0xff;
|
|
64
|
-
|
|
65
|
-
crc = crc_table[lookup_index] ^ (crc >>> 8);
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
return crc;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
1
|
/**
|
|
73
|
-
* 32-
|
|
74
|
-
*
|
|
75
|
-
* @param {Uint8Array} buffer byte buffer
|
|
76
|
-
* @param {number} [offset=0] where to start in the input buffer
|
|
77
|
-
* @param {number} [length=buffer.length] how many bytes to include in checksum calculation
|
|
78
|
-
* @return {number} Unsigned 32-bit integer value
|
|
79
|
-
* @copyright Company Named Limited (c) 2026
|
|
2
|
+
* @deprecated Moved to `core/binary/hash/crc32.js`. CRC-32/ISO-3309 is not a PNG algorithm — PNG
|
|
3
|
+
* merely happens to be the first thing in the tree that needed it.
|
|
80
4
|
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
* buffer.writeASCIIString("Hello World");
|
|
84
|
-
* const checksum = crc32(buffer.raw_bytes, 0, buffer.position);
|
|
5
|
+
* Kept as a re-export rather than removed: this is a library, and an import path is as much a
|
|
6
|
+
* published interface as a function signature.
|
|
85
7
|
*/
|
|
86
|
-
export
|
|
87
|
-
buffer,
|
|
88
|
-
offset=0,
|
|
89
|
-
length=buffer.length,
|
|
90
|
-
) {
|
|
91
|
-
return (update_crc(INITIAL, buffer, offset, length) ^ INITIAL) >>> 0;
|
|
92
|
-
}
|
|
8
|
+
export { crc32 } from "../../../../../core/binary/hash/crc32.js";
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* With the None filter
|
|
2
|
+
* With the `None` filter the scanline is transmitted unmodified, so reconstruction is a byte copy.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Byte-wise, like every other filter: at bit depths below eight a scanline carries several samples
|
|
5
|
+
* per byte, and unpacking them is {@link png_unpack_samples}' job, done after reconstruction. The
|
|
6
|
+
* two were once fused here, which is why `None` was the only filter that worked at those depths.
|
|
6
7
|
*
|
|
7
|
-
* @param {Uint8Array} data
|
|
8
|
-
* @param {number}
|
|
9
|
-
* @param {Uint8Array} output
|
|
10
|
-
* @param {number}
|
|
11
|
-
* @param {number}
|
|
12
|
-
* @param {number}
|
|
8
|
+
* @param {Uint8Array} scanline raw data
|
|
9
|
+
* @param {number} scanline_offset
|
|
10
|
+
* @param {Uint8Array} pixels processed output
|
|
11
|
+
* @param {number} bpp bytes-per-pixel, unused by this filter
|
|
12
|
+
* @param {number} offset
|
|
13
|
+
* @param {number} output_offset_previous unused by this filter
|
|
14
|
+
* @param {number} length number of bytes to reconstruct
|
|
13
15
|
*
|
|
14
16
|
* @see https://www.w3.org/TR/PNG-Filters.html
|
|
15
17
|
*/
|
|
16
|
-
export function png_filter_unFilterNone(
|
|
18
|
+
export function png_filter_unFilterNone(scanline: Uint8Array, scanline_offset: number, pixels: Uint8Array, bpp: number, offset: number, output_offset_previous: number, length: number): void;
|
|
17
19
|
//# sourceMappingURL=png_filter_unFilterNone.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"png_filter_unFilterNone.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/asset/loaders/image/png/filter/png_filter_unFilterNone.js"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"png_filter_unFilterNone.d.ts","sourceRoot":"","sources":["../../../../../../../../src/engine/asset/loaders/image/png/filter/png_filter_unFilterNone.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,kDAVW,UAAU,mBACV,MAAM,UACN,UAAU,OACV,MAAM,UACN,MAAM,0BACN,MAAM,UACN,MAAM,QAgBhB"}
|