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