#[repr(C)]pub struct Abgr<T> {
pub a: T,
pub b: T,
pub g: T,
pub r: T,
}
Expand description
An ABGR
pixel.
Fields§
§a: T
Alpha Component
b: T
Blue Component
g: T
Green Component
r: T
Red Component
Trait Implementations§
Source§impl<T> ContiguousPixel for Abgr<T>where
T: PixelComponent,
impl<T> ContiguousPixel for Abgr<T>where
T: PixelComponent,
Source§fn from_component_slice_ref(slice: &[Self::Component]) -> &Self
fn from_component_slice_ref(slice: &[Self::Component]) -> &Self
Returns a reference to the pixel type from a slice with the same number of components.
Source§fn from_component_slice_mut(slice: &mut [Self::Component]) -> &mut Self
fn from_component_slice_mut(slice: &mut [Self::Component]) -> &mut Self
Returns a mutable reference to the pixel type from a slice with the same number of components.
Source§impl<R, S> FromPixelCommon<Abgr<R>> for Abgr<S>
impl<R, S> FromPixelCommon<Abgr<R>> for Abgr<S>
Source§fn from_pixel_common(pixel: Abgr<R>) -> Self
fn from_pixel_common(pixel: Abgr<R>) -> Self
Converts the given pixel type to the
Self
type.Source§impl<R, S> FromPixelCommon<Abgr<R>> for Argb<S>
impl<R, S> FromPixelCommon<Abgr<R>> for Argb<S>
Source§fn from_pixel_common(pixel: Abgr<R>) -> Self
fn from_pixel_common(pixel: Abgr<R>) -> Self
Converts the given pixel type to the
Self
type.Source§impl<R, S> FromPixelCommon<Abgr<R>> for Bgr<S>
impl<R, S> FromPixelCommon<Abgr<R>> for Bgr<S>
Source§fn from_pixel_common(pixel: Abgr<R>) -> Self
fn from_pixel_common(pixel: Abgr<R>) -> Self
Converts the given pixel type to the
Self
type.Source§impl<R, S> FromPixelCommon<Abgr<R>> for Bgra<S>
impl<R, S> FromPixelCommon<Abgr<R>> for Bgra<S>
Source§fn from_pixel_common(pixel: Abgr<R>) -> Self
fn from_pixel_common(pixel: Abgr<R>) -> Self
Converts the given pixel type to the
Self
type.Source§impl<R, S> FromPixelCommon<Abgr<R>> for Gray<S>
impl<R, S> FromPixelCommon<Abgr<R>> for Gray<S>
Source§fn from_pixel_common(pixel: Abgr<R>) -> Self
fn from_pixel_common(pixel: Abgr<R>) -> Self
Converts the given pixel type to the
Self
type.Source§impl<R, S> FromPixelCommon<Abgr<R>> for GrayAlpha<S>
impl<R, S> FromPixelCommon<Abgr<R>> for GrayAlpha<S>
Source§fn from_pixel_common(pixel: Abgr<R>) -> Self
fn from_pixel_common(pixel: Abgr<R>) -> Self
Converts the given pixel type to the
Self
type.Source§impl<R, S> FromPixelCommon<Abgr<R>> for Rgb<S>
impl<R, S> FromPixelCommon<Abgr<R>> for Rgb<S>
Source§fn from_pixel_common(pixel: Abgr<R>) -> Self
fn from_pixel_common(pixel: Abgr<R>) -> Self
Converts the given pixel type to the
Self
type.Source§impl<R, S> FromPixelCommon<Abgr<R>> for Rgba<S>
impl<R, S> FromPixelCommon<Abgr<R>> for Rgba<S>
Source§fn from_pixel_common(pixel: Abgr<R>) -> Self
fn from_pixel_common(pixel: Abgr<R>) -> Self
Converts the given pixel type to the
Self
type.Source§impl<R, S> FromPixelCommon<Argb<R>> for Abgr<S>
impl<R, S> FromPixelCommon<Argb<R>> for Abgr<S>
Source§fn from_pixel_common(pixel: Argb<R>) -> Self
fn from_pixel_common(pixel: Argb<R>) -> Self
Converts the given pixel type to the
Self
type.Source§impl<R, S> FromPixelCommon<Bgr<R>> for Abgr<S>
impl<R, S> FromPixelCommon<Bgr<R>> for Abgr<S>
Source§fn from_pixel_common(pixel: Bgr<R>) -> Self
fn from_pixel_common(pixel: Bgr<R>) -> Self
Converts the given pixel type to the
Self
type.Source§impl<R, S> FromPixelCommon<Bgra<R>> for Abgr<S>
impl<R, S> FromPixelCommon<Bgra<R>> for Abgr<S>
Source§fn from_pixel_common(pixel: Bgra<R>) -> Self
fn from_pixel_common(pixel: Bgra<R>) -> Self
Converts the given pixel type to the
Self
type.Source§impl<R, S> FromPixelCommon<Gray<R>> for Abgr<S>
impl<R, S> FromPixelCommon<Gray<R>> for Abgr<S>
Source§fn from_pixel_common(pixel: Gray<R>) -> Self
fn from_pixel_common(pixel: Gray<R>) -> Self
Converts the given pixel type to the
Self
type.Source§impl<R, S> FromPixelCommon<GrayAlpha<R>> for Abgr<S>
impl<R, S> FromPixelCommon<GrayAlpha<R>> for Abgr<S>
Source§fn from_pixel_common(pixel: GrayAlpha<R>) -> Self
fn from_pixel_common(pixel: GrayAlpha<R>) -> Self
Converts the given pixel type to the
Self
type.Source§impl<R, S> FromPixelCommon<Rgb<R>> for Abgr<S>
impl<R, S> FromPixelCommon<Rgb<R>> for Abgr<S>
Source§fn from_pixel_common(pixel: Rgb<R>) -> Self
fn from_pixel_common(pixel: Rgb<R>) -> Self
Converts the given pixel type to the
Self
type.Source§impl<R, S> FromPixelCommon<Rgba<R>> for Abgr<S>
impl<R, S> FromPixelCommon<Rgba<R>> for Abgr<S>
Source§fn from_pixel_common(pixel: Rgba<R>) -> Self
fn from_pixel_common(pixel: Rgba<R>) -> Self
Converts the given pixel type to the
Self
type.Source§impl<T: Ord> Ord for Abgr<T>
impl<T: Ord> Ord for Abgr<T>
Source§impl<T: PartialOrd> PartialOrd for Abgr<T>
impl<T: PartialOrd> PartialOrd for Abgr<T>
Source§impl<T> Pixel for Abgr<T>where
T: PixelComponent,
impl<T> Pixel for Abgr<T>where
T: PixelComponent,
Source§const COMPONENT_COUNT: u8 = 4u8
const COMPONENT_COUNT: u8 = 4u8
The total number of components in the pixel. Read more
Source§type Component = T
type Component = T
The component type of the pixel used for both color and alpha components if any.
Source§type SelfType<U: PixelComponent> = Abgr<U>
type SelfType<U: PixelComponent> = Abgr<U>
The same pixel type as
Self
but with a different component type U
Source§type ComponentArray<R> = [R; 4]
type ComponentArray<R> = [R; 4]
The component array form of
Self
Source§type ColorArray<R> = [R; 3]
type ColorArray<R> = [R; 3]
The color array form of
Self
Source§fn component_array(&self) -> Self::ComponentArray<Self::Component>
fn component_array(&self) -> Self::ComponentArray<Self::Component>
Converts an owned
Pixel
type to an array of its components.Source§fn color_array(&self) -> Self::ColorArray<Self::Component>
fn color_array(&self) -> Self::ColorArray<Self::Component>
Converts an owned
Pixel
type to an array of its color components.Source§fn alpha(&self) -> Option<Self::Component>
fn alpha(&self) -> Option<Self::Component>
Returns the alpha component of the pixel if it has one.
Source§fn from_components(
components: impl IntoIterator<Item = Self::Component>,
) -> Self
fn from_components( components: impl IntoIterator<Item = Self::Component>, ) -> Self
Creates a new instance given an iterator of its components. Read more
Source§fn from_colors_alpha(
colors: impl IntoIterator<Item = Self::Component>,
alpha: Self::Component,
) -> Self
fn from_colors_alpha( colors: impl IntoIterator<Item = Self::Component>, alpha: Self::Component, ) -> Self
Create a new instance given an array of its color components and an alpha component. Read more
Source§fn map_components<U>(
&self,
f: impl FnMut(Self::Component) -> U,
) -> Self::SelfType<U>where
U: PixelComponent,
fn map_components<U>(
&self,
f: impl FnMut(Self::Component) -> U,
) -> Self::SelfType<U>where
U: PixelComponent,
Maps each of the pixels components with a function
f
.Source§impl<T> WithAlpha for Abgr<T>where
T: PixelComponent,
impl<T> WithAlpha for Abgr<T>where
T: PixelComponent,
Source§fn with_alpha(self) -> Self::WithAlpha
fn with_alpha(self) -> Self::WithAlpha
Returns the pixel type with its alpha component. If no alpha component is already contained
then it is set to the maximum value.
PixelComponent
.impl<T: Copy> Copy for Abgr<T>
impl<T: Eq> Eq for Abgr<T>
impl<T> StructuralPartialEq for Abgr<T>
Auto Trait Implementations§
impl<T> Freeze for Abgr<T>where
T: Freeze,
impl<T> RefUnwindSafe for Abgr<T>where
T: RefUnwindSafe,
impl<T> Send for Abgr<T>where
T: Send,
impl<T> Sync for Abgr<T>where
T: Sync,
impl<T> Unpin for Abgr<T>where
T: Unpin,
impl<T> UnwindSafe for Abgr<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FromComponentCommon<T> for T
impl<T> FromComponentCommon<T> for T
Source§fn from_component_common(component: T) -> T
fn from_component_common(component: T) -> T
Converts to this type from the input component type.