pub fn unpad_rows_rgba(
src: &[u8],
src_bpr: usize,
dst_bpr: usize,
rows: usize,
) -> Vec<u8> ⓘExpand description
Strips row padding from a mapped texture buffer into a tight row layout.
Exactly rows * dst_bpr bytes are returned. Each row copies at most
dst_bpr bytes from the corresponding src_bpr-spaced source row.
§Panics
Panics if a requested source row starts beyond src, if src_bpr is
smaller than dst_bpr for a fully present row, or if output-size arithmetic
overflows usize.
§Examples
use ailloli_ui_render_wgpu::capture::unpad_rows_rgba;
let src = [1, 2, 0, 0, 3, 4, 0, 0];
assert_eq!(unpad_rows_rgba(&src, 4, 2, 2), vec![1, 2, 3, 4]);