Expand description
Grayscale colors + alpha channel
Tuple Fields
0: [T; 2]
Trait Implementations
sourceimpl<T: PartialEq + Primitive> PartialEq<LumaA<T>> for LumaA<T>
impl<T: PartialEq + Primitive> PartialEq<LumaA<T>> for LumaA<T>
sourceimpl<T: Primitive + 'static> Pixel for LumaA<T>
impl<T: Primitive + 'static> Pixel for LumaA<T>
type Subpixel = T
type Subpixel = T
The underlying subpixel type.
sourceconst CHANNEL_COUNT: u8 = 2u8
const CHANNEL_COUNT: u8 = 2u8
The number of channels of this pixel type.
sourceconst COLOR_MODEL: &'static str = "YA"
const COLOR_MODEL: &'static str = "YA"
sourceconst COLOR_TYPE: ColorType = _
const COLOR_TYPE: ColorType = _
ColorType for this pixel format
sourcefn channels(&self) -> &[T]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
fn channels(&self) -> &[T]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
Returns the components as a slice.
sourcefn channels_mut(&mut self) -> &mut [T]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
fn channels_mut(&mut self) -> &mut [T]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
Returns the components as a mutable slice
sourcefn channels4(&self) -> (T, T, T, T)
fn channels4(&self) -> (T, T, T, T)
Returns the channels of this pixel as a 4 tuple. If the pixel
has less than 4 channels the remainder is filled with the maximum value Read more
sourcefn from_channels(a: T, b: T, c: T, d: T) -> LumaA<T>
fn from_channels(a: T, b: T, c: T, d: T) -> LumaA<T>
Construct a pixel from the 4 channels a, b, c and d.
If the pixel does not contain 4 channels the extra are ignored. Read more
sourcefn from_slice(slice: &[T]) -> &LumaA<T>
fn from_slice(slice: &[T]) -> &LumaA<T>
Returns a view into a slice. Read more
sourcefn from_slice_mut(slice: &mut [T]) -> &mut LumaA<T>
fn from_slice_mut(slice: &mut [T]) -> &mut LumaA<T>
Returns mutable view into a mutable slice. Read more
sourcefn to_luma_alpha(&self) -> LumaA<T>
fn to_luma_alpha(&self) -> LumaA<T>
Convert this pixel to luma with an alpha channel
sourcefn map<F>(&self, f: F) -> LumaA<T>where
F: FnMut(T) -> T,
fn map<F>(&self, f: F) -> LumaA<T>where
F: FnMut(T) -> T,
Apply the function
f
to each channel of this pixel.sourcefn apply<F>(&mut self, f: F)where
F: FnMut(T) -> T,
fn apply<F>(&mut self, f: F)where
F: FnMut(T) -> T,
Apply the function
f
to each channel of this pixel.sourcefn map_with_alpha<F, G>(&self, f: F, g: G) -> LumaA<T>where
F: FnMut(T) -> T,
G: FnMut(T) -> T,
fn map_with_alpha<F, G>(&self, f: F, g: G) -> LumaA<T>where
F: FnMut(T) -> T,
G: FnMut(T) -> T,
Apply the function
f
to each channel except the alpha channel.
Apply the function g
to the alpha channel. Read moresourcefn apply_with_alpha<F, G>(&mut self, f: F, g: G)where
F: FnMut(T) -> T,
G: FnMut(T) -> T,
fn apply_with_alpha<F, G>(&mut self, f: F, g: G)where
F: FnMut(T) -> T,
G: FnMut(T) -> T,
Apply the function
f
to each channel except the alpha channel.
Apply the function g
to the alpha channel. Works in-place. Read moresourcefn blend(&mut self, other: &LumaA<T>)
fn blend(&mut self, other: &LumaA<T>)
Blend the color of a given pixel into ourself, taking into account alpha channels
sourcefn channel_count() -> u8
fn channel_count() -> u8
👎Deprecated: please use CHANNEL_COUNT associated constant
Returns the number of channels of this pixel type.
sourcefn color_model() -> &'static str
fn color_model() -> &'static str
👎Deprecated: please use COLOR_MODEL associated constant
sourcefn color_type() -> ColorType
fn color_type() -> ColorType
👎Deprecated: please use COLOR_TYPE associated constant
Returns the ColorType for this pixel format
sourcefn map_without_alpha<F>(&self, f: F) -> Selfwhere
F: FnMut(Self::Subpixel) -> Self::Subpixel,
fn map_without_alpha<F>(&self, f: F) -> Selfwhere
F: FnMut(Self::Subpixel) -> Self::Subpixel,
Apply the function
f
to each channel except the alpha channel.impl<T: Copy + Primitive> Copy for LumaA<T>
impl<T: Eq + Primitive> Eq for LumaA<T>
impl<T: Primitive> StructuralEq for LumaA<T>
impl<T: Primitive> StructuralPartialEq for LumaA<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for LumaA<T>where
T: RefUnwindSafe,
impl<T> Send for LumaA<T>where
T: Send,
impl<T> Sync for LumaA<T>where
T: Sync,
impl<T> Unpin for LumaA<T>where
T: Unpin,
impl<T> UnwindSafe for LumaA<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more