#[repr(C)]pub struct Luma<T: Primitive>(pub [T; 1]);
Expand description
Grayscale colors
Tuple Fields
0: [T; 1]
Trait Implementations
sourceimpl<T: Hash + Primitive> Hash for Luma<T>
impl<T: Hash + Primitive> Hash for Luma<T>
sourcefn hash<__H: Hasher>(&self, state: &mut __H)
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [
Hasher
]. Read more1.3.0fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
Feeds a slice of this type into the given [
Hasher
]. Read moresourceimpl<T: PartialEq + Primitive> PartialEq<Luma<T>> for Luma<T>
impl<T: PartialEq + Primitive> PartialEq<Luma<T>> for Luma<T>
sourceimpl<T: Primitive + 'static> Pixel for Luma<T>
impl<T: Primitive + 'static> Pixel for Luma<T>
type Subpixel = T
type Subpixel = T
The underlying subpixel type.
sourceconst CHANNEL_COUNT: u8 = 1u8
const CHANNEL_COUNT: u8 = 1u8
The number of channels of this pixel type.
sourceconst COLOR_MODEL: &'static str = "Y"
const COLOR_MODEL: &'static str = "Y"
sourceconst COLOR_TYPE: ColorType = _
const COLOR_TYPE: ColorType = _
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) -> Luma<T>
fn from_channels(a: T, b: T, c: T, d: T) -> Luma<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]) -> &Luma<T>
fn from_slice(slice: &[T]) -> &Luma<T>
Returns a view into a slice. Read more
sourcefn from_slice_mut(slice: &mut [T]) -> &mut Luma<T>
fn from_slice_mut(slice: &mut [T]) -> &mut Luma<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) -> Luma<T>where
F: FnMut(T) -> T,
fn map<F>(&self, f: F) -> Luma<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) -> Luma<T>where
F: FnMut(T) -> T,
G: FnMut(T) -> T,
fn map_with_alpha<F, G>(&self, f: F, g: G) -> Luma<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: &Luma<T>)
fn blend(&mut self, other: &Luma<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.sourcefn apply_without_alpha<F>(&mut self, f: F)where
F: FnMut(Self::Subpixel) -> Self::Subpixel,
fn apply_without_alpha<F>(&mut self, f: F)where
F: FnMut(Self::Subpixel) -> Self::Subpixel,
Apply the function
f
to each channel except the alpha channel.
Works in place. Read moreimpl<T: Copy + Primitive> Copy for Luma<T>
impl<T: Eq + Primitive> Eq for Luma<T>
impl<T: Primitive> StructuralEq for Luma<T>
impl<T: Primitive> StructuralPartialEq for Luma<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for Luma<T>where
T: RefUnwindSafe,
impl<T> Send for Luma<T>where
T: Send,
impl<T> Sync for Luma<T>where
T: Sync,
impl<T> Unpin for Luma<T>where
T: Unpin,
impl<T> UnwindSafe for Luma<T>where
T: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstablefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> ToOwned for Twhere
T: Clone,
impl<T> ToOwned for Twhere
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
fn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
Uses borrowed data to replace owned data, usually by cloning. Read more