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