[][src]Struct yuv::RGB

#[repr(C)]pub struct RGB<ComponentType> {
    pub r: ComponentType,
    pub g: ComponentType,
    pub b: ComponentType,
}

An RGB pixel (from the rgb crate)

The RGB pixel

The component type can be u8 (aliased as RGB8), u16 (aliased as RGB16), or any other type (but simple copyable types are recommended.)

Fields

r: ComponentType

Red

g: ComponentType

Green

b: ComponentType

Blue

Implementations

impl<T> RGB<T>[src]

An RGB pixel (from the rgb crate)

pub const fn new(r: T, g: T, b: T) -> RGB<T>[src]

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

impl<T> RGB<T> where
    T: Clone
[src]

An RGB pixel (from the rgb crate)

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

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

pub fn alpha(&self, a: T) -> RGBA<T, T>[src]

Convenience function for converting to RGBA

pub fn new_alpha<A>(&self, a: A) -> RGBA<T, A>[src]

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

Trait Implementations

impl<T> Add<RGB<T>> for RGB<T> where
    T: Add<T>, 
[src]

px + px

type Output = RGB<<T as Add<T>>::Output>

The resulting type after applying the + operator.

impl<T> Add<T> for RGB<T> where
    T: Copy + Add<T, Output = T>, 
[src]

px + 1

type Output = RGB<T>

The resulting type after applying the + operator.

impl<T> AddAssign<RGB<T>> for RGB<T> where
    T: Add<T, Output = T> + Copy
[src]

px + px

impl<T> AddAssign<T> for RGB<T> where
    T: Copy + Add<T, Output = T>, 
[src]

px + 1

impl<T> AsMut<[T]> for RGB<T>[src]

impl<T> AsRef<[T]> for RGB<T>[src]

impl<ComponentType> Clone for RGB<ComponentType> where
    ComponentType: Clone
[src]

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

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

impl<ComponentType> Copy for RGB<ComponentType> where
    ComponentType: Copy
[src]

impl<ComponentType> Debug for RGB<ComponentType> where
    ComponentType: Debug
[src]

impl<ComponentType> Default for RGB<ComponentType> where
    ComponentType: Default
[src]

impl<T> Display for RGB<T> where
    T: Display
[src]

impl<T> Div<T> for RGB<T> where
    T: Copy + Div<T, Output = T>, 
[src]

px / 1

type Output = RGB<T>

The resulting type after applying the / operator.

impl<T> DivAssign<T> for RGB<T> where
    T: Copy + Div<T, Output = T>, 
[src]

px * 1

impl<ComponentType> Eq for RGB<ComponentType> where
    ComponentType: Eq
[src]

impl<T> From<[T; 3]> for RGB<T> where
    T: Copy
[src]

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

impl<T> From<BGR<T>> for RGB<T>[src]

impl<T> From<Gray<T>> for RGB<T> where
    T: Clone
[src]

impl From<RGB<f32>> for RGB<f64>[src]

impl From<RGB<i16>> for RGB<f32>[src]

impl From<RGB<i16>> for RGB<f64>[src]

impl From<RGB<i32>> for RGB<f64>[src]

impl From<RGB<u16>> for RGB<i32>[src]

impl From<RGB<u16>> for RGB<f64>[src]

impl From<RGB<u16>> for RGB<f32>[src]

impl From<RGB<u8>> for RGB<i16>[src]

impl From<RGB<u8>> for RGB<f32>[src]

impl From<RGB<u8>> for RGB<f64>[src]

impl<T> FromIterator<T> for RGB<T>[src]

fn from_iter<I>(into_iter: I) -> RGB<T> where
    I: IntoIterator<Item = T>, 
[src]

Takes exactly 3 elements from the iterator and creates a new instance. Panics if there are fewer elements in the iterator.

impl<ComponentType> Hash for RGB<ComponentType> where
    ComponentType: Hash
[src]

impl<T> Into<[T; 3]> for RGB<T>[src]

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

impl<T> LowerHex for RGB<T> where
    T: LowerHex
[src]

impl<T> Mul<T> for RGB<T> where
    T: Copy + Mul<T, Output = T>, 
[src]

px * 1

type Output = RGB<T>

The resulting type after applying the * operator.

impl<T> MulAssign<T> for RGB<T> where
    T: Copy + Mul<T, Output = T>, 
[src]

px * 1

impl<ComponentType> Ord for RGB<ComponentType> where
    ComponentType: Ord
[src]

impl<ComponentType> PartialEq<RGB<ComponentType>> for RGB<ComponentType> where
    ComponentType: PartialEq<ComponentType>, 
[src]

impl<ComponentType> PartialOrd<RGB<ComponentType>> for RGB<ComponentType> where
    ComponentType: PartialOrd<ComponentType>, 
[src]

impl<T> Pod for RGB<T> where
    T: Pod, 
[src]

impl<T> Sub<RGB<T>> for RGB<T> where
    T: Sub<T>, 
[src]

px - px

type Output = RGB<<T as Sub<T>>::Output>

The resulting type after applying the - operator.

impl<T> Sub<T> for RGB<T> where
    T: Copy + Sub<T, Output = T>, 
[src]

px - 1

type Output = RGB<<T as Sub<T>>::Output>

The resulting type after applying the - operator.

impl<T> SubAssign<RGB<T>> for RGB<T> where
    T: Sub<T, Output = T> + Copy
[src]

px - px

impl<T> SubAssign<T> for RGB<T> where
    T: Copy + Sub<T, Output = T>, 
[src]

px - 1

impl<T> Sum<RGB<T>> for RGB<T> where
    T: Default + Add<T, Output = T>, 
[src]

impl<T> UpperHex for RGB<T> where
    T: UpperHex
[src]

impl<T> Zeroable for RGB<T> where
    T: Zeroable, 
[src]

Auto Trait Implementations

impl<ComponentType> RefUnwindSafe for RGB<ComponentType> where
    ComponentType: RefUnwindSafe

impl<ComponentType> Send for RGB<ComponentType> where
    ComponentType: Send

impl<ComponentType> Sync for RGB<ComponentType> where
    ComponentType: Sync

impl<ComponentType> Unpin for RGB<ComponentType> where
    ComponentType: Unpin

impl<ComponentType> UnwindSafe for RGB<ComponentType> where
    ComponentType: UnwindSafe

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.