#[repr(C)]pub struct Luma<T>(pub [T; 1])
where
T: Primitive;Expand description
Grayscale colors
Tuple Fields§
§0: [T; 1]Trait Implementations§
Source§impl<T> ArrayData for Luma<T>where
T: Primitive + 'static,
impl<T> ArrayData for Luma<T>where
T: Primitive + 'static,
Source§type DataType = [T; 1]
type DataType = [T; 1]
The type of the data for this array.
e.g.
[T; 1] for Luma, [T; 3] for Rgb.Source§fn data(&self) -> <Luma<T> as ArrayData>::DataType
fn data(&self) -> <Luma<T> as ArrayData>::DataType
Get the data from this pixel as a constant length array.
Source§impl<T> Pixel for Luma<T>where
T: Primitive + 'static,
impl<T> Pixel for Luma<T>where
T: Primitive + 'static,
Source§const CHANNEL_COUNT: u8 = 1u8
const CHANNEL_COUNT: u8 = 1u8
The number of channels of this pixel type.
Source§const COLOR_MODEL: &'static str = "Y"
const COLOR_MODEL: &'static str = "Y"
A string that can help to interpret the meaning each channel
See gimp babl.
Source§const COLOR_TYPE: ColorType
const COLOR_TYPE: ColorType
ColorType for this pixel format
Source§fn channels_mut(&mut self) -> &mut [T]
fn channels_mut(&mut self) -> &mut [T]
Returns the components as a mutable slice
Source§fn 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
Source§fn 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
Source§fn 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
Source§fn to_luma_alpha(&self) -> LumaA<T>
fn to_luma_alpha(&self) -> LumaA<T>
Convert this pixel to luma with an alpha channel
Source§fn 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.Source§fn 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.Source§fn map_with_alpha<F, G>(&self, f: F, g: G) -> Luma<T>
fn map_with_alpha<F, G>(&self, f: F, g: G) -> Luma<T>
Apply the function
f to each channel except the alpha channel.
Apply the function g to the alpha channel.Source§fn apply_with_alpha<F, G>(&mut self, f: F, g: G)
fn apply_with_alpha<F, G>(&mut self, f: F, g: G)
Apply the function
f to each channel except the alpha channel.
Apply the function g to the alpha channel. Works in-place.Source§fn map2<F>(&self, other: &Luma<T>, f: F) -> Luma<T>where
F: FnMut(T, T) -> T,
fn map2<F>(&self, other: &Luma<T>, f: F) -> Luma<T>where
F: FnMut(T, T) -> T,
Apply the function
f to each channel of this pixel and
other pairwise.Source§fn apply2<F>(&mut self, other: &Luma<T>, f: F)where
F: FnMut(T, T) -> T,
fn apply2<F>(&mut self, other: &Luma<T>, f: F)where
F: FnMut(T, T) -> T,
Apply the function
f to each channel of this pixel and
other pairwise. Works in-place.Source§fn 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
Source§fn channel_count() -> u8
fn channel_count() -> u8
👎Deprecated: please use CHANNEL_COUNT associated constant
Returns the number of channels of this pixel type.
Source§fn color_model() -> &'static str
fn color_model() -> &'static str
👎Deprecated: please use COLOR_MODEL associated constant
Returns a string that can help to interpret the meaning each channel
See gimp babl.
Source§fn color_type() -> ColorType
fn color_type() -> ColorType
👎Deprecated: please use COLOR_TYPE associated constant
Returns the ColorType for this pixel format
Source§fn map_without_alpha<F>(&self, f: F) -> Self
fn map_without_alpha<F>(&self, f: F) -> Self
Apply the function
f to each channel except the alpha channel.Source§impl<T, U> WithChannel<U> for Luma<T>
impl<T, U> WithChannel<U> for Luma<T>
impl<T> Copy for Luma<T>
impl<T> Eq for Luma<T>
impl<T> StructuralPartialEq for Luma<T>where
T: Primitive,
Auto Trait Implementations§
impl<T> Freeze for Luma<T>where
T: Freeze,
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§
Source§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
Source§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
Source§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
Source§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
Source§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
Source§impl<T> ConvUtil for T
impl<T> ConvUtil for T
Source§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Approximate the subject to a given type with the default scheme.
Source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
Approximate the subject to a given type with a specific scheme.
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more