1 // GLSL is pickier than the C++ preprocessor in if-testing for undefined
2 // tokens; do some fixups here to keep it happy.
4 #ifndef YCBCR_OUTPUT_PLANAR
5 #define YCBCR_OUTPUT_PLANAR 0
8 #ifndef YCBCR_OUTPUT_SPLIT_Y_AND_CBCR
9 #define YCBCR_OUTPUT_SPLIT_Y_AND_CBCR 0
12 #ifndef YCBCR_ALSO_OUTPUT_RGBA
13 #define YCBCR_ALSO_OUTPUT_RGBA 0
16 #ifndef SQUARE_ROOT_TRANSFORMATION
17 #define SQUARE_ROOT_TRANSFORMATION 0
20 #if YCBCR_OUTPUT_PLANAR
24 #elif YCBCR_OUTPUT_SPLIT_Y_AND_CBCR
31 #if YCBCR_ALSO_OUTPUT_RGBA
37 #if YCBCR_ALSO_OUTPUT_RGBA
38 vec4 color[2] = INPUT(tc);
39 vec4 color0 = color[0];
40 vec4 color1 = color[1];
42 vec4 color0 = INPUT(tc);
45 #if SQUARE_ROOT_TRANSFORMATION
46 // Make sure we don't give negative values to sqrt.
47 color0.rgb = sqrt(max(color0.rgb, 0.0));
50 #if YCBCR_OUTPUT_PLANAR
54 #elif YCBCR_OUTPUT_SPLIT_Y_AND_CBCR
61 #if YCBCR_ALSO_OUTPUT_RGBA