[][src]Trait pix::ColorModel

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

    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>
; }

Model for pixel colors.

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

Associated Constants

const CIRCULAR: Range<usize>

Range of circular channel numbers

const LINEAR: Range<usize>

Range of linear channel numbers

const ALPHA: usize

Alpha channel number

Loading content...

Required methods

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

Convert into red, green, blue and alpha components

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

Convert from red, green, blue and alpha components

Loading content...

Implementors

impl ColorModel for Bgr[src]

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

Convert into red, green, blue and alpha components

fn from_rgba<P>(rgba: PixRgba<P>) -> P where
    P: Pixel<Model = Self>, 
[src]

Convert from red, green, blue and alpha components

impl ColorModel for Cmy[src]

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

Convert into red, green, blue and alpha components

fn from_rgba<P>(rgba: PixRgba<P>) -> P where
    P: Pixel<Model = Self>, 
[src]

Convert from red, green, blue and alpha components

impl ColorModel for Gray[src]

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

Convert into red, green, blue and alpha components

fn from_rgba<P>(rgba: PixRgba<P>) -> P where
    P: Pixel<Model = Self>, 
[src]

Convert from red, green, blue and alpha components

impl ColorModel for Hsl[src]

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

Convert into red, green, blue and alpha components

fn from_rgba<P>(rgba: PixRgba<P>) -> P where
    P: Pixel<Model = Self>, 
[src]

Convert from red, green, blue and alpha components

impl ColorModel for Hsv[src]

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

Convert into red, green, blue and alpha components

fn from_rgba<P>(rgba: PixRgba<P>) -> P where
    P: Pixel<Model = Self>, 
[src]

Convert from red, green, blue and alpha components

impl ColorModel for Hwb[src]

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

Convert into red, green, blue and alpha components

fn from_rgba<P>(rgba: PixRgba<P>) -> P where
    P: Pixel<Model = Self>, 
[src]

Convert from red, green, blue and alpha components

impl ColorModel for Matte[src]

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

Convert into red, green, blue and alpha components

fn from_rgba<P>(rgba: PixRgba<P>) -> P where
    P: Pixel<Model = Self>, 
[src]

Convert from red, green, blue and alpha components

impl ColorModel for Rgb[src]

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

Convert into red, green, blue and alpha components

fn from_rgba<P>(rgba: PixRgba<P>) -> P where
    P: Pixel<Model = Self>, 
[src]

Convert from red, green, blue and alpha components

impl ColorModel for YCbCr[src]

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

Convert into red, green, blue and alpha components

fn from_rgba<P>(rgba: PixRgba<P>) -> P where
    P: Pixel<Model = Self>, 
[src]

Convert from red, green, blue and alpha components

Loading content...