VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/shaders/cconvUYVY.c@ 22640

Last change on this file since 22640 was 22640, checked in by vboxsync, 16 years ago

OSE fix

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 849 bytes
Line 
1#extension GL_ARB_texture_rectangle : enable
2
3uniform sampler2DRect uSrcTex;
4
5void cconvApplyAYUV(vec4 color);
6/* texture internalFormat: 4
7 * size: width/2 X height
8 * data format: GL_BGRA_EXT
9 * UYVY ->
10 * U = B
11 * V = R
12 * for even -> Y = G
13 * for odd -> Y = A
14/* UYVY-rgb888 conversion shader */
15/* this is also Y422 and UYNV */
16void cconvUYVY(vec2 srcCoord)
17{
18 float x = srcCoord.x;
19 vec4 srcClr = texture2DRect(uSrcTex, vec2(x, srcCoord.y));
20 float u = srcClr.b;
21 float v = srcClr.r;
22 int pix = int(x);
23 float part = x - float(pix);
24 float y;
25 if(part < 0.5)
26 {
27 y = srcClr.g;
28 }
29 else
30 {
31 y = srcClr.a;
32 }
33 /* convert it to AYUV (for the GL_BGRA_EXT texture this is mapped as follows:
34 * A -> B
35 * Y -> G
36 * U -> R
37 * V -> A */
38 cconvApplyAYUV(vec4(u, y, 0.0, v));}
Note: See TracBrowser for help on using the repository browser.

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