[][src]Trait pix::Format

pub trait Format: Clone + Copy + Default + PartialEq {
    type Chan: Channel;
    fn rgba(self) -> [Self::Chan; 4];
fn with_rgba(rgba: [Self::Chan; 4]) -> Self;
fn difference(self, rhs: Self) -> Self;
fn within_threshold(self, rhs: Self) -> bool; }

Associated Types

type Chan: Channel

Channel type

Loading content...

Required methods

fn rgba(self) -> [Self::Chan; 4]

Get red, green, blue and alpha Channels

fn with_rgba(rgba: [Self::Chan; 4]) -> Self

Make a pixel with given RGBA Channels

fn difference(self, rhs: Self) -> Self

Get channel-wise difference

fn within_threshold(self, rhs: Self) -> bool

Check if all Channels are within threshold

Loading content...

Implementors

impl<C, A> Format for Gray<C, A> where
    C: Channel,
    A: Alpha<Chan = C> + From<C>, 
[src]

type Chan = C

fn rgba(self) -> [Self::Chan; 4][src]

Get red, green, blue and alpha Channels

fn with_rgba(rgba: [Self::Chan; 4]) -> Self[src]

Make a pixel with given RGBA Channels

fn difference(self, rhs: Self) -> Self[src]

Get channel-wise difference

fn within_threshold(self, rhs: Self) -> bool[src]

Check if all Channels are within threshold

impl<C, A> Format for Mask<C, A> where
    C: Channel,
    A: Alpha<Chan = C> + From<C>, 
[src]

type Chan = C

fn rgba(self) -> [Self::Chan; 4][src]

Get red, green, blue and alpha Channels

fn with_rgba(rgba: [Self::Chan; 4]) -> Self[src]

Make a pixel with given RGBA Channels

fn difference(self, rhs: Self) -> Self[src]

Get channel-wise difference

fn within_threshold(self, rhs: Self) -> bool[src]

Check if all Channels are within threshold

impl<C, A> Format for Rgb<C, A> where
    C: Channel,
    A: Alpha<Chan = C> + From<C>, 
[src]

type Chan = C

fn rgba(self) -> [Self::Chan; 4][src]

Get red, green, blue and alpha Channels

fn with_rgba(rgba: [Self::Chan; 4]) -> Self[src]

Make a pixel with given RGBA Channels

fn difference(self, rhs: Self) -> Self[src]

Get channel-wise difference

fn within_threshold(self, rhs: Self) -> bool[src]

Check if all Channels are within threshold

Loading content...