suica/jxl/render does not have a README file

    RenderOp

    type RenderOp = (FrameRender, Region) -> FrameRender

    RenderOp<S>: renders a frame from the given state.

    EpfKernelParams

    pub(all) struct EpfKernelParams {
    iters : Int
    channel_scale : FixedArray[Float]
    pass0_sigma_scale : Float
    pass2_sigma_scale : Float
    border_sad_mul : Float
    sigma_for_modular : Float
    }

    Plain-value form of jxl_frame::filter::EpfParams used by the filter kernels (sharp_lut and quant_mul are only used when computing sigma, which happens in vardct).

    FrameDependence

    type FrameDependence

    FrameRender

    pub enum FrameRender {
    Empty
    Rendering
    InProgress(RenderCache)
    Done(ImageWithRegion)
    Blended(ImageWithRegion)
    Failed(
    JxlError
    )
    ErrTaken
    }

    Render state of a frame (jxl-render FrameRender).

    Upstream variant names, except None → Empty and Err → Failed (to not shadow Option::None/Result::Err).

    FrameRenderHandle

    pub struct FrameRenderHandle {
    frame : IndexedFrame
    image_region : Region
    render : FrameRender
    render_op : (FrameRender, Region) -> FrameRender
    refs : FixedArray[Reference?]
    }

    A handle to the render state of a frame (jxl-render FrameRenderHandle).

    Upstream protects render with a mutex and a condvar for multithreaded rendering; rendering is sequential here.

    FrameRenderHandle::from_cache

    fn FrameRenderHandle::from_cache(frame : IndexedFrame, image_region : Region, cache : RenderCache, render_op : (FrameRender, Region) -> FrameRender, refs : FixedArray[Reference?]) -> FrameRenderHandle

    FrameRenderHandle::new

    fn FrameRenderHandle::new(frame : IndexedFrame, image_region : Region, render_op : (FrameRender, Region) -> FrameRender, refs : FixedArray[Reference?]) -> FrameRenderHandle

    FrameRenderHandle::reset

    Resets the render state, returning the previous state.

    FrameRenderHandle::run

    fn FrameRenderHandle::run(self : FrameRenderHandle, image_region : Region) -> Unit

    Renders the frame if not rendered yet, ignoring errors.

    FrameRenderHandle::run_with_image

    Renders the frame if not rendered yet, and returns a handle to the rendered image.

    ImageBuffer

    pub(all) enum ImageBuffer {
    F32(
    Grid
    [Float])
    I32(
    Grid
    [Int])
    }

    A sample buffer of one channel (jxl-render ImageBuffer).

    Upstream also has an I16 variant for "narrow" (16-bit) modular buffers; modular buffers are always Int in this port, so only F32 and I32 exist.

    ImageBuffer::as_float

    fn ImageBuffer::as_float(self : ImageBuffer) ->
    Grid
    [Float]?

    ImageBuffer::cast_to_float

    Casts integer samples to float without scaling.

    ImageBuffer::convert_to_float_modular

    Converts integer modular samples to float using bit_depth.

    Upstream mutates the buffer in place; here the converted grid is returned and the caller stores F32(grid) back (see ImageWithRegion::convert_channel_to_float_modular). Returns the original grid if already float.

    ImageBuffer::convert_to_float_modular_xyb

    fn ImageBuffer::convert_to_float_modular_xyb(yxb : FixedArray[ImageBuffer], lf_dequant :
    LfChannelDequantization
    ) -> FixedArray[
    Grid
    [Float]] raise
    JxlError

    Dequantizes XYB-encoded modular channels (given in Y, X, B order) into float X, Y, B values. Returns the float grids [y, x, b] positions, which now hold X, Y, B respectively.

    ImageBuffer::float

    Returns the float grid, panicking if the buffer is not F32 (as_float().unwrap()).

    ImageBuffer::from_modular_channel

    fn ImageBuffer::from_modular_channel(g :
    Grid
    [Int]) -> ImageBuffer

    ImageBuffer::height

    fn ImageBuffer::height(self : ImageBuffer) -> Int

    ImageBuffer::try_clone

    ImageBuffer::upsample_nn

    ImageBuffer::width

    fn ImageBuffer::width(self : ImageBuffer) -> Int

    ImageBuffer::zeroed_f32

    fn ImageBuffer::zeroed_f32(width : Int, height : Int, tracker :
    AllocTracker
    ?) -> ImageBuffer raise
    JxlError

    ImageWithRegion

    pub struct ImageWithRegion {
    buffer : Array[ImageBuffer]
    regions : Array[(Region,
    ChannelShift
    )]
    color_channels : Int
    ct_done : Bool
    blend_done : Bool
    tracker :
    AllocTracker
    ?
    }

    Rendered image: one buffer per channel, each with the region (in frame coordinates) it covers and its channel shift (jxl-render ImageWithRegion).

    ImageWithRegion::alloc_tracker

    ImageWithRegion::append_channel

    fn ImageWithRegion::append_channel(self : ImageWithRegion, buffer : ImageBuffer, region : Region) -> Unit

    ImageWithRegion::append_channel_shifted

    fn ImageWithRegion::append_channel_shifted(self : ImageWithRegion, buffer : ImageBuffer, original_region : Region, shift :
    ChannelShift
    ) -> Unit

    ImageWithRegion::as_color_floats

    fn ImageWithRegion::as_color_floats(self : ImageWithRegion) -> FixedArray[
    Grid
    [Float]]

    The three color channels as float grids (panics if not converted).

    ImageWithRegion::as_color_floats_mut

    fn ImageWithRegion::as_color_floats_mut(self : ImageWithRegion) -> FixedArray[
    Grid
    [Float]]

    ImageWithRegion::blend_done

    fn ImageWithRegion::blend_done(self : ImageWithRegion) -> Bool

    ImageWithRegion::buffer

    The channel buffers. The array is shared: assigning an element replaces the channel (upstream buffer_mut).

    ImageWithRegion::buffer_mut

    ImageWithRegion::channels

    fn ImageWithRegion::channels(self : ImageWithRegion) -> Int

    ImageWithRegion::clone_gray

    ImageWithRegion::color_channels

    fn ImageWithRegion::color_channels(self : ImageWithRegion) -> Int

    ImageWithRegion::color_groups_with_group_id

    fn ImageWithRegion::color_groups_with_group_id(self : ImageWithRegion, frame_header :
    FrameHeader
    ) -> Array[(Int, FixedArray[
    SubGrid
    [Float]])]

    Splits the color channels into groups and returns each group with its group index in the frame.

    ImageWithRegion::convert_channel_to_float_modular

    fn ImageWithRegion::convert_channel_to_float_modular(self : ImageWithRegion, index : Int, bit_depth :
    BitDepth
    ) ->
    Grid
    [Float] raise
    JxlError

    Converts channel index to float with bit_depth, stores it back and returns the float grid (upstream buffer_mut()[index].convert_to_float_modular(bit_depth)).

    ImageWithRegion::convert_modular_color

    ImageWithRegion::convert_modular_xyb

    ImageWithRegion::ct_done

    fn ImageWithRegion::ct_done(self : ImageWithRegion) -> Bool

    ImageWithRegion::extend_from_gmodular

    fn ImageWithRegion::extend_from_gmodular(self : ImageWithRegion, gmodular :
    GlobalModular
    ) -> Unit

    Appends the channels of a decoded GlobalModular image.

    ImageWithRegion::fill_opaque_alpha

    ImageWithRegion::new

    fn ImageWithRegion::new(color_channels : Int, tracker :
    AllocTracker
    ?) -> ImageWithRegion

    ImageWithRegion::prepare_color_upsampling

    fn ImageWithRegion::prepare_color_upsampling(self : ImageWithRegion, frame_header :
    FrameHeader
    ) -> Unit

    ImageWithRegion::regions_and_shifts

    ImageWithRegion::remove_color_channels

    fn ImageWithRegion::remove_color_channels(self : ImageWithRegion, count : Int) -> Unit

    ImageWithRegion::replace_channel

    fn ImageWithRegion::replace_channel(self : ImageWithRegion, index : Int, buffer : ImageBuffer, region : Region) -> Unit

    ImageWithRegion::replace_channel_shifted

    fn ImageWithRegion::replace_channel_shifted(self : ImageWithRegion, index : Int, buffer : ImageBuffer, original_region : Region, shift :
    ChannelShift
    ) -> Unit

    ImageWithRegion::set_blend_done

    fn ImageWithRegion::set_blend_done(self : ImageWithRegion, blend_done : Bool) -> Unit

    ImageWithRegion::set_ct_done

    fn ImageWithRegion::set_ct_done(self : ImageWithRegion, ct_done : Bool) -> Unit

    ImageWithRegion::swap_channel_f32

    fn ImageWithRegion::swap_channel_f32(self : ImageWithRegion, index : Int, buffer :
    Grid
    [Float], region : Region) ->
    Grid
    [Float]

    Swaps the F32 buffer of channel index with buffer; returns the old buffer (upstream swaps through &mut).

    ImageWithRegion::take_buffer

    fn ImageWithRegion::take_buffer(self : ImageWithRegion) -> Array[ImageBuffer]

    ImageWithRegion::try_clone

    ImageWithRegion::upsample_jpeg

    fn ImageWithRegion::upsample_jpeg(self : ImageWithRegion, valid_region : Region, bit_depth :
    BitDepth
    ) -> Unit raise
    JxlError

    ImageWithRegion::upsample_lf

    ImageWithRegion::upsample_nonseparable

    fn ImageWithRegion::upsample_nonseparable(self : ImageWithRegion, image_header :
    ImageHeader
    , frame_header :
    FrameHeader
    , upsampled_valid_region : Region, ec_to_color_only : Bool) -> Unit raise
    JxlError

    IndexedFrame

    pub struct IndexedFrame {
    f :
    Frame

    idx : Int
    }

    Frame with its index in the image (jxl-render IndexedFrame).

    Upstream derefs to Frame; here the frame is the field f and the commonly used Frame methods are forwarded.

    IndexedFrame::alloc_tracker

    IndexedFrame::feed_bytes

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

    IndexedFrame::frame

    Returns the underlying frame (upstream Deref).

    IndexedFrame::image_header

    IndexedFrame::index

    fn IndexedFrame::index(self : IndexedFrame) -> Int

    Returns the frame index.

    IndexedFrame::is_loading_done

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

    IndexedFrame::pass_group_bitstream

    fn IndexedFrame::pass_group_bitstream(self : IndexedFrame, pass_idx : Int, group_idx : Int) ->
    PassGroupBitstream
    ? raise
    JxlError

    IndexedFrame::pass_shifts

    IndexedFrame::try_parse_hf_global

    IndexedFrame::try_parse_lf_global

    PaddedGrid

    pub struct PaddedGrid[S] {
    grid :
    Grid
    [S]
    padding : Int
    }

    A grid with padding samples of padding on each side.

    PaddedGrid::buf_padded

    fn[S] PaddedGrid::buf_padded(self : PaddedGrid[S]) -> FixedArray[S]

    PaddedGrid::buf_padded_mut

    fn[S] PaddedGrid::buf_padded_mut(self : PaddedGrid[S]) -> FixedArray[S]

    PaddedGrid::mirror_edges_padding

    fn[S] PaddedGrid::mirror_edges_padding(self : PaddedGrid[S]) -> Unit

    PaddedGrid::with_alloc_tracker

    fn[S] PaddedGrid::with_alloc_tracker(width : Int, height : Int, padding : Int, init : S, tracker :
    AllocTracker
    ?) -> PaddedGrid[S] raise
    JxlError

    Reference

    pub struct Reference {
    frame : IndexedFrame
    image : FrameRenderHandle
    }

    ReferenceFrames

    pub struct ReferenceFrames {
    lf : Reference?
    refs : FixedArray[Reference?]
    }

    LF frame and reference frames a frame depends on.

    Region

    pub(all) struct Region {
    left : Int
    top : Int
    width : Int
    height : Int
    } derive(Default, Eq, Hash,
    Debug
    )

    A rectangular region (jxl-render Region).

    left/top are signed (i32 upstream); width/height are u32 upstream and are kept non-negative here.

    Region::apply_orientation

    fn Region::apply_orientation(self : Region, image_header :
    ImageHeader
    ) -> Region

    Region::bottom

    fn Region::bottom(self : Region) -> Int

    Region::container_aligned

    fn Region::container_aligned(self : Region, grid_dim : Int) -> Region

    Aligns the region to a multiple of grid_dim (a power of two).

    Region::contains

    fn Region::contains(self : Region, target : Region) -> Bool

    Region::downsample

    fn Region::downsample(self : Region, factor : Int) -> Region

    Region::downsample_separate

    fn Region::downsample_separate(self : Region, factor_x : Int, factor_y : Int) -> Region

    Region::downsample_with_shift

    fn Region::downsample_with_shift(self : Region, shift :
    ChannelShift
    ) -> Region

    Region::empty

    fn Region::empty() -> Region

    Region::intersection

    fn Region::intersection(self : Region, rhs : Region) -> Region

    Region::is_empty

    fn Region::is_empty(self : Region) -> Bool

    Region::merge

    fn Region::merge(self : Region, other : Region) -> Region

    Region::pad

    fn Region::pad(self : Region, size : Int) -> Region

    Region::right

    fn Region::right(self : Region) -> Int

    Region::translate

    fn Region::translate(self : Region, x : Int, y : Int) -> Region

    Region::upsample

    fn Region::upsample(self : Region, factor : Int) -> Region

    Region::upsample_separate

    fn Region::upsample_separate(self : Region, factor_x : Int, factor_y : Int) -> Region

    Region::with_size

    fn Region::with_size(width : Int, height : Int) -> Region

    RenderCache

    pub struct RenderCache {
    lf_global :
    LfGlobal
    ?
    hf_global :
    HfGlobal
    ?
    lf_groups : Map[Int,
    LfGroup
    ]
    }

    Render cache of a frame being rendered (jxl-render RenderCache): parsed LfGlobal, HfGlobal and LF groups, kept so that progressive rendering does not reparse them.

    RenderCache::new

    fn RenderCache::new(_frame : IndexedFrame) -> RenderCache

    RenderContext

    pub struct RenderContext {
    image_header :
    ImageHeader

    tracker :
    AllocTracker
    ?
    frames : Array[IndexedFrame]
    renders_wide : Array[FrameRenderHandle]
    keyframes : Array[Int]
    keyframe_in_progress : Int?
    refcounts : Array[Int]
    frame_deps : Array[FrameDependence]
    lf_frame : FixedArray[Int]
    reference : FixedArray[Int]
    loading_frame : IndexedFrame?
    loading_render_cache_wide : RenderCache?
    loading_region : Region?
    requested_image_region : Region
    embedded_icc : Bytes
    requested_color_encoding :
    ColorEncodingWithProfile

    cms : &
    ColorManagementSystem

    cached_transform :
    ColorTransform
    ?
    force_wide_buffers : Bool
    }

    Render context that tracks loaded and rendered frames.

    RenderContext::alloc_tracker

    RenderContext::builder

    RenderContext::current_loading_frame

    fn RenderContext::current_loading_frame(self : RenderContext) -> IndexedFrame?

    RenderContext::embedded_icc

    fn RenderContext::embedded_icc(self : RenderContext) -> Bytes?

    RenderContext::finalize_current_frame

    fn RenderContext::finalize_current_frame(self : RenderContext) -> Unit

    RenderContext::frame

    fn RenderContext::frame(self : RenderContext, frame_idx : Int) -> IndexedFrame?

    RenderContext::height

    fn RenderContext::height(self : RenderContext) -> Int

    Returns the image height.

    RenderContext::image_region

    fn RenderContext::image_region(self : RenderContext) -> Region

    RenderContext::keyframe

    fn RenderContext::keyframe(self : RenderContext, keyframe_idx : Int) -> IndexedFrame?

    Returns the frame with the keyframe index, or None if the keyframe does not exist.

    RenderContext::load_frame_header

    Loads a frame header from bitstream and starts loading the frame.

    On error the bitstream position is unchanged.

    RenderContext::loaded_frames

    fn RenderContext::loaded_frames(self : RenderContext) -> Int

    Returns the number of loaded frames in the context, including frames that are not shown directly.

    RenderContext::loaded_keyframes

    fn RenderContext::loaded_keyframes(self : RenderContext) -> Int

    Returns the number of loaded keyframes in the context.

    RenderContext::render

    Renders the first keyframe.

    The keyframe should be loaded in prior to rendering, with one of the loading methods.

    RenderContext::render_keyframe

    fn RenderContext::render_keyframe(self : RenderContext, keyframe_idx : Int) -> ImageWithRegion raise
    JxlError

    Renders the keyframe.

    The keyframe should be loaded in prior to rendering, with one of the loading methods.

    RenderContext::render_loading_keyframe

    Renders the keyframe currently being loaded, or the last keyframe in progress.

    RenderContext::request_color_encoding

    RenderContext::request_image_region

    fn RenderContext::request_image_region(self : RenderContext, image_region : Region) -> Unit

    RenderContext::requested_color_encoding

    RenderContext::reset_cache

    fn RenderContext::reset_cache(self : RenderContext) -> Unit

    RenderContext::set_cms

    RenderContext::suggested_hdr_tf

    RenderContext::width

    fn RenderContext::width(self : RenderContext) -> Int

    Returns the image width.

    RenderContextBuilder

    pub struct RenderContextBuilder {
    embedded_icc : Bytes
    tracker :
    AllocTracker
    ?
    force_wide_buffers : Bool
    }

    RenderContextBuilder::alloc_tracker

    RenderContextBuilder::default

    RenderContextBuilder::embedded_icc

    fn RenderContextBuilder::embedded_icc(self : RenderContextBuilder, icc : Bytes) -> RenderContextBuilder

    RenderContextBuilder::force_wide_buffers

    fn RenderContextBuilder::force_wide_buffers(self : RenderContextBuilder, force_wide_buffers : Bool) -> RenderContextBuilder

    Kept for API parity; buffers are always wide (32-bit) in this port.

    RenderedImage

    pub struct RenderedImage {
    image : FrameRenderHandle
    }

    A rendered (but possibly not yet blended) frame (jxl-render RenderedImage).

    RenderedImage::blend

    fn RenderedImage::blend(self : RenderedImage, oriented_image_region : Region?) -> ImageWithRegion raise
    JxlError

    Composites the rendered frame onto its references, caching the result.

    RenderedImage::new

    RenderedImage::try_take_blended

    fn RenderedImage::try_take_blended(_self : RenderedImage) -> ImageWithRegion?

    Upstream takes the blended image out of the handle when no one else holds it (Arc::into_inner). The call sites always hold another reference, so it never succeeds; without reference counting this always returns None.

    adaptive_lf_smoothing

    Adaptive LF smoothing of the dequantized LF image.

    apply_epf

    fn apply_epf(fb_image : ImageWithRegion, fb_scratch_arr : FixedArray[
    Grid
    [Float]], color_padded_region : Region, lf_groups : Map[Int,
    LfGroup
    ], frame_header :
    FrameHeader
    , epf_params :
    EpfParams
    ) -> Unit

    Edge-preserving filter on the color channels of fb.

    apply_epf_grids

    fn apply_epf_grids(fb : Array[
    SubGrid
    [Float]], fb_scratch_arr : Array[
    Grid
    [Float]], region_left : Int, region_top : Int, region_width : Int, region_height : Int, group_dim : Int, lf_groups_per_row : Int, sigma_grid_map : Array[
    Grid
    [Float]?], epf_params : EpfKernelParams) -> Bool

    Runs every EPF pass on the colour views fb (already cut to color_padded_region), using fb_scratch_arr (same sizes) as the second buffer. Returns true when the final result is in fb_scratch_arr (iters is 1 or 3), which upstream then puts into the image with replace_channel; otherwise the result is in fb.

    region_left/region_top/region_width/region_height describe color_padded_region; sigma_grid_map[lf_group_idx] is the hf_meta.epf_sigma grid of the LF group, if any.

    apply_gabor_like

    fn apply_gabor_like(fb : ImageWithRegion, color_padded_region : Region, fb_scratch : FixedArray[
    Grid
    [Float]], weights : FixedArray[FixedArray[Float]]) -> Unit

    Gabor-like filter on the color channels of fb within color_padded_region. The filtered channels are swapped into fb, and the previous buffers end up in fb_scratch.

    apply_gabor_like_grids

    fn apply_gabor_like_grids(fb : Array[
    SubGrid
    [Float]], fb_scratch : Array[
    Grid
    [Float]], weights : FixedArray[FixedArray[Float]]) -> Unit

    Runs Gaborish on the three colour channels fb (views of the padded colour region), writing the results into fb_scratch, which must have the same sizes as the views (filter/impls/generic.rs apply_gabor_like).

    weights[c] is [w0, w1] of channel c.

    apply_jpeg_upsampling_single

    JPEG-style chroma upsampling of one channel.

    apply_jpeg_upsampling_single_raw

    fn apply_jpeg_upsampling_single_raw(grid :
    SubGrid
    [Float], hshift : Int, vshift : Int, target_width : Int, target_height : Int, tracker :
    AllocTracker
    ?) ->
    Grid
    [Float] raise
    JxlError

    apply_jpeg_upsampling_single on plain values: hshift/vshift are the channel's ChannelShift::hshift()/vshift(), and target_width / target_height the size of target_region.

    apply_orientation_to_image_region

    fn apply_orientation_to_image_region(image_header :
    ImageHeader
    , image_region : Region) -> Region

    compute_modular_region

    fn compute_modular_region(frame_header :
    FrameHeader
    , gmodular :
    GlobalModular
    , region : Region, is_lf : Bool) -> Region

    convert_color_for_record

    fn convert_color_for_record(image_header :
    ImageHeader
    , do_ycbcr : Bool, fb : ImageWithRegion) -> Unit raise
    JxlError

    Converts the color channels for recording as a reference (save_before_ct = false): YCbCr → RGB, or XYB → the signalled enum color encoding.

    copy_lf_dequant

    fn copy_lf_dequant(grid :
    SubGrid
    [Float], quantizer :
    Quantizer
    , m_lf : Float, channel_data :
    Grid
    [Int], extra_precision : Int) -> Unit

    Dequantizes LF coefficients of one channel into grid.

    epf_step

    fn epf_step(step : Int, input : Array[
    SubGrid
    [Float]], output : Array[
    SubGrid
    [Float]], left : Int, top : Int, width : Int, height : Int, group_dim : Int, lf_groups_per_row : Int, sigma_grid_map : Array[
    Grid
    [Float]?], epf_params : EpfKernelParams) -> Unit

    One EPF pass (impls::epf::<STEP> → run_epf_rows → epf_row::<STEP>), reading input and writing output.

    failed_reference

    fn failed_reference() ->
    JxlError

    image_region_to_frame

    fn image_region_to_frame(frame : IndexedFrame, image_region : Region, ignore_lf_level : Bool) -> Region

    Converts a region in the image to the corresponding region in frame.

    incomplete_frame

    fn incomplete_frame() ->
    JxlError

    invalid_reference

    fn invalid_reference(idx : Int) ->
    JxlError

    is_incomplete_frame

    fn is_incomplete_frame(e :
    JxlError
    ) -> Bool

    Whether e is jxl-render's Error::IncompleteFrame.

    load_lf_groups

    Loads LF groups intersecting lf_region into lf_groups, and returns dequantized LF images for VarDCT frames without an LF frame.

    mirror

    fn mirror(offset : Int, len : Int) -> Int

    Mirrors offset into 0..len.

    pad_color_region

    fn pad_color_region(image_header :
    ImageHeader
    , frame_header :
    FrameHeader
    , frame_region : Region) -> Region

    pad_lf_region

    fn pad_lf_region(frame_header :
    FrameHeader
    , frame_region : Region) -> Region

    pad_upsampling

    fn pad_upsampling(image_header :
    ImageHeader
    , frame_header :
    FrameHeader
    , frame_region : Region) -> Region

    patch

    Renders a patch onto base_grid.

    render_modular

    fn render_modular(frame : IndexedFrame, cache : RenderCache, region : Region) -> ImageWithRegion raise
    JxlError

    Renders a Modular frame into an image with integer (or, for XYB images, dequantized float) channels.

    render_noise

    fn render_noise(header :
    FrameHeader
    , visible_frames_num : Int, invisible_frames_num : Int, base_correlations_xb : (Float, Float)?, grid : ImageWithRegion, params :
    NoiseParameters
    ) -> Unit raise
    JxlError

    Renders noise onto the color channels of grid.

    render_noise_raw

    fn render_noise_raw(frame_width : Int, frame_height : Int, group_dim : Int, visible_frames_num : Int, invisible_frames_num : Int, base_correlations_xb : (Float, Float)?, grid_x :
    Grid
    [Float], grid_y :
    Grid
    [Float], grid_b :
    Grid
    [Float], left : Int, top : Int, width : Int, height : Int, lut : FixedArray[Float], tracker :
    AllocTracker
    ?) -> Unit raise
    JxlError

    render_noise on plain values.

    • frame_width/frame_height/group_dim: from the frame header (the dimensions after upsampling, see init_noise).
    • grid_x/grid_y/grid_b: the colour channels of the image, whose sample (0, 0) is frame pixel (left, top).
    • left/top/width/height: actual_region, i.e. the image region intersected with the frame and downsampled with the channel shift.
    • lut: NoiseParameters::lut (8 values).

    render_spline

    fn render_spline(frame_header :
    FrameHeader
    , base_grid : ImageWithRegion, splines :
    Splines
    , base_correlations_xb : (Float, Float)?) -> Unit raise
    JxlError

    Renders splines onto the color channels of base_grid.

    render_spline_raw

    fn render_spline_raw(frame_width : Int, frame_height : Int, channels : Array[
    Grid
    [Float]], region_left : Int, region_top : Int, quant_points : Array[(Int64, Int64)], quant_xyb_dct : FixedArray[FixedArray[Int]], quant_sigma_dct : FixedArray[Int], quant_adjust : Int, base_correlations_xb : (Float, Float)?) -> Unit

    Renders one spline (render_spline for one element of splines.quant_splines) onto the colour channels channels, whose sample (0, 0) is frame pixel (region_left, region_top).

    quant_points, quant_xyb_dct and quant_sigma_dct are the fields of QuantSpline; quant_adjust is Splines::quant_adjust.

    render_spot_color

    fn render_spot_color(color_channels : FixedArray[
    Grid
    [Float]], ec_grid :
    Grid
    [Float], ec_ty :
    ExtraChannelType
    ) -> Unit raise
    JxlError

    Renders a spot color channel onto color_channels.

    render_spot_color_raw

    fn render_spot_color_raw(color_channels : Array[
    Grid
    [Float]], ec_grid :
    Grid
    [Float], red : Float, green : Float, blue : Float, solidity : Float) -> Unit

    Renders a spot colour channel onto color_channels (render_spot_color with the fields of ExtraChannelType::SpotColour given as values).

    uninitialized_lf_frame

    fn uninitialized_lf_frame(lf_level : Int) ->
    JxlError

    upsample

    Non-separable upsampling by 1 << factor; out_region is upsampled by factor.

    upsample_raw

    fn upsample_raw(grid :
    SubGrid
    [Float], up2_weight : FixedArray[Float], up4_weight : FixedArray[Float], up8_weight : FixedArray[Float], factor : Int, tracker :
    AllocTracker
    ?) ->
    Grid
    [Float]? raise
    JxlError

    upsample on plain values: up2_weight (15), up4_weight (55) and up8_weight (210) are ImageMetadata's custom weights; factor is the log2 upsampling factor. Returns None when factor == 0. The caller upsamples its region by factor (out_region.upsample(factor)).