Expand description
Grayscale colors + alpha channel
Tuple Fields
0: [T; 2]
Trait Implementations
type Subpixel = T
type Subpixel = T
The scalar type that is used to store each channel in this pixel.
The number of channels of this pixel type.
Returns the components as a slice.
Returns the components as a mutable slice
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
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
Returns a view into a slice. Read more
Returns mutable view into a mutable slice. Read more
Convert this pixel to luma with an alpha channel
Apply the function f
to each channel of this pixel.
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
Apply the function f
to each channel except the alpha channel.
Apply the function g
to the alpha channel. Works in-place. Read more
Apply the function f
to each channel of this pixel and
other
pairwise. Read more
Apply the function f
to each channel of this pixel and
other
pairwise. Works in-place. Read more
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.
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
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
Auto Trait Implementations
impl<T> RefUnwindSafe for LumaA<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for LumaA<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more