-/* $Id: colortab.c,v 1.48 2003/01/26 14:37:16 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "context.h"
#include "image.h"
#include "macros.h"
-#include "mmath.h"
#include "state.h"
}
-void
-_mesa_init_colortable( struct gl_color_table *p )
-{
- p->FloatTable = GL_FALSE;
- p->Table = NULL;
- p->Size = 0;
- p->IntFormat = GL_RGBA;
-}
-
-
-
-void
-_mesa_free_colortable_data( struct gl_color_table *p )
-{
- if (p->Table) {
- FREE(p->Table);
- p->Table = NULL;
- }
-}
-
/*
* Examine table's format and set the component sizes accordingly.
return;
}
}
+
+/**********************************************************************/
+/***** Initialization *****/
+/**********************************************************************/
+
+
+void
+_mesa_init_one_colortable( struct gl_color_table *p )
+{
+ p->FloatTable = GL_FALSE;
+ p->Table = NULL;
+ p->Size = 0;
+ p->IntFormat = GL_RGBA;
+}
+
+
+
+void
+_mesa_free_one_colortable( struct gl_color_table *p )
+{
+ if (p->Table) {
+ FREE(p->Table);
+ p->Table = NULL;
+ }
+}
+
+void _mesa_init_colortable( GLcontext * ctx )
+{
+ /* Color tables */
+ _mesa_init_one_colortable(&ctx->ColorTable);
+ _mesa_init_one_colortable(&ctx->ProxyColorTable);
+ _mesa_init_one_colortable(&ctx->PostConvolutionColorTable);
+ _mesa_init_one_colortable(&ctx->ProxyPostConvolutionColorTable);
+ _mesa_init_one_colortable(&ctx->PostColorMatrixColorTable);
+ _mesa_init_one_colortable(&ctx->ProxyPostColorMatrixColorTable);
+}
+
+void _mesa_free_colortable_data( GLcontext *ctx )
+{
+ _mesa_free_one_colortable( &ctx->ColorTable );
+ _mesa_free_one_colortable( &ctx->ProxyColorTable );
+ _mesa_free_one_colortable( &ctx->PostConvolutionColorTable );
+ _mesa_free_one_colortable( &ctx->ProxyPostConvolutionColorTable );
+ _mesa_free_one_colortable( &ctx->PostColorMatrixColorTable );
+ _mesa_free_one_colortable( &ctx->ProxyPostColorMatrixColorTable );
+}