VirtualBox

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

最後變更 在這個檔案從47160是 35579,由 vboxsync 提交於 14 年 前

scm: cleanups and adjustments

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id Revision
檔案大小: 1.2 KB
 
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}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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