Struct rgb::alt::BGRA [−][src]
#[repr(C)]pub struct BGRA<ComponentType, AlphaComponentType = ComponentType> { pub b: ComponentType, pub g: ComponentType, pub r: ComponentType, pub a: AlphaComponentType, }
BGR+A
Fields
b: ComponentType
Blue first
g: ComponentType
Green
r: ComponentType
Red
a: AlphaComponentType
Alpha last
Methods
impl<T: Clone> BGRA<T>
[src]
impl<T: Clone> BGRA<T>
impl<T: Clone, A> BGRA<T, A>
[src]
impl<T: Clone, A> BGRA<T, A>
impl<T, A> BGRA<T, A>
[src]
impl<T, A> BGRA<T, A>
pub fn rgb_mut(&mut self) -> &mut BGR<T>
[src]
pub fn rgb_mut(&mut self) -> &mut BGR<T>
Provide a mutable view of only RGB components (leaving out alpha). Useful to change color without changing opacity.
impl<T: Copy, A: Clone> BGRA<T, A>
[src]
impl<T: Copy, A: Clone> BGRA<T, A>
pub fn map_rgb<F, U, B>(&self, f: F) -> BGRA<U, B> where
F: FnMut(T) -> U,
U: Clone,
B: From<A> + Clone,
[src]
pub fn map_rgb<F, U, B>(&self, f: F) -> BGRA<U, B> where
F: FnMut(T) -> U,
U: Clone,
B: From<A> + Clone,
Create new RGBA with the same alpha value, but different RGB values
Trait Implementations
impl<T: Copy> From<RGB<T>> for BGRA<T, u8>
[src]
impl<T: Copy> From<RGB<T>> for BGRA<T, u8>
Assumes 255 is opaque
impl<T: Copy> From<RGB<T>> for BGRA<T, u16>
[src]
impl<T: Copy> From<RGB<T>> for BGRA<T, u16>
Assumes 255 is opaque
impl<T: Copy, B> ComponentMap<BGRA<B>, T, B> for BGRA<T>
[src]
impl<T: Copy, B> ComponentMap<BGRA<B>, T, B> for BGRA<T>
fn map<F>(&self, f: F) -> BGRA<B> where
F: FnMut(T) -> B,
[src]
fn map<F>(&self, f: F) -> BGRA<B> where
F: FnMut(T) -> B,
Convenience function (equivalent of self.iter().map().collect()
) for applying the same formula to every component. Read more
impl<T> ComponentSlice<T> for BGRA<T>
[src]
impl<T> ComponentSlice<T> for BGRA<T>
fn as_slice(&self) -> &[T]
[src]
fn as_slice(&self) -> &[T]
The components interpreted as an array, e.g. one RGB
expands to 3 elements. Read more
fn as_mut_slice(&mut self) -> &mut [T]
[src]
fn as_mut_slice(&mut self) -> &mut [T]
impl<T: Copy> From<BGR<T>> for BGRA<T, u8>
[src]
impl<T: Copy> From<BGR<T>> for BGRA<T, u8>
Assumes 255 is opaque
impl<T: Copy> From<BGR<T>> for BGRA<T, u16>
[src]
impl<T: Copy> From<BGR<T>> for BGRA<T, u16>
Assumes 65535 is opaque
impl<T: Display, A: Display> Display for BGRA<T, A>
[src]
impl<T: Display, A: Display> Display for BGRA<T, A>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T, A> From<(T, T, T, A)> for BGRA<T, A>
[src]
impl<T, A> From<(T, T, T, A)> for BGRA<T, A>
impl<T, A> Into<(T, T, T, A)> for BGRA<T, A>
[src]
impl<T, A> Into<(T, T, T, A)> for BGRA<T, A>
impl<T> From<RGBA<T>> for BGRA<T>
[src]
impl<T> From<RGBA<T>> for BGRA<T>
impl<T> From<BGRA<T>> for RGBA<T>
[src]
impl<T> From<BGRA<T>> for RGBA<T>
impl<ComponentType: Copy, AlphaComponentType: Copy> Copy for BGRA<ComponentType, AlphaComponentType>
[src]
impl<ComponentType: Copy, AlphaComponentType: Copy> Copy for BGRA<ComponentType, AlphaComponentType>
impl<ComponentType: Clone, AlphaComponentType: Clone> Clone for BGRA<ComponentType, AlphaComponentType>
[src]
impl<ComponentType: Clone, AlphaComponentType: Clone> Clone for BGRA<ComponentType, AlphaComponentType>
fn clone(&self) -> BGRA<ComponentType, AlphaComponentType>
[src]
fn clone(&self) -> BGRA<ComponentType, AlphaComponentType>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<ComponentType: Debug, AlphaComponentType: Debug> Debug for BGRA<ComponentType, AlphaComponentType>
[src]
impl<ComponentType: Debug, AlphaComponentType: Debug> Debug for BGRA<ComponentType, AlphaComponentType>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<ComponentType: Default, AlphaComponentType: Default> Default for BGRA<ComponentType, AlphaComponentType>
[src]
impl<ComponentType: Default, AlphaComponentType: Default> Default for BGRA<ComponentType, AlphaComponentType>
fn default() -> BGRA<ComponentType, AlphaComponentType>
[src]
fn default() -> BGRA<ComponentType, AlphaComponentType>
Returns the "default value" for a type. Read more
impl<ComponentType: Eq, AlphaComponentType: Eq> Eq for BGRA<ComponentType, AlphaComponentType>
[src]
impl<ComponentType: Eq, AlphaComponentType: Eq> Eq for BGRA<ComponentType, AlphaComponentType>
impl<ComponentType: PartialEq, AlphaComponentType: PartialEq> PartialEq for BGRA<ComponentType, AlphaComponentType>
[src]
impl<ComponentType: PartialEq, AlphaComponentType: PartialEq> PartialEq for BGRA<ComponentType, AlphaComponentType>
fn eq(&self, other: &BGRA<ComponentType, AlphaComponentType>) -> bool
[src]
fn eq(&self, other: &BGRA<ComponentType, AlphaComponentType>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &BGRA<ComponentType, AlphaComponentType>) -> bool
[src]
fn ne(&self, other: &BGRA<ComponentType, AlphaComponentType>) -> bool
This method tests for !=
.
impl<ComponentType: Ord, AlphaComponentType: Ord> Ord for BGRA<ComponentType, AlphaComponentType>
[src]
impl<ComponentType: Ord, AlphaComponentType: Ord> Ord for BGRA<ComponentType, AlphaComponentType>
fn cmp(&self, other: &BGRA<ComponentType, AlphaComponentType>) -> Ordering
[src]
fn cmp(&self, other: &BGRA<ComponentType, AlphaComponentType>) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl<ComponentType: PartialOrd, AlphaComponentType: PartialOrd> PartialOrd for BGRA<ComponentType, AlphaComponentType>
[src]
impl<ComponentType: PartialOrd, AlphaComponentType: PartialOrd> PartialOrd for BGRA<ComponentType, AlphaComponentType>
fn partial_cmp(
&self,
other: &BGRA<ComponentType, AlphaComponentType>
) -> Option<Ordering>
[src]
fn partial_cmp(
&self,
other: &BGRA<ComponentType, AlphaComponentType>
) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &BGRA<ComponentType, AlphaComponentType>) -> bool
[src]
fn lt(&self, other: &BGRA<ComponentType, AlphaComponentType>) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &BGRA<ComponentType, AlphaComponentType>) -> bool
[src]
fn le(&self, other: &BGRA<ComponentType, AlphaComponentType>) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &BGRA<ComponentType, AlphaComponentType>) -> bool
[src]
fn gt(&self, other: &BGRA<ComponentType, AlphaComponentType>) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &BGRA<ComponentType, AlphaComponentType>) -> bool
[src]
fn ge(&self, other: &BGRA<ComponentType, AlphaComponentType>) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<ComponentType: Hash, AlphaComponentType: Hash> Hash for BGRA<ComponentType, AlphaComponentType>
[src]
impl<ComponentType: Hash, AlphaComponentType: Hash> Hash for BGRA<ComponentType, AlphaComponentType>