Type Alias rgb::alt::BGR16

source ·
pub type BGR16 = BGR<u16>;
Expand description

16-bit BGR in machine’s native endian

Aliased Type§

struct BGR16 {
    pub b: u16,
    pub g: u16,
    pub r: u16,
}

Fields§

§b: u16

Blue first

§g: u16

Green

§r: u16

Red last

Implementations

source§

impl<T: Clone> BGR<T>

source

pub fn iter(&self) -> Cloned<Iter<'_, T>>

Iterate over color components (R, G, and B)

source§

impl<T: Clone> BGR<T>

source

pub fn alpha(&self, a: T) -> BGRA<T>

Convenience function for converting to RGBA

source

pub fn new_alpha<A>(&self, a: A) -> BGRA<T, A>

Convenience function for converting to RGBA with alpha channel of a different type than type of the pixels

source§

impl<T> BGR<T>

source

pub const fn new(r: T, g: T, b: T) -> Self

👎Deprecated: This function has a misleading order of arguments. Use BGR{} literal instead

Convenience function for creating a new pixel Wargning: The order of arguments is R,G,B

Trait Implementations

source§

impl<ComponentType: Clone> Clone for BGR<ComponentType>

source§

fn clone(&self) -> BGR<ComponentType>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Copy, B> ColorComponentMap<BGR<B>, T, B> for BGR<T>

source§

fn map_c<F>(&self, f: F) -> BGR<B>
where F: FnMut(T) -> B,

Convenience function for applying the same formula to every rgb/gray component, but skipping the alpha component. Read more
source§

impl<T: Copy, B> ComponentMap<BGR<B>, T, B> for BGR<T>

source§

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
source§

impl<T> ComponentSlice<T> for BGR<T>

source§

fn as_slice(&self) -> &[T]

The components interpreted as an array, e.g. one RGB expands to 3 elements. Read more
source§

fn as_mut_slice(&mut self) -> &mut [T]

The components interpreted as a mutable array, e.g. one RGB expands to 3 elements. Read more
source§

impl<ComponentType: Debug> Debug for BGR<ComponentType>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<ComponentType: Default> Default for BGR<ComponentType>

source§

fn default() -> BGR<ComponentType>

Returns the “default value” for a type. Read more
source§

impl<T: Display> Display for BGR<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: Copy> From<[T; 3]> for BGR<T>

source§

fn from(other: [T; 3]) -> Self

Converts to this type from the input type.
source§

impl<T> From<(T, T, T)> for BGR<T>

source§

fn from(other: (T, T, T)) -> Self

Converts to this type from the input type.
source§

impl<T> From<RGB<T>> for BGR<T>
where T: Clone,

source§

fn from(other: RGB<T>) -> Self

Converts to this type from the input type.
source§

impl<ComponentType: Hash> Hash for BGR<ComponentType>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<T> Into<[T; 3]> for BGR<T>

source§

fn into(self) -> [T; 3]

Converts this type into the (usually inferred) input type.
source§

impl<T> Into<(T, T, T)> for BGR<T>

source§

fn into(self) -> (T, T, T)

Converts this type into the (usually inferred) input type.
source§

impl<T: LowerHex> LowerHex for BGR<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl<ComponentType: Ord> Ord for BGR<ComponentType>

source§

fn cmp(&self, other: &BGR<ComponentType>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl<ComponentType: PartialEq> PartialEq for BGR<ComponentType>

source§

fn eq(&self, other: &BGR<ComponentType>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<ComponentType: PartialOrd> PartialOrd for BGR<ComponentType>

source§

fn partial_cmp(&self, other: &BGR<ComponentType>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<T: UpperHex> UpperHex for BGR<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl<T> Zeroable for BGR<T>
where T: Zeroable,

source§

fn zeroed() -> Self

source§

impl<ComponentType: Copy> Copy for BGR<ComponentType>

source§

impl<ComponentType: Eq> Eq for BGR<ComponentType>

source§

impl<T> Pod for BGR<T>
where T: Pod,

source§

impl<ComponentType> StructuralPartialEq for BGR<ComponentType>