Struct image::LumaA
[−]
[src]
#[repr(C)]pub struct LumaA<T: Primitive> { pub data: [T; 2], }
Grayscale colors + alpha channel
Fields
data: [T; 2]
Trait Implementations
impl<T: PartialEq + Primitive> PartialEq for LumaA<T>[src]
fn eq(&self, __arg_0: &LumaA<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: &LumaA<T>) -> bool[src]
This method tests for !=.
impl<T: Eq + Primitive> Eq for LumaA<T>[src]
impl<T: Clone + Primitive> Clone for LumaA<T>[src]
fn clone(&self) -> LumaA<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 LumaA<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 LumaA<T>[src]
impl<T: Hash + Primitive> Hash for LumaA<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 LumaA<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 interprete 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) -> LumaA<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<'a>(slice: &'a [T]) -> &'a LumaA<T>[src]
Returns a view into a slice. Read more
fn from_slice_mut<'a>(slice: &'a mut [T]) -> &'a mut LumaA<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) -> LumaA<T> where
F: Fn(T) -> T, [src]
F: Fn(T) -> T,
Apply the function f to each channel of this pixel.
fn apply<F>(&mut self, f: F) where
F: Fn(T) -> T, [src]
F: Fn(T) -> T,
Apply the function f to each channel of this pixel.
fn map_with_alpha<F, G>(&self, f: F, g: G) -> LumaA<T> where
F: Fn(T) -> T,
G: Fn(T) -> T, [src]
F: Fn(T) -> T,
G: Fn(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: Fn(T) -> T,
G: Fn(T) -> T, [src]
F: Fn(T) -> T,
G: Fn(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) -> LumaA<T> where
F: Fn(T, T) -> T, [src]
F: Fn(T, T) -> T,
Apply the function f to each channel of this pixel and other pairwise. Read more
fn apply2<F>(&mut self, other: &LumaA<T>, f: F) where
F: Fn(T, T) -> T, [src]
F: Fn(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: &LumaA<T>)[src]
Blend the color of a given pixel into ourself, taking into account alpha channels
impl<T: Primitive> Index<usize> for LumaA<T>[src]
type Output = T
The returned type after indexing.
ⓘImportant traits for &'a mut Rfn index<'a>(&'a self, _index: usize) -> &'a T[src]
Performs the indexing (container[index]) operation.