Trait Pixel

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§

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§

§

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

§

impl Pixel for (u8, u8)

§

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

§

impl Pixel for u8

§

impl Pixel for u32

§

impl Pixel for [f32; 4]

§

impl Pixel for [u8; 2]

§

impl Pixel for [u8; 4]

Implementors§

§

impl Pixel for Color4f

§

impl Pixel for Color