@woosh/meep-engine 3.8.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/rasterize/native/oit/shader_oit_blend.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/oit/shader_oit_blend.js +5 -4
- 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/shade/renderer/shader/chunk/math/chunk_magnitude_floor.d.ts +9 -0
- package/src/shade/renderer/shader/chunk/math/chunk_magnitude_floor.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/math/chunk_magnitude_floor.js +16 -0
- package/src/shade/renderer/shader/chunk/math/complex/chunk_complex_magnitude_floor.d.ts +10 -0
- package/src/shade/renderer/shader/chunk/math/complex/chunk_complex_magnitude_floor.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/math/complex/chunk_complex_magnitude_floor.js +17 -0
- package/src/shade/renderer/shader/chunk/math/complex/chunk_complex_solve_cubic_blinn.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/math/complex/chunk_complex_solve_cubic_blinn.js +7 -1
- package/src/shade/renderer/shader/chunk/math/complex/chunk_complex_square_root.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/math/complex/chunk_complex_square_root.js +9 -3
- package/src/shade/renderer/shader/chunk/math/polynomial/chunk_solve_cubic.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/math/polynomial/chunk_solve_cubic.js +13 -7
- package/src/shade/renderer/shader/chunk/math/polynomial/chunk_solve_cubic_blinn_smallest.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/math/polynomial/chunk_solve_cubic_blinn_smallest.js +13 -4
- package/src/shade/renderer/shader/chunk/math/polynomial/chunk_solve_quadratic.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/math/polynomial/chunk_solve_quadratic.js +20 -13
- package/src/shade/renderer/shader/chunk/math/polynomial/chunk_solve_quartic_neumark.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/math/polynomial/chunk_solve_quartic_neumark.js +8 -4
- package/src/shade/renderer/shader/chunk/mboit/NOTES.md +35 -1
- package/src/shade/renderer/shader/chunk/mboit/moments/geometric/chunk_compute_transmittance_from_2_trigonometric_moments.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/mboit/moments/geometric/chunk_compute_transmittance_from_2_trigonometric_moments.js +18 -5
- package/src/shade/renderer/shader/chunk/mboit/moments/geometric/chunk_compute_transmittance_from_3_trigonometric_moments.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/mboit/moments/geometric/chunk_compute_transmittance_from_3_trigonometric_moments.js +21 -8
- package/src/shade/renderer/shader/chunk/mboit/moments/geometric/chunk_compute_transmittance_from_4_trigonometric_moments.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/mboit/moments/geometric/chunk_compute_transmittance_from_4_trigonometric_moments.js +25 -12
- package/src/shade/renderer/shader/chunk/mboit/moments/geometric/chunk_generate_trigonometric_moments_4.d.ts +6 -2
- package/src/shade/renderer/shader/chunk/mboit/moments/geometric/chunk_generate_trigonometric_moments_4.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/mboit/moments/geometric/chunk_generate_trigonometric_moments_4.js +42 -35
- package/src/shade/renderer/shader/chunk/mboit/moments/power/chunk_compute_transmittance_from_4_power_moments.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/mboit/moments/power/chunk_compute_transmittance_from_4_power_moments.js +18 -5
- package/src/shade/renderer/shader/chunk/mboit/moments/power/chunk_compute_transmittance_from_6_power_moments.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/mboit/moments/power/chunk_compute_transmittance_from_6_power_moments.js +24 -9
- package/src/shade/renderer/shader/chunk/mboit/moments/power/chunk_compute_transmittance_from_8_power_moments.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/mboit/moments/power/chunk_compute_transmittance_from_8_power_moments.js +29 -13
- package/src/shade/renderer/shader/chunk/mboit/moments/power/chunk_generate_power_moments_4.d.ts +12 -0
- package/src/shade/renderer/shader/chunk/mboit/moments/power/chunk_generate_power_moments_4.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/mboit/moments/power/chunk_generate_power_moments_4.js +38 -48
- 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
|
@@ -29,6 +29,16 @@ export const PQ_MAX_NITS: number;
|
|
|
29
29
|
* Luminance of SDR reference white, in nits, per ITU-R BT.2408. This is the engine's `1.0`, and it is
|
|
30
30
|
* NOT PQ's `1.0`: converting between the two scales is the caller's job and needs
|
|
31
31
|
* {@link PQ_SDR_WHITE_LINEAR} in one direction or its reciprocal in the other.
|
|
32
|
+
*
|
|
33
|
+
* It is also not the only number in the engine called a reference white, so: this one is a *renderer*
|
|
34
|
+
* convention, applied by callers of {@link linear_to_PQ} / {@link PQ_to_linear} rather than folded into
|
|
35
|
+
* them. The GPU's `chunk_eotfSt2084` folds 100 into its own transfer pair, but that 100 is GT7's "Standard
|
|
36
|
+
* 1.0 unit" shared with `chunk_tonemap_gt7`, not a competing SDR white. `avif/native/color/transfer_to_linear.js`
|
|
37
|
+
* uses a third 100, the reference display that H.273's SDR curves are defined against. The boundary where
|
|
38
|
+
* the conventions meet is named explicitly, as `linear_reference_nits`, in `sampler2d_to_avif` and
|
|
39
|
+
* `avif_to_sampler2d`.
|
|
40
|
+
*
|
|
41
|
+
* @see chunk_eotfSt2084 for the GPU side and the full comparison
|
|
32
42
|
* @type {number}
|
|
33
43
|
*/
|
|
34
44
|
export const SDR_WHITE_NITS: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PQ_constants.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/PQ/PQ_constants.js"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,kCAAkC;AAClC,oBADW,MAAM,CACoB;AAErC,+BAA+B;AAC/B,oBADW,MAAM,CACa;AAE9B,iCAAiC;AACjC,oBADW,MAAM,CACc;AAE/B,gCAAgC;AAChC,oBADW,MAAM,CACe;AAEhC,gCAAgC;AAChC,oBADW,MAAM,CACY;AAE7B;;;;;GAKG;AACH,0BAFU,MAAM,CAEiB;AAEjC
|
|
1
|
+
{"version":3,"file":"PQ_constants.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/PQ/PQ_constants.js"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,kCAAkC;AAClC,oBADW,MAAM,CACoB;AAErC,+BAA+B;AAC/B,oBADW,MAAM,CACa;AAE9B,iCAAiC;AACjC,oBADW,MAAM,CACc;AAE/B,gCAAgC;AAChC,oBADW,MAAM,CACe;AAEhC,gCAAgC;AAChC,oBADW,MAAM,CACY;AAE7B;;;;;GAKG;AACH,0BAFU,MAAM,CAEiB;AAEjC;;;;;;;;;;;;;;;GAeG;AACH,6BAFU,MAAM,CAEkB;AAElC;;;;;;GAMG;AACH,kCAFU,MAAM,CAEgD"}
|
|
@@ -36,6 +36,16 @@ export const PQ_MAX_NITS = 10000;
|
|
|
36
36
|
* Luminance of SDR reference white, in nits, per ITU-R BT.2408. This is the engine's `1.0`, and it is
|
|
37
37
|
* NOT PQ's `1.0`: converting between the two scales is the caller's job and needs
|
|
38
38
|
* {@link PQ_SDR_WHITE_LINEAR} in one direction or its reciprocal in the other.
|
|
39
|
+
*
|
|
40
|
+
* It is also not the only number in the engine called a reference white, so: this one is a *renderer*
|
|
41
|
+
* convention, applied by callers of {@link linear_to_PQ} / {@link PQ_to_linear} rather than folded into
|
|
42
|
+
* them. The GPU's `chunk_eotfSt2084` folds 100 into its own transfer pair, but that 100 is GT7's "Standard
|
|
43
|
+
* 1.0 unit" shared with `chunk_tonemap_gt7`, not a competing SDR white. `avif/native/color/transfer_to_linear.js`
|
|
44
|
+
* uses a third 100, the reference display that H.273's SDR curves are defined against. The boundary where
|
|
45
|
+
* the conventions meet is named explicitly, as `linear_reference_nits`, in `sampler2d_to_avif` and
|
|
46
|
+
* `avif_to_sampler2d`.
|
|
47
|
+
*
|
|
48
|
+
* @see chunk_eotfSt2084 for the GPU side and the full comparison
|
|
39
49
|
* @type {number}
|
|
40
50
|
*/
|
|
41
51
|
export const SDR_WHITE_NITS = 203;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linear_to_PQ.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/PQ/linear_to_PQ.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"linear_to_PQ.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/PQ/linear_to_PQ.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qCAPW,MAAM,GACJ,MAAM,CAelB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { assert } from "../../assert.js";
|
|
1
2
|
import { PQ_C1, PQ_C2, PQ_C3, PQ_M1, PQ_M2 } from "./PQ_constants.js";
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -26,6 +27,11 @@ import { PQ_C1, PQ_C2, PQ_C3, PQ_M1, PQ_M2 } from "./PQ_constants.js";
|
|
|
26
27
|
* @copyright Company Named Limited (c) 2026
|
|
27
28
|
*/
|
|
28
29
|
export function linear_to_PQ(linear) {
|
|
30
|
+
// validated per the package rule: a non-finite input has no encoding, while a negative one does have a
|
|
31
|
+
// defined answer and is clamped below rather than rejected
|
|
32
|
+
assert.isNumber(linear, 'linear');
|
|
33
|
+
assert.isFinite(linear, 'linear');
|
|
34
|
+
|
|
29
35
|
const y = Math.pow(Math.max(linear, 0), PQ_M1);
|
|
30
36
|
|
|
31
37
|
return Math.pow((PQ_C1 + PQ_C2 * y) / (1 + PQ_C3 * y), PQ_M2);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Rec.709 / sRGB primaries, as coefficients, in one place.
|
|
3
|
+
*
|
|
4
|
+
* These numbers previously appeared at three different precisions in three files — 4 significant digits in
|
|
5
|
+
* `rgb_to_luminance`, 15 in the WGSL `chunk_rgb_to_luminance`, and 20 in `rgb_to_xyz`'s middle row — which is
|
|
6
|
+
* how a single quantity comes to look like three quantities. Nothing was wrong with any of them; the problem
|
|
7
|
+
* is that there was no way to tell whether a future edit to one was meant to apply to the others.
|
|
8
|
+
*
|
|
9
|
+
* They are *derived* values, not the rounded ones quoted in IEC 61966-2-1. Deriving them from the chromaticity
|
|
10
|
+
* coordinates below rather than quoting `0.2126 / 0.7152 / 0.0722` is what makes linear white land on
|
|
11
|
+
* `Y = 1` and on `L* = 100, a* = 0, b* = 0` exactly, which the rest of this package relies on:
|
|
12
|
+
*
|
|
13
|
+
* ```
|
|
14
|
+
* xr, yr = 0.6400, 0.3300
|
|
15
|
+
* xg, yg = 0.3000, 0.6000
|
|
16
|
+
* xb, yb = 0.1500, 0.0600
|
|
17
|
+
* xw, yw = 0.3127, 0.3290 (D65)
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* The difference from the rounded spec values is ~1e-4 — below an 8-bit quantum, and below f32 rounding in
|
|
21
|
+
* the WGSL twins, so aligning on these costs nothing and settles which spelling is normative.
|
|
22
|
+
*
|
|
23
|
+
* @see chunk_rgb_to_luminance the WGSL twin, which must carry the same digits
|
|
24
|
+
* @see https://en.wikipedia.org/wiki/Luminance
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* Red's contribution to relative luminance.
|
|
28
|
+
* @type {number}
|
|
29
|
+
*/
|
|
30
|
+
export const REC709_LUMINANCE_R: number;
|
|
31
|
+
/**
|
|
32
|
+
* Green's contribution to relative luminance.
|
|
33
|
+
* @type {number}
|
|
34
|
+
*/
|
|
35
|
+
export const REC709_LUMINANCE_G: number;
|
|
36
|
+
/**
|
|
37
|
+
* Blue's contribution to relative luminance.
|
|
38
|
+
* @type {number}
|
|
39
|
+
*/
|
|
40
|
+
export const REC709_LUMINANCE_B: number;
|
|
41
|
+
/**
|
|
42
|
+
* Exponent of the sRGB OETF's power segment, `1 / 2.4`.
|
|
43
|
+
*
|
|
44
|
+
* Written out rather than computed so that the WGSL twin can carry the identical literal; the two used to
|
|
45
|
+
* differ in their trailing digits (`0.41666666666` against `0.4166666666666667`) for no reason anyone
|
|
46
|
+
* recorded.
|
|
47
|
+
* @type {number}
|
|
48
|
+
*/
|
|
49
|
+
export const SRGB_OETF_EXPONENT: number;
|
|
50
|
+
//# sourceMappingURL=REC709_PRIMARIES.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"REC709_PRIMARIES.d.ts","sourceRoot":"","sources":["../../../../src/core/color/REC709_PRIMARIES.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;GAGG;AACH,iCAFU,MAAM,CAEyC;AAEzD;;;GAGG;AACH,iCAFU,MAAM,CAEyC;AAEzD;;;GAGG;AACH,iCAFU,MAAM,CAEyC;AAEzD;;;;;;;GAOG;AACH,iCAFU,MAAM,CAEqC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Rec.709 / sRGB primaries, as coefficients, in one place.
|
|
3
|
+
*
|
|
4
|
+
* These numbers previously appeared at three different precisions in three files — 4 significant digits in
|
|
5
|
+
* `rgb_to_luminance`, 15 in the WGSL `chunk_rgb_to_luminance`, and 20 in `rgb_to_xyz`'s middle row — which is
|
|
6
|
+
* how a single quantity comes to look like three quantities. Nothing was wrong with any of them; the problem
|
|
7
|
+
* is that there was no way to tell whether a future edit to one was meant to apply to the others.
|
|
8
|
+
*
|
|
9
|
+
* They are *derived* values, not the rounded ones quoted in IEC 61966-2-1. Deriving them from the chromaticity
|
|
10
|
+
* coordinates below rather than quoting `0.2126 / 0.7152 / 0.0722` is what makes linear white land on
|
|
11
|
+
* `Y = 1` and on `L* = 100, a* = 0, b* = 0` exactly, which the rest of this package relies on:
|
|
12
|
+
*
|
|
13
|
+
* ```
|
|
14
|
+
* xr, yr = 0.6400, 0.3300
|
|
15
|
+
* xg, yg = 0.3000, 0.6000
|
|
16
|
+
* xb, yb = 0.1500, 0.0600
|
|
17
|
+
* xw, yw = 0.3127, 0.3290 (D65)
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* The difference from the rounded spec values is ~1e-4 — below an 8-bit quantum, and below f32 rounding in
|
|
21
|
+
* the WGSL twins, so aligning on these costs nothing and settles which spelling is normative.
|
|
22
|
+
*
|
|
23
|
+
* @see chunk_rgb_to_luminance the WGSL twin, which must carry the same digits
|
|
24
|
+
* @see https://en.wikipedia.org/wiki/Luminance
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Red's contribution to relative luminance.
|
|
29
|
+
* @type {number}
|
|
30
|
+
*/
|
|
31
|
+
export const REC709_LUMINANCE_R = 0.21263900587151035754;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Green's contribution to relative luminance.
|
|
35
|
+
* @type {number}
|
|
36
|
+
*/
|
|
37
|
+
export const REC709_LUMINANCE_G = 0.71516867876775592746;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Blue's contribution to relative luminance.
|
|
41
|
+
* @type {number}
|
|
42
|
+
*/
|
|
43
|
+
export const REC709_LUMINANCE_B = 0.07219231536073371500;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Exponent of the sRGB OETF's power segment, `1 / 2.4`.
|
|
47
|
+
*
|
|
48
|
+
* Written out rather than computed so that the WGSL twin can carry the identical literal; the two used to
|
|
49
|
+
* differ in their trailing digits (`0.41666666666` against `0.4166666666666667`) for no reason anyone
|
|
50
|
+
* recorded.
|
|
51
|
+
* @type {number}
|
|
52
|
+
*/
|
|
53
|
+
export const SRGB_OETF_EXPONENT = 0.4166666666666667;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build a `Color` from a CSS hex literal.
|
|
3
|
+
*
|
|
4
|
+
* Accepts all four forms — `#RGB`, `#RGBA`, `#RRGGBB`, `#RRGGBBAA` — and throws on anything else, naming the
|
|
5
|
+
* offending string.
|
|
6
|
+
*
|
|
7
|
+
* The result holds **encoded** sRGB, because that is what a hex literal is. Decode with
|
|
8
|
+
* {@link Color.from_sRGB_to_linear} before handing it to anything in `operations/`, or use
|
|
9
|
+
* {@link color_srgb_apply}.
|
|
10
|
+
*
|
|
11
|
+
* @param {string} hex
|
|
12
|
+
* @param {Color} [output]
|
|
13
|
+
* @returns {Color} `output`, holding **encoded** sRGB
|
|
14
|
+
* @throws Error if `hex` is not one of the four accepted forms
|
|
15
|
+
*
|
|
16
|
+
* @author Alex Goldring
|
|
17
|
+
* @copyright Company Named Limited (c) 2026
|
|
18
|
+
*/
|
|
19
|
+
export function color_from_hex(hex: string, output?: Color): Color;
|
|
20
|
+
import { Color } from "../Color.js";
|
|
21
|
+
//# sourceMappingURL=color_from_hex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color_from_hex.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/construct/color_from_hex.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AACH,oCARW,MAAM,WACN,KAAK,GACH,KAAK,CAgBjB;sBA/BqB,aAAa"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { uint8_to_float } from "../../binary/uint8_to_float.js";
|
|
2
|
+
import { Color } from "../Color.js";
|
|
3
|
+
import { hex_to_rgb } from "../hex/hex_to_rgb.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Build a `Color` from a CSS hex literal.
|
|
7
|
+
*
|
|
8
|
+
* Accepts all four forms — `#RGB`, `#RGBA`, `#RRGGBB`, `#RRGGBBAA` — and throws on anything else, naming the
|
|
9
|
+
* offending string.
|
|
10
|
+
*
|
|
11
|
+
* The result holds **encoded** sRGB, because that is what a hex literal is. Decode with
|
|
12
|
+
* {@link Color.from_sRGB_to_linear} before handing it to anything in `operations/`, or use
|
|
13
|
+
* {@link color_srgb_apply}.
|
|
14
|
+
*
|
|
15
|
+
* @param {string} hex
|
|
16
|
+
* @param {Color} [output]
|
|
17
|
+
* @returns {Color} `output`, holding **encoded** sRGB
|
|
18
|
+
* @throws Error if `hex` is not one of the four accepted forms
|
|
19
|
+
*
|
|
20
|
+
* @author Alex Goldring
|
|
21
|
+
* @copyright Company Named Limited (c) 2026
|
|
22
|
+
*/
|
|
23
|
+
export function color_from_hex(hex, output = new Color()) {
|
|
24
|
+
|
|
25
|
+
const { r, g, b, a } = hex_to_rgb(hex);
|
|
26
|
+
|
|
27
|
+
return output.set(
|
|
28
|
+
uint8_to_float(r),
|
|
29
|
+
uint8_to_float(g),
|
|
30
|
+
uint8_to_float(b),
|
|
31
|
+
uint8_to_float(a)
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build a `Color` from a blackbody colour temperature.
|
|
3
|
+
*
|
|
4
|
+
* `kelvin_to_rgb` has been here all along with no `Color`-shaped way to reach it.
|
|
5
|
+
*
|
|
6
|
+
* The result holds **encoded** sRGB — `kelvin_to_rgb`'s own contract, and the one place in the package where
|
|
7
|
+
* that was already stated. Convert with {@link Color.from_sRGB_to_linear} before mixing it with anything.
|
|
8
|
+
*
|
|
9
|
+
* Alpha is set to 1. Useful range is roughly 1000 K to 40000 K; below the Draper point the result fades to
|
|
10
|
+
* black, which is the physically sensible answer rather than an error.
|
|
11
|
+
*
|
|
12
|
+
* @param {number} kelvin colour temperature
|
|
13
|
+
* @param {Color} [output]
|
|
14
|
+
* @returns {Color} `output`, holding **encoded** sRGB
|
|
15
|
+
*
|
|
16
|
+
* @see kelvin_to_rgb
|
|
17
|
+
* @author Alex Goldring
|
|
18
|
+
* @copyright Company Named Limited (c) 2026
|
|
19
|
+
*/
|
|
20
|
+
export function color_from_temperature(kelvin: number, output?: Color): Color;
|
|
21
|
+
import { Color } from "../Color.js";
|
|
22
|
+
//# sourceMappingURL=color_from_temperature.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color_from_temperature.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/construct/color_from_temperature.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;GAkBG;AACH,+CARW,MAAM,WACN,KAAK,GACH,KAAK,CAWjB;sBAhCqB,aAAa"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Color } from "../Color.js";
|
|
2
|
+
import { kelvin_to_rgb } from "../kelvin/kelvin_to_rgb.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @type {number[]}
|
|
6
|
+
*/
|
|
7
|
+
const scratch = [0, 0, 0];
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Build a `Color` from a blackbody colour temperature.
|
|
11
|
+
*
|
|
12
|
+
* `kelvin_to_rgb` has been here all along with no `Color`-shaped way to reach it.
|
|
13
|
+
*
|
|
14
|
+
* The result holds **encoded** sRGB — `kelvin_to_rgb`'s own contract, and the one place in the package where
|
|
15
|
+
* that was already stated. Convert with {@link Color.from_sRGB_to_linear} before mixing it with anything.
|
|
16
|
+
*
|
|
17
|
+
* Alpha is set to 1. Useful range is roughly 1000 K to 40000 K; below the Draper point the result fades to
|
|
18
|
+
* black, which is the physically sensible answer rather than an error.
|
|
19
|
+
*
|
|
20
|
+
* @param {number} kelvin colour temperature
|
|
21
|
+
* @param {Color} [output]
|
|
22
|
+
* @returns {Color} `output`, holding **encoded** sRGB
|
|
23
|
+
*
|
|
24
|
+
* @see kelvin_to_rgb
|
|
25
|
+
* @author Alex Goldring
|
|
26
|
+
* @copyright Company Named Limited (c) 2026
|
|
27
|
+
*/
|
|
28
|
+
export function color_from_temperature(kelvin, output = new Color()) {
|
|
29
|
+
|
|
30
|
+
kelvin_to_rgb(scratch, 0, kelvin);
|
|
31
|
+
|
|
32
|
+
return output.set(scratch[0], scratch[1], scratch[2], 1);
|
|
33
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build a `Color` from a packed 24-bit `0xRRGGBB` value. Alpha is set to 1.
|
|
3
|
+
*
|
|
4
|
+
* `Color.fromUint` exists as an instance method; constructing from a packed integer took two lines because
|
|
5
|
+
* there was no static. This is that static, as a free function.
|
|
6
|
+
*
|
|
7
|
+
* Values outside `[0, 0xFFFFFF]` throw rather than being truncated — see {@link int_to_rgb}.
|
|
8
|
+
*
|
|
9
|
+
* @param {number} value 24-bit `0xRRGGBB`
|
|
10
|
+
* @param {Color} [output]
|
|
11
|
+
* @returns {Color} `output`
|
|
12
|
+
* @throws Error if `value` is not an integer in `[0, 0xFFFFFF]`
|
|
13
|
+
*
|
|
14
|
+
* @author Alex Goldring
|
|
15
|
+
* @copyright Company Named Limited (c) 2026
|
|
16
|
+
*/
|
|
17
|
+
export function color_from_uint24(value: number, output?: Color): Color;
|
|
18
|
+
import { Color } from "../Color.js";
|
|
19
|
+
//# sourceMappingURL=color_from_uint24.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color_from_uint24.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/construct/color_from_uint24.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,yCARW,MAAM,WACN,KAAK,GACH,KAAK,CAWjB;sBAxBqB,aAAa"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { uint8_to_float } from "../../binary/uint8_to_float.js";
|
|
2
|
+
import { Color } from "../Color.js";
|
|
3
|
+
import { int_to_rgb } from "../int_to_rgb.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Build a `Color` from a packed 24-bit `0xRRGGBB` value. Alpha is set to 1.
|
|
7
|
+
*
|
|
8
|
+
* `Color.fromUint` exists as an instance method; constructing from a packed integer took two lines because
|
|
9
|
+
* there was no static. This is that static, as a free function.
|
|
10
|
+
*
|
|
11
|
+
* Values outside `[0, 0xFFFFFF]` throw rather than being truncated — see {@link int_to_rgb}.
|
|
12
|
+
*
|
|
13
|
+
* @param {number} value 24-bit `0xRRGGBB`
|
|
14
|
+
* @param {Color} [output]
|
|
15
|
+
* @returns {Color} `output`
|
|
16
|
+
* @throws Error if `value` is not an integer in `[0, 0xFFFFFF]`
|
|
17
|
+
*
|
|
18
|
+
* @author Alex Goldring
|
|
19
|
+
* @copyright Company Named Limited (c) 2026
|
|
20
|
+
*/
|
|
21
|
+
export function color_from_uint24(value, output = new Color()) {
|
|
22
|
+
|
|
23
|
+
const { r, g, b } = int_to_rgb(value);
|
|
24
|
+
|
|
25
|
+
return output.set(uint8_to_float(r), uint8_to_float(g), uint8_to_float(b), 1);
|
|
26
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build a `Color` from a packed 32-bit `0xRRGGBBAA` value.
|
|
3
|
+
*
|
|
4
|
+
* The byte order is {@link Color#toUint32}'s, which is what `serialize_scene` writes — red in the most
|
|
5
|
+
* significant byte, alpha in the least. Note that this is *not* the `0xAARRGGBB` that some tooling uses;
|
|
6
|
+
* there is no way to tell the two apart from the bits, which is why {@link parse_color} refuses 32-bit input
|
|
7
|
+
* entirely rather than guessing.
|
|
8
|
+
*
|
|
9
|
+
* @param {number} value 32-bit `0xRRGGBBAA`
|
|
10
|
+
* @param {Color} [output]
|
|
11
|
+
* @returns {Color} `output`
|
|
12
|
+
* @throws Error if `value` is not an integer in `[0, 0xFFFFFFFF]`
|
|
13
|
+
*
|
|
14
|
+
* @see Color#toUint32
|
|
15
|
+
* @author Alex Goldring
|
|
16
|
+
* @copyright Company Named Limited (c) 2026
|
|
17
|
+
*/
|
|
18
|
+
export function color_from_uint32(value: number, output?: Color): Color;
|
|
19
|
+
import { Color } from "../Color.js";
|
|
20
|
+
//# sourceMappingURL=color_from_uint32.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color_from_uint32.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/construct/color_from_uint32.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;GAgBG;AACH,yCATW,MAAM,WACN,KAAK,GACH,KAAK,CAmBjB;sBArCqB,aAAa"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { uint8_to_float } from "../../binary/uint8_to_float.js";
|
|
2
|
+
import { Color } from "../Color.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Largest value that fits in four packed bytes.
|
|
6
|
+
* @type {number}
|
|
7
|
+
*/
|
|
8
|
+
const UINT32_MAX = 0xFFFFFFFF;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Build a `Color` from a packed 32-bit `0xRRGGBBAA` value.
|
|
12
|
+
*
|
|
13
|
+
* The byte order is {@link Color#toUint32}'s, which is what `serialize_scene` writes — red in the most
|
|
14
|
+
* significant byte, alpha in the least. Note that this is *not* the `0xAARRGGBB` that some tooling uses;
|
|
15
|
+
* there is no way to tell the two apart from the bits, which is why {@link parse_color} refuses 32-bit input
|
|
16
|
+
* entirely rather than guessing.
|
|
17
|
+
*
|
|
18
|
+
* @param {number} value 32-bit `0xRRGGBBAA`
|
|
19
|
+
* @param {Color} [output]
|
|
20
|
+
* @returns {Color} `output`
|
|
21
|
+
* @throws Error if `value` is not an integer in `[0, 0xFFFFFFFF]`
|
|
22
|
+
*
|
|
23
|
+
* @see Color#toUint32
|
|
24
|
+
* @author Alex Goldring
|
|
25
|
+
* @copyright Company Named Limited (c) 2026
|
|
26
|
+
*/
|
|
27
|
+
export function color_from_uint32(value, output = new Color()) {
|
|
28
|
+
|
|
29
|
+
if (!Number.isInteger(value) || value < 0 || value > UINT32_MAX) {
|
|
30
|
+
throw new Error(`Failed to decode color '${value}', expected an integer in [0, 0xFFFFFFFF]`);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return output.set(
|
|
34
|
+
uint8_to_float((value >>> 24) & 0xFF),
|
|
35
|
+
uint8_to_float((value >>> 16) & 0xFF),
|
|
36
|
+
uint8_to_float((value >>> 8) & 0xFF),
|
|
37
|
+
uint8_to_float(value & 0xFF)
|
|
38
|
+
);
|
|
39
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build a neutral `Color` with all three channels at `value`.
|
|
3
|
+
*
|
|
4
|
+
* Space-agnostic like the class itself: a linear 0.5 and an encoded 0.5 are different greys, and this writes
|
|
5
|
+
* whichever one you hand it without comment.
|
|
6
|
+
*
|
|
7
|
+
* @param {number} value
|
|
8
|
+
* @param {number} [alpha]
|
|
9
|
+
* @param {Color} [output]
|
|
10
|
+
* @returns {Color} `output`
|
|
11
|
+
*
|
|
12
|
+
* @author Alex Goldring
|
|
13
|
+
* @copyright Company Named Limited (c) 2026
|
|
14
|
+
*/
|
|
15
|
+
export function color_gray(value: number, alpha?: number, output?: Color): Color;
|
|
16
|
+
import { Color } from "../Color.js";
|
|
17
|
+
//# sourceMappingURL=color_gray.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color_gray.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/construct/color_gray.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;GAaG;AACH,kCARW,MAAM,UACN,MAAM,WACN,KAAK,GACH,KAAK,CASjB;sBApBqB,aAAa"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { assert } from "../../assert.js";
|
|
2
|
+
import { Color } from "../Color.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Build a neutral `Color` with all three channels at `value`.
|
|
6
|
+
*
|
|
7
|
+
* Space-agnostic like the class itself: a linear 0.5 and an encoded 0.5 are different greys, and this writes
|
|
8
|
+
* whichever one you hand it without comment.
|
|
9
|
+
*
|
|
10
|
+
* @param {number} value
|
|
11
|
+
* @param {number} [alpha]
|
|
12
|
+
* @param {Color} [output]
|
|
13
|
+
* @returns {Color} `output`
|
|
14
|
+
*
|
|
15
|
+
* @author Alex Goldring
|
|
16
|
+
* @copyright Company Named Limited (c) 2026
|
|
17
|
+
*/
|
|
18
|
+
export function color_gray(value, alpha = 1, output = new Color()) {
|
|
19
|
+
assert.isNumber(value, 'value');
|
|
20
|
+
|
|
21
|
+
return output.set(value, value, value, alpha);
|
|
22
|
+
}
|
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
* @param {string} hex expect form #FFFFFF or #FFFFFFFF for RGBA
|
|
4
|
-
* @returns {{r: number, g: number, b: number, a:number}} rgb
|
|
5
|
-
*/
|
|
6
|
-
export function hex2rgb(hex: string): {
|
|
7
|
-
r: number;
|
|
8
|
-
g: number;
|
|
9
|
-
b: number;
|
|
10
|
-
a: number;
|
|
11
|
-
};
|
|
1
|
+
export { hex_to_rgb as hex2rgb } from "./hex_to_rgb.js";
|
|
12
2
|
//# sourceMappingURL=hex2rgb.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hex2rgb.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/hex/hex2rgb.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hex2rgb.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/hex/hex2rgb.js"],"names":[],"mappings":""}
|
|
@@ -1,24 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export function hex2rgb(hex) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const result = {
|
|
12
|
-
r: hex2dec(hex.slice(1, 3)),
|
|
13
|
-
g: hex2dec(hex.slice(3, 5)),
|
|
14
|
-
b: hex2dec(hex.slice(5, 7))
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
if (hex.length > 7) {
|
|
18
|
-
result.a = hex2dec(hex.slice(7, 9));
|
|
19
|
-
}else{
|
|
20
|
-
result.a = 0xFF;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
return result;
|
|
24
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Renamed to `hex_to_rgb`, following the package's `name_to_name` convention.
|
|
3
|
+
*
|
|
4
|
+
* Kept as a re-export rather than removed: this is a library, and an import path is as much a published
|
|
5
|
+
* interface as a function signature.
|
|
6
|
+
*/
|
|
7
|
+
export { hex_to_rgb as hex2rgb } from "./hex_to_rgb.js";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decode a CSS hex colour.
|
|
3
|
+
*
|
|
4
|
+
* Accepts all four CSS forms: `#RGB`, `#RGBA`, `#RRGGBB` and `#RRGGBBAA`. Anything else throws, naming the
|
|
5
|
+
* offending string — the short forms are the two most common ways to write a colour by hand, and decoding
|
|
6
|
+
* them by fixed byte offsets used to yield a `NaN` blue rather than an error.
|
|
7
|
+
*
|
|
8
|
+
* @param {string} hex `#RGB`, `#RGBA`, `#RRGGBB` or `#RRGGBBAA`
|
|
9
|
+
* @returns {{r: number, g: number, b: number, a:number}} channels in the Uint8 range (0...255)
|
|
10
|
+
* @throws Error if `hex` is not one of the four accepted forms
|
|
11
|
+
*/
|
|
12
|
+
export function hex_to_rgb(hex: string): {
|
|
13
|
+
r: number;
|
|
14
|
+
g: number;
|
|
15
|
+
b: number;
|
|
16
|
+
a: number;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=hex_to_rgb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hex_to_rgb.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/hex/hex_to_rgb.js"],"names":[],"mappings":"AA4BA;;;;;;;;;;GAUG;AACH,gCAJW,MAAM,GACJ;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAC,MAAM,CAAA;CAAC,CAyBvD"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { hex2dec } from "../../binary/hex2dec.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The four CSS hex forms, and nothing else.
|
|
5
|
+
*
|
|
6
|
+
* Validating up front rather than letting {@link hex2dec} run on a bad slice: `parseInt` returns `NaN` for
|
|
7
|
+
* an out-of-range slice, and a `NaN` channel only surfaces several frames later, inside whichever consumer
|
|
8
|
+
* happens to assert. Worse, that consumer's guard is an `assert`, so a build with asserts stripped
|
|
9
|
+
* propagates the `NaN` instead of throwing.
|
|
10
|
+
*
|
|
11
|
+
* @type {RegExp}
|
|
12
|
+
*/
|
|
13
|
+
const HEX_COLOR = /^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Expand a single hex nibble to a byte, the way CSS does: `f` → `ff`, `3` → `33`.
|
|
17
|
+
*
|
|
18
|
+
* Duplicating the nibble rather than shifting it keeps the endpoints exact — `f` must land on 255, not 240.
|
|
19
|
+
*
|
|
20
|
+
* @param {string} nibble
|
|
21
|
+
* @returns {number}
|
|
22
|
+
*/
|
|
23
|
+
function expand_nibble(nibble) {
|
|
24
|
+
const v = hex2dec(nibble);
|
|
25
|
+
|
|
26
|
+
return v * 0x11;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Decode a CSS hex colour.
|
|
31
|
+
*
|
|
32
|
+
* Accepts all four CSS forms: `#RGB`, `#RGBA`, `#RRGGBB` and `#RRGGBBAA`. Anything else throws, naming the
|
|
33
|
+
* offending string — the short forms are the two most common ways to write a colour by hand, and decoding
|
|
34
|
+
* them by fixed byte offsets used to yield a `NaN` blue rather than an error.
|
|
35
|
+
*
|
|
36
|
+
* @param {string} hex `#RGB`, `#RGBA`, `#RRGGBB` or `#RRGGBBAA`
|
|
37
|
+
* @returns {{r: number, g: number, b: number, a:number}} channels in the Uint8 range (0...255)
|
|
38
|
+
* @throws Error if `hex` is not one of the four accepted forms
|
|
39
|
+
*/
|
|
40
|
+
export function hex_to_rgb(hex) {
|
|
41
|
+
|
|
42
|
+
if (typeof hex !== "string" || !HEX_COLOR.test(hex)) {
|
|
43
|
+
throw new Error(`Failed to decode hex color '${hex}', expected #RGB, #RGBA, #RRGGBB or #RRGGBBAA`);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (hex.length <= 5) {
|
|
47
|
+
// short form, one nibble per channel
|
|
48
|
+
return {
|
|
49
|
+
r: expand_nibble(hex.charAt(1)),
|
|
50
|
+
g: expand_nibble(hex.charAt(2)),
|
|
51
|
+
b: expand_nibble(hex.charAt(3)),
|
|
52
|
+
a: hex.length === 5 ? expand_nibble(hex.charAt(4)) : 0xFF
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return {
|
|
57
|
+
r: hex2dec(hex.slice(1, 3)),
|
|
58
|
+
g: hex2dec(hex.slice(3, 5)),
|
|
59
|
+
b: hex2dec(hex.slice(5, 7)),
|
|
60
|
+
a: hex.length === 9 ? hex2dec(hex.slice(7, 9)) : 0xFF
|
|
61
|
+
};
|
|
62
|
+
}
|
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Takes values in 0..255 range
|
|
3
|
-
* @param {number} r
|
|
4
|
-
* @param {number} g
|
|
5
|
-
* @param {number} b
|
|
6
|
-
* @returns {string}
|
|
7
|
-
*/
|
|
8
|
-
export function rgb2hex(r: number, g: number, b: number): string;
|
|
1
|
+
export { rgb_to_hex as rgb2hex } from "./rgb_to_hex.js";
|
|
9
2
|
//# sourceMappingURL=rgb2hex.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rgb2hex.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/hex/rgb2hex.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rgb2hex.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/hex/rgb2hex.js"],"names":[],"mappings":""}
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* @returns {string}
|
|
9
|
-
*/
|
|
10
|
-
export function rgb2hex(r, g, b) {
|
|
11
|
-
|
|
12
|
-
return dec2hex(r) + dec2hex(g) + dec2hex(b);
|
|
13
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Renamed to `rgb_to_hex`, following the package's `name_to_name` convention.
|
|
3
|
+
*
|
|
4
|
+
* Kept as a re-export rather than removed: this is a library, and an import path is as much a published
|
|
5
|
+
* interface as a function signature.
|
|
6
|
+
*/
|
|
7
|
+
export { rgb_to_hex as rgb2hex } from "./rgb_to_hex.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rgb_to_hex.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/hex/rgb_to_hex.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,8BALW,MAAM,KACN,MAAM,KACN,MAAM,GACJ,MAAM,CAKlB"}
|