skia_safe

Trait 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

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

Source§

impl Pixel for (u8, u8)

Source§

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

Source§

impl Pixel for u8

Source§

impl Pixel for u32

Source§

impl Pixel for [f32; 4]

Source§

impl Pixel for [u8; 2]

Source§

impl Pixel for [u8; 4]

Implementors§