1 
2 /// Chroma subsampling format
3 #[derive(Debug, Copy, Clone, Eq, PartialEq)]
4 pub enum ChromaSampling {
5     /// 4:2:0 = 2x2 pixels of luma per 1 pixel of chroma
6     Cs420,
7     /// 4:2:2 = Horizontally subsampled
8     Cs422,
9     /// 4:2:4 = Not subsampled (chroma and luma are 1:1)
10     Cs444,
11     /// 4:0:0 Only luma (grayscale)
12     Monochrome,
13 }
14 
15 /// Range of allowed values for pixels
16 #[repr(C)]
17 #[derive(Debug, Copy, Clone, Eq, PartialEq)]
18 pub enum Range {
19     /// Luma is 16-235, Chroma is 16-240
20     Limited,
21     /// 0-255
22     Full,
23 }
24 
25 /// Supported Color Primaries
26 ///
27 /// As defined by “Color primaries” section of ISO/IEC 23091-4/ITU-T H.273
28 #[repr(C)]
29 #[derive(Debug, Copy, Clone, Eq, PartialEq)]
30 pub enum ColorPrimaries {
31     /// BT.709, sRGB, sYCC. BT.709 is the standard for high definition (HD) television; sRGB is the most common color space used for computer displays.
32     BT709 = 1,
33     /// BT.470 System M, NTSC (standard definition television in the United States) (historical)
34     BT470M = 4,
35     /// BT.470 System B, G; BT.601; BT.1358 625; BT.1700 625 PAL and 625 SECAM (historical)
36     BT470BG,
37     /// BT.601-7 525 (SMPTE 170 M) and SMPTE 240M (historical)
38     BT601,
39     /// ITU-T H.264
40     GenericFilm = 8,
41     /// BT.2020; BT.2100. Used for ultra-high definition (4K) High Dynamic Range (HDR) video, these have a very wide color gamut and support 10-bit and 12-bit color component depths.
42     BT2020,
43     /// CIE 1921 XYZ; SMPTE ST 428 (D-Cinema Distribution Master: Image characteristics). Defines the uncompressed image characteristics for DCDM.
44     XYZ,
45     /// SMPTE RP 431 (D-Cinema Quality: Reference projector and environment).
46     SMPTE431,
47     /// SMPTE EG 432-1 (Digital Source Processing: Color Processing for D-Cinema).
48     SMPTE432,
49     /// EBU Tech. 3213-E
50     EBU3213 = 22,
51 }
52 
53 
54 /// Gamma correction, essentially.
55 /// As defined by “Transfer characteristics” section of ISO/IEC 23091-4/ITU-TH.273.
56 #[repr(C)]
57 #[derive(Debug, Copy, Clone, Eq, PartialEq)]
58 pub enum TransferCharacteristics {
59     /// BT.709
60     BT709 = 1,
61     /// BT.470 System M (historical)
62     BT470M = 4,
63     /// BT.470 System B, G (historical)
64     BT470BG,
65     /// BT.601-7 525 (SMPTE 170 M)
66     BT601,
67     /// SMPTE 240 M
68     SMPTE240,
69     /// Linear
70     Linear,
71     /// Logarithmic (100:1 range)
72     Log100,
73     /// Logarithmic ((100 * √10):1 range)
74     Log100Sqrt10,
75     /// IEC 61966-2-4
76     IEC61966,
77     /// BT.1361 extended color gamut system (historical)
78     BT1361,
79     /// sRGB or sYCC
80     SRGB,
81     /// BT.2020 10-bit systems
82     BT2020_10Bit,
83     /// BT.2020 12-bit systems
84     BT2020_12Bit,
85     /// SMPTE ST 2084, ITU BT.2100 PQ
86     SMPTE2084,
87     /// SMPTE ST 428
88     SMPTE428,
89     /// BT.2100 HLG (Hybrid Log Gamma), ARIB STD-B67
90     HLG,
91 }
92 
93 /// Bit depth (8 = 1 byte, >=10 = 2 bytes)
94 #[repr(C)]
95 #[derive(Debug, Copy, Clone, Eq, PartialEq)]
96 pub enum Depth {
97     Depth8 = 8,
98     Depth10 = 10,
99     Depth12 = 12,
100     Depth16 = 16,
101 }
102 
103 /// As defined by the “Matrix coefficients” section of ISO/IEC 23091-4/ITU-TH.273.
104 #[repr(C)]
105 #[derive(Debug, Copy, Clone, Eq, PartialEq)]
106 pub enum MatrixCoefficients {
107     /// Identity matrix
108     Identity = 0,
109     /// BT.709 ITU-R Rec. BT.709-5, ITU-R Rec. BT.1361 conventional colour gamut system and extended colour gamut system,
110     /// IEC 61966-2-4 xvYCC709,
111     /// Society of Motion Picture and Television Engineers RP 177 (1993)
112     /// KR = 0.2126; KB = 0.0722
113     BT709,
114     /// United States Federal Communications Commission Title 47 Code of Federal Regulations (2003) 73.682 (a) (20)
115     /// KR = 0.30; KB = 0.11
116     FCC = 4,
117     /// ITU-RRec.BT.470-6SystemB,G,IEC61966-2-4xvYCC601 (historical)
118     /// KR=0.299;KB=0.114
119     BT470BG,
120     /// BT.601-7 525 (SMPTE 170 M)
121     /// KR=0.299;KB=0.114
122     BT601,
123     /// SMPTE 240 M
124     /// KR=0.212;KB=0.087
125     SMPTE240,
126     /// YCgCo
127     YCgCo,
128     /// BT.2020 non-constant luminance, BT.2100 YCbCr
129     BT2020NCL,
130     /// BT.2020 constant luminance
131     BT2020CL,
132     /// SMPTE ST 2085 YDzDx
133     SMPTE2085,
134     /// Chromaticity-derived non-constant luminance
135     ChromatNCL,
136     /// Chromaticity-derived constant luminance
137     ChromatCL,
138     /// BT.2020 ICtCp
139     ICtCp,
140 }
141 
142 #[repr(C)]
143 #[derive(Debug, Copy, Clone, Eq, PartialEq)]
144 pub enum ChromaSamplePosition {
145     /// Horizontally co-located with (0, 0) luma sample, vertically positioned
146     /// in the middle between two luma samples.
147     Vertical,
148     /// Co-located with (0, 0) luma sample.
149     Colocated,
150 }
151