Skip to main content

cgimage_render_rgba_into_strided

Function cgimage_render_rgba_into_strided 

Source
pub unsafe extern "C" fn cgimage_render_rgba_into_strided(
    image: *const c_void,
    dest: *mut u8,
    dest_capacity: usize,
    dest_bytes_per_row: usize,
) -> usize
Expand description

Strided variant of cgimage_render_rgba_into: renders RGBA bytes using a caller-specified row stride (dest_bytes_per_row) instead of the tightly-packed width * 4. Lets consumers with row-aligned/padded buffers (GPU upload, wgpu) avoid an extra repack. Returns the number of bytes spanned (height * dest_bytes_per_row) on success, or 0 on failure (stride too small or buffer too small).