suica/jxl/color does not have a README file

    ColourEncoding

    Color encoding, either represented by enum values, or a signal of existence of ICC profile.

    ColourSpace

    Color space type.

    Customxy

    using @suica/jxl/image { type Customxy }

    Custom xy-chromaticity coordinate.

    Coordinate values are scaled by 1e6 (1_000_000).

    EnumColourEncoding

    "Enum color encoding" represented by JPEG XL enum values.

    OpsinInverseMatrix

    Opsin inverse metadata.

    Primaries

    RGB primaries.

    RenderingIntent

    Rendering intent, defined by ICC specification.

    ToneMapping

    HDR tone mapping metadata.

    TransferFunction

    Transfer function (tone curve).

    WhitePoint

    White point.

    AsIlluminant

    pub(open) trait AsIlluminant {
    fn as_illuminant(Self) -> FixedArray[Float]
    }

    Types that represent an illuminant (white point) as xy-chromaticity.

    AsPrimaries

    pub(open) trait AsPrimaries {
    fn as_primaries(Self) -> FixedArray[FixedArray[Float]]
    }

    Types that represent RGB primaries as xy-chromaticity ([[x, y]; 3]).

    ColorManagementSystem

    pub(open) trait ColorManagementSystem {
    fn prepare_transform(Self, from_icc : Bytes, to_icc : Bytes, intent :
    RenderingIntent
    ) -> &PreparedTransform raise
    JxlError

    fn supports_linear_tf(Self) -> Bool = _
    }

    Color management system that handles ICCv4 profiles.

    Implementations report failures by raising @bitstream.JxlError (preferably Color("CmsFailure: <details>")).

    PreparedTransform

    pub(open) trait PreparedTransform {
    fn num_input_channels(Self) -> Int
    fn num_output_channels(Self) -> Int
    fn transform(Self, channels : Array[FixedArray[Float]], start : Int, len : Int) -> Unit raise
    JxlError

    }

    Prepared transformation created by [ColorManagementSystem].

    Prepared transformations may be cached by the decoder.

    ColorEncodingWithProfile

    pub struct ColorEncodingWithProfile {
    // private fields
    }

    Color encoding represented by either enum values or an ICC profile.

    ColorEncodingWithProfile::encoding

    Returns the color encoding representation.

    ColorEncodingWithProfile::icc_profile

    fn ColorEncodingWithProfile::icc_profile(self : ColorEncodingWithProfile) -> Bytes

    Returns the associated ICC profile.

    ColorEncodingWithProfile::is_cmyk

    Returns whether the color encoding represents CMYK color space.

    ColorEncodingWithProfile::is_grayscale

    fn ColorEncodingWithProfile::is_grayscale(self : ColorEncodingWithProfile) -> Bool

    Returns whether the color encoding describes a grayscale color space.

    ColorEncodingWithProfile::new

    Creates a color encoding from enum values.

    ColorEncodingWithProfile::with_icc

    Creates a color encoding from ICC profile.

    Raises an error if it cannot parse the ICC profile.

    ColorTransform

    pub struct ColorTransform {
    // private fields
    }

    Color transformation from a color encoding to another.

    ColorTransform::builder

    Creates a new ColorTransform builder.

    ColorTransform::input_channels

    fn ColorTransform::input_channels(self : ColorTransform) -> Int

    ColorTransform::is_noop

    fn ColorTransform::is_noop(self : ColorTransform) -> Bool

    ColorTransform::new

    Prepares a color transformation.

    Raises an error if it cannot prepare such color transformation.

    ColorTransform::output_channels

    fn ColorTransform::output_channels(self : ColorTransform) -> Int

    ColorTransform::run

    fn ColorTransform::run(self : ColorTransform, channels : Array[FixedArray[Float]], start? : Int, len? : Int) -> Int raise
    JxlError

    Performs the prepared color transformation on the samples.

    Returns the number of final channels after transformation.

    channels are planar sample data, all having the same length; samples start..start + len (the whole buffers by default) are transformed.

    Raises an error if it encountered ICC to ICC operation and the provided CMS cannot handle it.

    ColorTransform::run_with_threads

    fn ColorTransform::run_with_threads(self : ColorTransform, channels : Array[FixedArray[Float]]) -> Int raise
    JxlError

    Performs the prepared color transformation on the samples, in chunks of 65536 samples (jxl-oxide runs the chunks on a thread pool; here they run sequentially). Peak detection of tone mapping operates per chunk.

    Returns the number of final channels after transformation.

    ColorTransform::xyb_to_enum

    Prepares a color transformation from XYB color encoding.

    Raises an error if it cannot prepare such color transformation.

    ColorTransformBuilder

    pub struct ColorTransformBuilder {
    // private fields
    }

    ColorTransformBuilder::default

    ColorTransformBuilder::from_pq

    ColorTransformBuilder::new

    Creates a new ColorTransform builder.

    ColorTransformBuilder::set_detect_peak

    fn ColorTransformBuilder::set_detect_peak(self : ColorTransformBuilder, value : Bool) -> ColorTransformBuilder

    ColorTransformBuilder::set_srgb_icc

    fn ColorTransformBuilder::set_srgb_icc(self : ColorTransformBuilder, value : Bool) -> ColorTransformBuilder

    ColorTransformOp

    type ColorTransformOp

    IccHeader

    pub(all) struct IccHeader {
    color_space : Bytes
    rendering_intent :
    RenderingIntent

    }

    IccProfileInfo

    pub struct IccProfileInfo {
    // private fields
    } derive(
    Debug
    )

    IccProfileInfo::is_cmyk

    fn IccProfileInfo::is_cmyk(self : IccProfileInfo) -> Bool

    IccProfileInfo::is_grayscale

    fn IccProfileInfo::is_grayscale(self : IccProfileInfo) -> Bool

    IccProfileInfo::is_rgb

    fn IccProfileInfo::is_rgb(self : IccProfileInfo) -> Bool

    IccProfileInfo::primaries

    IccProfileInfo::rendering_intent

    IccProfileInfo::white_point

    NullCms

    pub(all) struct NullCms {
    } derive(
    Debug
    )

    "Null" color management system that fails on every operation.

    adapt_mat

    fn[F : AsIlluminant, T : AsIlluminant] adapt_mat(from_illuminant : F, to_illuminant : T) -> FixedArray[Float]

    apply_gamma

    fn apply_gamma(samples : FixedArray[Float], gamma : Float, start? : Int, len? : Int) -> Unit

    Applies gamma to samples.

    bt709_to_linear

    fn bt709_to_linear(samples : FixedArray[Float], start? : Int, len? : Int) -> Unit

    Converts samples in BT.709 transfer curve to linear.

    colour_encoding_to_icc

    fn colour_encoding_to_icc(colour_encoding :
    EnumColourEncoding
    ) -> Bytes

    Creates an ICCv4 profile from the given EnumColourEncoding.

    decode_icc

    fn decode_icc(stream : Bytes) -> Bytes raise
    JxlError

    Decodes the given ICC profile stream.

    detect_profile_info

    fn detect_profile_info(profile : Bytes) -> IccProfileInfo raise
    JxlError

    fast_powf_generic

    fn fast_powf_generic(base : Float, exp : Float) -> Float

    Approximates base.powf(exp) (libjxl FastPowf).

    hlg_inverse_oo

    fn hlg_inverse_oo(samples_r : FixedArray[Float], samples_g : FixedArray[Float], samples_b : FixedArray[Float], luminances : FixedArray[Float], intensity_target : Float, start? : Int, len? : Int) -> Unit

    Converts the display-referred samples to scene-referred signals using the hybrid log-gamma transfer function (HLG inverse OOTF).

    hlg_oo

    fn hlg_oo(samples_r : FixedArray[Float], samples_g : FixedArray[Float], samples_b : FixedArray[Float], luminances : FixedArray[Float], intensity_target : Float, start? : Int, len? : Int) -> Unit

    Converts scene luminance values to display luminance values using the hybrid log-gamma transfer function (HLG OOTF).

    hlg_table

    fn hlg_table(n : Int) -> Array[Int]

    Lookup table of the HLG inverse OETF with n entries, scaled to 0..=65535 (used for ICC profile synthesis).

    hlg_to_linear

    fn hlg_to_linear(samples : FixedArray[Float], start? : Int, len? : Int) -> Unit

    HLG inverse OETF, maps non-linear HLG signal to scene-referred linear sample.

    icc_tf

    illuminant_d50

    let illuminant_d50 : FixedArray[Float]

    CIE illuminant D50.

    xy-chromaticity value is computed so that the resulting chad tag matches that of libjxl.

    illuminant_d65

    let illuminant_d65 : FixedArray[Float]

    CIE illuminant D65.

    This is the white point mainly used in the sRGB colorspace.

    illuminant_dci

    let illuminant_dci : FixedArray[Float]

    DCI-P3 illuminant.

    illuminant_e

    let illuminant_e : FixedArray[Float]

    CIE illuminant E (equal-energy).

    illuminant_to_xyz

    fn[I : AsIlluminant] illuminant_to_xyz(illuminant : I) -> FixedArray[Float]

    linear_to_bt709

    fn linear_to_bt709(samples : FixedArray[Float], start? : Int, len? : Int) -> Unit

    Converts the linear samples with the BT.709 transfer curve.

    linear_to_hlg

    fn linear_to_hlg(samples : FixedArray[Float], start? : Int, len? : Int) -> Unit

    Converts the scene-referred linear samples with the hybrid log-gamma transfer function.

    linear_to_pq

    fn linear_to_pq(samples : FixedArray[Float], intensity_target : Float, start? : Int, len? : Int) -> Unit

    Converts the linear samples with the PQ transfer function, where linear sample value of 1.0 represents intensity_target nits (PQ inverse EOTF).

    linear_to_srgb

    fn linear_to_srgb(samples : FixedArray[Float], start? : Int, len? : Int) -> Unit

    Converts the linear samples with the sRGB transfer curve.

    Fast linear to sRGB conversion, ported from libjxl.

    matinv

    fn matinv(mat : FixedArray[Float]) -> FixedArray[Float]

    matmul3

    fn matmul3(a : FixedArray[Float], b : FixedArray[Float]) -> FixedArray[Float]

    matmul3vec

    fn matmul3vec(a : FixedArray[Float], b : FixedArray[Float]) -> FixedArray[Float]

    pq_table

    fn pq_table(n : Int) -> Array[Int]

    Lookup table of the PQ EOTF with n entries, scaled to 0..=65535 (used for ICC profile synthesis).

    pq_to_linear

    fn pq_to_linear(samples : FixedArray[Float], intensity_target : Float, start? : Int, len? : Int) -> Unit

    Converts non-linear PQ signals to linear display luminance values, where luminance value of 1.0 represents intensity_target nits (PQ EOTF).

    primaries_bt2100

    let primaries_bt2100 : FixedArray[FixedArray[Float]]

    Primaries specified in ITU-R BT.2100-2.

    primaries_p3

    let primaries_p3 : FixedArray[FixedArray[Float]]

    Primaries specified in SMPTE ST 428-1.

    primaries_srgb

    let primaries_srgb : FixedArray[FixedArray[Float]]

    Primaries used by the sRGB colorspace.

    primaries_to_xyz_mat

    fn[P : AsPrimaries, W : AsIlluminant] primaries_to_xyz_mat(primaries : P, wp : W) -> FixedArray[Float]

    read_icc

    Reads the encoded ICC profile stream from the given bitstream.

    srgb_to_linear

    fn srgb_to_linear(samples : FixedArray[Float], start? : Int, len? : Int) -> Unit

    Converts samples in sRGB transfer curve to linear. Inverse of linear_to_srgb.

    xyz_to_primaries_mat

    fn[P : AsPrimaries, W : AsIlluminant] xyz_to_primaries_mat(primaries : P, wp : W) -> FixedArray[Float]

    ycbcr_to_rgb

    fn ycbcr_to_rgb(cb : FixedArray[Float], y : FixedArray[Float], cr : FixedArray[Float], start? : Int, len? : Int) -> Unit

    Applies transform from YCbCr to RGB.

    Channels are expected to be in CbYCr order; after the call they hold R, G, B. Panics if the channel lengths differ.