Skip to main content

sample_pixel

Function sample_pixel 

Source
pub fn sample_pixel(pixels: &[u8], width: u32, x: u32, y: u32) -> [u8; 4]
Expand description

Reads the RGBA bytes of pixel (x, y) from a tightly packed RGBA8 buffer that is width pixels wide. Panics when the pixel lies outside the buffer.