summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/attrib.c8
-rw-r--r--src/mesa/main/config.h5
-rw-r--r--src/mesa/main/context.c35
-rw-r--r--src/mesa/main/enable.c21
-rw-r--r--src/mesa/main/get.c194
-rw-r--r--src/mesa/main/pixel.c74
6 files changed, 259 insertions, 78 deletions
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index 8e9966bca67..2e6516f2d00 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -1,4 +1,4 @@
-/* $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
@@ -167,6 +167,9 @@ _mesa_PushAttrib(GLbitfield mask)
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;
@@ -508,6 +511,9 @@ _mesa_PopAttrib(void)
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);
diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h
index 8c91483767d..fc43ebcd5a5 100644
--- a/src/mesa/main/config.h
+++ b/src/mesa/main/config.h
@@ -1,4 +1,4 @@
-/* $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
@@ -118,6 +118,9 @@
/* Size of histogram tables */
#define HISTOGRAM_TABLE_SIZE 256
+/* Max convolution filter sizes */
+#define MAX_CONVOLUTION_WIDTH 5
+#define MAX_CONVOLUTION_HEIGHT 5
/*
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 3533b822773..645fe63e2f4 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1,4 +1,4 @@
-/* $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
@@ -711,6 +711,8 @@ init_attrib_groups( GLcontext *ctx )
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 );
@@ -1022,25 +1024,24 @@ init_attrib_groups( GLcontext *ctx )
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;
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 70e29b98690..9a64a00e7ab 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -1,4 +1,4 @@
-/* $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
@@ -495,6 +495,17 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
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" );
@@ -719,6 +730,14 @@ _mesa_IsEnabled( GLenum cap )
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;
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 0282c588336..e5e11f051fe 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -1,4 +1,4 @@
-/* $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
@@ -1096,28 +1096,60 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
*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 */
@@ -2155,28 +2187,60 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
*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 */
@@ -3191,28 +3255,60 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
*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 */
@@ -4250,28 +4346,60 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
*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 */
diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c
index ec64446214c..8538ae0d638 100644
--- a/src/mesa/main/pixel.c
+++ b/src/mesa/main/pixel.c
@@ -1,4 +1,4 @@
-/* $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
@@ -558,28 +558,52 @@ _mesa_PixelTransferf( GLenum pname, GLfloat param )
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)" );
@@ -596,14 +620,14 @@ _mesa_PixelTransferf( GLenum pname, GLfloat param )
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 {
@@ -696,14 +720,14 @@ _mesa_map_rgba( const GLcontext *ctx, GLuint n, GLfloat rgba[][4] )
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++) {