42typedef enum : uint32_t {
62typedef enum : uint8_t {
73typedef enum : uint8_t {
Module-private seams shared by the producer translation units.
ra8_err_t(* jof_geom_fn)(void *ctx, uint16_t width, uint16_t height, uint8_t channels)
Producer geometry hook: fires once when the source dimensions and output channel count are known,...
ra8_err_t(* jof_rows_fn)(void *ctx, const uint8_t *px, uint16_t width, uint16_t y0, uint16_t nrows, uint8_t channels)
Producer row sink: receives decoded pixel rows strictly in order.
ra8_err_t priv_jof_png_chunk_hdr(ra8_png_state_t *st, uint32_t *out_len, uint32_t *out_type)
Read one 8-byte chunk header (length + type, both big-endian).
ra8_err_t priv_jof_png_pre_idat(ra8_png_state_t *st, uint32_t len, uint32_t type)
Dispatch one pre-IDAT chunk (PLTE / tRNS / ancillary / stray IEND).
ra8_png_field_t
IHDR field offsets and legal values (PNG sec 11.2.2 "IHDR").
@ k_ra8_png_opaque
Fully-opaque alpha value.
@ k_ra8_png_filter_none
Row filter: none.
@ k_ra8_png_filter_avg
Row filter: average.
@ k_ra8_png_color_rgba
Truecolour + alpha.
@ k_ra8_png_ch_3
3 bytes per pixel.
@ k_ra8_png_filter_sub
Row filter: sub.
@ k_ra8_png_color_gray
Grayscale.
@ k_ra8_png_ihdr_ofs_filter
Filter-method offset.
@ k_ra8_png_ihdr_ofs_compress
Compression-method offset.
@ k_ra8_png_filter_paeth
Row filter: Paeth.
@ k_ra8_png_be_sh24
Big-endian assembly shifts.
@ k_ra8_png_ihdr_ofs_depth
Bit-depth byte offset.
@ k_ra8_png_color_ga
Grayscale + alpha.
@ k_ra8_png_ihdr_ofs_interlace
Interlace-method offset.
@ k_ra8_png_be_sh16
Big-endian assembly shifts.
@ k_ra8_png_color_pal
Indexed-colour.
@ k_ra8_png_depth_8
Only supported bit depth.
@ k_ra8_png_ch_2
2 bytes per pixel.
@ k_ra8_png_color_rgb
Truecolour.
@ k_ra8_png_filter_up
Row filter: up.
@ k_ra8_png_ihdr_ofs_color
Colour-type byte offset.
@ k_ra8_png_ch_1
1 byte per pixel.
@ k_ra8_png_ch_4
4 bytes per pixel.
@ k_ra8_png_be_sh8
Big-endian assembly shifts.
ra8_err_t priv_jof_png_prologue(ra8_png_state_t *st, uint16_t max_w, uint16_t max_h)
Verify the 8-byte signature, then parse + validate the IHDR.
ra8_err_t priv_jof_png_pull_exact(ra8_png_state_t *st, uint8_t *buf, uint32_t len)
Pull exactly len bytes; EOF mid-read is a protocol error.
ra8_err_t priv_jof_png_skip(ra8_png_state_t *st, uint32_t len)
Discard exactly len source bytes (unknown / ancillary chunks).
ra8_png_signature_t
Fixed non-ASCII bytes in the PNG signature.
@ k_ra8_png_sig_lf
Line feed byte.
@ k_ra8_png_sig_cr
Carriage return byte.
@ k_ra8_png_sig_sub
DOS EOF byte.
@ k_ra8_png_sig_high
High-bit signature byte.
ra8_png_const_t
PNG structural sizes and caps (PNG sec 5 "Datastream structure").
@ k_ra8_png_type_trns
"tRNS" big-endian.
@ k_ra8_png_sig_bytes
Signature length.
@ k_ra8_png_type_ihdr
"IHDR" big-endian.
@ k_ra8_png_skip_chunk
Discard-buffer granularity.
@ k_ra8_png_type_plte
"PLTE" big-endian.
@ k_ra8_png_ihdr_len
IHDR payload length.
@ k_ra8_png_max_chunks
Chunk-walk budget (hostile cap).
@ k_ra8_png_type_idat
"IDAT" big-endian.
@ k_ra8_png_plte_max
Max PLTE payload (256 * 3).
@ k_ra8_png_inbuf_bytes
Compressed-input chunk buffer.
@ k_ra8_png_type_iend
"IEND" big-endian.
@ k_ra8_png_chunk_hdr
Chunk length + type fields.
@ k_ra8_png_ring_bytes
Inflate ring (power of 2).
@ k_ra8_png_trns_max
Max palette tRNS payload.
@ k_ra8_png_max_len
Max legal chunk length.
@ k_ra8_png_crc_bytes
Trailing chunk CRC field.
ra8_err_t priv_jof_png_finish(ra8_png_state_t *st)
Walk the post-IDAT chunks until IEND (ancillary chunks skipped).
ra8_err_t(* jof_pull_fn)(void *ctx, uint8_t *buf, size_t cap, size_t *got)
Forward byte source for the producer (DIP seam).
Annotation-attribute framework macros for ra8-firmware.
#define RA8_PRIV
Module-private helper: shared across TUs but only inside one library.
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Whole streaming PNG decode state (module-static instance).
uint16_t trns_count
tRNS entries present.
uint16_t rows_done
Rows emitted so far.
uint32_t pending_type
Pending chunk type (big-endian value).
uint8_t * prevrow
Carved previous unfiltered row.
tinfl_decompressor * inflator
Carved inflate context.
jof_geom_fn on_geom
Producer geometry hook.
uint8_t pending_valid
1 when a pending chunk header is held.
uint8_t src_ch
Source bytes per pixel (filter bpp).
void * pull_ctx
Context for pull.
uint8_t * xlat
Carved translated output row.
uint32_t idat_rem
Bytes left in the current IDAT chunk.
uint8_t source_done
1 once a non-IDAT chunk ended the data.
uint32_t pending_len
Pending chunk payload length.
uint8_t * inbuf
Carved compressed-input buffer.
void * cb_ctx
Producer context.
jof_pull_fn pull
Sequential byte source.
uint8_t * ring
Carved 64 KiB inflate ring.
uint8_t trns[k_ra8_png_trns_max]
Palette alpha (tRNS).
uint8_t has_trns
1 once tRNS parsed.
uint16_t h
Image height, pixels.
jof_rows_fn on_rows
Producer row sink.
uint8_t * rowbuf
Carved scanline (filter + pixels).
uint32_t rowfill
Scanline bytes assembled so far.
uint16_t plte_count
Palette entries present.
uint32_t ring_wr
Ring write offset.
uint8_t palette[k_ra8_png_plte_max]
PLTE payload (RGB triples).
uint8_t has_plte
1 once PLTE parsed.
uint32_t rowlen
Scanline bytes (1 + w * src_ch).
uint8_t color_type
IHDR colour type.
uint8_t dst_ch
Output bytes per pixel (1, 3 or 4).
uint16_t w
Image width, pixels.