suica/jxl/frame does not have a README file

    BlendMode

    pub(all) enum BlendMode {
    Replace
    Add
    Blend
    MulAdd
    Mul
    } derive(Eq,
    Debug
    )

    BlendMode::default

    fn BlendMode::default() -> BlendMode

    BlendMode::use_alpha

    fn BlendMode::use_alpha(self : BlendMode) -> Bool

    BlendingInfo

    pub(all) struct BlendingInfo {
    mode : BlendMode
    alpha_channel : Int
    clamp : Bool
    source : Int
    } derive(
    Debug
    )

    BlendingInfo::default

    fn BlendingInfo::default() -> BlendingInfo

    BlendingModeInformation

    pub(all) struct BlendingModeInformation {
    mode : PatchBlendMode
    alpha_channel : Int
    clamp : Bool
    } derive(
    Debug
    )

    EdgePreservingFilter

    pub(all) enum EdgePreservingFilter {
    Disabled
    Enabled(EpfParams)
    } derive(
    Debug
    )

    EdgePreservingFilter::default

    EdgePreservingFilter::enabled

    fn EdgePreservingFilter::enabled(self : EdgePreservingFilter) -> Bool

    Encoding

    pub(all) enum Encoding {
    VarDct
    Modular
    } derive(Eq,
    Debug
    )

    Encoding::default

    fn Encoding::default() -> Encoding

    EpfParams

    pub(all) struct EpfParams {
    iters : Int
    sharp_lut : FixedArray[Float]
    channel_scale : FixedArray[Float]
    sigma : EpfSigma
    sigma_for_modular : Float
    } derive(
    Debug
    )

    EpfParams::default

    fn EpfParams::default() -> EpfParams

    EpfSigma

    pub(all) struct EpfSigma {
    quant_mul : Float
    pass0_sigma_scale : Float
    pass2_sigma_scale : Float
    border_sad_mul : Float
    } derive(
    Debug
    )

    EpfSigma::default

    fn EpfSigma::default() -> EpfSigma

    Frame

    pub struct Frame {
    // private fields
    }

    JPEG XL frame.

    A frame represents a single unit of image that can be displayed or referenced by other frames.

    Frame::adjust_region

    fn Frame::adjust_region(self : Frame, region : (Int, Int, Int, Int)) -> (Int, Int, Int, Int)

    Adjusts the cropping region of the image to the actual decoding region of the frame.

    The cropping region of the image needs to be adjusted to be used in a frame, for a few reasons:
    • A frame may be blended to the canvas with offset, which makes the image and the frame have different coordinates.
    • Some filters reference other samples, which requires padding to the region.

    This method takes care of those and returns the adjusted region (left, top, width, height).

    Frame::alloc_tracker

    Frame::current_loading_group

    fn Frame::current_loading_group(self : Frame) -> TocGroup?

    Frame::data

    fn Frame::data(self : Frame, group : TocGroupKind) -> BytesView?

    Frame::feed_bytes

    fn Frame::feed_bytes(self : Frame, buf : BytesView) -> BytesView raise
    JxlError

    Feeds frame data; returns the bytes not consumed by this frame.

    Frame::header

    fn Frame::header(self : Frame) -> FrameHeader

    Returns the frame header.

    Frame::image_header

    Frame::is_loading_done

    fn Frame::is_loading_done(self : Frame) -> Bool

    Frame::parse

    FrameContext: the image header and an optional allocation tracker. (The thread pool of upstream is dropped; everything runs sequentially.)

    Frame::pass_group_bitstream

    fn Frame::pass_group_bitstream(self : Frame, pass_idx : Int, group_idx : Int) -> Result[PassGroupBitstream,
    JxlError
    ]?

    Frame::pass_shifts

    fn Frame::pass_shifts(self : Frame) ->
    SortedMap
    [Int, (Int, Int)]

    Frame::toc

    fn Frame::toc(self : Frame) -> Toc

    Returns the TOC.

    Frame::try_parse_hf_global

    fn Frame::try_parse_hf_global(self : Frame, cached_lf_global : LfGlobal?) -> Result[HfGlobal,
    JxlError
    ]?

    Frame::try_parse_lf_global

    fn Frame::try_parse_lf_global(self : Frame) -> Result[LfGlobal,
    JxlError
    ]?

    Frame::try_parse_lf_group

    fn Frame::try_parse_lf_group(self : Frame, lf_global_vardct : LfGlobalVarDct?, global_ma_config :
    MaConfig
    ?, mlf_group :
    TransformedModularSubimage
    ?, lf_group_idx : Int) -> Result[LfGroup,
    JxlError
    ]?

    FrameFlags

    pub(all) struct FrameFlags(UInt64) derive(Eq,
    Debug
    )

    FrameFlags::noise

    fn FrameFlags::noise(self : FrameFlags) -> Bool

    FrameFlags::patches

    fn FrameFlags::patches(self : FrameFlags) -> Bool

    FrameFlags::skip_adaptive_lf_smoothing

    fn FrameFlags::skip_adaptive_lf_smoothing(self : FrameFlags) -> Bool

    FrameFlags::splines

    fn FrameFlags::splines(self : FrameFlags) -> Bool

    FrameFlags::use_lf_frame

    fn FrameFlags::use_lf_frame(self : FrameFlags) -> Bool

    FrameHeader

    pub(all) struct FrameHeader {
    all_default : Bool
    frame_type : FrameType
    encoding : Encoding
    flags : FrameFlags
    do_ycbcr : Bool
    encoded_color_channels : Int
    jpeg_upsampling : FixedArray[Int]
    upsampling : Int
    ec_upsampling : Array[Int]
    group_size_shift : Int
    x_qm_scale : Int
    b_qm_scale : Int
    passes : Passes
    lf_level : Int
    have_crop : Bool
    x0 : Int
    y0 : Int
    width : Int
    height : Int
    blending_info : BlendingInfo
    ec_blending_info : Array[BlendingInfo]
    duration : UInt
    timecode : UInt
    is_last : Bool
    save_as_reference : Int
    resets_canvas : Bool
    save_before_ct : Bool
    name : String
    restoration_filter : RestorationFilter
    extensions :
    Extensions

    bit_depth :
    BitDepth

    } derive(
    Debug
    )

    Frame header.

    FrameHeader::can_reference

    fn FrameHeader::can_reference(self : FrameHeader) -> Bool

    FrameHeader::color_sample_height

    fn FrameHeader::color_sample_height(self : FrameHeader) -> Int

    FrameHeader::color_sample_width

    fn FrameHeader::color_sample_width(self : FrameHeader) -> Int

    FrameHeader::default

    FrameHeader::default_with_context(headers): the header of an all-default frame.

    FrameHeader::encoded_color_channels

    fn FrameHeader::encoded_color_channels(self : FrameHeader) -> Int

    Returns the number of channels actually encoded in the frame.

    FrameHeader::group_dim

    fn FrameHeader::group_dim(self : FrameHeader) -> Int

    FrameHeader::group_idx_from_coord

    fn FrameHeader::group_idx_from_coord(self : FrameHeader, x : Int, y : Int) -> Int?

    FrameHeader::group_size_for

    fn FrameHeader::group_size_for(self : FrameHeader, group_idx : Int) -> (Int, Int)

    FrameHeader::groups_per_row

    fn FrameHeader::groups_per_row(self : FrameHeader) -> Int

    FrameHeader::is_group_collides_region

    fn FrameHeader::is_group_collides_region(self : FrameHeader, group_idx : Int, region : (Int, Int, Int, Int)) -> Bool

    FrameHeader::is_keyframe

    fn FrameHeader::is_keyframe(self : FrameHeader) -> Bool

    Returns whether this frame is a keyframe that should be displayed.

    FrameHeader::is_lf_group_collides_region

    fn FrameHeader::is_lf_group_collides_region(self : FrameHeader, lf_group_idx : Int, region : (Int, Int, Int, Int)) -> Bool

    FrameHeader::lf_group_dim

    fn FrameHeader::lf_group_dim(self : FrameHeader) -> Int

    FrameHeader::lf_group_idx_from_group_idx

    fn FrameHeader::lf_group_idx_from_group_idx(self : FrameHeader, group_idx : Int) -> Int

    FrameHeader::lf_group_size_for

    fn FrameHeader::lf_group_size_for(self : FrameHeader, lf_group_idx : Int) -> (Int, Int)

    FrameHeader::lf_groups_per_row

    fn FrameHeader::lf_groups_per_row(self : FrameHeader) -> Int

    FrameHeader::num_groups

    fn FrameHeader::num_groups(self : FrameHeader) -> Int

    FrameHeader::num_lf_groups

    fn FrameHeader::num_lf_groups(self : FrameHeader) -> Int

    FrameHeader::sample_height

    fn FrameHeader::sample_height(self : FrameHeader, upsampling : Int) -> Int

    FrameHeader::sample_width

    fn FrameHeader::sample_width(self : FrameHeader, upsampling : Int) -> Int

    FrameType

    pub(all) enum FrameType {
    RegularFrame
    LfFrame
    ReferenceOnly
    SkipProgressive
    } derive(Eq,
    Debug
    )

    FrameType::default

    fn FrameType::default() -> FrameType

    FrameType::is_normal_frame

    fn FrameType::is_normal_frame(self : FrameType) -> Bool

    FrameType::is_progressive_frame

    fn FrameType::is_progressive_frame(self : FrameType) -> Bool

    Gabor

    pub(all) enum Gabor {
    Disabled
    Enabled(FixedArray[FixedArray[Float]])
    } derive(
    Debug
    )

    Gabor-like filter parameters.

    Gabor::default

    fn Gabor::default() -> Gabor

    Gabor::enabled

    fn Gabor::enabled(self : Gabor) -> Bool

    GlobalModular

    pub struct GlobalModular {
    ma_config :
    MaConfig
    ?
    modular :
    Modular

    // private fields
    }

    GlobalModular::extra_channel_from

    fn GlobalModular::extra_channel_from(self : GlobalModular) -> Int

    GlobalModular::is_partial

    fn GlobalModular::is_partial(self : GlobalModular) -> Bool

    GlobalModular::ma_config

    GlobalModular::try_clone

    fn GlobalModular::try_clone(self : GlobalModular) -> GlobalModular

    HfGlobal

    pub(all) struct HfGlobal {
    dequant_matrices :
    DequantMatrixSet

    num_hf_presets : Int
    hf_passes : Array[
    HfPass
    ]
    }

    LfGlobal

    pub(all) struct LfGlobal {
    patches : Patches?
    splines : Splines?
    noise : NoiseParameters?
    lf_dequant :
    LfChannelDequantization

    vardct : LfGlobalVarDct?
    gmodular : GlobalModular
    }

    LfGlobalParams

    pub(all) struct LfGlobalParams {
    image_header :
    ImageHeader

    frame_header : FrameHeader
    tracker :
    AllocTracker
    ?
    allow_partial : Bool
    }

    LfGlobalParams::new

    fn LfGlobalParams::new(image_header :
    ImageHeader
    , frame_header : FrameHeader, tracker :
    AllocTracker
    ?, allow_partial : Bool) -> LfGlobalParams

    LfGroup

    pub(all) struct LfGroup {
    lf_coeff :
    LfCoeff
    ?
    hf_meta :
    HfMetadata
    ?
    partial : Bool
    }

    LfGroupParams

    pub(all) struct LfGroupParams {
    frame_header : FrameHeader
    quantizer :
    Quantizer
    ?
    global_ma_config :
    MaConfig
    ?
    mlf_group :
    TransformedModularSubimage
    ?
    lf_group_idx : Int
    allow_partial : Bool
    tracker :
    AllocTracker
    ?
    }

    NoiseParameters

    pub(all) struct NoiseParameters {
    lut : FixedArray[Float]
    } derive(
    Debug
    )

    PassGroupBitstream

    pub(all) struct PassGroupBitstream {
    bitstream :
    Bitstream

    partial : Bool
    }

    PassGroupParams

    pub(all) struct PassGroupParams {
    frame_header : FrameHeader
    lf_group : LfGroup
    pass_idx : Int
    group_idx : Int
    global_ma_config :
    MaConfig
    ?
    modular :
    TransformedModularSubimage
    ?
    vardct : PassGroupParamsVardct?
    allow_partial : Bool
    tracker :
    AllocTracker
    ?
    }

    PassGroupParamsVardct

    pub(all) struct PassGroupParamsVardct {
    lf_vardct : LfGlobalVarDct
    hf_global : HfGlobal
    hf_coeff_output : FixedArray[
    SubGrid
    [Int]]
    }

    Passes

    pub(all) struct Passes {
    num_passes : Int
    num_ds : Int
    shift : Array[Int]
    downsample : Array[Int]
    last_pass : Array[Int]
    } derive(
    Debug
    )

    Passes::default

    fn Passes::default() -> Passes

    PatchBlendMode

    pub(all) enum PatchBlendMode {
    None
    Replace
    Add
    Mul
    BlendAbove
    BlendBelow
    MulAddAbove
    MulAddBelow
    } derive(Eq,
    Debug
    )

    PatchBlendMode::try_from

    PatchBlendMode::use_alpha

    fn PatchBlendMode::use_alpha(self : PatchBlendMode) -> Bool

    PatchRef

    pub(all) struct PatchRef {
    ref_idx : Int
    x0 : Int
    y0 : Int
    width : Int
    height : Int
    patch_targets : Array[PatchTarget]
    } derive(
    Debug
    )

    PatchTarget

    pub(all) struct PatchTarget {
    x : Int
    y : Int
    blending : Array[BlendingModeInformation]
    } derive(
    Debug
    )

    Patches

    pub(all) struct Patches {
    patches : Array[PatchRef]
    } derive(
    Debug
    )

    QuantSpline

    pub(all) struct QuantSpline {
    quant_points : Array[(Int64, Int64)]
    manhattan_distance : UInt64
    xyb_dct : FixedArray[FixedArray[Int]]
    sigma_dct : FixedArray[Int]
    } derive(
    Debug
    )

    Holds delta-endcoded control points coordinates (without starting point) and quantized DCT32 coefficients

    RestorationFilter

    pub(all) struct RestorationFilter {
    all_default : Bool
    gab : Gabor
    epf : EdgePreservingFilter
    extensions :
    Extensions

    } derive(
    Debug
    )

    RestorationFilter::default

    Splines

    pub(all) struct Splines {
    quant_splines : Array[QuantSpline]
    quant_adjust : Int
    } derive(
    Debug
    )

    Holds quantized splines

    Splines::estimate_area

    fn Splines::estimate_area(self : Splines, base_correlation_xb : (Float, Float)?) -> UInt64

    Estimated area covered by the splines (Splines::estimate_area).

    Toc

    pub struct Toc {
    // private fields
    }

    Table of contents of a frame.

    Frame data are organized in groups. TOC specified the size and order of each group, and it is decoded after the frame header.
    impl Show for Toc

    Toc::bookmark

    fn Toc::bookmark(self : Toc) -> Int

    Returns the offset to the beginning of the data.

    Toc::group_index_bitstream_order

    fn Toc::group_index_bitstream_order(self : Toc, kind : TocGroupKind) -> Int

    Toc::is_single_entry

    fn Toc::is_single_entry(self : Toc) -> Bool

    Returns whether the frame has only one group.

    Toc::iter_bitstream_order

    fn Toc::iter_bitstream_order(self : Toc) -> Array[TocGroup]

    Groups in bitstream order.

    Toc::total_byte_size

    fn Toc::total_byte_size(self : Toc) -> Int

    Returns the total size of the frame data in bytes.

    TocGroup

    pub(all) struct TocGroup {
    kind : TocGroupKind
    offset : Int
    size : Int
    } derive(Eq,
    Debug
    )

    Information about a group in TOC.

    TocGroupKind

    pub(all) enum TocGroupKind {
    All
    LfGlobal
    LfGroup(Int)
    HfGlobal
    GroupPass(pass_idx~ : Int, group_idx~ : Int)
    } derive(Compare, Eq, Hash,
    Debug
    )

    Kind of a TOC group. The derived ordering matches upstream's Ord: All < LfGlobal < LfGroup(idx) < HfGlobal < GroupPass(pass, group).

    decode_pass_group

    decode_pass_group_modular

    fn decode_pass_group_modular(bs :
    Bitstream
    , frame_header : FrameHeader, global_ma_config :
    MaConfig
    ?, pass_idx : Int, group_idx : Int, modular :
    TransformedModularSubimage
    , allow_partial : Bool, tracker :
    AllocTracker
    ?) -> Unit raise
    JxlError