#[repr(C)]pub struct Bgra<T>(pub [T; 4])
where
T: Primitive;Expand description
BGR colors + alpha channel
Tuple Fields§
§0: [T; 4]Trait Implementations§
Source§impl<T> Pixel for Bgra<T>where
T: Primitive + 'static,
impl<T> Pixel for Bgra<T>where
T: Primitive + 'static,
Source§const CHANNEL_COUNT: u8 = 4u8
const CHANNEL_COUNT: u8 = 4u8
The number of channels of this pixel type.
Source§const COLOR_MODEL: &'static str = "BGRA"
const COLOR_MODEL: &'static str = "BGRA"
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) -> Bgra<T>
fn from_channels(a: T, b: T, c: T, d: T) -> Bgra<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 Bgra<T>
fn from_slice_mut(slice: &mut [T]) -> &mut Bgra<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) -> Bgra<T>where
F: FnMut(T) -> T,
fn map<F>(&self, f: F) -> Bgra<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) -> Bgra<T>
fn map_with_alpha<F, G>(&self, f: F, g: G) -> Bgra<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: &Bgra<T>, f: F) -> Bgra<T>where
F: FnMut(T, T) -> T,
fn map2<F>(&self, other: &Bgra<T>, f: F) -> Bgra<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: &Bgra<T>, f: F)where
F: FnMut(T, T) -> T,
fn apply2<F>(&mut self, other: &Bgra<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: &Bgra<T>)
fn blend(&mut self, other: &Bgra<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.impl<T> Copy for Bgra<T>
impl<T> Eq for Bgra<T>
impl<T> StructuralPartialEq for Bgra<T>where
T: Primitive,
Auto Trait Implementations§
impl<T> Freeze for Bgra<T>where
T: Freeze,
impl<T> RefUnwindSafe for Bgra<T>where
T: RefUnwindSafe,
impl<T> Send for Bgra<T>where
T: Send,
impl<T> Sync for Bgra<T>where
T: Sync,
impl<T> Unpin for Bgra<T>where
T: Unpin,
impl<T> UnwindSafe for Bgra<T>where
T: UnwindSafe,
Blanket Implementations§
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