removed obsolete _mesa_pack_rgba_span_chan()

This commit is contained in:
Brian Paul 2006-10-13 15:00:35 +00:00
parent c28d0f779a
commit 6b998c5584
2 changed files with 0 additions and 80 deletions

View file

@ -1996,78 +1996,6 @@ _mesa_pack_rgba_span_float( GLcontext *ctx,
}
/*
* Pack the given RGBA span into client memory at 'dest' address
* in the given pixel format and type.
* Optionally apply the enabled pixel transfer ops.
* Pack into memory using the given packing params struct.
* This is used by glReadPixels and glGetTexImage?D()
* \param ctx - the context
* n - number of pixels in the span
* rgba - the pixels
* format - dest packing format
* type - dest packing data type
* destination - destination packing address
* packing - pixel packing parameters
* transferOps - bitmask of IMAGE_*_BIT operations to apply
*/
void
_mesa_pack_rgba_span_chan( GLcontext *ctx,
GLuint n, CONST GLchan srcRgba[][4],
GLenum dstFormat, GLenum dstType,
GLvoid *dstAddr,
const struct gl_pixelstore_attrib *dstPacking,
GLuint transferOps)
{
ASSERT((ctx->NewState & _NEW_PIXEL) == 0 || transferOps == 0);
/* Test for optimized case first */
if (transferOps == 0 && dstFormat == GL_RGBA && dstType == CHAN_TYPE) {
/* common simple case */
_mesa_memcpy(dstAddr, srcRgba, n * 4 * sizeof(GLchan));
}
else if (transferOps == 0 && dstFormat == GL_RGB && dstType == CHAN_TYPE) {
/* common simple case */
GLuint i;
GLchan *dest = (GLchan *) dstAddr;
for (i = 0; i < n; i++) {
dest[0] = srcRgba[i][RCOMP];
dest[1] = srcRgba[i][GCOMP];
dest[2] = srcRgba[i][BCOMP];
dest += 3;
}
}
else if (transferOps == 0 && dstFormat == GL_RGBA && dstType == GL_UNSIGNED_BYTE) {
/* common simple case */
GLuint i;
GLubyte *dest = (GLubyte *) dstAddr;
for (i = 0; i < n; i++) {
dest[0] = CHAN_TO_UBYTE(srcRgba[i][RCOMP]);
dest[1] = CHAN_TO_UBYTE(srcRgba[i][GCOMP]);
dest[2] = CHAN_TO_UBYTE(srcRgba[i][BCOMP]);
dest[3] = CHAN_TO_UBYTE(srcRgba[i][ACOMP]);
dest += 4;
}
}
else {
/* general solution */
GLuint i;
GLfloat rgba[MAX_WIDTH][4];
assert(n <= MAX_WIDTH);
/* convert color components to floating point */
for (i = 0; i < n; i++) {
rgba[i][RCOMP] = CHAN_TO_FLOAT(srcRgba[i][RCOMP]);
rgba[i][GCOMP] = CHAN_TO_FLOAT(srcRgba[i][GCOMP]);
rgba[i][BCOMP] = CHAN_TO_FLOAT(srcRgba[i][BCOMP]);
rgba[i][ACOMP] = CHAN_TO_FLOAT(srcRgba[i][ACOMP]);
}
_mesa_pack_rgba_span_float(ctx, n, (const GLfloat (*)[4]) rgba,
dstFormat, dstType, dstAddr,
dstPacking, transferOps);
}
}
#define SWAP2BYTE(VALUE) \
{ \
GLubyte *bytes = (GLubyte *) &(VALUE); \

View file

@ -123,14 +123,6 @@ _mesa_pack_rgba_span_float( GLcontext *ctx,
GLuint transferOps );
extern void
_mesa_pack_rgba_span_chan( GLcontext *ctx,
GLuint n, CONST GLchan rgba[][4],
GLenum dstFormat, GLenum dstType, GLvoid *dstAddr,
const struct gl_pixelstore_attrib *dstPacking,
GLuint transferOps );
extern void
_mesa_unpack_color_span_chan( GLcontext *ctx,
GLuint n, GLenum dstFormat, GLchan dest[],