[][src]Struct lodepng::GreyAlpha

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

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

Implementations

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 new(brightness: T, alpha: A) -> GrayAlpha<T, A>[src]

New grayscale+alpha pixel

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
    T: Copy,
    A: Clone
[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, A> Add<GrayAlpha<T, A>> for GrayAlpha<T, A> where
    T: Add<T>,
    A: Add<A>, 
[src]

px + px

type Output = GrayAlpha<<T as Add<T>>::Output, <A as Add<A>>::Output>

The resulting type after applying the + operator.

impl<T> Add<T> for GrayAlpha<T, T> where
    T: Copy + Add<T, Output = T>, 
[src]

px + 1

type Output = GrayAlpha<T, T>

The resulting type after applying the + operator.

impl<T, A> AddAssign<GrayAlpha<T, A>> for GrayAlpha<T, A> where
    T: Add<T, Output = T> + Copy,
    A: Add<A, Output = A> + Copy
[src]

px + px

impl<T> AddAssign<T> for GrayAlpha<T, T> where
    T: Copy + Add<T, Output = T>, 
[src]

px + 1

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

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

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

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

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

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

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

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

impl<T> Div<T> for GrayAlpha<T, T> where
    T: Copy + Div<T, Output = T>, 
[src]

px / 1

type Output = GrayAlpha<T, T>

The resulting type after applying the / operator.

impl<T> DivAssign<T> for GrayAlpha<T, T> where
    T: Copy + Div<T, Output = T>, 
[src]

px * 1

impl<ComponentType, AlphaComponentType> Eq for GrayAlpha<ComponentType, AlphaComponentType> where
    ComponentType: Eq,
    AlphaComponentType: Eq
[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> Hash for GrayAlpha<ComponentType, AlphaComponentType> where
    ComponentType: Hash,
    AlphaComponentType: Hash
[src]

impl<T> Mul<T> for GrayAlpha<T, T> where
    T: Copy + Mul<T, Output = T>, 
[src]

px * 1

type Output = GrayAlpha<T, T>

The resulting type after applying the * operator.

impl<T> MulAssign<T> for GrayAlpha<T, T> where
    T: Copy + Mul<T, Output = T>, 
[src]

px * 1

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

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

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

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

impl<ComponentType, AlphaComponentType> StructuralEq for GrayAlpha<ComponentType, AlphaComponentType>[src]

impl<ComponentType, AlphaComponentType> StructuralPartialEq for GrayAlpha<ComponentType, AlphaComponentType>[src]

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

px - px

type Output = GrayAlpha<<T as Sub<T>>::Output, <A as Sub<A>>::Output>

The resulting type after applying the - operator.

impl<T> Sub<T> for GrayAlpha<T, T> where
    T: Copy + Sub<T, Output = T>, 
[src]

px - 1

type Output = GrayAlpha<<T as Sub<T>>::Output, <T as Sub<T>>::Output>

The resulting type after applying the - operator.

impl<T, A> SubAssign<GrayAlpha<T, A>> for GrayAlpha<T, A> where
    T: Sub<T, Output = T> + Copy,
    A: Sub<A, Output = A> + Copy
[src]

px - px

impl<T> SubAssign<T> for GrayAlpha<T, T> where
    T: Copy + Sub<T, Output = T>, 
[src]

px - 1

impl<T, A> Sum<GrayAlpha<T, A>> for GrayAlpha<T, A> where
    T: Default + Add<T, Output = T>,
    A: Default + Add<A, Output = A>, 
[src]

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

Auto Trait Implementations

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

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

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

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

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

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> CallHasher for T where
    T: Hash

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.