Struct image::Luma
[−]
[src]
#[repr(C)]pub struct Luma<T: Primitive> { pub data: [T; 1], }
Grayscale colors
Fields
data: [T; 1]
Trait Implementations
impl<T: PartialEq + Primitive> PartialEq for Luma<T>
[src]
fn eq(&self, __arg_0: &Luma<T>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Luma<T>) -> bool
[src]
This method tests for !=
.
impl<T: Eq + Primitive> Eq for Luma<T>
[src]
impl<T: Clone + Primitive> Clone for Luma<T>
[src]
fn clone(&self) -> Luma<T>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T: Debug + Primitive> Debug for Luma<T>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<T: Copy + Primitive> Copy for Luma<T>
[src]
impl<T: Hash + Primitive> Hash for Luma<T>
[src]
fn hash<__HT: Hasher>(&self, __arg_0: &mut __HT)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<T: Primitive + 'static> Pixel for Luma<T>
[src]
type Subpixel = T
The underlying subpixel type.
fn channel_count() -> u8
[src]
Returns the number of channels of this pixel type.
fn color_model() -> &'static str
[src]
Returns a string that can help to interpret the meaning each channel See gimp babl. Read more
fn color_type() -> ColorType
[src]
Returns the ColorType for this pixel format
fn channels(&self) -> &[T]
[src]
Returns the components as a slice.
fn channels_mut(&mut self) -> &mut [T]
[src]
Returns the components as a mutable slice
fn channels4(&self) -> (T, T, T, T)
[src]
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
fn from_channels(a: T, b: T, c: T, d: T) -> Luma<T>
[src]
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
fn from_slice(slice: &[T]) -> &Luma<T>
[src]
Returns a view into a slice. Read more
fn from_slice_mut(slice: &mut [T]) -> &mut Luma<T>
[src]
Returns mutable view into a mutable slice. Read more
fn to_rgb(&self) -> Rgb<T>
[src]
Convert this pixel to RGB
fn to_rgba(&self) -> Rgba<T>
[src]
Convert this pixel to RGB with an alpha channel
fn to_luma(&self) -> Luma<T>
[src]
Convert this pixel to luma
fn to_luma_alpha(&self) -> LumaA<T>
[src]
Convert this pixel to luma with an alpha channel
fn map<F>(&self, f: F) -> Luma<T> where
F: FnMut(T) -> T,
[src]
F: FnMut(T) -> T,
Apply the function f
to each channel of this pixel.
fn apply<F>(&mut self, f: F) where
F: FnMut(T) -> T,
[src]
F: FnMut(T) -> T,
Apply the function f
to each channel of this pixel.
fn map_with_alpha<F, G>(&self, f: F, g: G) -> Luma<T> where
F: FnMut(T) -> T,
G: FnMut(T) -> T,
[src]
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 more
fn apply_with_alpha<F, G>(&mut self, f: F, g: G) where
F: FnMut(T) -> T,
G: FnMut(T) -> T,
[src]
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 more
fn map2<F>(&self, other: &Self, f: F) -> Luma<T> where
F: FnMut(T, T) -> T,
[src]
F: FnMut(T, T) -> T,
Apply the function f
to each channel of this pixel and other
pairwise. Read more
fn apply2<F>(&mut self, other: &Luma<T>, f: F) where
F: FnMut(T, T) -> T,
[src]
F: FnMut(T, T) -> T,
Apply the function f
to each channel of this pixel and other
pairwise. Works in-place. Read more
fn invert(&mut self)
[src]
Invert this pixel
fn blend(&mut self, other: &Luma<T>)
[src]
Blend the color of a given pixel into ourself, taking into account alpha channels
impl<T: Primitive> Index<usize> for Luma<T>
[src]
type Output = T
The returned type after indexing.
fn index(&self, _index: usize) -> &T
[src]
Performs the indexing (container[index]
) operation.