replace color table FloatTable boolean with Type enum
[mesa.git] / src / mesa / main / pixel.c
index 80ddeb270bd05413a3e2a0fced9ee122c032b359..f211af91703b0a605cf2cfda2686d90f7d80a8c6 100644 (file)
@@ -1,9 +1,9 @@
 
 /*
  * Mesa 3-D graphics library
- * Version:  4.1
+ * Version:  5.1
  *
- * Copyright (C) 1999-2002  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2003  Brian Paul   All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -38,7 +38,7 @@
 
 
 
-void
+void GLAPIENTRY
 _mesa_PixelZoom( GLfloat xfactor, GLfloat yfactor )
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -59,7 +59,7 @@ _mesa_PixelZoom( GLfloat xfactor, GLfloat yfactor )
 /**********************************************************************/
 
 
-void
+void GLAPIENTRY
 _mesa_PixelStorei( GLenum pname, GLint param )
 {
    /* NOTE: this call can't be compiled into the display list */
@@ -240,7 +240,7 @@ _mesa_PixelStorei( GLenum pname, GLint param )
 }
 
 
-void
+void GLAPIENTRY
 _mesa_PixelStoref( GLenum pname, GLfloat param )
 {
    _mesa_PixelStorei( pname, (GLint) param );
@@ -254,8 +254,8 @@ _mesa_PixelStoref( GLenum pname, GLfloat param )
 
 
 
-void
-_mesa_PixelMapfv( GLenum map, GLint mapsize, const GLfloat *values )
+void GLAPIENTRY
+_mesa_PixelMapfv( GLenum map, GLsizei mapsize, const GLfloat *values )
 {
    GLint i;
    GET_CURRENT_CONTEXT(ctx);
@@ -352,8 +352,8 @@ _mesa_PixelMapfv( GLenum map, GLint mapsize, const GLfloat *values )
 
 
 
-void
-_mesa_PixelMapuiv(GLenum map, GLint mapsize, const GLuint *values )
+void GLAPIENTRY
+_mesa_PixelMapuiv(GLenum map, GLsizei mapsize, const GLuint *values )
 {
    const GLint n = MIN2(mapsize, MAX_PIXEL_MAP_TABLE);
    GLfloat fvalues[MAX_PIXEL_MAP_TABLE];
@@ -373,8 +373,8 @@ _mesa_PixelMapuiv(GLenum map, GLint mapsize, const GLuint *values )
 
 
 
-void
-_mesa_PixelMapusv(GLenum map, GLint mapsize, const GLushort *values )
+void GLAPIENTRY
+_mesa_PixelMapusv(GLenum map, GLsizei mapsize, const GLushort *values )
 {
    const GLint n = MIN2(mapsize, MAX_PIXEL_MAP_TABLE);
    GLfloat fvalues[MAX_PIXEL_MAP_TABLE];
@@ -394,7 +394,7 @@ _mesa_PixelMapusv(GLenum map, GLint mapsize, const GLushort *values )
 
 
 
-void
+void GLAPIENTRY
 _mesa_GetPixelMapfv( GLenum map, GLfloat *values )
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -442,7 +442,7 @@ _mesa_GetPixelMapfv( GLenum map, GLfloat *values )
 }
 
 
-void
+void GLAPIENTRY
 _mesa_GetPixelMapuiv( GLenum map, GLuint *values )
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -502,7 +502,7 @@ _mesa_GetPixelMapuiv( GLenum map, GLuint *values )
 }
 
 
-void
+void GLAPIENTRY
 _mesa_GetPixelMapusv( GLenum map, GLushort *values )
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -576,7 +576,7 @@ _mesa_GetPixelMapusv( GLenum map, GLushort *values )
  * Implements glPixelTransfer[fi] whether called immediately or from a
  * display list.
  */
-void
+void GLAPIENTRY
 _mesa_PixelTransferf( GLenum pname, GLfloat param )
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -770,7 +770,7 @@ _mesa_PixelTransferf( GLenum pname, GLfloat param )
 }
 
 
-void
+void GLAPIENTRY
 _mesa_PixelTransferi( GLenum pname, GLint param )
 {
    _mesa_PixelTransferf( pname, (GLfloat) param );
@@ -877,6 +877,7 @@ _mesa_transform_rgba(const GLcontext *ctx, GLuint n, GLfloat rgba[][4])
 
 /*
  * Apply a color table lookup to an array of colors.
+ * XXX merge with _swrast_texture_table_lookup in s_texture.c
  */
 void
 _mesa_lookup_rgba(const struct gl_color_table *table,
@@ -888,7 +889,7 @@ _mesa_lookup_rgba(const struct gl_color_table *table,
    switch (table->Format) {
       case GL_INTENSITY:
          /* replace RGBA with I */
-         if (!table->FloatTable) {
+         if (table->Type != GL_FLOAT) {
             const GLint max = table->Size - 1;
             const GLfloat scale = (GLfloat) max;
             const GLchan *lut = (const GLchan *) table->Table;
@@ -915,7 +916,7 @@ _mesa_lookup_rgba(const struct gl_color_table *table,
          break;
       case GL_LUMINANCE:
          /* replace RGB with L */
-         if (!table->FloatTable) {
+         if (table->Type != GL_FLOAT) {
             const GLint max = table->Size - 1;
             const GLfloat scale = (GLfloat) max;
             const GLchan *lut = (const GLchan *) table->Table;
@@ -940,7 +941,7 @@ _mesa_lookup_rgba(const struct gl_color_table *table,
          break;
       case GL_ALPHA:
          /* replace A with A */
-         if (!table->FloatTable) {
+         if (table->Type != GL_FLOAT) {
             const GLint max = table->Size - 1;
             const GLfloat scale = (GLfloat) max;
             const GLchan *lut = (const GLchan *) table->Table;
@@ -963,7 +964,7 @@ _mesa_lookup_rgba(const struct gl_color_table *table,
          break;
       case GL_LUMINANCE_ALPHA:
          /* replace RGBA with LLLA */
-         if (!table->FloatTable) {
+         if (table->Type != GL_FLOAT) {
             const GLint max = table->Size - 1;
             const GLfloat scale = (GLfloat) max;
             const GLchan *lut = (const GLchan *) table->Table;
@@ -1000,7 +1001,7 @@ _mesa_lookup_rgba(const struct gl_color_table *table,
          break;
       case GL_RGB:
          /* replace RGB with RGB */
-         if (!table->FloatTable) {
+         if (table->Type != GL_FLOAT) {
             const GLint max = table->Size - 1;
             const GLfloat scale = (GLfloat) max;
             const GLchan *lut = (const GLchan *) table->Table;
@@ -1037,7 +1038,7 @@ _mesa_lookup_rgba(const struct gl_color_table *table,
          break;
       case GL_RGBA:
          /* replace RGBA with RGBA */
-         if (!table->FloatTable) {
+         if (table->Type != GL_FLOAT) {
             const GLint max = table->Size - 1;
             const GLfloat scale = (GLfloat) max;
             const GLchan *lut = (const GLchan *) table->Table;