Struct rgb::alt::BGR [−][src]
#[repr(C)]pub struct BGR<ComponentType> { pub b: ComponentType, pub g: ComponentType, pub r: ComponentType, }
RGB in reverse byte order
Fields
b: ComponentType
Blue first
g: ComponentType
Green
r: ComponentType
Red last
Methods
impl<T: Clone> BGR<T>
[src]
impl<T: Clone> BGR<T>
pub fn new(r: T, g: T, b: T) -> Self
[src]
pub fn new(r: T, g: T, b: T) -> Self
Convenience function for creating a new pixel
pub fn iter(&self) -> Cloned<Iter<T>>
[src]
pub fn iter(&self) -> Cloned<Iter<T>>
Iterate over color components (R, G, and B)
pub fn alpha(&self, a: T) -> BGRA<T>
[src]
pub fn alpha(&self, a: T) -> BGRA<T>
pub fn new_alpha<A>(&self, a: A) -> BGRA<T, A>
[src]
pub fn new_alpha<A>(&self, a: A) -> BGRA<T, A>
Trait Implementations
impl<T: Copy, B> ComponentMap<BGR<B>, T, B> for BGR<T>
[src]
impl<T: Copy, B> ComponentMap<BGR<B>, T, B> for BGR<T>
fn map<F>(&self, f: F) -> BGR<B> where
F: FnMut(T) -> B,
[src]
fn map<F>(&self, f: F) -> BGR<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 BGR<T>
[src]
impl<T> ComponentSlice<T> for BGR<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: Display> Display for BGR<T>
[src]
impl<T: Display> Display for BGR<T>
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: 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 RGBA<T, u8>
[src]
impl<T: Copy> From<BGR<T>> for RGBA<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: Copy> From<BGR<T>> for RGBA<T, u16>
[src]
impl<T: Copy> From<BGR<T>> for RGBA<T, u16>
Assumes 255 is opaque
impl<T> From<(T, T, T)> for BGR<T>
[src]
impl<T> From<(T, T, T)> for BGR<T>
impl<T> Into<(T, T, T)> for BGR<T>
[src]
impl<T> Into<(T, T, T)> for BGR<T>
impl<T> From<RGB<T>> for BGR<T>
[src]
impl<T> From<RGB<T>> for BGR<T>
impl<T> From<BGR<T>> for RGB<T>
[src]
impl<T> From<BGR<T>> for RGB<T>
impl<ComponentType: Copy> Copy for BGR<ComponentType>
[src]
impl<ComponentType: Copy> Copy for BGR<ComponentType>
impl<ComponentType: Clone> Clone for BGR<ComponentType>
[src]
impl<ComponentType: Clone> Clone for BGR<ComponentType>
fn clone(&self) -> BGR<ComponentType>
[src]
fn clone(&self) -> BGR<ComponentType>
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> Debug for BGR<ComponentType>
[src]
impl<ComponentType: Debug> Debug for BGR<ComponentType>
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> Default for BGR<ComponentType>
[src]
impl<ComponentType: Default> Default for BGR<ComponentType>
impl<ComponentType: Eq> Eq for BGR<ComponentType>
[src]
impl<ComponentType: Eq> Eq for BGR<ComponentType>
impl<ComponentType: PartialEq> PartialEq for BGR<ComponentType>
[src]
impl<ComponentType: PartialEq> PartialEq for BGR<ComponentType>
fn eq(&self, other: &BGR<ComponentType>) -> bool
[src]
fn eq(&self, other: &BGR<ComponentType>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &BGR<ComponentType>) -> bool
[src]
fn ne(&self, other: &BGR<ComponentType>) -> bool
This method tests for !=
.
impl<ComponentType: Ord> Ord for BGR<ComponentType>
[src]
impl<ComponentType: Ord> Ord for BGR<ComponentType>
fn cmp(&self, other: &BGR<ComponentType>) -> Ordering
[src]
fn cmp(&self, other: &BGR<ComponentType>) -> 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> PartialOrd for BGR<ComponentType>
[src]
impl<ComponentType: PartialOrd> PartialOrd for BGR<ComponentType>
fn partial_cmp(&self, other: &BGR<ComponentType>) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &BGR<ComponentType>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &BGR<ComponentType>) -> bool
[src]
fn lt(&self, other: &BGR<ComponentType>) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &BGR<ComponentType>) -> bool
[src]
fn le(&self, other: &BGR<ComponentType>) -> 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: &BGR<ComponentType>) -> bool
[src]
fn gt(&self, other: &BGR<ComponentType>) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &BGR<ComponentType>) -> bool
[src]
fn ge(&self, other: &BGR<ComponentType>) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<ComponentType: Hash> Hash for BGR<ComponentType>
[src]
impl<ComponentType: Hash> Hash for BGR<ComponentType>