Skip to main content

render

Function render 

Source
pub fn render(
    format_version: u16,
    chromahash: &[u8],
    dominant_color: [u8; 3],
    max_width: u32,
    max_height: u32,
) -> RgbaImage
Expand description

Render a stored placeholder record, honouring the versioned fallback.

The happy path is a recognized LQIP_FORMAT_V1 payload that parses: it is decoded, band-limited to max_width x max_height. Anything else — an unknown future version, or bytes from_bytes rejects (a corrupt payload, or a stale non-chromahash one) — returns the 1x1 solid dominant_color fill. A reader must never misrender a payload it does not understand.