Skip to main content

scale_thumbnail

Function scale_thumbnail 

Source
pub fn scale_thumbnail(
    src: &[u8],
    src_w: u32,
    src_h: u32,
    dst_w: u32,
    dst_h: u32,
) -> Vec<u8> 
Expand description

Scales a source image buffer to the destination dimensions using nearest-neighbour sampling.

The buffers are expected to be RGBA (4 bytes per pixel), stored row-major.

Returns the scaled pixel data, or an empty Vec if any dimension is zero.