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

Caller-owned composite buffers – the module's entire memory footprint. More...

#include <zoom.h>

Data Fields

uint8_t * row
 One source row, >= dst.w bytes.
uint32_t row_cap
 Capacity of row, bytes.
uint8_t * strip
 gray8 destination strip, dst.w * strip_rows.
uint32_t strip_cap
 Capacity of strip, bytes.
uint8_t * packed
 The strip packed to 4 bpp (2 px/byte).
uint32_t packed_cap
 Capacity of packed, bytes.

Detailed Description

Caller-owned composite buffers – the module's entire memory footprint.

Three buffers, all supplied by the caller and none allocated: one source row, one destination strip in gray8, and the same strip packed to 4 bpp. Sizing is a function of the viewport width alone, never its height, which is the whole point of the strip pipeline (see the file docblock):

  • row_cap >= dst.w – the widest source row a frame reads
  • strip_cap >= dst.w – at least one destination row
  • packed_cap >= (dst.w * strip_rows + 1)/2 – with strip_rows = strip_cap / dst.w

zoom_view_open derives strip_rows from strip_cap and rejects a packed_cap that cannot hold it, so an under-sized buffer is a startup error and never a partial frame.

Invariant
No pointer is NULL and no capacity is zero in an opened view.
The three buffers do not overlap.
Example:
static uint8_t s_row[1024], s_strip[1024 * 16], s_packed[(1024 * 16) / 2];
cfg.scratch = (zoom_scratch_t){ .row = s_row, .row_cap = sizeof(s_row),
.strip = s_strip, .strip_cap = sizeof(s_strip),
.packed = s_packed, .packed_cap = sizeof(s_packed) };
static longstrip_t s_strip
Opened longstrip scroll state.
Definition main.c:271
static uint8_t s_packed[k_ez_packed_bytes]
Composite scratch: the dithered strip packed to 4 bpp (SRAM).
Definition main.c:211
static uint8_t s_row[k_ez_row_bytes]
Composite scratch: one source row at the widest viewport (SRAM).
Definition main.c:190
Caller-owned composite buffers – the module's entire memory footprint.
Definition zoom.h:335
uint32_t strip_cap
Capacity of strip, bytes.
Definition zoom.h:339
uint8_t * strip
gray8 destination strip, dst.w * strip_rows.
Definition zoom.h:338
See also
zoom_view_open
Since
0.1.0

Definition at line 335 of file zoom.h.

Field Documentation

◆ packed

uint8_t* zoom_scratch_t::packed

The strip packed to 4 bpp (2 px/byte).

Definition at line 340 of file zoom.h.

Referenced by internal_cfg_ptrs_ok(), and internal_emit_strip().

◆ packed_cap

uint32_t zoom_scratch_t::packed_cap

Capacity of packed, bytes.

Definition at line 341 of file zoom.h.

Referenced by internal_cfg_scratch_ok(), and internal_emit_strip().

◆ row

uint8_t* zoom_scratch_t::row

One source row, >= dst.w bytes.

Definition at line 336 of file zoom.h.

Referenced by internal_cfg_ptrs_ok(), internal_expand_row(), and internal_fill_row().

◆ row_cap

uint32_t zoom_scratch_t::row_cap

Capacity of row, bytes.

Definition at line 337 of file zoom.h.

Referenced by internal_cfg_scratch_ok().

◆ strip

uint8_t* zoom_scratch_t::strip

gray8 destination strip, dst.w * strip_rows.

Definition at line 338 of file zoom.h.

Referenced by internal_cfg_ptrs_ok(), internal_emit_strip(), and internal_fill_strip().

◆ strip_cap

uint32_t zoom_scratch_t::strip_cap

Capacity of strip, bytes.

Definition at line 339 of file zoom.h.

Referenced by internal_cfg_scratch_ok().


The documentation for this struct was generated from the following file:
  • apps/shared_libs/zoom/inc/zoom.h