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
Required Methods
sourcefn color_type() -> ColorType
fn color_type() -> ColorType
Get the PNG color type.
sourcefn over(pix: &mut [Self], mask: &Mask, src: Self)
fn over(pix: &mut [Self], mask: &Mask, src: Self)
Blend pixels with an alpha mask.
pix
Slice of pixels.mask
Alpha mask for compositing.src
Source color.
sourcefn divide_alpha(pix: &mut [Self])
fn divide_alpha(pix: &mut [Self])
Divide alpha (remove premultiplied alpha)
pix
Slice of pixels.
Provided Methods
sourcefn as_u8_slice(pix: &[Self]) -> &[u8] ⓘ
fn as_u8_slice(pix: &[Self]) -> &[u8] ⓘ
Convert a pixel slice into a u8 slice.
pix
Slice of pixels.
sourcefn as_u8_slice_mut(pix: &mut [Self]) -> &mut [u8] ⓘ
fn as_u8_slice_mut(pix: &mut [Self]) -> &mut [u8] ⓘ
Convert a pixel slice into a mutable u8 slice.
pix
Slice of pixels.
sourcefn as_slice(pix: &[u8]) -> &[Self] ⓘ
fn as_slice(pix: &[u8]) -> &[Self] ⓘ
Convert a u8 slice into a pixel slice.
pix
Slice of u8 pixel data.
sourcefn as_slice_mut(pix: &mut [u8]) -> &mut [Self] ⓘ
fn as_slice_mut(pix: &mut [u8]) -> &mut [Self] ⓘ
Convert a u8 slice into a mutable pixel slice.
pix
Slice of u8 pixel data.