Struct rgb::RGBA [−][src]
#[repr(C)]pub struct RGBA<ComponentType, AlphaComponentType = ComponentType> { pub r: ComponentType, pub g: ComponentType, pub b: ComponentType, pub a: AlphaComponentType, }
The RGBA pixel
The component type can be u8
(aliased as RGBA8
), u16
(aliased as RGBA16
),
or any other type (but simple copyable types are recommended.)
You can specify a different type for alpha, but it’s only for special cases
(e.g. if you use a newtype like RGBA<LinearLight<u16>, u16>
).
Fields
r: ComponentType
Red
g: ComponentType
Green
b: ComponentType
Blue
a: AlphaComponentType
Alpha
Implementations
impl<T: Copy, A: Clone> RGBA<T, A>
[src]
impl<T: Copy, A: Clone> RGBA<T, A>
[src]Trait Implementations
impl<T, A> AddAssign<RGBA<T, A>> for RGBA<T, A> where
T: Add<Output = T> + Copy,
A: Add<Output = A> + Copy,
[src]
impl<T, A> AddAssign<RGBA<T, A>> for RGBA<T, A> where
T: Add<Output = T> + Copy,
A: Add<Output = A> + Copy,
[src]px + px
fn add_assign(&mut self, other: RGBA<T, A>)
[src]
fn add_assign(&mut self, other: RGBA<T, A>)
[src]Performs the +=
operation. Read more
impl<T> AddAssign<T> for RGBA<T> where
T: Copy + Add<Output = T>,
[src]
impl<T> AddAssign<T> for RGBA<T> where
T: Copy + Add<Output = T>,
[src]px + 1
fn add_assign(&mut self, r: T)
[src]
fn add_assign(&mut self, r: T)
[src]Performs the +=
operation. Read more
impl<T> AsPixels<RGBA<T, T>> for [T]
[src]
impl<T> AsPixels<RGBA<T, T>> for [T]
[src]impl<ComponentType: Clone, AlphaComponentType: Clone> Clone for RGBA<ComponentType, AlphaComponentType>
[src]
impl<ComponentType: Clone, AlphaComponentType: Clone> Clone for RGBA<ComponentType, AlphaComponentType>
[src]impl<T: Copy, B> ComponentMap<RGBA<B, B>, T, B> for RGBA<T>
[src]
impl<T: Copy, B> ComponentMap<RGBA<B, B>, T, B> for RGBA<T>
[src]impl<T> ComponentSlice<T> for RGBA<T>
[src]
impl<T> ComponentSlice<T> for RGBA<T>
[src]impl<ComponentType: Debug, AlphaComponentType: Debug> Debug for RGBA<ComponentType, AlphaComponentType>
[src]
impl<ComponentType: Debug, AlphaComponentType: Debug> Debug for RGBA<ComponentType, AlphaComponentType>
[src]impl<ComponentType: Default, AlphaComponentType: Default> Default for RGBA<ComponentType, AlphaComponentType>
[src]
impl<ComponentType: Default, AlphaComponentType: Default> Default for RGBA<ComponentType, AlphaComponentType>
[src]impl<'de, ComponentType, AlphaComponentType> Deserialize<'de> for RGBA<ComponentType, AlphaComponentType> where
ComponentType: Deserialize<'de>,
AlphaComponentType: Deserialize<'de>,
[src]
impl<'de, ComponentType, AlphaComponentType> Deserialize<'de> for RGBA<ComponentType, AlphaComponentType> where
ComponentType: Deserialize<'de>,
AlphaComponentType: Deserialize<'de>,
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
impl<T> DivAssign<T> for RGBA<T> where
T: Copy + Div<Output = T>,
[src]
impl<T> DivAssign<T> for RGBA<T> where
T: Copy + Div<Output = T>,
[src]px * 1
fn div_assign(&mut self, r: T)
[src]
fn div_assign(&mut self, r: T)
[src]Performs the /=
operation. Read more
impl<T> FromIterator<T> for RGBA<T>
[src]
impl<T> FromIterator<T> for RGBA<T>
[src]fn from_iter<I: IntoIterator<Item = T>>(into_iter: I) -> Self
[src]
fn from_iter<I: IntoIterator<Item = T>>(into_iter: I) -> Self
[src]Takes exactly 4 elements from the iterator and creates a new instance. Panics if there are fewer elements in the iterator.
impl<ComponentType: Hash, AlphaComponentType: Hash> Hash for RGBA<ComponentType, AlphaComponentType>
[src]
impl<ComponentType: Hash, AlphaComponentType: Hash> Hash for RGBA<ComponentType, AlphaComponentType>
[src]impl<T> MulAssign<T> for RGBA<T> where
T: Copy + Mul<Output = T>,
[src]
impl<T> MulAssign<T> for RGBA<T> where
T: Copy + Mul<Output = T>,
[src]px * 1
fn mul_assign(&mut self, r: T)
[src]
fn mul_assign(&mut self, r: T)
[src]Performs the *=
operation. Read more
impl<ComponentType: Ord, AlphaComponentType: Ord> Ord for RGBA<ComponentType, AlphaComponentType>
[src]
impl<ComponentType: Ord, AlphaComponentType: Ord> Ord for RGBA<ComponentType, AlphaComponentType>
[src]#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]Compares and returns the maximum of two values. Read more
impl<ComponentType: PartialEq, AlphaComponentType: PartialEq> PartialEq<RGBA<ComponentType, AlphaComponentType>> for RGBA<ComponentType, AlphaComponentType>
[src]
impl<ComponentType: PartialEq, AlphaComponentType: PartialEq> PartialEq<RGBA<ComponentType, AlphaComponentType>> for RGBA<ComponentType, AlphaComponentType>
[src]impl<ComponentType: PartialOrd, AlphaComponentType: PartialOrd> PartialOrd<RGBA<ComponentType, AlphaComponentType>> for RGBA<ComponentType, AlphaComponentType>
[src]
impl<ComponentType: PartialOrd, AlphaComponentType: PartialOrd> PartialOrd<RGBA<ComponentType, AlphaComponentType>> for RGBA<ComponentType, AlphaComponentType>
[src]fn partial_cmp(
&self,
other: &RGBA<ComponentType, AlphaComponentType>
) -> Option<Ordering>
[src]
fn partial_cmp(
&self,
other: &RGBA<ComponentType, AlphaComponentType>
) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<ComponentType, AlphaComponentType> Serialize for RGBA<ComponentType, AlphaComponentType> where
ComponentType: Serialize,
AlphaComponentType: Serialize,
[src]
impl<ComponentType, AlphaComponentType> Serialize for RGBA<ComponentType, AlphaComponentType> where
ComponentType: Serialize,
AlphaComponentType: Serialize,
[src]impl<T, A> SubAssign<RGBA<T, A>> for RGBA<T, A> where
T: Sub<Output = T> + Copy,
A: Sub<Output = A> + Copy,
[src]
impl<T, A> SubAssign<RGBA<T, A>> for RGBA<T, A> where
T: Sub<Output = T> + Copy,
A: Sub<Output = A> + Copy,
[src]px - px
fn sub_assign(&mut self, other: RGBA<T, A>)
[src]
fn sub_assign(&mut self, other: RGBA<T, A>)
[src]Performs the -=
operation. Read more
impl<T> SubAssign<T> for RGBA<T> where
T: Copy + Sub<Output = T>,
[src]
impl<T> SubAssign<T> for RGBA<T> where
T: Copy + Sub<Output = T>,
[src]px - 1
fn sub_assign(&mut self, r: T)
[src]
fn sub_assign(&mut self, r: T)
[src]Performs the -=
operation. Read more
impl<T, A> Sum<RGBA<T, A>> for RGBA<T, A> where
T: Default + Add<Output = T>,
A: Default + Add<Output = A>,
[src]
impl<T, A> Sum<RGBA<T, A>> for RGBA<T, A> where
T: Default + Add<Output = T>,
A: Default + Add<Output = A>,
[src]impl<ComponentType: Copy, AlphaComponentType: Copy> Copy for RGBA<ComponentType, AlphaComponentType>
[src]
impl<ComponentType: Eq, AlphaComponentType: Eq> Eq for RGBA<ComponentType, AlphaComponentType>
[src]
impl<T, A> Pod for RGBA<T, A> where
T: Pod,
A: Pod,
[src]
T: Pod,
A: Pod,
impl<ComponentType, AlphaComponentType> StructuralEq for RGBA<ComponentType, AlphaComponentType>
[src]
impl<ComponentType, AlphaComponentType> StructuralPartialEq for RGBA<ComponentType, AlphaComponentType>
[src]
Auto Trait Implementations
impl<ComponentType, AlphaComponentType> RefUnwindSafe for RGBA<ComponentType, AlphaComponentType> where
AlphaComponentType: RefUnwindSafe,
ComponentType: RefUnwindSafe,
AlphaComponentType: RefUnwindSafe,
ComponentType: RefUnwindSafe,
impl<ComponentType, AlphaComponentType> Send for RGBA<ComponentType, AlphaComponentType> where
AlphaComponentType: Send,
ComponentType: Send,
AlphaComponentType: Send,
ComponentType: Send,
impl<ComponentType, AlphaComponentType> Sync for RGBA<ComponentType, AlphaComponentType> where
AlphaComponentType: Sync,
ComponentType: Sync,
AlphaComponentType: Sync,
ComponentType: Sync,
impl<ComponentType, AlphaComponentType> Unpin for RGBA<ComponentType, AlphaComponentType> where
AlphaComponentType: Unpin,
ComponentType: Unpin,
AlphaComponentType: Unpin,
ComponentType: Unpin,
impl<ComponentType, AlphaComponentType> UnwindSafe for RGBA<ComponentType, AlphaComponentType> where
AlphaComponentType: UnwindSafe,
ComponentType: UnwindSafe,
AlphaComponentType: UnwindSafe,
ComponentType: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,