Expand description
Grayscale colors + alpha channel
Fields
data: [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.
sourcefn channel_count() -> u8
fn channel_count() -> u8
Returns the number of channels of this pixel type.
sourcefn color_model() -> &'static str
fn color_model() -> &'static str
sourcefn color_type() -> ColorType
fn color_type() -> ColorType
Returns the ColorType for this pixel format
sourcefn channels_mut(&mut self) -> &mut [T] ⓘ
fn channels_mut(&mut self) -> &mut [T] ⓘ
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 moreimpl<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