Struct plot_interface::dependency::image::LumaA
[−]Expand description
Grayscale colors + alpha channel
Tuple Fields
0: [T; 2]
Trait Implementations
impl<T> Pixel for LumaA<T> where
T: Primitive,
impl<T> Pixel for LumaA<T> where
T: Primitive,
type Subpixel = T
type Subpixel = T
The scalar type that is used to store each channel in this pixel.
const CHANNEL_COUNT: u8 = 2u8
const CHANNEL_COUNT: u8 = 2u8
The number of channels of this pixel type.
fn channels(&self) -> &[T]ⓘNotable traits for &mut [u8]impl Write for &mut [u8]impl Read for &[u8]
fn channels(&self) -> &[T]ⓘNotable traits for &mut [u8]impl Write for &mut [u8]impl Read for &[u8]
Returns the components as a slice.
fn channels_mut(&mut self) -> &mut [T]ⓘNotable traits for &mut [u8]impl Write for &mut [u8]impl Read for &[u8]
fn channels_mut(&mut self) -> &mut [T]ⓘNotable traits for &mut [u8]impl Write for &mut [u8]impl Read for &[u8]
Returns the components as a mutable slice
const COLOR_MODEL: &'static str = "YA"
const COLOR_MODEL: &'static str = "YA"
fn channels4(&self) -> (T, T, T, T)
fn channels4(&self) -> (T, T, T, T)
Use channels()
or channels_mut()
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>
fn from_channels(a: T, b: T, c: T, d: T) -> LumaA<T>
Use the constructor of the pixel, for example Rgba::new(r,g,b,a)
or Pixel::from_slice
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]) -> &LumaA<T>
fn from_slice(slice: &[T]) -> &LumaA<T>
Returns a view into a slice. Read more
fn 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
fn to_luma_alpha(&self) -> LumaA<T>
fn to_luma_alpha(&self) -> LumaA<T>
Convert this pixel to luma with an alpha channel
fn 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.
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.
fn 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 more
fn 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 more
fn map2<F>(&self, other: &LumaA<T>, f: F) -> LumaA<T> where
F: FnMut(T, T) -> T,
fn map2<F>(&self, other: &LumaA<T>, f: F) -> LumaA<T> where
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: &LumaA<T>, f: F) where
F: FnMut(T, T) -> T,
fn apply2<F>(&mut self, other: &LumaA<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. Read more
fn invert(&mut self)
fn invert(&mut self)
Invert this pixel
fn blend(&mut self, other: &LumaA<T>)
fn blend(&mut self, other: &LumaA<T>)
Blend the color of a given pixel into ourself, taking into account alpha channels
fn map_without_alpha<F>(&self, f: F) -> Self where
F: FnMut(Self::Subpixel) -> Self::Subpixel,
fn map_without_alpha<F>(&self, f: F) -> Self where
F: FnMut(Self::Subpixel) -> Self::Subpixel,
Apply the function f
to each channel except the alpha channel.
fn 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 more
impl PixelWithColorType for LumaA<u16>
impl PixelWithColorType for LumaA<u16>
const COLOR_TYPE: ColorType = ColorType::La16
const COLOR_TYPE: ColorType = ColorType::La16
This pixel has the format of one of the predefined ColorType
s,
such as Rgb8
, La16
or Rgba32F
.
This is needed for automatically detecting
a color format when saving an image as a file. Read more
impl PixelWithColorType for LumaA<u8>
impl PixelWithColorType for LumaA<u8>
const COLOR_TYPE: ColorType = ColorType::La8
const COLOR_TYPE: ColorType = ColorType::La8
This pixel has the format of one of the predefined ColorType
s,
such as Rgb8
, La16
or Rgba32F
.
This is needed for automatically detecting
a color format when saving an image as a file. Read more
impl<T> Copy for LumaA<T> where
T: Copy,
impl<T> Eq for LumaA<T> where
T: Eq,
impl<T> StructuralEq for LumaA<T>
impl<T> 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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
type Err = Infallible
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<Target, Original> VectorizedInto<Target> for Original where
Target: VectorizedFrom<Original>,
impl<Target, Original> VectorizedInto<Target> for Original where
Target: VectorizedFrom<Original>,
sourcefn vectorized_into(self) -> Target
fn vectorized_into(self) -> Target
Performs the conversion.