[][src]Struct pix::Rgb

#[repr(C)]
pub struct Rgb<C: Channel, A: Alpha, M: AlphaMode, G: GammaMode> { /* fields omitted */ }

RGB pixel Format, with optional Alpha channel.

The Channels are red, green and blue.

Methods

impl<C: Channel, A: Alpha, M: AlphaMode, G: GammaMode> Rgb<C, A, M, G>[src]

pub fn new<H>(red: H, green: H, blue: H) -> Self where
    C: From<H>,
    A: From<Opaque<C>>, 
[src]

Create an Opaque color by specifying red, green and blue values.

pub fn with_alpha<H, B>(red: H, green: H, blue: H, alpha: B) -> Self where
    C: From<H>,
    A: From<B>, 
[src]

Create a Translucent color by specifying red, green, blue and alpha values.

pub fn red(self) -> C[src]

Get the red Channel.

pub fn green(self) -> C[src]

Get the green Channel.

pub fn blue(self) -> C[src]

Get the blue Channel.

pub fn alpha(self) -> A[src]

Get the alpha Channel.

Trait Implementations

impl<C: Channel, A: Alpha, M: AlphaMode, G: GammaMode> AlphaMode for Rgb<C, A, M, G>[src]

fn encode<H: Channel, B: Alpha<Chan = H>>(h: H, b: B) -> H[src]

Encode one Channel using the gamma mode.

fn decode<H: Channel, B: Alpha<Chan = H>>(h: H, b: B) -> H[src]

Decode one Channel using the gamma mode.

impl<C: Clone + Channel, A: Clone + Alpha, M: Clone + AlphaMode, G: Clone + GammaMode> Clone for Rgb<C, A, M, G>[src]

impl<C: Copy + Channel, A: Copy + Alpha, M: Copy + AlphaMode, G: Copy + GammaMode> Copy for Rgb<C, A, M, G>[src]

impl<C: Debug + Channel, A: Debug + Alpha, M: Debug + AlphaMode, G: Debug + GammaMode> Debug for Rgb<C, A, M, G>[src]

impl<C: Default + Channel, A: Default + Alpha, M: Default + AlphaMode, G: Default + GammaMode> Default for Rgb<C, A, M, G>[src]

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

type Chan = C

Channel type

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, G: GammaMode> From<Mask<A>> for Rgb<C, A, StraightAlpha, G> where
    C: Channel,
    A: Alpha<Chan = C>, 
[src]

fn from(c: Mask<A>) -> Self[src]

Get an Rgb from a Mask

impl<C, A, G: GammaMode> From<Mask<A>> for Rgb<C, A, PremultipliedAlpha, G> where
    C: Channel,
    A: Alpha<Chan = C>, 
[src]

fn from(c: Mask<A>) -> Self[src]

Get an Rgb from a Mask

impl<C, A, M, G: GammaMode> From<Rgb<C, A, M, G>> for i32 where
    C: Channel,
    Ch8: From<C>,
    A: Alpha<Chan = C>,
    M: AlphaMode
[src]

fn from(c: Rgb<C, A, M, G>) -> i32[src]

Get an i32 from an Rgb

impl<C, A, G: GammaMode> From<Rgb<C, A, PremultipliedAlpha, G>> for Rgb<C, A, StraightAlpha, G> where
    C: Channel,
    A: Alpha<Chan = C>, 
[src]

impl<C, A, G: GammaMode> From<Rgb<C, A, StraightAlpha, G>> for Rgb<C, A, PremultipliedAlpha, G> where
    C: Channel,
    A: Alpha<Chan = C>, 
[src]

impl<C, M, G: GammaMode> From<Rgb<C, Opaque<C>, M, G>> for Rgb<C, Translucent<C>, M, G> where
    C: Channel,
    M: AlphaMode
[src]

impl<C, M, G: GammaMode> From<Rgb<C, Translucent<C>, M, G>> for Rgb<C, Opaque<C>, M, G> where
    C: Channel,
    M: AlphaMode
[src]

impl<C, A, M, G: GammaMode> From<i32> for Rgb<C, A, M, G> where
    C: Channel + From<Ch8>,
    A: Alpha<Chan = C> + From<Translucent<Ch8>>,
    M: AlphaMode
[src]

fn from(c: i32) -> Self[src]

Get an Rgb from an i32

impl<C: Channel, A: Alpha, M: AlphaMode, G: GammaMode> GammaMode for Rgb<C, A, M, G>[src]

fn encode<H: Channel>(h: H) -> H[src]

Encode one Channel using the gamma mode.

fn decode<H: Channel>(h: H) -> H[src]

Decode one Channel using the gamma mode.

impl<C: Channel, A: Alpha, M: AlphaMode, G: GammaMode> Iterator for Rgb<C, A, M, G>[src]

type Item = Self

The type of the elements being iterated over.

impl<C: Channel, A: Alpha<Chan = C>, G: GammaMode> Mul<Rgb<C, A, PremultipliedAlpha, G>> for Rgb<C, A, PremultipliedAlpha, G>[src]

type Output = Self

The resulting type after applying the * operator.

impl<C: Channel, A: Alpha, G: GammaMode> Mul<Rgb<C, A, StraightAlpha, G>> for Rgb<C, A, StraightAlpha, G>[src]

type Output = Self

The resulting type after applying the * operator.

impl<C: PartialEq + Channel, A: PartialEq + Alpha, M: PartialEq + AlphaMode, G: PartialEq + GammaMode> PartialEq<Rgb<C, A, M, G>> for Rgb<C, A, M, G>[src]

impl<C: Channel, A: Alpha, M: AlphaMode, G: GammaMode> StructuralPartialEq for Rgb<C, A, M, G>[src]

Auto Trait Implementations

impl<C, A, M, G> RefUnwindSafe for Rgb<C, A, M, G> where
    A: RefUnwindSafe,
    C: RefUnwindSafe,
    G: RefUnwindSafe,
    M: RefUnwindSafe

impl<C, A, M, G> Send for Rgb<C, A, M, G> where
    A: Send,
    C: Send,
    G: Send,
    M: Send

impl<C, A, M, G> Sync for Rgb<C, A, M, G> where
    A: Sync,
    C: Sync,
    G: Sync,
    M: Sync

impl<C, A, M, G> Unpin for Rgb<C, A, M, G> where
    A: Unpin,
    C: Unpin,
    G: Unpin,
    M: Unpin

impl<C, A, M, G> UnwindSafe for Rgb<C, A, M, G> where
    A: UnwindSafe,
    C: UnwindSafe,
    G: UnwindSafe,
    M: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.