VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/shaders/cconvYV12.c@ 51988

Last change on this file since 51988 was 35579, checked in by vboxsync, 14 years ago

scm: cleanups and adjustments

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 1.2 KB
Line 
1#extension GL_ARB_texture_rectangle : enable
2uniform sampler2DRect uSrcTex;
3uniform sampler2DRect uVTex;
4uniform sampler2DRect uUTex;
5void vboxCConvApplyAYUV(vec4 color);
6void vboxCConv()
7{
8 vec2 clrCoordY = vec2(gl_TexCoord[0]);
9 vec2 clrCoordV = vec2(gl_TexCoord[1]);
10 int ixY = int(clrCoordY.x);
11 vec2 coordY = vec2(float(ixY), clrCoordY.y);
12 int ixV = int(clrCoordV.x);
13 vec2 coordV = vec2(float(ixV), clrCoordV.y);
14 vec4 clrY = texture2DRect(uSrcTex, coordY);
15 vec4 clrV = texture2DRect(uVTex, coordV);
16 vec4 clrU = texture2DRect(uUTex, coordV);
17 float partY = clrCoordY.x - float(ixY);
18 float partVU = clrCoordV.x - float(ixV);
19 float y;
20 float v;
21 float u;
22 if(partY < 0.25)
23 {
24 y = clrY.b;
25 }
26 else if(partY < 0.5)
27 {
28 y = clrY.g;
29 }
30 else if(partY < 0.75)
31 {
32 y = clrY.r;
33 }
34 else
35 {
36 y = clrY.a;
37 }
38
39 if(partVU < 0.25)
40 {
41 v = clrV.b;
42 u = clrU.b;
43 }
44 else if(partVU < 0.5)
45 {
46 v = clrV.g;
47 u = clrU.g;
48 }
49 else if(partVU < 0.75)
50 {
51 v = clrV.r;
52 u = clrU.r;
53 }
54 else
55 {
56 v = clrV.a;
57 u = clrU.a;
58 }
59 vboxCConvApplyAYUV(vec4(u, y, 0.0, v));
60}
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette