#[non_exhaustive]#[repr(u32)]pub enum ColorSpace {
Show 13 variants
Default = 0,
Smpte170M = 1,
Smpte240M = 2,
Rec709 = 3,
Bt878 = 4,
C470SystemM = 5,
C470SystemBg = 6,
Jpeg = 7,
Srgb = 8,
Oprgb = 9,
Bt2020 = 10,
Raw = 11,
DciP3 = 12,
}Expand description
Colorspace enum
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Default = 0
Default colorspace, i.e. let the driver figure it out. Can only be used with video capture.
Smpte170M = 1
SMPTE 170M: used for broadcast NTSC/PAL SDTV
Smpte240M = 2
Obsolete pre-1998 SMPTE 240M HDTV standard, superseded by Rec 709
Rec709 = 3
Rec.709: used for HDTV
Bt878 = 4
Deprecated, do not use. No driver will ever return this. This was based on a misunderstanding of the bt878 datasheet.
C470SystemM = 5
NTSC 1953 colorspace. This only makes sense when dealing with really, really old NTSC recordings. Superseded by SMPTE 170M.
C470SystemBg = 6
EBU Tech 3213 PAL/SECAM colorspace.
Jpeg = 7
Effectively shorthand for SRGB, YCBCR_ENC_601 and QUANTIZATION_FULL_RANGE. To be used for (Motion-)JPEG.
Srgb = 8
For RGB colorspaces such as produces by most webcams.
Oprgb = 9
opRGB colorspace
Bt2020 = 10
BT.2020 colorspace, used for UHDTV.
Raw = 11
Raw colorspace: for RAW unprocessed images
DciP3 = 12
DCI-P3 colorspace, used by cinema projectors
Implementations§
Source§impl ColorSpace
impl ColorSpace
Sourcepub fn new_default(is_sdtv: bool, is_hdtv: bool) -> Self
pub fn new_default(is_sdtv: bool, is_hdtv: bool) -> Self
Determine how ColorSpace::Default should map to a proper colorspace. This depends on whether this is a SDTV image (use SMPTE 170M), an HDTV image (use Rec. 709), or something else (use sRGB).
Trait Implementations§
Source§impl AsRef<u32> for ColorSpace
impl AsRef<u32> for ColorSpace
Source§impl Clone for ColorSpace
impl Clone for ColorSpace
Source§fn clone(&self) -> ColorSpace
fn clone(&self) -> ColorSpace
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ColorSpace
impl Debug for ColorSpace
Source§impl Deref for ColorSpace
impl Deref for ColorSpace
Source§impl Display for ColorSpace
impl Display for ColorSpace
Source§impl From<ColorSpace> for XferFunc
impl From<ColorSpace> for XferFunc
Source§fn from(colsp: ColorSpace) -> Self
fn from(colsp: ColorSpace) -> Self
Determine how XferFunc::Default should map to a proper transfer function. This depends on the colorspace.
Source§impl From<ColorSpace> for YcbcrEncoding
impl From<ColorSpace> for YcbcrEncoding
Source§fn from(colsp: ColorSpace) -> Self
fn from(colsp: ColorSpace) -> Self
Determine how YcbcrEncoding::Default should map to a proper Y’CbCr encoding. This depends on the colorspace.