Skip to main content

render_rgba

Function render_rgba 

Source
pub fn render_rgba(
    raw: &RawImage,
    center: f64,
    width: f64,
    user_invert: bool,
) -> Vec<u8> 
Expand description

Apply a window/level and convert a RawImage to RGBA8.

The output is grey-on-grey (R = G = B = level) with full alpha. Cheap enough to call on every drag delta for interactive W/L. The effective inversion is raw.photometric_invert XOR user_invert, so toggling “invert” on a MONOCHROME1 image cancels back to natural display.