[][src]Enum yuv::convert::RGBConvert

pub enum RGBConvert<T = u8> {
    Matrix(Matrix<T>),
    Copy(Copy<T>),
    IdentityScale(IdentityScale<T>),
}

Enum containing concrete type of converter used.

Use RGBConvert::new to create a new instance.

Variants of this enum are indivdually optimized for specific color spaces. You can either call RGBConvert::to_rgb() for convenient method, or match on the enum, and use ToRGB trait with each of the variants to make Rust generate optimized functions for each.

Variants

Matrix(Matrix<T>)

Converter YCbCr color spaces

Copy(Copy<T>)

No conversion

IdentityScale(IdentityScale<T>)

Scale numbers from 10/12-bit to 16-bit, and/or from studio range to full range. All channels use Y range.

Implementations

impl RGBConvert<u8>[src]

pub fn new(range: Range, matrix: MatrixCoefficients) -> Result<Self, Error>[src]

Use RGBConvert::<u8>::new() to call this method, because there's also a u16 version

impl RGBConvert<u16>[src]

pub fn new(
    range: Range,
    matrix: MatrixCoefficients,
    depth: Depth
) -> Result<Self, Error>
[src]

Use RGBConvert::<u16>::new() to call this method, because there's also a u8 version

impl<T> RGBConvert<T> where
    Matrix<T>: ToRGB<T, T>,
    IdentityScale<T>: ToRGB<T, T>, 
[src]

pub fn to_rgb(&self, px: YUV<T>) -> RGB<T>[src]

Convert a single YUV pixel to an RGB pixel.

This method has a match internally, which may or may not be the fastest way to do this (dependin on optimizer). If you want to have optimal code, use variants of this enum individually. They all implement ToRGB trait.

Trait Implementations

impl<T: Clone> Clone for RGBConvert<T>[src]

impl<T: Debug> Debug for RGBConvert<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for RGBConvert<T> where
    T: RefUnwindSafe

impl<T> Send for RGBConvert<T> where
    T: Send

impl<T> Sync for RGBConvert<T> where
    T: Sync

impl<T> Unpin for RGBConvert<T> where
    T: Unpin

impl<T> UnwindSafe for RGBConvert<T> where
    T: 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, 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.