Trait skia_safe::Pixel

source ·
pub unsafe trait Pixel: Copy {
    // Required method
    fn matches_color_type(ct: ColorType) -> bool;
}
Expand description

Implement this trait to use a pixel type in Handle<Pixmap>::pixels().

Safety

This trait is unsafe because external Pixel implementations may lie about their ColorType or fail to match the alignment of the pixels stored in Handle<Pixmap>.

Required Methods§

source

fn matches_color_type(ct: ColorType) -> bool

true if the type matches the color type’s format.

Implementations on Foreign Types§

source§

impl Pixel for (u8, u8)

source§

impl Pixel for [u8; 2]

source§

impl Pixel for (f32, f32, f32, f32)

source§

impl Pixel for (u8, u8, u8, u8)

source§

impl Pixel for [u8; 4]

source§

impl Pixel for u8

source§

impl Pixel for [f32; 4]

source§

impl Pixel for u32

Implementors§