ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_png_state_t Struct Reference

Whole streaming PNG decode state (module-static instance). More...

#include <jof_png_internal.h>

Data Fields

jof_pull_fn pull
 Sequential byte source.
void * pull_ctx
 Context for pull.
jof_geom_fn on_geom
 Producer geometry hook.
jof_rows_fn on_rows
 Producer row sink.
void * cb_ctx
 Producer context.
uint16_t w
 Image width, pixels.
uint16_t h
 Image height, pixels.
uint8_t color_type
 IHDR colour type.
uint8_t src_ch
 Source bytes per pixel (filter bpp).
uint8_t dst_ch
 Output bytes per pixel (1, 3 or 4).
uint8_t palette [k_ra8_png_plte_max]
 PLTE payload (RGB triples).
uint8_t trns [k_ra8_png_trns_max]
 Palette alpha (tRNS).
uint16_t plte_count
 Palette entries present.
uint16_t trns_count
 tRNS entries present.
uint8_t has_plte
 1 once PLTE parsed.
uint8_t has_trns
 1 once tRNS parsed.
tinfl_decompressor * inflator
 Carved inflate context.
uint8_t * ring
 Carved 64 KiB inflate ring.
uint8_t * inbuf
 Carved compressed-input buffer.
uint8_t * rowbuf
 Carved scanline (filter + pixels).
uint8_t * prevrow
 Carved previous unfiltered row.
uint8_t * xlat
 Carved translated output row.
uint32_t ring_wr
 Ring write offset.
uint32_t rowlen
 Scanline bytes (1 + w * src_ch).
uint32_t rowfill
 Scanline bytes assembled so far.
uint16_t rows_done
 Rows emitted so far.
uint32_t idat_rem
 Bytes left in the current IDAT chunk.
uint8_t source_done
 1 once a non-IDAT chunk ended the data.
uint8_t pending_valid
 1 when a pending chunk header is held.
uint32_t pending_len
 Pending chunk payload length.
uint32_t pending_type
 Pending chunk type (big-endian value).

Detailed Description

Whole streaming PNG decode state (module-static instance).

One static instance: the inflate ring pointer set plus palette tables would blow the stack budget. All heap-sized buffers are carved from the producer's bump arena.

Invariant
rowfill <= rowlen and rows_done <= h at all times.

Definition at line 110 of file jof_png_internal.h.

Field Documentation

◆ cb_ctx

void* ra8_png_state_t::cb_ctx

Producer context.

Definition at line 115 of file jof_png_internal.h.

Referenced by internal_png_bind_geometry(), internal_png_consume_rows(), and priv_jof_png_rows().

◆ color_type

uint8_t ra8_png_state_t::color_type

◆ dst_ch

uint8_t ra8_png_state_t::dst_ch

Output bytes per pixel (1, 3 or 4).

Definition at line 121 of file jof_png_internal.h.

Referenced by internal_png_bind_geometry(), internal_png_consume_rows(), and internal_png_translate().

◆ h

uint16_t ra8_png_state_t::h

◆ has_plte

uint8_t ra8_png_state_t::has_plte

1 once PLTE parsed.

Definition at line 127 of file jof_png_internal.h.

Referenced by internal_png_bind_geometry(), internal_png_parse_plte(), and internal_png_parse_trns().

◆ has_trns

uint8_t ra8_png_state_t::has_trns

1 once tRNS parsed.

Definition at line 128 of file jof_png_internal.h.

Referenced by internal_png_bind_geometry(), and internal_png_parse_trns().

◆ idat_rem

uint32_t ra8_png_state_t::idat_rem

Bytes left in the current IDAT chunk.

Definition at line 142 of file jof_png_internal.h.

Referenced by internal_png_inflate_idat(), and internal_png_refill_input().

◆ inbuf

uint8_t* ra8_png_state_t::inbuf

Carved compressed-input buffer.

Definition at line 132 of file jof_png_internal.h.

Referenced by internal_png_bind_geometry(), internal_png_inflate_step(), and internal_png_refill_input().

◆ inflator

tinfl_decompressor* ra8_png_state_t::inflator

Carved inflate context.

Definition at line 130 of file jof_png_internal.h.

Referenced by internal_png_bind_geometry(), and internal_png_inflate_step().

◆ on_geom

jof_geom_fn ra8_png_state_t::on_geom

Producer geometry hook.

Definition at line 113 of file jof_png_internal.h.

Referenced by internal_png_bind_geometry(), and priv_jof_png_rows().

◆ on_rows

jof_rows_fn ra8_png_state_t::on_rows

Producer row sink.

Definition at line 114 of file jof_png_internal.h.

Referenced by internal_png_consume_rows(), and priv_jof_png_rows().

◆ palette

uint8_t ra8_png_state_t::palette[k_ra8_png_plte_max]

PLTE payload (RGB triples).

Definition at line 123 of file jof_png_internal.h.

Referenced by internal_png_parse_plte(), and internal_png_translate().

◆ pending_len

uint32_t ra8_png_state_t::pending_len

Pending chunk payload length.

Definition at line 145 of file jof_png_internal.h.

Referenced by internal_png_refill_input(), and priv_jof_png_finish().

◆ pending_type

uint32_t ra8_png_state_t::pending_type

Pending chunk type (big-endian value).

Definition at line 146 of file jof_png_internal.h.

Referenced by internal_png_refill_input(), and priv_jof_png_finish().

◆ pending_valid

uint8_t ra8_png_state_t::pending_valid

1 when a pending chunk header is held.

Definition at line 144 of file jof_png_internal.h.

Referenced by internal_png_refill_input(), and priv_jof_png_finish().

◆ plte_count

uint16_t ra8_png_state_t::plte_count

Palette entries present.

Definition at line 125 of file jof_png_internal.h.

Referenced by internal_png_parse_plte(), and internal_png_translate().

◆ prevrow

uint8_t* ra8_png_state_t::prevrow

Carved previous unfiltered row.

Definition at line 134 of file jof_png_internal.h.

Referenced by internal_png_bind_geometry(), and internal_png_consume_rows().

◆ pull

jof_pull_fn ra8_png_state_t::pull

Sequential byte source.

Definition at line 111 of file jof_png_internal.h.

Referenced by priv_jof_png_pull_exact(), and priv_jof_png_rows().

◆ pull_ctx

void* ra8_png_state_t::pull_ctx

Context for pull.

Definition at line 112 of file jof_png_internal.h.

Referenced by priv_jof_png_pull_exact(), and priv_jof_png_rows().

◆ ring

uint8_t* ra8_png_state_t::ring

Carved 64 KiB inflate ring.

Definition at line 131 of file jof_png_internal.h.

Referenced by internal_png_bind_geometry(), and internal_png_inflate_step().

◆ ring_wr

uint32_t ra8_png_state_t::ring_wr

Ring write offset.

Definition at line 137 of file jof_png_internal.h.

Referenced by internal_png_inflate_step().

◆ rowbuf

uint8_t* ra8_png_state_t::rowbuf

Carved scanline (filter + pixels).

Definition at line 133 of file jof_png_internal.h.

Referenced by internal_png_bind_geometry(), and internal_png_consume_rows().

◆ rowfill

uint32_t ra8_png_state_t::rowfill

Scanline bytes assembled so far.

Definition at line 139 of file jof_png_internal.h.

Referenced by internal_png_consume_rows(), and internal_png_inflate_idat().

◆ rowlen

uint32_t ra8_png_state_t::rowlen

Scanline bytes (1 + w * src_ch).

Definition at line 138 of file jof_png_internal.h.

Referenced by internal_png_bind_geometry(), and internal_png_consume_rows().

◆ rows_done

uint16_t ra8_png_state_t::rows_done

Rows emitted so far.

Definition at line 140 of file jof_png_internal.h.

Referenced by internal_png_consume_rows(), and internal_png_inflate_idat().

◆ source_done

uint8_t ra8_png_state_t::source_done

1 once a non-IDAT chunk ended the data.

Definition at line 143 of file jof_png_internal.h.

Referenced by internal_png_inflate_step(), and internal_png_refill_input().

◆ src_ch

uint8_t ra8_png_state_t::src_ch

Source bytes per pixel (filter bpp).

Definition at line 120 of file jof_png_internal.h.

Referenced by internal_png_bind_geometry(), internal_png_check_ihdr(), and internal_png_consume_rows().

◆ trns

uint8_t ra8_png_state_t::trns[k_ra8_png_trns_max]

Palette alpha (tRNS).

Definition at line 124 of file jof_png_internal.h.

Referenced by internal_png_parse_trns(), and internal_png_translate().

◆ trns_count

uint16_t ra8_png_state_t::trns_count

tRNS entries present.

Definition at line 126 of file jof_png_internal.h.

Referenced by internal_png_parse_trns(), and internal_png_translate().

◆ w

uint16_t ra8_png_state_t::w

◆ xlat

uint8_t* ra8_png_state_t::xlat

Carved translated output row.

Definition at line 135 of file jof_png_internal.h.

Referenced by internal_png_bind_geometry(), internal_png_consume_rows(), and internal_png_translate().


The documentation for this struct was generated from the following file: