Mercurial > mplayer.hg
comparison libvo/gl_common.h @ 16488:3191dcb27a12
hardware color-space conversion for vo_gl and vo_gl2
author | reimar |
---|---|
date | Wed, 14 Sep 2005 22:08:04 +0000 |
parents | ec7036dedee4 |
children | 26b156d7a68d |
comparison
equal
deleted
inserted
replaced
16487:bafefab46f12 | 16488:3191dcb27a12 |
---|---|
15 #include <X11/Xlib.h> | 15 #include <X11/Xlib.h> |
16 #include <GL/glx.h> | 16 #include <GL/glx.h> |
17 #include "x11_common.h" | 17 #include "x11_common.h" |
18 #endif | 18 #endif |
19 | 19 |
20 // conditionally define all extension defines used | |
21 // vendor specific extensions should be marked as such | |
22 // (e.g. _NV), _ARB is not used to ease readability. | |
23 #ifndef GL_MAX_GENERAL_COMBINERS_NV | |
24 #define GL_MAX_GENERAL_COMBINERS_NV 0x854D | |
25 #endif | |
26 #ifndef GL_NUM_GENERAL_COMBINERS_NV | |
27 #define GL_NUM_GENERAL_COMBINERS_NV 0x854E | |
28 #endif | |
29 #ifndef GL_CONSTANT_COLOR0_NV | |
30 #define GL_CONSTANT_COLOR0_NV 0x852A | |
31 #endif | |
32 #ifndef GL_CONSTANT_COLOR1_NV | |
33 #define GL_CONSTANT_COLOR1_NV 0x852B | |
34 #endif | |
35 #ifndef GL_COMBINER0_NV | |
36 #define GL_COMBINER0_NV 0x8550 | |
37 #endif | |
38 #ifndef GL_COMBINER1_NV | |
39 #define GL_COMBINER1_NV 0x8551 | |
40 #endif | |
41 #ifndef GL_VARIABLE_A_NV | |
42 #define GL_VARIABLE_A_NV 0x8523 | |
43 #endif | |
44 #ifndef GL_VARIABLE_B_NV | |
45 #define GL_VARIABLE_B_NV 0x8524 | |
46 #endif | |
47 #ifndef GL_VARIABLE_C_NV | |
48 #define GL_VARIABLE_C_NV 0x8525 | |
49 #endif | |
50 #ifndef GL_VARIABLE_D_NV | |
51 #define GL_VARIABLE_D_NV 0x8526 | |
52 #endif | |
53 #ifndef GL_UNSIGNED_INVERT_NV | |
54 #define GL_UNSIGNED_INVERT_NV 0x8537 | |
55 #endif | |
56 #ifndef GL_HALF_BIAS_NORMAL_NV | |
57 #define GL_HALF_BIAS_NORMAL_NV 0x853A | |
58 #endif | |
59 #ifndef GL_SIGNED_IDENTITY_NV | |
60 #define GL_SIGNED_IDENTITY_NV 0x853C | |
61 #endif | |
62 #ifndef GL_SCALE_BY_FOUR_NV | |
63 #define GL_SCALE_BY_FOUR_NV 0x853F | |
64 #endif | |
65 #ifndef GL_DISCARD_NV | |
66 #define GL_DISCARD_NV 0x8530 | |
67 #endif | |
68 #ifndef GL_SPARE0_NV | |
69 #define GL_SPARE0_NV 0x852E | |
70 #endif | |
71 #ifndef GL_MAX_TEXTURE_UNITS | |
72 #define GL_MAX_TEXTURE_UNITS 0x84E2 | |
73 #endif | |
74 #ifndef GL_TEXTURE0 | |
75 #define GL_TEXTURE0 0x84C0 | |
76 #endif | |
77 #ifndef GL_TEXTURE1 | |
78 #define GL_TEXTURE1 0x84C1 | |
79 #endif | |
80 #ifndef GL_TEXTURE2 | |
81 #define GL_TEXTURE2 0x84C2 | |
82 #endif | |
83 #ifndef GL_TEXTURE3 | |
84 #define GL_TEXTURE3 0x84C3 | |
85 #endif | |
20 #ifndef GL_TEXTURE_RECTANGLE | 86 #ifndef GL_TEXTURE_RECTANGLE |
21 #define GL_TEXTURE_RECTANGLE 0x84F5 | 87 #define GL_TEXTURE_RECTANGLE 0x84F5 |
22 #endif | 88 #endif |
23 #ifndef GL_PIXEL_UNPACK_BUFFER | 89 #ifndef GL_PIXEL_UNPACK_BUFFER |
24 #define GL_PIXEL_UNPACK_BUFFER 0x88EC | 90 #define GL_PIXEL_UNPACK_BUFFER 0x88EC |
53 #ifndef GL_UNSIGNED_SHORT_5_5_5_1 | 119 #ifndef GL_UNSIGNED_SHORT_5_5_5_1 |
54 #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 | 120 #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 |
55 #endif | 121 #endif |
56 #ifndef GL_UNSIGNED_SHORT_1_5_5_5_REV | 122 #ifndef GL_UNSIGNED_SHORT_1_5_5_5_REV |
57 #define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 | 123 #define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 |
124 #endif | |
125 #ifndef GL_FRAGMENT_PROGRAM | |
126 #define GL_FRAGMENT_PROGRAM 0x8804 | |
127 #endif | |
128 #ifndef GL_PROGRAM_FORMAT_ASCII | |
129 #define GL_PROGRAM_FORMAT_ASCII 0x8875 | |
130 #endif | |
131 #ifndef GL_PROGRAM_ERROR_POSITION | |
132 #define GL_PROGRAM_ERROR_POSITION 0x864B | |
58 #endif | 133 #endif |
59 | 134 |
60 void glAdjustAlignment(int stride); | 135 void glAdjustAlignment(int stride); |
61 | 136 |
62 const char *glValName(GLint value); | 137 const char *glValName(GLint value); |
69 void glUploadTex(GLenum target, GLenum format, GLenum type, | 144 void glUploadTex(GLenum target, GLenum format, GLenum type, |
70 const char *data, int stride, | 145 const char *data, int stride, |
71 int x, int y, int w, int h, int slice); | 146 int x, int y, int w, int h, int slice); |
72 void glDrawTex(GLfloat x, GLfloat y, GLfloat w, GLfloat h, | 147 void glDrawTex(GLfloat x, GLfloat y, GLfloat w, GLfloat h, |
73 GLfloat tx, GLfloat ty, GLfloat tw, GLfloat th, | 148 GLfloat tx, GLfloat ty, GLfloat tw, GLfloat th, |
74 int sx, int sy, int rect_tex); | 149 int sx, int sy, int rect_tex, int is_yv12); |
150 | |
151 //! do not use YUV conversion, this should always stay 0 | |
152 #define YUV_CONVERSION_NONE 0 | |
153 //! use nVidia specific register combiners for YUV conversion | |
154 #define YUV_CONVERSION_COMBINERS 1 | |
155 //! use a fragment program for YUV conversion | |
156 #define YUV_CONVERSION_FRAGMENT 2 | |
157 //! use a fragment program for YUV conversion with gamma using POW | |
158 #define YUV_CONVERSION_FRAGMENT_POW 3 | |
159 //! use a fragment program with additional table lookup for YUV conversion | |
160 #define YUV_CONVERSION_FRAGMENT_LOOKUP 4 | |
161 void glSetupYUVConversion(int type, float brightness, float contrast, | |
162 float hue, float saturation, | |
163 float rgamma, float ggamma, float bgamma); | |
164 void inline glEnableYUVConversion(GLenum target, int type); | |
165 void inline glDisableYUVConversion(GLenum target, int type); | |
75 | 166 |
76 //! could not set new window, will continue drawing into the old one. | 167 //! could not set new window, will continue drawing into the old one. |
77 #define SET_WINDOW_FAILED -1 | 168 #define SET_WINDOW_FAILED -1 |
78 //! new window is set, could even transfer the OpenGL context. | 169 //! new window is set, could even transfer the OpenGL context. |
79 #define SET_WINDOW_OK 0 | 170 #define SET_WINDOW_OK 0 |
102 GLenum, GLenum, GLboolean, GLboolean, | 193 GLenum, GLenum, GLboolean, GLboolean, |
103 GLboolean); | 194 GLboolean); |
104 extern void (APIENTRY *ActiveTexture)(GLenum); | 195 extern void (APIENTRY *ActiveTexture)(GLenum); |
105 extern void (APIENTRY *BindTexture)(GLenum, GLuint); | 196 extern void (APIENTRY *BindTexture)(GLenum, GLuint); |
106 extern void (APIENTRY *MultiTexCoord2f)(GLenum, GLfloat, GLfloat); | 197 extern void (APIENTRY *MultiTexCoord2f)(GLenum, GLfloat, GLfloat); |
198 extern void (APIENTRY *GenPrograms)(GLsizei, GLuint *); | |
199 extern void (APIENTRY *DeletePrograms)(GLsizei, const GLuint *); | |
107 extern void (APIENTRY *BindProgram)(GLenum, GLuint); | 200 extern void (APIENTRY *BindProgram)(GLenum, GLuint); |
108 extern void (APIENTRY *ProgramString)(GLenum, GLenum, GLsizei, const GLvoid *); | 201 extern void (APIENTRY *ProgramString)(GLenum, GLenum, GLsizei, const GLvoid *); |
109 extern void (APIENTRY *ProgramEnvParameter4f)(GLenum, GLuint, GLfloat, GLfloat, | 202 extern void (APIENTRY *ProgramEnvParameter4f)(GLenum, GLuint, GLfloat, GLfloat, |
110 GLfloat, GLfloat); | 203 GLfloat, GLfloat); |
111 extern int (APIENTRY *SwapInterval)(int); | 204 extern int (APIENTRY *SwapInterval)(int); |