ReactOS  0.4.14-dev-608-gd495a4f
colortab.h File Reference
#include "types.h"
Include dependency graph for colortab.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define GL_COLOR_TABLE_FORMAT_EXT   0x80D8
 
#define GL_COLOR_TABLE_WIDTH_EXT   0x80D9
 
#define GL_COLOR_TABLE_RED_SIZE_EXT   0x80DA
 
#define GL_COLOR_TABLE_GREEN_SIZE_EXT   0x80DB
 
#define GL_COLOR_TABLE_BLUE_SIZE_EXT   0x80DC
 
#define GL_COLOR_TABLE_ALPHA_SIZE_EXT   0x80DD
 
#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT   0x80DE
 
#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT   0x80DF
 

Functions

void gl_ColorTable (GLcontext *ctx, GLenum target, GLenum internalformat, struct gl_image *table)
 
void gl_ColorSubTable (GLcontext *ctx, GLenum target, GLsizei start, struct gl_image *data)
 
void gl_GetColorTable (GLcontext *ctx, GLenum target, GLenum format, GLenum type, GLvoid *table)
 
void gl_GetColorTableParameterfv (GLcontext *ctx, GLenum target, GLenum pname, GLfloat *params)
 
void gl_GetColorTableParameteriv (GLcontext *ctx, GLenum target, GLenum pname, GLint *params)
 

Macro Definition Documentation

◆ GL_COLOR_TABLE_ALPHA_SIZE_EXT

#define GL_COLOR_TABLE_ALPHA_SIZE_EXT   0x80DD

Definition at line 43 of file colortab.h.

◆ GL_COLOR_TABLE_BLUE_SIZE_EXT

#define GL_COLOR_TABLE_BLUE_SIZE_EXT   0x80DC

Definition at line 42 of file colortab.h.

◆ GL_COLOR_TABLE_FORMAT_EXT

#define GL_COLOR_TABLE_FORMAT_EXT   0x80D8

Definition at line 38 of file colortab.h.

◆ GL_COLOR_TABLE_GREEN_SIZE_EXT

#define GL_COLOR_TABLE_GREEN_SIZE_EXT   0x80DB

Definition at line 41 of file colortab.h.

◆ GL_COLOR_TABLE_INTENSITY_SIZE_EXT

#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT   0x80DF

Definition at line 45 of file colortab.h.

◆ GL_COLOR_TABLE_LUMINANCE_SIZE_EXT

#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT   0x80DE

Definition at line 44 of file colortab.h.

◆ GL_COLOR_TABLE_RED_SIZE_EXT

#define GL_COLOR_TABLE_RED_SIZE_EXT   0x80DA

Definition at line 40 of file colortab.h.

◆ GL_COLOR_TABLE_WIDTH_EXT

#define GL_COLOR_TABLE_WIDTH_EXT   0x80D9

Definition at line 39 of file colortab.h.

Function Documentation

◆ gl_ColorSubTable()

void gl_ColorSubTable ( GLcontext ctx,
GLenum  target,
GLsizei  start,
struct gl_image data 
)

Definition at line 187 of file colortab.c.

189 {
190  /* XXX TODO */
191  gl_problem(ctx, "glColorSubTableEXT not implemented");
192 }
void gl_problem(const GLcontext *ctx, const char *s)
Definition: context.c:1394

Referenced by execute_list(), and init_exec_pointers().

◆ gl_ColorTable()

void gl_ColorTable ( GLcontext ctx,
GLenum  target,
GLenum  internalformat,
struct gl_image table 
)

Definition at line 129 of file colortab.c.

131 {
132  struct gl_texture_object *texObj;
134 
135  if (INSIDE_BEGIN_END(ctx)) {
136  gl_error( ctx, GL_INVALID_OPERATION, "glGetBooleanv" );
137  return;
138  }
139 
140  switch (target) {
141  case GL_TEXTURE_1D:
142  texObj = ctx->Texture.Current1D;
143  break;
144  case GL_TEXTURE_2D:
145  texObj = ctx->Texture.Current2D;
146  break;
147  case GL_PROXY_TEXTURE_1D:
148  texObj = ctx->Texture.Proxy1D;
149  proxy = GL_TRUE;
150  break;
151  case GL_PROXY_TEXTURE_2D:
152  texObj = ctx->Texture.Proxy2D;
153  proxy = GL_TRUE;
154  break;
155  default:
156  gl_error(ctx, GL_INVALID_ENUM, "glColorTableEXT(target)");
157  return;
158  }
159 
160  /* internalformat = just like glTexImage */
161 
162  if (table->Width < 1 || table->Width > MAX_TEXTURE_PALETTE_SIZE
163  || !power_of_two(table->Width)) {
164  gl_error(ctx, GL_INVALID_VALUE, "glColorTableEXT(width)");
165  if (proxy) {
166  texObj->PaletteSize = 0;
167  texObj->PaletteIntFormat = 0;
168  texObj->PaletteFormat = 0;
169  }
170  return;
171  }
172 
173  /* per-texture object palette */
174  texObj->PaletteSize = table->Width;
177  if (!proxy) {
178  MEMCPY(texObj->Palette, table->Data, table->Width*table->Components);
179  if (ctx->Driver.UpdateTexturePalette) {
180  (*ctx->Driver.UpdateTexturePalette)( ctx, texObj );
181  }
182  }
183 }
GLubyte Palette[MAX_TEXTURE_PALETTE_SIZE *4]
Definition: types.h:1103
int proxy
Definition: main.c:67
#define GL_PROXY_TEXTURE_2D
Definition: gl.h:727
#define MAX_TEXTURE_PALETTE_SIZE
Definition: config.h:122
#define GL_FALSE
Definition: gl.h:173
static GLint decode_internal_format(GLint format)
Definition: colortab.c:72
#define INSIDE_BEGIN_END(CTX)
Definition: macros.h:135
struct dd_function_table Driver
Definition: types.h:1276
static GLboolean power_of_two(GLint k)
Definition: colortab.c:60
#define GL_TEXTURE_1D
Definition: gl.h:644
unsigned char GLboolean
Definition: gl.h:151
GLenum internalFormat
Definition: glext.h:8404
struct gl_texture_attrib Texture
Definition: types.h:1334
#define GL_PROXY_TEXTURE_1D
Definition: gl.h:726
#define MEMCPY(DST, SRC, BYTES)
Definition: macros.h:231
GLenum PaletteFormat
Definition: types.h:1106
GLenum PaletteIntFormat
Definition: types.h:1105
#define GL_INVALID_VALUE
Definition: gl.h:695
#define GL_INVALID_OPERATION
Definition: gl.h:696
void gl_error(GLcontext *ctx, GLenum error, const char *s)
Definition: context.c:1421
#define GL_TRUE
Definition: gl.h:174
#define GL_INVALID_ENUM
Definition: gl.h:694
#define GL_TEXTURE_2D
Definition: gl.h:645
GLenum target
Definition: glext.h:7315
GLuint PaletteSize
Definition: types.h:1104

Referenced by execute_list(), and init_exec_pointers().

◆ gl_GetColorTable()

void gl_GetColorTable ( GLcontext ctx,
GLenum  target,
GLenum  format,
GLenum  type,
GLvoid table 
)

Definition at line 196 of file colortab.c.

198 {
199  if (INSIDE_BEGIN_END(ctx)) {
200  gl_error( ctx, GL_INVALID_OPERATION, "glGetBooleanv" );
201  return;
202  }
203 
204  switch (target) {
205  case GL_TEXTURE_1D:
206  break;
207  case GL_TEXTURE_2D:
208  break;
209  case GL_TEXTURE_3D_EXT:
210  break;
211  default:
212  gl_error(ctx, GL_INVALID_ENUM, "glGetColorTableEXT(target)");
213  return;
214  }
215 
216  gl_problem(ctx, "glGetColorTableEXT not implemented!");
217 }
#define GL_TEXTURE_3D_EXT
Definition: glext.h:2471
#define INSIDE_BEGIN_END(CTX)
Definition: macros.h:135
#define GL_TEXTURE_1D
Definition: gl.h:644
#define GL_INVALID_OPERATION
Definition: gl.h:696
void gl_problem(const GLcontext *ctx, const char *s)
Definition: context.c:1394
void gl_error(GLcontext *ctx, GLenum error, const char *s)
Definition: context.c:1421
#define GL_INVALID_ENUM
Definition: gl.h:694
#define GL_TEXTURE_2D
Definition: gl.h:645
GLenum target
Definition: glext.h:7315

Referenced by init_dlist_pointers(), and init_exec_pointers().

◆ gl_GetColorTableParameterfv()

void gl_GetColorTableParameterfv ( GLcontext ctx,
GLenum  target,
GLenum  pname,
GLfloat params 
)

Definition at line 221 of file colortab.c.

223 {
224  GLint iparams[10];
225 
226  gl_GetColorTableParameteriv( ctx, target, pname, iparams );
227  *params = (GLfloat) iparams[0];
228 }
GLenum pname
Definition: glext.h:5645
GLenum const GLfloat * params
Definition: glext.h:5645
void gl_GetColorTableParameteriv(GLcontext *ctx, GLenum target, GLenum pname, GLint *params)
Definition: colortab.c:232
float GLfloat
Definition: gl.h:161
GLenum target
Definition: glext.h:7315
int GLint
Definition: gl.h:156

◆ gl_GetColorTableParameteriv()

void gl_GetColorTableParameteriv ( GLcontext ctx,
GLenum  target,
GLenum  pname,
GLint params 
)

Definition at line 232 of file colortab.c.

234 {
235  struct gl_texture_object *texObj;
236 
237  if (INSIDE_BEGIN_END(ctx)) {
238  gl_error( ctx, GL_INVALID_OPERATION, "glGetColorTableParameter" );
239  return;
240  }
241 
242  switch (target) {
243  case GL_TEXTURE_1D:
244  texObj = ctx->Texture.Current1D;
245  break;
246  case GL_TEXTURE_2D:
247  texObj = ctx->Texture.Current2D;
248  break;
249  default:
250  gl_error(ctx, GL_INVALID_ENUM, "glGetColorTableParameter(target)");
251  return;
252  }
253 
254  switch (pname) {
256  if (texObj)
257  *params = texObj->PaletteIntFormat;
258  break;
260  if (texObj)
261  *params = texObj->PaletteSize;
262  break;
264  *params = 8;
265  break;
267  *params = 8;
268  break;
270  *params = 8;
271  break;
273  *params = 8;
274  break;
276  *params = 8;
277  break;
279  *params = 8;
280  break;
281  default:
282  gl_error(ctx, GL_INVALID_ENUM, "glGetColorTableParameter" );
283  return;
284  }
285 }
#define GL_COLOR_TABLE_RED_SIZE_EXT
Definition: colortab.h:40
#define INSIDE_BEGIN_END(CTX)
Definition: macros.h:135
GLenum pname
Definition: glext.h:5645
GLenum const GLfloat * params
Definition: glext.h:5645
#define GL_TEXTURE_1D
Definition: gl.h:644
#define GL_COLOR_TABLE_BLUE_SIZE_EXT
Definition: colortab.h:42
struct gl_texture_attrib Texture
Definition: types.h:1334
#define GL_COLOR_TABLE_WIDTH_EXT
Definition: colortab.h:39
GLenum PaletteIntFormat
Definition: types.h:1105
#define GL_INVALID_OPERATION
Definition: gl.h:696
void gl_error(GLcontext *ctx, GLenum error, const char *s)
Definition: context.c:1421
#define GL_COLOR_TABLE_GREEN_SIZE_EXT
Definition: colortab.h:41
#define GL_COLOR_TABLE_ALPHA_SIZE_EXT
Definition: colortab.h:43
#define GL_INVALID_ENUM
Definition: gl.h:694
#define GL_TEXTURE_2D
Definition: gl.h:645
GLenum target
Definition: glext.h:7315
#define GL_COLOR_TABLE_FORMAT_EXT
Definition: colortab.h:38
GLuint PaletteSize
Definition: types.h:1104
#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT
Definition: colortab.h:45
#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT
Definition: colortab.h:44

Referenced by gl_GetColorTableParameterfv(), init_dlist_pointers(), and init_exec_pointers().