[][src]Struct lodepng::GreyAlpha

#[repr(C)]
pub struct GreyAlpha<ComponentType, AlphaComponentType = ComponentType>(pub ComponentType, pub AlphaComponentType);

Grayscale with alpha. Use .0/.1 to access.

Methods

impl<T, A> GrayAlpha<T, A> where
    T: Clone
[src]

pub fn gray(&self) -> Gray<T>[src]

Copy Gray component out of the GrayAlpha struct

impl<T, A> GrayAlpha<T, A>[src]

pub fn gray_mut(&mut self) -> &mut Gray<T>[src]

Provide a mutable view of only Gray component (leaving out alpha).

impl<T, A> GrayAlpha<T, A> where
    A: Clone,
    T: Copy
[src]

pub fn alpha(&self, a: A) -> GrayAlpha<T, A>[src]

Create a new GrayAlpha with the new alpha value, but same gray value

pub fn map_alpha<F, B>(&self, f: F) -> GrayAlpha<T, B> where
    F: FnOnce(A) -> B, 
[src]

Create a new GrayAlpha with a new alpha value created by the callback.

pub fn map_gray<F, U, B>(&self, f: F) -> GrayAlpha<U, B> where
    B: From<A> + Clone,
    F: FnOnce(T) -> U,
    U: Clone
[src]

Create new GrayAlpha with the same alpha value, but different Gray value

Trait Implementations

impl<T> AsMut<T> for GrayAlpha<T, T>[src]

impl<T> From<Gray<T>> for GrayAlpha<T, u16> where
    T: Copy
[src]

Assumes 65535 is opaque

impl<T> From<Gray<T>> for GrayAlpha<T, u8> where
    T: Copy
[src]

Assumes 255 is opaque

impl<ComponentType, AlphaComponentType> Clone for GrayAlpha<ComponentType, AlphaComponentType> where
    AlphaComponentType: Clone,
    ComponentType: Clone
[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<ComponentType, AlphaComponentType> Eq for GrayAlpha<ComponentType, AlphaComponentType> where
    AlphaComponentType: Eq,
    ComponentType: Eq
[src]

impl<T> AsRef<T> for GrayAlpha<T, T>[src]

impl<ComponentType, AlphaComponentType> Ord for GrayAlpha<ComponentType, AlphaComponentType> where
    AlphaComponentType: Ord,
    ComponentType: Ord
[src]

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl<ComponentType, AlphaComponentType> Hash for GrayAlpha<ComponentType, AlphaComponentType> where
    AlphaComponentType: Hash,
    ComponentType: Hash
[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<ComponentType, AlphaComponentType> Copy for GrayAlpha<ComponentType, AlphaComponentType> where
    AlphaComponentType: Copy,
    ComponentType: Copy
[src]

impl<ComponentType, AlphaComponentType> PartialEq<GrayAlpha<ComponentType, AlphaComponentType>> for GrayAlpha<ComponentType, AlphaComponentType> where
    AlphaComponentType: PartialEq<AlphaComponentType>,
    ComponentType: PartialEq<ComponentType>, 
[src]

impl<ComponentType, AlphaComponentType> Default for GrayAlpha<ComponentType, AlphaComponentType> where
    AlphaComponentType: Default,
    ComponentType: Default
[src]

impl<ComponentType, AlphaComponentType> Debug for GrayAlpha<ComponentType, AlphaComponentType> where
    AlphaComponentType: Debug,
    ComponentType: Debug
[src]

impl<T, B> ComponentMap<GrayAlpha<B, B>, T, B> for GrayAlpha<T, T> where
    T: Copy
[src]

impl<ComponentType, AlphaComponentType> PartialOrd<GrayAlpha<ComponentType, AlphaComponentType>> for GrayAlpha<ComponentType, AlphaComponentType> where
    AlphaComponentType: PartialOrd<AlphaComponentType>,
    ComponentType: PartialOrd<ComponentType>, 
[src]

impl<T> ComponentSlice<T> for GrayAlpha<T, T>[src]

Auto Trait Implementations

impl<ComponentType, AlphaComponentType> Send for GrayAlpha<ComponentType, AlphaComponentType> where
    AlphaComponentType: Send,
    ComponentType: Send

impl<ComponentType, AlphaComponentType> Unpin for GrayAlpha<ComponentType, AlphaComponentType> where
    AlphaComponentType: Unpin,
    ComponentType: Unpin

impl<ComponentType, AlphaComponentType> Sync for GrayAlpha<ComponentType, AlphaComponentType> where
    AlphaComponentType: Sync,
    ComponentType: Sync

impl<ComponentType, AlphaComponentType> UnwindSafe for GrayAlpha<ComponentType, AlphaComponentType> where
    AlphaComponentType: UnwindSafe,
    ComponentType: UnwindSafe

impl<ComponentType, AlphaComponentType> RefUnwindSafe for GrayAlpha<ComponentType, AlphaComponentType> where
    AlphaComponentType: RefUnwindSafe,
    ComponentType: RefUnwindSafe

Blanket Implementations

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

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

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.

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

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

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