Last change
on this file since 79723 was 71027, checked in by vboxsync, 7 years ago |
FE/Qt: big svn props cleanup
|
-
Property svn:eol-style
set to
native
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
1.2 KB
|
Line | |
---|
1 | /* $Id: cconvYV12.c 71027 2018-02-15 14:33:48Z vboxsync $ */
|
---|
2 | #extension GL_ARB_texture_rectangle : enable
|
---|
3 | uniform sampler2DRect uSrcTex;
|
---|
4 | uniform sampler2DRect uVTex;
|
---|
5 | uniform sampler2DRect uUTex;
|
---|
6 | void vboxCConvApplyAYUV(vec4 color);
|
---|
7 | void 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.