VirtualBox

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

最後變更 在這個檔案從70948是 55401,由 vboxsync 提交於 10 年 前

added a couple of missing Id headers

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

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