Skip to main content

pack_plane

Function pack_plane 

Source
pub fn pack_plane(
    src: &[u8],
    stride: usize,
    width_bytes: usize,
    height: usize,
) -> Vec<u8> 
Expand description

Copies src, a plane with row stride stride bytes, into a new tightly packed buffer of width_bytes * height bytes.

width_bytes is width * bytes_per_sample, not a pixel count, so this works the same at any bit depth. Passing a pixel count here packs the wrong number of bytes per row.