Skip to main content

render_frame

Function render_frame 

Source
pub(crate) fn render_frame(
    buf: &mut [u8],
    w: i32,
    h: i32,
    brain_alpha: f32,
    window_alpha: f32,
    radius: f32,
    bgr: bool,
    footer: &[String],
    stages: &[String],
)
Expand description

Composite one frame, pre-multiplied, into a 4-byte-per-pixel buffer: the dark backdrop with the centered brain blended at brain_alpha, the stage list band, and the footer identity strip — all masked to a radius-rounded rect and scaled by the global window_alpha (fade-out). Pre-multiplied output is what both X Render compositors and wl_shm ARGB8888 expect. bgr selects byte order: true → B,G,R,A (X11 ARGB / Wayland ARGB8888 on LE), false → R,G,B,A. Shared by both backends.

radius=0 + window_alpha=1 yields a fully-opaque square (the X11 no-compositor fallback path). stages may be empty (no events received).