[][src]Struct pix::Gray

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

Gray pixel Format, with optional Alpha channel.

For types, see: Gray8, Gray16, Gray32, GrayAlpha8, GrayAlpha16, GrayAlpha32

Methods

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

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

Create an Opaque gray value.

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

Create a Translucent gray value.

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

Get the gray value.

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

Get the alpha value.

Trait Implementations

impl<C: Channel, A: Alpha, M: AlphaMode, G: GammaMode> AlphaMode for Gray<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 Gray<C, A, M, G>[src]

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

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

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

impl<C, A, M: AlphaMode, G: GammaMode> Format for Gray<C, A, M, G> where
    C: Channel,
    A: Alpha<Chan = C> + From<C>, 
[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<Gray<C, A, AssociatedAlpha, G>> for Gray<C, A, SeparatedAlpha, G> where
    C: Channel,
    A: Alpha<Chan = C>, 
[src]

impl<C, A, G: GammaMode> From<Gray<C, A, SeparatedAlpha, G>> for Gray<C, A, AssociatedAlpha, G> where
    C: Channel,
    A: Alpha<Chan = C>, 
[src]

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

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

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

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

Get a Gray from a Mask

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

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

Get a Gray from a Mask

impl<C, A, M: AlphaMode, G: GammaMode> From<u8> for Gray<C, A, M, G> where
    C: Channel,
    C: From<Ch8>,
    A: Alpha,
    A: From<Opaque<C>>, 
[src]

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

Convert from a u8 value.

impl<C: Channel, A: Alpha, M: AlphaMode, G: GammaMode> GammaMode for Gray<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 Gray<C, A, M, G>[src]

type Item = Self

The type of the elements being iterated over.

impl<C: Channel, A: Alpha, M: AlphaMode, G: GammaMode> Mul<Gray<C, A, M, G>> for Gray<C, A, M, 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<Gray<C, A, M, G>> for Gray<C, A, M, G>[src]

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

Auto Trait Implementations

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

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

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

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

impl<C, A, M, G> UnwindSafe for Gray<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.