#[repr(C)]pub struct Argb<T, A = T> {
pub a: A,
pub r: T,
pub g: T,
pub b: T,
}
Expand description
An Alpha + Red + Green + Blue
pixel.
§Examples
use rgb::Argb;
let pixel: Argb<u8> = Argb { a: 255, r: 0, g: 0, b: 0 };
Fields§
§a: A
Alpha Component
r: T
Red Component
g: T
Green Component
b: T
Blue Component
Implementations§
Source§impl<T, A> Argb<T, A>
impl<T, A> Argb<T, A>
Trait Implementations§
Source§impl<T> AddAssign<T> for Argb<T>
px + 1
impl<T> AddAssign<T> for Argb<T>
px + 1
Source§fn add_assign(&mut self, r: T)
fn add_assign(&mut self, r: T)
Performs the
+=
operation. Read moreSource§impl<T, A> AddAssign for Argb<T, A>
px + px
impl<T, A> AddAssign for Argb<T, A>
px + px
Source§fn add_assign(&mut self, other: Argb<T, A>)
fn add_assign(&mut self, other: Argb<T, A>)
Performs the
+=
operation. Read moreSource§impl<T> AsPixels<Argb<T>> for [T]
impl<T> AsPixels<Argb<T>> for [T]
Source§fn as_pixels_mut(&mut self) -> &mut [Argb<T>]
fn as_pixels_mut(&mut self) -> &mut [Argb<T>]
Use
::bytemuck::cast_slice_mut()
instead. Read moreSource§impl<T, A, B> ColorComponentMap<Argb<B, A>, T, B> for Argb<T, A>
impl<T, A, B> ColorComponentMap<Argb<B, A>, T, B> for Argb<T, A>
Source§impl<T> ComponentSlice<T> for Argb<T>
impl<T> ComponentSlice<T> for Argb<T>
Source§impl<T> DivAssign<T> for Argb<T>
px * 1
impl<T> DivAssign<T> for Argb<T>
px * 1
Source§fn div_assign(&mut self, r: T)
fn div_assign(&mut self, r: T)
Performs the
/=
operation. Read moreSource§impl<R, S> From<(R, R, R, R)> for Argb<S>where
R: Into<S>,
impl<R, S> From<(R, R, R, R)> for Argb<S>where
R: Into<S>,
Source§fn from(value: (R, R, R, R)) -> Argb<S>
fn from(value: (R, R, R, R)) -> Argb<S>
Converts to this type from the input type.
Source§impl<R, S> From<Argb<R>> for (S, S, S, S)where
R: Into<S>,
impl<R, S> From<Argb<R>> for (S, S, S, S)where
R: Into<S>,
Source§fn from(value: Argb<R>) -> (S, S, S, S)
fn from(value: Argb<R>) -> (S, S, S, S)
Converts to this type from the input type.
Source§impl<T> MulAssign<T> for Argb<T>
px * 1
impl<T> MulAssign<T> for Argb<T>
px * 1
Source§fn mul_assign(&mut self, r: T)
fn mul_assign(&mut self, r: T)
Performs the
*=
operation. Read moreSource§impl<T, A> Ord for Argb<T, A>
impl<T, A> Ord for Argb<T, A>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T, A> PartialOrd for Argb<T, A>where
T: PartialOrd,
A: PartialOrd,
impl<T, A> PartialOrd for Argb<T, A>where
T: PartialOrd,
A: PartialOrd,
Source§impl<T> SubAssign<T> for Argb<T>
px - 1
impl<T> SubAssign<T> for Argb<T>
px - 1
Source§fn sub_assign(&mut self, r: T)
fn sub_assign(&mut self, r: T)
Performs the
-=
operation. Read moreSource§impl<T, A> SubAssign for Argb<T, A>
px - px
impl<T, A> SubAssign for Argb<T, A>
px - px
Source§fn sub_assign(&mut self, other: Argb<T, A>)
fn sub_assign(&mut self, other: Argb<T, A>)
Performs the
-=
operation. Read moreSource§impl<T, A> Zeroable for Argb<T, A>
This is unsound. You can disable as-bytes
feature, enable bytemuck
, and use bytemuck::cast_slice()
instead.
impl<T, A> Zeroable for Argb<T, A>
This is unsound. You can disable as-bytes
feature, enable bytemuck
, and use bytemuck::cast_slice()
instead.
impl<T, A> Copy for Argb<T, A>
impl<T, A> Eq for Argb<T, A>
impl<T, A> Pod for Argb<T, A>
This is unsound. You can disable as-bytes
feature, enable bytemuck
, and use bytemuck::cast_slice()
instead.
impl<T, A> StructuralPartialEq for Argb<T, A>
Auto Trait Implementations§
impl<T, A> Freeze for Argb<T, A>
impl<T, A> RefUnwindSafe for Argb<T, A>where
A: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, A> Send for Argb<T, A>
impl<T, A> Sync for Argb<T, A>
impl<T, A> Unpin for Argb<T, A>
impl<T, A> UnwindSafe for Argb<T, A>where
A: UnwindSafe,
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> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§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>
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.Source§impl<Target, Original> VectorizedInto<Target> for Originalwhere
Target: VectorizedFrom<Original>,
impl<Target, Original> VectorizedInto<Target> for Originalwhere
Target: VectorizedFrom<Original>,
Source§fn vectorized_into(self) -> Target
fn vectorized_into(self) -> Target
Performs the conversion.