Trait footile::PixFmt

source ·
pub trait PixFmt: Clone + Default {
    fn color_type() -> ColorType;
    fn over(pix: &mut [Self], mask: &Mask, src: Self);
    fn divide_alpha(pix: &mut [Self]);

    fn as_u8_slice(pix: &[Self]) -> &[u8]  { ... }
    fn as_u8_slice_mut(pix: &mut [Self]) -> &mut [u8]  { ... }
    fn as_slice(pix: &[u8]) -> &[Self]  { ... }
    fn as_slice_mut(pix: &mut [u8]) -> &mut [Self]  { ... }
}
Expand description

Pixel format.

This determines color components and bit depth, as well as the layout of pixels in memory.

Required Methods

Get the PNG color type.

Blend pixels with an alpha mask.

  • pix Slice of pixels.
  • mask Alpha mask for compositing.
  • src Source color.

Divide alpha (remove premultiplied alpha)

  • pix Slice of pixels.

Provided Methods

Convert a pixel slice into a u8 slice.

  • pix Slice of pixels.

Convert a pixel slice into a mutable u8 slice.

  • pix Slice of pixels.

Convert a u8 slice into a pixel slice.

  • pix Slice of u8 pixel data.

Convert a u8 slice into a mutable pixel slice.

  • pix Slice of u8 pixel data.

Implementors