Skip to main content

Module framebuffer

Module framebuffer 

Source
Expand description

A RAM-backed, readback-capable framebuffer.

Framebuffer implements DrawTarget and PixelRead, so rendering into it unlocks true per-pixel alpha compositing (RenderCtx::*_true_alpha) instead of the ordered-dither approximation used for write-only displays. The typical pattern is a software double buffer: render the UI into a Framebuffer, then blit it to the physical panel once per frame.

Storage is a fixed [Rgb565; N] array (no allocator). Pick N >= W * H; put the buffer behind a StaticCell (or on the stack for host tooling).

Structsยง

Framebuffer
A fixed-capacity RGB565 framebuffer. N is the backing array length and must be at least width * height.