1 | /* $Id: cconvUYVY.c 55401 2015-04-23 10:03:17Z vboxsync $ */
|
---|
2 | #extension GL_ARB_texture_rectangle : enable
|
---|
3 | uniform sampler2DRect uSrcTex;
|
---|
4 | void vboxCConvApplyAYUV(vec4 color);
|
---|
5 | void vboxCConv()
|
---|
6 | {
|
---|
7 | vec2 srcCoord = vec2(gl_TexCoord[0]);
|
---|
8 | float x = srcCoord.x;
|
---|
9 | int pix = int(x);
|
---|
10 | vec4 srcClr = texture2DRect(uSrcTex, vec2(float(pix), srcCoord.y));
|
---|
11 | float u = srcClr.b;
|
---|
12 | float v = srcClr.r;
|
---|
13 | float part = x - float(pix);
|
---|
14 | float y;
|
---|
15 | if(part < 0.5)
|
---|
16 | {
|
---|
17 | y = srcClr.g;
|
---|
18 | }
|
---|
19 | else
|
---|
20 | {
|
---|
21 | y = srcClr.a;
|
---|
22 | }
|
---|
23 | vboxCConvApplyAYUV(vec4(u, y, 0.0, v));
|
---|
24 | }
|
---|