From 94f9d4c0dd2b62e01032c2b0dd9b8a25466690c2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 28 Feb 2004 21:19:27 +0000 Subject: minor clean-ups --- src/mesa/main/image.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index 7defce8813..ba5b4ff17a 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -1003,7 +1003,7 @@ _mesa_pack_rgba_span_float( GLcontext *ctx, { const GLint comps = _mesa_components_in_format(dstFormat); GLfloat luminance[MAX_WIDTH]; - GLfloat (*rgba)[4]; + const GLfloat (*rgba)[4]; GLuint i; if (transferOps) { @@ -1012,10 +1012,8 @@ _mesa_pack_rgba_span_float( GLcontext *ctx, CHECKARRAY(rgbaCopy, return); /* mac 32k limitation */ _mesa_memcpy(rgbaCopy, rgbaIn, n * 4 * sizeof(GLfloat)); - - rgba = (GLfloat (*)[4]) rgbaCopy; - - _mesa_apply_rgba_transfer_ops(ctx, transferOps, n, rgba); + _mesa_apply_rgba_transfer_ops(ctx, transferOps, n, rgbaCopy); + rgba = (const GLfloat (*)[4]) rgbaCopy; if ((transferOps & IMAGE_MIN_MAX_BIT) && ctx->MinMax.Sink) { UNDEFARRAY(rgbaCopy); /* mac 32k limitation */ @@ -1025,12 +1023,13 @@ _mesa_pack_rgba_span_float( GLcontext *ctx, } else { /* use incoming data, not a copy */ - rgba = (GLfloat (*)[4]) rgbaIn; + rgba = (const GLfloat (*)[4]) rgbaIn; } /* XXX clamp rgba to [0,1]? */ if (dstFormat == GL_LUMINANCE || dstFormat == GL_LUMINANCE_ALPHA) { + /* compute luminance values */ for (i = 0; i < n; i++) { GLfloat sum = rgba[i][RCOMP] + rgba[i][GCOMP] + rgba[i][BCOMP]; #if CHAN_TYPE == GL_FLOAT @@ -1984,7 +1983,7 @@ _mesa_pack_rgba_span_chan( GLcontext *ctx, assert(n <= MAX_WIDTH); /* convert color components to floating point */ - for (i=0;i