]> git.sesse.net Git - movit/blob - image_format.h
Fix a typo in a comment.
[movit] / image_format.h
1 #ifndef _MOVIT_IMAGE_FORMAT_H
2 #define _MOVIT_IMAGE_FORMAT_H 1
3
4 // Note: Input depths above 8 bits have not been tested, so Rec. 2020
5 // support should be regarded as somewhat untested (it assumes 10-
6 // or 12-bit input). We also only support “conventional non-constant
7 // luminance” for Rec. 2020, where Y' is derived from R'G'B' instead of
8 // RGB, since this is the same system as used in Rec. 601 and 709.
9
10 enum MovitPixelFormat {
11         FORMAT_RGB,
12         FORMAT_RGBA_PREMULTIPLIED_ALPHA,
13         FORMAT_RGBA_POSTMULTIPLIED_ALPHA,
14         FORMAT_BGR,
15         FORMAT_BGRA_PREMULTIPLIED_ALPHA,
16         FORMAT_BGRA_POSTMULTIPLIED_ALPHA,
17         FORMAT_GRAYSCALE
18 };
19
20 enum Colorspace {
21         COLORSPACE_INVALID = -1,  // For internal use.
22         COLORSPACE_sRGB = 0,
23         COLORSPACE_REC_709 = 0,  // Same as sRGB.
24         COLORSPACE_REC_601_525 = 1,
25         COLORSPACE_REC_601_625 = 2,
26         COLORSPACE_XYZ = 3,  // Mostly useful for testing and debugging.
27         COLORSPACE_REC_2020 = 4,
28 };
29
30 enum GammaCurve {
31         GAMMA_INVALID = -1,  // For internal use.
32         GAMMA_LINEAR = 0,
33         GAMMA_sRGB = 1,
34         GAMMA_REC_601 = 2,
35         GAMMA_REC_709 = 2,  // Same as Rec. 601.
36         GAMMA_REC_2020_10_BIT = 2,  // Same as Rec. 601.
37         GAMMA_REC_2020_12_BIT = 3,
38 };
39
40 enum YCbCrLumaCoefficients {
41         YCBCR_REC_601 = 0,
42         YCBCR_REC_709 = 1,
43         YCBCR_REC_2020 = 2,
44 };
45
46 struct ImageFormat {
47         Colorspace color_space;
48         GammaCurve gamma_curve;
49 };
50
51 #endif  // !defined(_MOVIT_IMAGE_FORMAT_H)