data = ADD_POINTERS(buf, data);
}
- _mesa_pack_rgba_span_float(ctx, table->Size, (const GLfloat (*)[4]) rgba,
+ _mesa_pack_rgba_span_float(ctx, table->Size, rgba,
format, type, data, &ctx->Pack, 0x0);
if (ctx->Pack.BufferObj->Name) {
/*
* Mesa 3-D graphics library
- * Version: 6.3
+ * Version: 6.5.2
*
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 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"),
void GLAPIENTRY
-_mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid *image)
+_mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type,
+ GLvoid *image)
{
- const struct gl_convolution_attrib *filter;
+ struct gl_convolution_attrib *filter;
GLuint row;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
GLvoid *dst = _mesa_image_address2d(&ctx->Pack, image, filter->Width,
filter->Height, format, type,
row, 0);
- const GLfloat *src = filter->Filter + row * filter->Width * 4;
- _mesa_pack_rgba_span_float(ctx, filter->Width,
- (const GLfloat (*)[4]) src,
- format, type, dst, &ctx->Pack, 0);
+ GLfloat (*src)[4] = (GLfloat (*)[4]) (filter->Filter + row * filter->Width * 4);
+ _mesa_pack_rgba_span_float(ctx, filter->Width, src,
+ format, type, dst, &ctx->Pack, 0x0);
}
if (ctx->Pack.BufferObj->Name) {
void GLAPIENTRY
-_mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span)
+_mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type,
+ GLvoid *row, GLvoid *column, GLvoid *span)
{
const GLint colStart = MAX_CONVOLUTION_WIDTH * 4;
- const struct gl_convolution_attrib *filter;
+ struct gl_convolution_attrib *filter;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
}
if (!_mesa_is_legal_format_and_type(ctx, format, type)) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glGetConvolutionFilter(format or type)");
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetConvolutionFilter(format or type)");
return;
}
GLvoid *dst = _mesa_image_address1d(&ctx->Pack, row, filter->Width,
format, type, 0);
_mesa_pack_rgba_span_float(ctx, filter->Width,
- (const GLfloat (*)[4]) filter->Filter,
- format, type, dst, &ctx->Pack, 0);
+ (GLfloat (*)[4]) filter->Filter,
+ format, type, dst, &ctx->Pack, 0x0);
}
/* Column filter */
if (column) {
GLvoid *dst = _mesa_image_address1d(&ctx->Pack, column, filter->Height,
format, type, 0);
- const GLfloat *src = filter->Filter + colStart;
- _mesa_pack_rgba_span_float(ctx, filter->Height,
- (const GLfloat (*)[4]) src,
- format, type, dst, &ctx->Pack, 0);
+ GLfloat (*src)[4] = (GLfloat (*)[4]) (filter->Filter + colStart);
+ _mesa_pack_rgba_span_float(ctx, filter->Height, src,
+ format, type, dst, &ctx->Pack, 0x0);
}
(void) span; /* unused at this time */
minmax[1][GCOMP] = CLAMP(ctx->MinMax.Max[GCOMP], 0.0F, 1.0F);
minmax[1][BCOMP] = CLAMP(ctx->MinMax.Max[BCOMP], 0.0F, 1.0F);
minmax[1][ACOMP] = CLAMP(ctx->MinMax.Max[ACOMP], 0.0F, 1.0F);
- _mesa_pack_rgba_span_float(ctx, 2, (CONST GLfloat (*)[4]) minmax,
- format, type, values, &ctx->Pack, 0);
+ _mesa_pack_rgba_span_float(ctx, 2, minmax,
+ format, type, values, &ctx->Pack, 0x0);
}
if (ctx->Pack.BufferObj->Name) {
* by the dstFormat, dstType and dstPacking. Used by glReadPixels,
* glGetConvolutionFilter(), etc.
* Incoming colors will be clamped to [0,1] if needed.
+ * Note: the rgba values will be modified by this function when any pixel
+ * transfer ops are enabled.
*/
void
-_mesa_pack_rgba_span_float( GLcontext *ctx,
- GLuint n, CONST GLfloat rgbaIn[][4],
- GLenum dstFormat, GLenum dstType,
- GLvoid *dstAddr,
- const struct gl_pixelstore_attrib *dstPacking,
- GLbitfield transferOps )
+_mesa_pack_rgba_span_float(GLcontext *ctx, GLuint n, GLfloat rgba[][4],
+ GLenum dstFormat, GLenum dstType,
+ GLvoid *dstAddr,
+ const struct gl_pixelstore_attrib *dstPacking,
+ GLbitfield transferOps)
{
+ GLfloat luminance[MAX_WIDTH];
const GLint comps = _mesa_components_in_format(dstFormat);
- GLfloat rgbaCopy[MAX_WIDTH][4], luminance[MAX_WIDTH];
- const GLfloat (*rgba)[4];
GLuint i;
if (dstType != GL_FLOAT) {
}
if (transferOps) {
- /* make copy of incoming data */
- _mesa_memcpy(rgbaCopy, rgbaIn, n * 4 * sizeof(GLfloat));
- _mesa_apply_rgba_transfer_ops(ctx, transferOps, n, rgbaCopy);
- rgba = (const GLfloat (*)[4]) rgbaCopy;
-
+ _mesa_apply_rgba_transfer_ops(ctx, transferOps, n, rgba);
if ((transferOps & IMAGE_MIN_MAX_BIT) && ctx->MinMax.Sink) {
return;
}
}
- else {
- /* use incoming data, not a copy */
- rgba = (const GLfloat (*)[4]) rgbaIn;
- }
if (dstFormat == GL_LUMINANCE || dstFormat == GL_LUMINANCE_ALPHA) {
/* compute luminance values */
GLuint n, GLfloat rgba[][4]);
extern void
-_mesa_pack_rgba_span_float( GLcontext *ctx,
- GLuint n, CONST GLfloat rgba[][4],
+_mesa_pack_rgba_span_float( GLcontext *ctx, GLuint n, GLfloat rgba[][4],
GLenum dstFormat, GLenum dstType, GLvoid *dstAddr,
const struct gl_pixelstore_attrib *dstPacking,
GLbitfield transferOps );
GLfloat *dst = tempImage + img * (convWidth * convHeight * 4);
for (row = 0; row < convHeight; row++) {
_mesa_pack_rgba_span_float(ctx, convWidth,
- (const GLfloat (*)[4]) src,
+ (GLfloat (*)[4]) src,
logicalBaseFormat, GL_FLOAT,
dst, &ctx->DefaultPacking,
postConvTransferOps);
for (col = 0; col < width; col++) {
(*texImage->FetchTexelf)(texImage, col, row, img, rgba[col]);
}
- _mesa_pack_rgba_span_float(ctx, width,
- (const GLfloat (*)[4]) rgba,
- format, type, dest, &ctx->Pack,
- 0 /* no image transfer */);
+ _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) rgba,
+ format, type, dest,
+ &ctx->Pack, 0x0 /*image xfer ops*/);
} /* format */
} /* row */
} /* img */
GLvoid *dest;
dest = _mesa_image_address2d(packing, pixels, width, height,
format, type, row, 0);
- _mesa_pack_rgba_span_float(ctx, width,
- (const GLfloat (*)[4]) src,
+ _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) src,
format, type, dest, packing,
transferOps & IMAGE_POST_CONVOLUTION_BITS);
src += width * 4;
}
/* pack the row of RGBA pixels into user's buffer */
- _mesa_pack_rgba_span_float(ctx, width, (CONST GLfloat (*)[4]) rgba,
- format, type, dst,
+ _mesa_pack_rgba_span_float(ctx, width, rgba, format, type, dst,
packing, ctx->_ImageTransferState);
dst += dstStride;