#[repr(C)]pub struct RGBA<T, A = T> {
pub r: T,
pub g: T,
pub b: T,
pub a: A,
}Expand description
A Red + Green + Blue + Alpha pixel.
§Examples
use rgb::Rgba;
let pixel: Rgba<u8> = Rgba { r: 0, g: 0, b: 0, a: 255 };Fields§
§r: TRed Component
g: TGreen Component
b: TBlue Component
a: AAlpha Component
Implementations§
Source§impl<T, A> Rgba<T, A>
impl<T, A> Rgba<T, A>
Trait Implementations§
Source§impl<T> AddAssign<T> for Rgba<T>
px + 1
impl<T> AddAssign<T> for Rgba<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 Rgba<T, A>
px + px
impl<T, A> AddAssign for Rgba<T, A>
px + px
Source§fn add_assign(&mut self, other: Rgba<T, A>)
fn add_assign(&mut self, other: Rgba<T, A>)
Performs the
+= operation. Read moreSource§impl<T, A, B> ColorComponentMap<Rgba<B, A>, T, B> for Rgba<T, A>
impl<T, A, B> ColorComponentMap<Rgba<B, A>, T, B> for Rgba<T, A>
Source§impl<T> ComponentSlice<T> for Rgba<T>
impl<T> ComponentSlice<T> for Rgba<T>
Source§impl<T> DivAssign<T> for Rgba<T>
px * 1
impl<T> DivAssign<T> for Rgba<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 Rgba<S>where
R: Into<S>,
impl<R, S> From<(R, R, R, R)> for Rgba<S>where
R: Into<S>,
Source§fn from(value: (R, R, R, R)) -> Rgba<S>
fn from(value: (R, R, R, R)) -> Rgba<S>
Converts to this type from the input type.
Source§impl<T, A> From<GrayAlpha_v08<T, A>> for Rgba<T, A>where
T: Clone,
impl<T, A> From<GrayAlpha_v08<T, A>> for Rgba<T, A>where
T: Clone,
Source§fn from(other: GrayAlpha_v08<T, A>) -> Rgba<T, A>
fn from(other: GrayAlpha_v08<T, A>) -> Rgba<T, A>
Converts to this type from the input type.
Source§impl<T> FromIterator<T> for Rgba<T>
impl<T> FromIterator<T> for Rgba<T>
Source§fn from_iter<I>(into_iter: I) -> Rgba<T>where
I: IntoIterator<Item = T>,
fn from_iter<I>(into_iter: I) -> Rgba<T>where
I: IntoIterator<Item = T>,
Takes exactly 4 elements from the iterator and creates a new instance. Panics if there are fewer elements in the iterator.
Source§impl<T> MulAssign<T> for Rgba<T>
px * 1
impl<T> MulAssign<T> for Rgba<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 Rgba<T, A>
impl<T, A> Ord for Rgba<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 Rgba<T, A>where
T: PartialOrd,
A: PartialOrd,
impl<T, A> PartialOrd for Rgba<T, A>where
T: PartialOrd,
A: PartialOrd,
Source§impl<T> SubAssign<T> for Rgba<T>
px - 1
impl<T> SubAssign<T> for Rgba<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 Rgba<T, A>
px - px
impl<T, A> SubAssign for Rgba<T, A>
px - px
Source§fn sub_assign(&mut self, other: Rgba<T, A>)
fn sub_assign(&mut self, other: Rgba<T, A>)
Performs the
-= operation. Read moreimpl<T, A> Copy for Rgba<T, A>
impl<T, A> Eq for Rgba<T, A>
impl<T, A> StructuralPartialEq for Rgba<T, A>
Auto Trait Implementations§
impl<T, A> Freeze for Rgba<T, A>
impl<T, A> RefUnwindSafe for Rgba<T, A>where
T: RefUnwindSafe,
A: RefUnwindSafe,
impl<T, A> Send for Rgba<T, A>
impl<T, A> Sync for Rgba<T, A>
impl<T, A> Unpin for Rgba<T, A>
impl<T, A> UnwindSafe for Rgba<T, A>where
T: UnwindSafe,
A: 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