Enum yuv::convert::RGBConvert
source · pub enum RGBConvert<T = u8> {
Matrix(Matrix<T>),
Copy(CopyGBR<T>),
IdentityScale(IdentityScale<T>),
}
Expand description
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(CopyGBR<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§
source§impl RGBConvert<u8>
impl RGBConvert<u8>
source§impl RGBConvert<u16>
impl RGBConvert<u16>
source§impl<T> RGBConvert<T>
impl<T> RGBConvert<T>
sourcepub fn to_rgb(&self, px: YUV<T>) -> RGB<T>
pub fn to_rgb(&self, px: YUV<T>) -> RGB<T>
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§
source§impl<T: Clone> Clone for RGBConvert<T>
impl<T: Clone> Clone for RGBConvert<T>
source§fn clone(&self) -> RGBConvert<T>
fn clone(&self) -> RGBConvert<T>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<T: Debug> Debug for RGBConvert<T>
impl<T: Debug> Debug for RGBConvert<T>
source§impl<T> ToRGB<T, T> for RGBConvert<T>
impl<T> ToRGB<T, T> for RGBConvert<T>
source§fn to_rgb(&self, px: YUV<T>) -> RGB<T>
fn to_rgb(&self, px: YUV<T>) -> RGB<T>
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.