suica/jxl/bitstream does not have a README file

    JxlError

    pub(all) suberror JxlError {
    Eof
    Io(String)
    InvalidBox
    NonZeroPadding
    InvalidFloat
    InvalidEnum(String, UInt)
    ValidationFailed(String)
    ProfileConformance(String)
    CannotSkip
    NotAligned
    Decoder(String)
    Modular(String)
    Frame(String)
    IncompleteFrameData(String)
    Color(String)
    Render(String)
    NotSupported(String)
    OutOfMemory(Int)
    Jbr(String)
    Brotli(String)
    } derive(Eq,
    Debug
    )

    The single error type of the whole decoder. Every package raises this, mirroring the union of jxl-oxide's per-crate Error enums.

    JxlError::unexpected_eof

    fn JxlError::unexpected_eof(self : JxlError) -> Bool

    Bitstream

    pub struct Bitstream {
    bytes : Bytes
    end : Int
    pos : Int
    buf : UInt64
    num_read_bits : Int
    remaining_buf_bits : Int
    }

    LSB-first bit reader over a byte buffer, ported from jxl-bitstream.

    Bitstream::bits_left

    fn Bitstream::bits_left(self : Bitstream) -> Int

    Number of bits that can still be read.

    Bitstream::bytes_left

    fn Bitstream::bytes_left(self : Bitstream) -> Int

    Number of bytes not yet loaded into the bit buffer.

    Bitstream::clone

    fn Bitstream::clone(self : Bitstream) -> Bitstream

    An independent copy of the reader state (Rust Clone).

    Bitstream::consume_bits

    fn Bitstream::consume_bits(self : Bitstream, n : Int) -> Unit raise JxlError

    Bitstream::new

    fn Bitstream::new(bytes : Bytes) -> Bitstream

    Bitstream::new_range

    fn Bitstream::new_range(bytes : Bytes, start : Int, len : Int) -> Bitstream

    A reader over bytes[start:start+len].

    Bitstream::num_read_bits

    fn Bitstream::num_read_bits(self : Bitstream) -> Int

    Bitstream::peek_bits

    fn Bitstream::peek_bits(self : Bitstream, n : Int) -> UInt

    Peeks n bits (n <= 32), refilling the buffer first.

    Bitstream::peek_bits_prefilled

    fn Bitstream::peek_bits_prefilled(self : Bitstream, n : Int) -> UInt

    Peeks n bits without refilling; only valid after a peek_bits.

    Bitstream::read_bits

    fn Bitstream::read_bits(self : Bitstream, n : Int) -> UInt raise JxlError

    Reads n bits (n <= 32) as an unsigned value.

    Bitstream::read_bits_int

    fn Bitstream::read_bits_int(self : Bitstream, n : Int) -> Int raise JxlError

    read_bits returning a (non-negative) Int; n must be <= 31.

    Bitstream::read_bool

    fn Bitstream::read_bool(self : Bitstream) -> Bool raise JxlError

    Bitstream::read_bytes_aligned

    fn Bitstream::read_bytes_aligned(self : Bitstream, n : Int) -> Bytes raise JxlError

    Reads n bytes (after the reader is byte aligned) into a new buffer.

    Bitstream::read_enum_raw

    fn Bitstream::read_enum_raw(self : Bitstream) -> UInt raise JxlError

    Reads the raw value of an Enum(T) field; callers map it to their enum and raise InvalidEnum(name, value) when it is out of range.

    Bitstream::read_f16_as_f32

    fn Bitstream::read_f16_as_f32(self : Bitstream) -> Float raise JxlError

    Bitstream::read_u32

    fn Bitstream::read_u32(self : Bitstream, d0 : U32Spec, d1 : U32Spec, d2 : U32Spec, d3 : U32Spec) -> UInt raise JxlError

    Bitstream::read_u64

    fn Bitstream::read_u64(self : Bitstream) -> UInt64 raise JxlError

    Bitstream::skip_bits

    fn Bitstream::skip_bits(self : Bitstream, n : Int) -> Unit raise JxlError

    Bitstream::zero_pad_to_byte

    fn Bitstream::zero_pad_to_byte(self : Bitstream) -> Unit raise JxlError

    U32Spec

    pub(all) enum U32Spec {
    Constant(UInt)
    BitsOffset(UInt, Int)
    }

    A U32 distribution entry: constant, or offset + u(bits).
    fn c(v : UInt) -> U32Spec

    c
    fn cu(c : UInt, n : Int) -> U32Spec

    c + u(n)

    read_name

    fn read_name(bs : Bitstream) -> String raise JxlError

    The Name bundle: a UTF-8 string with a U32 length prefix.
    fn u(n : Int) -> U32Spec

    u(n)

    unpack_signed

    fn unpack_signed(x : UInt) -> Int

    unpack_signed_u64

    fn unpack_signed_u64(x : UInt64) -> Int64