1 uniform sampler2D PREFIX(tex_y);
2 uniform sampler2D PREFIX(tex_cb);
3 uniform sampler2D PREFIX(tex_cr);
5 vec4 FUNCNAME(vec2 tc) {
6 // OpenGL's origin is bottom-left, but most graphics software assumes
7 // a top-left origin. Thus, for inputs that come from the user,
8 // we flip the y coordinate.
12 ycbcr.x = texture2D(PREFIX(tex_y), tc).x;
13 ycbcr.y = texture2D(PREFIX(tex_cb), tc + PREFIX(chroma_offset)).x;
14 ycbcr.z = texture2D(PREFIX(tex_cr), tc + PREFIX(chroma_offset)).x;
16 ycbcr -= PREFIX(offset);
17 ycbcr *= PREFIX(scale);
20 rgba.rgb = PREFIX(inv_ycbcr_matrix) * ycbcr;