Release Movit 1.3.2. (From a branch, since I do not want to break ABI compatibility...
[movit] / footer.frag
1 // GLSL is pickier than the C++ preprocessor in if-testing for undefined
2 // tokens; do some fixups here to keep it happy.
3
4 #ifndef YCBCR_OUTPUT_PLANAR
5 #define YCBCR_OUTPUT_PLANAR 0
6 #endif
7
8 #ifndef YCBCR_OUTPUT_SPLIT_Y_AND_CBCR
9 #define YCBCR_OUTPUT_SPLIT_Y_AND_CBCR 0
10 #endif
11
12 #ifndef YCBCR_ALSO_OUTPUT_RGBA
13 #define YCBCR_ALSO_OUTPUT_RGBA 0
14 #endif
15
16 #if YCBCR_OUTPUT_PLANAR
17 out vec4 Y;
18 out vec4 Cb;
19 out vec4 Cr;
20 #elif YCBCR_OUTPUT_SPLIT_Y_AND_CBCR
21 out vec4 Y;
22 out vec4 Chroma;
23 #else
24 out vec4 FragColor;
25 #endif
26
27 #if YCBCR_ALSO_OUTPUT_RGBA
28 out vec4 RGBA;
29 #endif
30
31 void main()
32 {
33 #if YCBCR_ALSO_OUTPUT_RGBA
34         vec4 color[2] = INPUT(tc);
35         vec4 color0 = color[0];
36         vec4 color1 = color[1];
37 #else
38         vec4 color0 = INPUT(tc);
39 #endif
40
41 #if YCBCR_OUTPUT_PLANAR
42         Y = color0.rrra;
43         Cb = color0.ggga;
44         Cr = color0.bbba;
45 #elif YCBCR_OUTPUT_SPLIT_Y_AND_CBCR
46         Y = color0.rrra;
47         Chroma = color0.gbba;
48 #else
49         FragColor = color0;
50 #endif
51
52 #if YCBCR_ALSO_OUTPUT_RGBA
53         RGBA = color1;
54 #endif
55 }