[][src]Struct rgb::alt::BGRA

#[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> BGRA<T>
[src]

pub fn new(r: T, g: T, b: T, a: T) -> Self
[src]

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

impl<T, A> BGRA<T, A>
[src]

pub fn new_alpha(r: T, g: T, b: T, a: A) -> Self
[src]

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

impl<T: Clone> BGRA<T>
[src]

pub fn iter(&self) -> Cloned<Iter<T>>
[src]

Iterate over all components (length=4)

impl<T: Clone, A> BGRA<T, A>
[src]

pub fn rgb(&self) -> BGR<T>
[src]

Copy RGB components out of the RGBA struct

Note: you can use .into() to convert between other types

impl<T, A> BGRA<T, A>
[src]

pub fn rgb_mut(&mut self) -> &mut BGR<T>
[src]

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]

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]

Create new RGBA with the same alpha value, but different RGB values

Trait Implementations

impl<T> ComponentSlice<T> for BGRA<T>
[src]

impl<T: Copy, B> ComponentMap<BGRA<B, B>, T, B> for BGRA<T>
[src]

impl<T> AsPixels<BGRA<T, T>> for [T]
[src]

impl<ComponentType: Copy, AlphaComponentType: Copy> Copy for BGRA<ComponentType, AlphaComponentType>
[src]

impl<T: Display, A: Display> Display for BGRA<T, A>
[src]

impl<ComponentType: Debug, AlphaComponentType: Debug> Debug for BGRA<ComponentType, AlphaComponentType>
[src]

impl<ComponentType: PartialEq, AlphaComponentType: PartialEq> PartialEq<BGRA<ComponentType, AlphaComponentType>> for BGRA<ComponentType, AlphaComponentType>
[src]

impl<ComponentType: Eq, AlphaComponentType: Eq> Eq for BGRA<ComponentType, AlphaComponentType>
[src]

impl<ComponentType: Ord, AlphaComponentType: Ord> Ord for BGRA<ComponentType, AlphaComponentType>
[src]

fn max(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the minimum of two values. Read more

impl<ComponentType: PartialOrd, AlphaComponentType: PartialOrd> PartialOrd<BGRA<ComponentType, AlphaComponentType>> for BGRA<ComponentType, AlphaComponentType>
[src]

impl<ComponentType: Hash, AlphaComponentType: Hash> Hash for BGRA<ComponentType, AlphaComponentType>
[src]

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

Feeds a slice of this type into the given [Hasher]. Read more

impl<T: Copy> From<RGB<T>> for BGRA<T, u8>
[src]

Assumes 255 is opaque

impl<T: Copy> From<RGB<T>> for BGRA<T, u16>
[src]

Assumes 255 is opaque

impl<T: Copy> From<BGR<T>> for BGRA<T, u8>
[src]

Assumes 255 is opaque

impl<T: Copy> From<BGR<T>> for BGRA<T, u16>
[src]

Assumes 65535 is opaque

impl<T: Copy> From<[T; 4]> for BGRA<T>
[src]

impl<T, A> From<(T, T, T, A)> for BGRA<T, A>
[src]

impl<T> From<RGBA<T, T>> for BGRA<T>
[src]

impl<T> From<BGRA<T, T>> for RGBA<T>
[src]

impl<ComponentType: Clone, AlphaComponentType: Clone> Clone for BGRA<ComponentType, AlphaComponentType>
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<ComponentType: Default, AlphaComponentType: Default> Default for BGRA<ComponentType, AlphaComponentType>
[src]

impl<T> Into<[T; 4]> for BGRA<T>
[src]

impl<T, A> Into<(T, T, T, A)> for BGRA<T, A>
[src]

Auto Trait Implementations

impl<ComponentType, AlphaComponentType> Send for BGRA<ComponentType, AlphaComponentType> where
    AlphaComponentType: Send,
    ComponentType: Send

impl<ComponentType, AlphaComponentType> Sync for BGRA<ComponentType, AlphaComponentType> where
    AlphaComponentType: Sync,
    ComponentType: Sync

Blanket Implementations

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> From for T
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]