Skip to main content

fit

Function fit 

Source
pub fn fit(
    rgba: &[u8],
    width: u32,
    height: u32,
    max: u32,
) -> (Vec<u8>, u32, u32)
Expand description

rgba, width × height, resampled to at most max pixels a side with its aspect kept, or as it is when it already fits. Each new pixel is the area-weighted average of the pixels under it, in premultiplied alpha so a transparent pixel lends no color.