source:
trunk/src/testing/app/ishare/FastDXT/bin/ycocg.frag
@
4
Revision 4, 309 bytes checked in by ajaworski, 13 years ago (diff) |
---|
Line | |
---|---|
1 | uniform sampler2D yuvtex; |
2 | |
3 | void main(void) |
4 | { |
5 | vec4 col = texture2D(yuvtex, gl_TexCoord[0].st); |
6 | |
7 | float Co = col[0] - 0.5; |
8 | float Cg = col[1] - 0.375; |
9 | float Y = col[3]; |
10 | |
11 | float s = Y - (Cg / 2.0); |
12 | float G = Cg + s; |
13 | float B = s - (Co / 2.0); |
14 | float R = B + Co; |
15 | |
16 | gl_FragColor=vec4(R,G,B,1.0); |
17 | } |
18 |
Note: See TracBrowser
for help on using the repository browser.