Trait pix::ColorModel

source ·
pub trait ColorModel: Clone + Copy + Debug + Default + PartialEq + Any {
    const CIRCULAR: Range<usize>;
    const LINEAR: Range<usize>;
    const ALPHA: usize;

    // Required methods
    fn into_rgba<P>(p: P) -> PixRgba<P>
       where P: Pixel<Model = Self>;
    fn from_rgba<P>(rgba: PixRgba<P>) -> P
       where P: Pixel<Model = Self>;
}
Expand description

Model for pixel colors.

Existing color models are Rgb, Bgr, Cmy, Gray, Hsv, Hsl, Hwb, YCbCr and Matte.

Required Associated Constants§

source

const CIRCULAR: Range<usize>

Range of circular channel numbers

source

const LINEAR: Range<usize>

Range of linear channel numbers

source

const ALPHA: usize

Alpha channel number

Required Methods§

source

fn into_rgba<P>(p: P) -> PixRgba<P>where P: Pixel<Model = Self>,

Convert into red, green, blue and alpha components

source

fn from_rgba<P>(rgba: PixRgba<P>) -> Pwhere P: Pixel<Model = Self>,

Convert from red, green, blue and alpha components

Implementors§

source§

impl ColorModel for Bgr

source§

impl ColorModel for Cmy

source§

impl ColorModel for Gray

source§

impl ColorModel for Hsl

source§

impl ColorModel for Hsv

source§

impl ColorModel for Hwb

source§

impl ColorModel for Matte

source§

impl ColorModel for Oklab

source§

impl ColorModel for Rgb

source§

impl ColorModel for Xyz

source§

impl ColorModel for YCbCr