VirtualBox

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

Last change on this file since 58423 was 55401, checked in by vboxsync, 10 years ago

added a couple of missing Id headers

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