Struct Abgr

Source
#[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: Clone> Clone for Abgr<T>

Source§

fn clone(&self) -> Abgr<T>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T> ContiguousPixel for Abgr<T>
where T: PixelComponent,

Source§

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

Returns a mutable reference to the pixel type from a slice with the same number of components.
Source§

impl<T: Debug> Debug for Abgr<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Default> Default for Abgr<T>

Source§

fn default() -> Abgr<T>

Returns the “default value” for a type. Read more
Source§

impl<R, S> From<[R; 4]> for Abgr<S>
where R: Into<S>,

Source§

fn from(value: [R; 4]) -> Self

Converts to this type from the input type.
Source§

impl<R, S> From<Abgr<R>> for [S; 4]
where R: Into<S>,

Source§

fn from(value: Abgr<R>) -> Self

Converts to this type from the input type.
Source§

impl<R, S> From<Abgr<R>> for Argb<S>
where R: Into<S>,

Source§

fn from(value: Abgr<R>) -> Self

Converts to this type from the input type.
Source§

impl<R, S> From<Abgr<R>> for Bgr<S>
where R: Into<S>,

Source§

fn from(value: Abgr<R>) -> Self

Converts to this type from the input type.
Source§

impl<R, S> From<Abgr<R>> for Bgra<S>
where R: Into<S>,

Source§

fn from(value: Abgr<R>) -> Self

Converts to this type from the input type.
Source§

impl<R, S> From<Abgr<R>> for Rgb<S>
where R: Into<S>,

Source§

fn from(value: Abgr<R>) -> Self

Converts to this type from the input type.
Source§

impl<R, S> From<Abgr<R>> for Rgba<S>
where R: Into<S>,

Source§

fn from(value: Abgr<R>) -> Self

Converts to this type from the input type.
Source§

impl<R, S> From<Argb<R>> for Abgr<S>
where R: Into<S>,

Source§

fn from(value: Argb<R>) -> Self

Converts to this type from the input type.
Source§

impl<R, S> From<Bgra<R>> for Abgr<S>
where R: Into<S>,

Source§

fn from(value: Bgra<R>) -> Self

Converts to this type from the input type.
Source§

impl<R, S> From<Rgba<R>> for Abgr<S>
where R: Into<S>,

Source§

fn from(value: Rgba<R>) -> Self

Converts to this type from the input type.
Source§

impl<R, S> FromPixelCommon<Abgr<R>> for Abgr<S>

Source§

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>

Source§

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>

Source§

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>

Source§

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>

Source§

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>

Source§

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>

Source§

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>

Source§

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>

Source§

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>

Source§

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>

Source§

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>

Source§

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>

Source§

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>

Source§

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>

Source§

fn from_pixel_common(pixel: Rgba<R>) -> Self

Converts the given pixel type to the Self type.
Source§

impl<T: Hash> Hash for Abgr<T>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<T: Ord> Ord for Abgr<T>

Source§

fn cmp(&self, other: &Abgr<T>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<T: PartialEq> PartialEq for Abgr<T>

Source§

fn eq(&self, other: &Abgr<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: PartialOrd> PartialOrd for Abgr<T>

Source§

fn partial_cmp(&self, other: &Abgr<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<T> Pixel for Abgr<T>
where T: PixelComponent,

Source§

const COMPONENT_COUNT: u8 = 4u8

The total number of components in the pixel. Read more
Source§

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>

The same pixel type as Self but with a different component type U
Source§

type ComponentArray<R> = [R; 4]

The component array form of Self
Source§

type ColorArray<R> = [R; 3]

The color array form of Self
Source§

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>

Converts an owned Pixel type to an array of its color components.
Source§

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

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

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,

Maps each of the pixels components with a function f.
Source§

fn map_colors(&self, f: impl FnMut(Self::Component) -> Self::Component) -> Self

Maps each of the pixels color components with a function f.
Source§

fn map_alpha(&self, f: impl FnMut(Self::Component) -> Self::Component) -> Self

Maps the pixels alpha components with a function f. Read more
Source§

impl<T> WithAlpha for Abgr<T>
where T: PixelComponent,

Source§

type WithAlpha = Abgr<T>

The pixel type with its alpha component.
Source§

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.
Source§

impl<T: Copy> Copy for Abgr<T>

Source§

impl<T: Eq> Eq for Abgr<T>

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromComponentCommon<T> for T

Source§

fn from_component_common(component: T) -> T

Converts to this type from the input component type.
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.