-/* $Id: attrib.c,v 1.21 2000/04/07 16:27:54 brianp Exp $ */
+/* $Id: attrib.c,v 1.22 2000/05/07 20:37:40 brianp Exp $ */
/*
* Mesa 3-D graphics library
attr->ClipPlane[i] = ctx->Transform.ClipEnabled[i];
}
attr->ColorMaterial = ctx->Light.ColorMaterialEnabled;
+ attr->Convolution1D = ctx->Pixel.Convolution1DEnabled;
+ attr->Convolution2D = ctx->Pixel.Convolution2DEnabled;
+ attr->Separable2D = ctx->Pixel.Separable2DEnabled;
attr->CullFace = ctx->Polygon.CullFlag;
attr->DepthTest = ctx->Depth.Test;
attr->Dither = ctx->Color.DitherFlag;
TEST_AND_UPDATE(ctx->Polygon.CullFlag, enable->CullFace, GL_CULL_FACE);
TEST_AND_UPDATE(ctx->Depth.Test, enable->DepthTest, GL_DEPTH_TEST);
TEST_AND_UPDATE(ctx->Color.DitherFlag, enable->Dither, GL_DITHER);
+ TEST_AND_UPDATE(ctx->Pixel.Convolution1DEnabled, enable->Convolution1D, GL_CONVOLUTION_1D);
+ TEST_AND_UPDATE(ctx->Pixel.Convolution2DEnabled, enable->Convolution2D, GL_CONVOLUTION_2D);
+ TEST_AND_UPDATE(ctx->Pixel.Separable2DEnabled, enable->Separable2D, GL_SEPARABLE_2D);
TEST_AND_UPDATE(ctx->Fog.Enabled, enable->Fog, GL_FOG);
TEST_AND_UPDATE(ctx->Light.Enabled, enable->Lighting, GL_LIGHTING);
TEST_AND_UPDATE(ctx->Line.SmoothFlag, enable->LineSmooth, GL_LINE_SMOOTH);
-/* $Id: config.h,v 1.11 2000/04/12 00:27:37 brianp Exp $ */
+/* $Id: config.h,v 1.12 2000/05/07 20:37:40 brianp Exp $ */
/*
* Mesa 3-D graphics library
/* Size of histogram tables */
#define HISTOGRAM_TABLE_SIZE 256
+/* Max convolution filter sizes */
+#define MAX_CONVOLUTION_WIDTH 5
+#define MAX_CONVOLUTION_HEIGHT 5
/*
-/* $Id: context.c,v 1.62 2000/05/04 13:53:55 brianp Exp $ */
+/* $Id: context.c,v 1.63 2000/05/07 20:37:40 brianp Exp $ */
/*
* Mesa 3-D graphics library
ctx->Const.LineWidthGranularity = LINE_WIDTH_GRANULARITY;
ctx->Const.NumAuxBuffers = NUM_AUX_BUFFERS;
ctx->Const.MaxColorTableSize = MAX_COLOR_TABLE_SIZE;
+ ctx->Const.MaxConvolutionWidth = MAX_CONVOLUTION_WIDTH;
+ ctx->Const.MaxConvolutionHeight = MAX_CONVOLUTION_HEIGHT;
/* Modelview matrix */
gl_matrix_ctr( &ctx->ModelView );
ctx->Pixel.PixelTextureEnabled = GL_FALSE;
ctx->Pixel.FragmentRgbSource = GL_PIXEL_GROUP_COLOR_SGIS;
ctx->Pixel.FragmentAlphaSource = GL_PIXEL_GROUP_COLOR_SGIS;
- ctx->Pixel.PostColorMatrixRedBias = 0.0;
- ctx->Pixel.PostColorMatrixRedScale = 1.0;
- ctx->Pixel.PostColorMatrixGreenBias = 0.0;
- ctx->Pixel.PostColorMatrixGreenScale = 1.0;
- ctx->Pixel.PostColorMatrixBlueBias = 0.0;
- ctx->Pixel.PostColorMatrixBlueScale = 1.0;
- ctx->Pixel.PostColorMatrixAlphaBias = 0.0;
- ctx->Pixel.PostColorMatrixAlphaScale = 1.0;
- ctx->Pixel.ColorTableScale[0] = 1.0F;
- ctx->Pixel.ColorTableScale[1] = 1.0F;
- ctx->Pixel.ColorTableScale[2] = 1.0F;
- ctx->Pixel.ColorTableScale[3] = 1.0F;
- ctx->Pixel.ColorTableBias[0] = 0.0F;
- ctx->Pixel.ColorTableBias[1] = 0.0F;
- ctx->Pixel.ColorTableBias[2] = 0.0F;
- ctx->Pixel.ColorTableBias[3] = 0.0F;
+ ASSIGN_4V(ctx->Pixel.PostColorMatrixScale, 1.0, 1.0, 1.0, 1.0);
+ ASSIGN_4V(ctx->Pixel.PostColorMatrixBias, 0.0, 0.0, 0.0, 0.0);
+ ASSIGN_4V(ctx->Pixel.ColorTableScale, 1.0, 1.0, 1.0, 1.0);
+ ASSIGN_4V(ctx->Pixel.ColorTableBias, 0.0, 0.0, 0.0, 0.0);
ctx->Pixel.ColorTableEnabled = GL_FALSE;
ctx->Pixel.PostConvolutionColorTableEnabled = GL_FALSE;
ctx->Pixel.PostColorMatrixColorTableEnabled = GL_FALSE;
+ ctx->Pixel.Convolution1DEnabled = GL_FALSE;
+ ctx->Pixel.Convolution2DEnabled = GL_FALSE;
+ ctx->Pixel.Separable2DEnabled = GL_FALSE;
+ for (i = 0; i < 3; i++) {
+ ASSIGN_4V(ctx->Pixel.ConvolutionBorderColor[i], 0.0, 0.0, 0.0, 0.0);
+ ctx->Pixel.ConvolutionBorderMode[i] = GL_REDUCE;
+ ASSIGN_4V(ctx->Pixel.ConvolutionFilterScale[i], 1.0, 1.0, 1.0, 1.0);
+ ASSIGN_4V(ctx->Pixel.ConvolutionFilterBias[i], 0.0, 0.0, 0.0, 0.0);
+ }
+ ASSIGN_4V(ctx->Pixel.PostConvolutionScale, 1.0, 1.0, 1.0, 1.0);
+ ASSIGN_4V(ctx->Pixel.PostConvolutionBias, 0.0, 0.0, 0.0, 0.0);
/* Point group */
ctx->Point.SmoothFlag = GL_FALSE;
-/* $Id: enable.c,v 1.17 2000/05/05 23:41:52 brianp Exp $ */
+/* $Id: enable.c,v 1.18 2000/05/07 20:37:40 brianp Exp $ */
/*
* Mesa 3-D graphics library
ctx->Pixel.PostColorMatrixColorTableEnabled = state;
break;
+ /* GL_EXT_convolution */
+ case GL_CONVOLUTION_1D:
+ ctx->Pixel.Convolution1DEnabled = state;
+ break;
+ case GL_CONVOLUTION_2D:
+ ctx->Pixel.Convolution2DEnabled = state;
+ break;
+ case GL_SEPARABLE_2D:
+ ctx->Pixel.Separable2DEnabled = state;
+ break;
+
default:
if (state) {
gl_error( ctx, GL_INVALID_ENUM, "glEnable" );
case GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI:
return ctx->Pixel.PostColorMatrixColorTableEnabled;
+ /* GL_EXT_convolution */
+ case GL_CONVOLUTION_1D:
+ return ctx->Pixel.Convolution1DEnabled;
+ case GL_CONVOLUTION_2D:
+ return ctx->Pixel.Convolution2DEnabled;
+ case GL_SEPARABLE_2D:
+ return ctx->Pixel.Separable2DEnabled;
+
default:
gl_error( ctx, GL_INVALID_ENUM, "glIsEnabled" );
return GL_FALSE;
-/* $Id: get.c,v 1.22 2000/05/04 13:48:49 brianp Exp $ */
+/* $Id: get.c,v 1.23 2000/05/07 20:37:40 brianp Exp $ */
/*
* Mesa 3-D graphics library
*params = FLOAT_TO_BOOL(MAX_COLOR_STACK_DEPTH);
break;
case GL_POST_COLOR_MATRIX_RED_SCALE_SGI:
- *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixRedScale);
+ *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixScale[0]);
break;
case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI:
- *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixGreenScale);
+ *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixScale[1]);
break;
case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI:
- *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixBlueScale);
+ *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixScale[2]);
break;
case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI:
- *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixAlphaScale);
+ *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixScale[3]);
break;
case GL_POST_COLOR_MATRIX_RED_BIAS_SGI:
- *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixRedBias);
+ *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixBias[0]);
break;
case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI:
- *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixGreenBias);
+ *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixBias[1]);
break;
case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI:
- *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixBlueBias);
+ *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixBias[2]);
break;
case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI:
- *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixAlphaBias);
+ *params = FLOAT_TO_BOOL(ctx->Pixel.PostColorMatrixBias[3]);
+ break;
+
+ /* GL_EXT_convolution (also in 1.2 imaging) */
+ case GL_MAX_CONVOLUTION_WIDTH:
+ *params = INT_TO_BOOL(ctx->Const.MaxConvolutionWidth);
+ break;
+ case GL_MAX_CONVOLUTION_HEIGHT:
+ *params = INT_TO_BOOL(ctx->Const.MaxConvolutionHeight);
+ break;
+ case GL_POST_CONVOLUTION_RED_SCALE_EXT:
+ *params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionScale[0]);
+ break;
+ case GL_POST_CONVOLUTION_GREEN_SCALE_EXT:
+ *params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionScale[1]);
+ break;
+ case GL_POST_CONVOLUTION_BLUE_SCALE_EXT:
+ *params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionScale[2]);
+ break;
+ case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT:
+ *params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionScale[3]);
+ break;
+ case GL_POST_CONVOLUTION_RED_BIAS_EXT:
+ *params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionBias[0]);
+ break;
+ case GL_POST_CONVOLUTION_GREEN_BIAS_EXT:
+ *params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionBias[1]);
+ break;
+ case GL_POST_CONVOLUTION_BLUE_BIAS_EXT:
+ *params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionBias[2]);
+ break;
+ case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT:
+ *params = FLOAT_TO_BOOL(ctx->Pixel.PostConvolutionBias[2]);
break;
/* GL_SGI_color_table (also in 1.2 imaging */
*params = (GLdouble) MAX_COLOR_STACK_DEPTH;
break;
case GL_POST_COLOR_MATRIX_RED_SCALE_SGI:
- *params = (GLdouble) ctx->Pixel.PostColorMatrixRedScale;
+ *params = (GLdouble) ctx->Pixel.PostColorMatrixScale[0];
break;
case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI:
- *params = (GLdouble) ctx->Pixel.PostColorMatrixGreenScale;
+ *params = (GLdouble) ctx->Pixel.PostColorMatrixScale[1];
break;
case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI:
- *params = (GLdouble) ctx->Pixel.PostColorMatrixBlueScale;
+ *params = (GLdouble) ctx->Pixel.PostColorMatrixScale[2];
break;
case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI:
- *params = (GLdouble) ctx->Pixel.PostColorMatrixAlphaScale;
+ *params = (GLdouble) ctx->Pixel.PostColorMatrixScale[3];
break;
case GL_POST_COLOR_MATRIX_RED_BIAS_SGI:
- *params = (GLdouble) ctx->Pixel.PostColorMatrixRedBias;
+ *params = (GLdouble) ctx->Pixel.PostColorMatrixBias[0];
break;
case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI:
- *params = (GLdouble) ctx->Pixel.PostColorMatrixGreenBias;
+ *params = (GLdouble) ctx->Pixel.PostColorMatrixBias[1];
break;
case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI:
- *params = (GLdouble) ctx->Pixel.PostColorMatrixBlueBias;
+ *params = (GLdouble) ctx->Pixel.PostColorMatrixBias[2];
break;
case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI:
- *params = (GLdouble) ctx->Pixel.PostColorMatrixAlphaBias;
+ *params = (GLdouble) ctx->Pixel.PostColorMatrixBias[3];
+ break;
+
+ /* GL_EXT_convolution (also in 1.2 imaging) */
+ case GL_MAX_CONVOLUTION_WIDTH:
+ *params = (GLdouble) ctx->Const.MaxConvolutionWidth;
+ break;
+ case GL_MAX_CONVOLUTION_HEIGHT:
+ *params = (GLdouble) ctx->Const.MaxConvolutionHeight;
+ break;
+ case GL_POST_CONVOLUTION_RED_SCALE_EXT:
+ *params = (GLdouble) ctx->Pixel.PostConvolutionScale[0];
+ break;
+ case GL_POST_CONVOLUTION_GREEN_SCALE_EXT:
+ *params = (GLdouble) ctx->Pixel.PostConvolutionScale[1];
+ break;
+ case GL_POST_CONVOLUTION_BLUE_SCALE_EXT:
+ *params = (GLdouble) ctx->Pixel.PostConvolutionScale[2];
+ break;
+ case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT:
+ *params = (GLdouble) ctx->Pixel.PostConvolutionScale[3];
+ break;
+ case GL_POST_CONVOLUTION_RED_BIAS_EXT:
+ *params = (GLdouble) ctx->Pixel.PostConvolutionBias[0];
+ break;
+ case GL_POST_CONVOLUTION_GREEN_BIAS_EXT:
+ *params = (GLdouble) ctx->Pixel.PostConvolutionBias[1];
+ break;
+ case GL_POST_CONVOLUTION_BLUE_BIAS_EXT:
+ *params = (GLdouble) ctx->Pixel.PostConvolutionBias[2];
+ break;
+ case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT:
+ *params = (GLdouble) ctx->Pixel.PostConvolutionBias[2];
break;
/* GL_SGI_color_table (also in 1.2 imaging */
*params = (GLfloat) MAX_COLOR_STACK_DEPTH;
break;
case GL_POST_COLOR_MATRIX_RED_SCALE_SGI:
- *params = ctx->Pixel.PostColorMatrixRedScale;
+ *params = ctx->Pixel.PostColorMatrixScale[0];
break;
case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI:
- *params = ctx->Pixel.PostColorMatrixGreenScale;
+ *params = ctx->Pixel.PostColorMatrixScale[1];
break;
case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI:
- *params = ctx->Pixel.PostColorMatrixBlueScale;
+ *params = ctx->Pixel.PostColorMatrixScale[2];
break;
case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI:
- *params = ctx->Pixel.PostColorMatrixAlphaScale;
+ *params = ctx->Pixel.PostColorMatrixScale[3];
break;
case GL_POST_COLOR_MATRIX_RED_BIAS_SGI:
- *params = ctx->Pixel.PostColorMatrixRedBias;
+ *params = ctx->Pixel.PostColorMatrixBias[0];
break;
case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI:
- *params = ctx->Pixel.PostColorMatrixGreenBias;
+ *params = ctx->Pixel.PostColorMatrixBias[1];
break;
case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI:
- *params = ctx->Pixel.PostColorMatrixBlueBias;
+ *params = ctx->Pixel.PostColorMatrixBias[2];
break;
case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI:
- *params = ctx->Pixel.PostColorMatrixAlphaBias;
+ *params = ctx->Pixel.PostColorMatrixBias[3];
+ break;
+
+ /* GL_EXT_convolution (also in 1.2 imaging) */
+ case GL_MAX_CONVOLUTION_WIDTH:
+ *params = (GLfloat) ctx->Const.MaxConvolutionWidth;
+ break;
+ case GL_MAX_CONVOLUTION_HEIGHT:
+ *params = (GLfloat) ctx->Const.MaxConvolutionHeight;
+ break;
+ case GL_POST_CONVOLUTION_RED_SCALE_EXT:
+ *params = ctx->Pixel.PostConvolutionScale[0];
+ break;
+ case GL_POST_CONVOLUTION_GREEN_SCALE_EXT:
+ *params = ctx->Pixel.PostConvolutionScale[1];
+ break;
+ case GL_POST_CONVOLUTION_BLUE_SCALE_EXT:
+ *params = ctx->Pixel.PostConvolutionScale[2];
+ break;
+ case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT:
+ *params = ctx->Pixel.PostConvolutionScale[3];
+ break;
+ case GL_POST_CONVOLUTION_RED_BIAS_EXT:
+ *params = ctx->Pixel.PostConvolutionBias[0];
+ break;
+ case GL_POST_CONVOLUTION_GREEN_BIAS_EXT:
+ *params = ctx->Pixel.PostConvolutionBias[1];
+ break;
+ case GL_POST_CONVOLUTION_BLUE_BIAS_EXT:
+ *params = ctx->Pixel.PostConvolutionBias[2];
+ break;
+ case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT:
+ *params = ctx->Pixel.PostConvolutionBias[2];
break;
/* GL_SGI_color_table (also in 1.2 imaging */
*params = MAX_COLOR_STACK_DEPTH;
break;
case GL_POST_COLOR_MATRIX_RED_SCALE_SGI:
- *params = (GLint) ctx->Pixel.PostColorMatrixRedScale;
+ *params = (GLint) ctx->Pixel.PostColorMatrixScale[0];
break;
case GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI:
- *params = (GLint) ctx->Pixel.PostColorMatrixGreenScale;
+ *params = (GLint) ctx->Pixel.PostColorMatrixScale[1];
break;
case GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI:
- *params = (GLint) ctx->Pixel.PostColorMatrixBlueScale;
+ *params = (GLint) ctx->Pixel.PostColorMatrixScale[2];
break;
case GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI:
- *params = (GLint) ctx->Pixel.PostColorMatrixAlphaScale;
+ *params = (GLint) ctx->Pixel.PostColorMatrixScale[3];
break;
case GL_POST_COLOR_MATRIX_RED_BIAS_SGI:
- *params = (GLint) ctx->Pixel.PostColorMatrixRedBias;
+ *params = (GLint) ctx->Pixel.PostColorMatrixBias[0];
break;
case GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI:
- *params = (GLint) ctx->Pixel.PostColorMatrixGreenBias;
+ *params = (GLint) ctx->Pixel.PostColorMatrixBias[1];
break;
case GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI:
- *params = (GLint) ctx->Pixel.PostColorMatrixBlueBias;
+ *params = (GLint) ctx->Pixel.PostColorMatrixBias[2];
break;
case GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI:
- *params = (GLint) ctx->Pixel.PostColorMatrixAlphaBias;
+ *params = (GLint) ctx->Pixel.PostColorMatrixBias[3];
+ break;
+
+ /* GL_EXT_convolution (also in 1.2 imaging) */
+ case GL_MAX_CONVOLUTION_WIDTH:
+ *params = ctx->Const.MaxConvolutionWidth;
+ break;
+ case GL_MAX_CONVOLUTION_HEIGHT:
+ *params = ctx->Const.MaxConvolutionHeight;
+ break;
+ case GL_POST_CONVOLUTION_RED_SCALE_EXT:
+ *params = (GLint) ctx->Pixel.PostConvolutionScale[0];
+ break;
+ case GL_POST_CONVOLUTION_GREEN_SCALE_EXT:
+ *params = (GLint) ctx->Pixel.PostConvolutionScale[1];
+ break;
+ case GL_POST_CONVOLUTION_BLUE_SCALE_EXT:
+ *params = (GLint) ctx->Pixel.PostConvolutionScale[2];
+ break;
+ case GL_POST_CONVOLUTION_ALPHA_SCALE_EXT:
+ *params = (GLint) ctx->Pixel.PostConvolutionScale[3];
+ break;
+ case GL_POST_CONVOLUTION_RED_BIAS_EXT:
+ *params = (GLint) ctx->Pixel.PostConvolutionBias[0];
+ break;
+ case GL_POST_CONVOLUTION_GREEN_BIAS_EXT:
+ *params = (GLint) ctx->Pixel.PostConvolutionBias[1];
+ break;
+ case GL_POST_CONVOLUTION_BLUE_BIAS_EXT:
+ *params = (GLint) ctx->Pixel.PostConvolutionBias[2];
+ break;
+ case GL_POST_CONVOLUTION_ALPHA_BIAS_EXT:
+ *params = (GLint) ctx->Pixel.PostConvolutionBias[2];
break;
/* GL_SGI_color_table (also in 1.2 imaging */
-/* $Id: pixel.c,v 1.9 2000/04/17 17:57:04 brianp Exp $ */
+/* $Id: pixel.c,v 1.10 2000/05/07 20:37:40 brianp Exp $ */
/*
* Mesa 3-D graphics library
ctx->Pixel.DepthBias = param;
break;
case GL_POST_COLOR_MATRIX_RED_SCALE:
- ctx->Pixel.PostColorMatrixRedScale = param;
+ ctx->Pixel.PostColorMatrixScale[0] = param;
break;
case GL_POST_COLOR_MATRIX_RED_BIAS:
- ctx->Pixel.PostColorMatrixRedBias = param;
+ ctx->Pixel.PostColorMatrixBias[0] = param;
break;
case GL_POST_COLOR_MATRIX_GREEN_SCALE:
- ctx->Pixel.PostColorMatrixGreenScale = param;
+ ctx->Pixel.PostColorMatrixScale[1] = param;
break;
case GL_POST_COLOR_MATRIX_GREEN_BIAS:
- ctx->Pixel.PostColorMatrixGreenBias = param;
+ ctx->Pixel.PostColorMatrixBias[1] = param;
break;
case GL_POST_COLOR_MATRIX_BLUE_SCALE:
- ctx->Pixel.PostColorMatrixBlueScale = param;
+ ctx->Pixel.PostColorMatrixScale[2] = param;
break;
case GL_POST_COLOR_MATRIX_BLUE_BIAS:
- ctx->Pixel.PostColorMatrixBlueBias = param;
+ ctx->Pixel.PostColorMatrixBias[2] = param;
break;
case GL_POST_COLOR_MATRIX_ALPHA_SCALE:
- ctx->Pixel.PostColorMatrixAlphaScale = param;
+ ctx->Pixel.PostColorMatrixScale[3] = param;
break;
case GL_POST_COLOR_MATRIX_ALPHA_BIAS:
- ctx->Pixel.PostColorMatrixAlphaBias = param;
+ ctx->Pixel.PostColorMatrixBias[3] = param;
+ break;
+ case GL_POST_CONVOLUTION_RED_SCALE:
+ ctx->Pixel.PostConvolutionScale[0] = param;
+ break;
+ case GL_POST_CONVOLUTION_RED_BIAS:
+ ctx->Pixel.PostConvolutionBias[0] = param;
+ break;
+ case GL_POST_CONVOLUTION_GREEN_SCALE:
+ ctx->Pixel.PostConvolutionScale[1] = param;
+ break;
+ case GL_POST_CONVOLUTION_GREEN_BIAS:
+ ctx->Pixel.PostConvolutionBias[1] = param;
+ break;
+ case GL_POST_CONVOLUTION_BLUE_SCALE:
+ ctx->Pixel.PostConvolutionScale[2] = param;
+ break;
+ case GL_POST_CONVOLUTION_BLUE_BIAS:
+ ctx->Pixel.PostConvolutionBias[2] = param;
+ break;
+ case GL_POST_CONVOLUTION_ALPHA_SCALE:
+ ctx->Pixel.PostConvolutionScale[2] = param;
+ break;
+ case GL_POST_CONVOLUTION_ALPHA_BIAS:
+ ctx->Pixel.PostConvolutionBias[2] = param;
break;
default:
gl_error( ctx, GL_INVALID_ENUM, "glPixelTransfer(pname)" );
ctx->Pixel.ScaleOrBiasRGBA = GL_FALSE;
}
- if (ctx->Pixel.PostColorMatrixRedScale!=1.0F ||
- ctx->Pixel.PostColorMatrixRedBias!=0.0F ||
- ctx->Pixel.PostColorMatrixGreenScale!=1.0F ||
- ctx->Pixel.PostColorMatrixGreenBias!=0.0F ||
- ctx->Pixel.PostColorMatrixBlueScale!=1.0F ||
- ctx->Pixel.PostColorMatrixBlueBias!=0.0F ||
- ctx->Pixel.PostColorMatrixAlphaScale!=1.0F ||
- ctx->Pixel.PostColorMatrixAlphaBias!=0.0F) {
+ if (ctx->Pixel.PostColorMatrixScale[0] != 1.0F ||
+ ctx->Pixel.PostColorMatrixBias[0] != 0.0F ||
+ ctx->Pixel.PostColorMatrixScale[1] != 1.0F ||
+ ctx->Pixel.PostColorMatrixBias[1] != 0.0F ||
+ ctx->Pixel.PostColorMatrixScale[2] != 1.0F ||
+ ctx->Pixel.PostColorMatrixBias[2] != 0.0F ||
+ ctx->Pixel.PostColorMatrixScale[3] != 1.0F ||
+ ctx->Pixel.PostColorMatrixBias[3] != 0.0F) {
ctx->Pixel.ScaleOrBiasRGBApcm = GL_TRUE;
}
else {
void
_mesa_transform_rgba(const GLcontext *ctx, GLuint n, GLfloat rgba[][4])
{
- const GLfloat rs = ctx->Pixel.PostColorMatrixRedScale;
- const GLfloat rb = ctx->Pixel.PostColorMatrixRedBias;
- const GLfloat gs = ctx->Pixel.PostColorMatrixGreenScale;
- const GLfloat gb = ctx->Pixel.PostColorMatrixGreenBias;
- const GLfloat bs = ctx->Pixel.PostColorMatrixBlueScale;
- const GLfloat bb = ctx->Pixel.PostColorMatrixBlueBias;
- const GLfloat as = ctx->Pixel.PostColorMatrixAlphaScale;
- const GLfloat ab = ctx->Pixel.PostColorMatrixAlphaBias;
+ const GLfloat rs = ctx->Pixel.PostColorMatrixScale[0];
+ const GLfloat rb = ctx->Pixel.PostColorMatrixBias[0];
+ const GLfloat gs = ctx->Pixel.PostColorMatrixScale[1];
+ const GLfloat gb = ctx->Pixel.PostColorMatrixBias[1];
+ const GLfloat bs = ctx->Pixel.PostColorMatrixScale[2];
+ const GLfloat bb = ctx->Pixel.PostColorMatrixBias[2];
+ const GLfloat as = ctx->Pixel.PostColorMatrixScale[3];
+ const GLfloat ab = ctx->Pixel.PostColorMatrixBias[3];
const GLfloat *m = ctx->ColorMatrix.m;
GLuint i;
for (i = 0; i < n; i++) {