Skip to main content

apply_alpha_mask

Function apply_alpha_mask 

Source
pub fn apply_alpha_mask(
    pixels: &mut [u8],
    width: u32,
    height: u32,
    shape: ImageMaskShape,
)
Expand description

Apply an alpha mask in-place to an RGBA8 buffer. RGB channels are preserved; only alpha is modulated by the coverage value, so a pre-multiplied source remains pre-multiplied (the alpha-channel-only transformation matches RasterIcon::to_alpha_mask).

The shape accepts the public ImageMaskShape surface; the RoundedSquare radius is interpreted as a fraction of min(width, height), clamped to 0.0..=0.5. None is a no-op.