suica/jxl/grid does not have a README file

    AllocTracker

    pub struct AllocTracker {
    bytes_left : Int64
    }

    Tracks the bytes of sample buffers allocated, to fail decoding of images that would use too much memory (jxl-grid AllocTracker). Shared by reference: copies of the value share the counter.

    AllocTracker::alloc

    fn AllocTracker::alloc(self : AllocTracker, count : Int, elem_size : Int) -> Unit raise
    JxlError

    Reserves count elements of elem_size bytes, raising OutOfMemory.

    AllocTracker::free

    fn AllocTracker::free(self : AllocTracker, count : Int, elem_size : Int) -> Unit

    Returns count * elem_size bytes to the tracker.

    AllocTracker::with_limit

    fn AllocTracker::with_limit(bytes : Int64) -> AllocTracker

    Grid

    pub struct Grid[T] {
    width : Int
    height : Int
    buf : FixedArray[T]
    }

    A row-major 2D buffer (jxl-grid AlignedGrid); stride is the width.

    Grid::as_subgrid

    fn[T] Grid::as_subgrid(self : Grid[T]) -> SubGrid[T]

    Grid::buf

    fn[T] Grid::buf(self : Grid[T]) -> FixedArray[T]

    Grid::clone

    fn[T] Grid::clone(self : Grid[T]) -> Grid[T]

    Grid::empty

    fn[T] Grid::empty(init : T) -> Grid[T]

    Grid::from_buf

    fn[T] Grid::from_buf(width : Int, height : Int, buf : FixedArray[T]) -> Grid[T]

    Grid::get

    fn[T] Grid::get(self : Grid[T], x : Int, y : Int) -> T

    Grid::height

    fn[T] Grid::height(self : Grid[T]) -> Int

    Grid::new

    fn[T] Grid::new(width : Int, height : Int, init : T) -> Grid[T]

    Grid::row_offset

    fn[T] Grid::row_offset(self : Grid[T], row : Int) -> Int

    Index of the first sample of row in buf.

    Grid::set

    fn[T] Grid::set(self : Grid[T], x : Int, y : Int, v : T) -> Unit

    Grid::width

    fn[T] Grid::width(self : Grid[T]) -> Int

    Grid::with_alloc_tracker

    fn[T] Grid::with_alloc_tracker(width : Int, height : Int, init : T, tracker : AllocTracker?, elem_size? : Int) -> Grid[T] raise
    JxlError

    Allocates through tracker when one is given.

    SubGrid

    pub struct SubGrid[T] {
    buf : FixedArray[T]
    offset : Int
    width : Int
    height : Int
    stride : Int
    }

    A rectangular view into a shared buffer (jxl-grid SharedSubgrid and MutableSubgrid; MoonBit buffers are shared, so one type serves both).

    SubGrid::from_buf

    fn[T] SubGrid::from_buf(buf : FixedArray[T], offset : Int, width : Int, height : Int, stride : Int) -> SubGrid[T]

    SubGrid::get

    fn[T] SubGrid::get(self : SubGrid[T], x : Int, y : Int) -> T

    SubGrid::height

    fn[T] SubGrid::height(self : SubGrid[T]) -> Int

    SubGrid::into_groups

    fn[T] SubGrid::into_groups(self : SubGrid[T], group_width : Int, group_height : Int) -> Array[SubGrid[T]]

    Splits into groups of group_width x group_height, row-major (jxl-grid into_groups).

    SubGrid::row_offset

    fn[T] SubGrid::row_offset(self : SubGrid[T], row : Int) -> Int

    Index in buf of sample (0, row).

    SubGrid::set

    fn[T] SubGrid::set(self : SubGrid[T], x : Int, y : Int, v : T) -> Unit

    SubGrid::split_horizontal

    fn[T] SubGrid::split_horizontal(self : SubGrid[T], x : Int) -> (SubGrid[T], SubGrid[T])

    SubGrid::split_vertical

    fn[T] SubGrid::split_vertical(self : SubGrid[T], y : Int) -> (SubGrid[T], SubGrid[T])

    SubGrid::subgrid

    fn[T] SubGrid::subgrid(self : SubGrid[T], left : Int, top : Int, width : Int, height : Int) -> SubGrid[T]

    SubGrid::swap

    fn[T] SubGrid::swap(self : SubGrid[T], ax : Int, ay : Int, bx : Int, by : Int) -> Unit

    SubGrid::width

    fn[T] SubGrid::width(self : SubGrid[T]) -> Int

    Source Files