From b92d64e150a3b1389f5a4b6cbfe57425a77f24bf Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 31 Aug 2000 15:24:07 +0000 Subject: renamed some variables --- src/mesa/main/image.c | 182 ++++++++++++++++++++++++++------------------------ src/mesa/main/image.h | 20 +++--- 2 files changed, 103 insertions(+), 99 deletions(-) (limited to 'src/mesa/main') diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index 0d4b2ef525..bf7ec502bf 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -1,4 +1,4 @@ -/* $Id: image.c,v 1.38 2000/08/30 18:21:37 brianp Exp $ */ +/* $Id: image.c,v 1.39 2000/08/31 15:24:07 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -609,21 +609,24 @@ _mesa_pack_polygon_stipple( const GLuint pattern[32], GLubyte *dest, void _mesa_pack_rgba_span( GLcontext *ctx, GLuint n, CONST GLubyte srcRgba[][4], - GLenum format, GLenum type, GLvoid *destination, - const struct gl_pixelstore_attrib *packing, + GLenum dstFormat, GLenum dstType, + GLvoid *dstAddr, + const struct gl_pixelstore_attrib *dstPacking, GLuint transferOps) { ASSERT(ctx->ImageTransferState != UPDATE_IMAGE_TRANSFER_STATE); /* Test for optimized case first */ - if (transferOps == 0 && format == GL_RGBA && type == GL_UNSIGNED_BYTE) { + if (transferOps == 0 && dstFormat == GL_RGBA + && dstType == GL_UNSIGNED_BYTE) { /* common simple case */ - MEMCPY( destination, srcRgba, n * 4 * sizeof(GLubyte) ); + MEMCPY(dstAddr, srcRgba, n * 4 * sizeof(GLubyte)); } - else if (transferOps == 0 && format == GL_RGB && type == GL_UNSIGNED_BYTE) { + else if (transferOps == 0 && dstFormat == GL_RGB + && dstType == GL_UNSIGNED_BYTE) { /* common simple case */ GLint i; - GLubyte *dest = (GLubyte *) destination; + GLubyte *dest = (GLubyte *) dstAddr; for (i = 0; i < n; i++) { dest[0] = srcRgba[i][RCOMP]; dest[1] = srcRgba[i][GCOMP]; @@ -648,8 +651,8 @@ _mesa_pack_rgba_span( GLcontext *ctx, rgba[i][ACOMP] = srcRgba[i][ACOMP] * ascale; } _mesa_pack_float_rgba_span(ctx, n, (const GLfloat (*)[4]) rgba, - format, type, destination, - packing, transferOps); + dstFormat, dstType, dstAddr, + dstPacking, transferOps); } } @@ -657,11 +660,12 @@ _mesa_pack_rgba_span( GLcontext *ctx, void _mesa_pack_float_rgba_span( GLcontext *ctx, GLuint n, CONST GLfloat rgbaIn[][4], - GLenum format, GLenum type, GLvoid *destination, - const struct gl_pixelstore_attrib *packing, + GLenum dstFormat, GLenum dstType, + GLvoid *dstAddr, + const struct gl_pixelstore_attrib *dstPacking, GLuint transferOps ) { - const GLint comps = _mesa_components_in_format(format); + const GLint comps = _mesa_components_in_format(dstFormat); GLfloat luminance[MAX_WIDTH]; GLfloat (*rgba)[4]; GLuint i; @@ -725,7 +729,7 @@ _mesa_pack_float_rgba_span( GLcontext *ctx, /* XXX clamp rgba to [0,1]? */ - if (format == GL_LUMINANCE || format == GL_LUMINANCE_ALPHA) { + if (dstFormat == GL_LUMINANCE || dstFormat == GL_LUMINANCE_ALPHA) { for (i = 0; i < n; i++) { GLfloat sum = rgba[i][RCOMP] + rgba[i][GCOMP] + rgba[i][BCOMP]; luminance[i] = CLAMP(sum, 0.0F, 1.0F); @@ -735,11 +739,11 @@ _mesa_pack_float_rgba_span( GLcontext *ctx, /* * Pack/store the pixels. Ugh! Lots of cases!!! */ - switch (type) { + switch (dstType) { case GL_UNSIGNED_BYTE: { - GLubyte *dst = (GLubyte *) destination; - switch (format) { + GLubyte *dst = (GLubyte *) dstAddr; + switch (dstFormat) { case GL_RED: for (i=0;iSwapBytes) { + if (dstPacking->SwapBytes) { _mesa_swap2( (GLushort *) dst, n * comps); } } break; case GL_SHORT: { - GLshort *dst = (GLshort *) destination; - switch (format) { + GLshort *dst = (GLshort *) dstAddr; + switch (dstFormat) { case GL_RED: for (i=0;iSwapBytes) { + if (dstPacking->SwapBytes) { _mesa_swap2( (GLushort *) dst, n * comps ); } } break; case GL_UNSIGNED_INT: { - GLuint *dst = (GLuint *) destination; - switch (format) { + GLuint *dst = (GLuint *) dstAddr; + switch (dstFormat) { case GL_RED: for (i=0;iSwapBytes) { + if (dstPacking->SwapBytes) { _mesa_swap4( (GLuint *) dst, n * comps ); } } break; case GL_INT: { - GLint *dst = (GLint *) destination; - switch (format) { + GLint *dst = (GLint *) dstAddr; + switch (dstFormat) { case GL_RED: for (i=0;iSwapBytes) { + if (dstPacking->SwapBytes) { _mesa_swap4( (GLuint *) dst, n * comps ); } } break; case GL_FLOAT: { - GLfloat *dst = (GLfloat *) destination; - switch (format) { + GLfloat *dst = (GLfloat *) dstAddr; + switch (dstFormat) { case GL_RED: for (i=0;iSwapBytes) { + if (dstPacking->SwapBytes) { _mesa_swap4( (GLuint *) dst, n * comps ); } } break; case GL_UNSIGNED_BYTE_3_3_2: - if (format == GL_RGB) { - GLubyte *dst = (GLubyte *) destination; + if (dstFormat == GL_RGB) { + GLubyte *dst = (GLubyte *) dstAddr; for (i=0;iSwapBytes); + srcPacking->SwapBytes); /* scale and bias colors */ if (transferOps & IMAGE_SCALE_BIAS_BIT) { @@ -2480,7 +2484,7 @@ _mesa_unpack_float_color_span( GLcontext *ctx, GLuint n, GLenum dstFormat, GLfloat dest[], GLenum srcFormat, GLenum srcType, const GLvoid *source, - const struct gl_pixelstore_attrib *unpacking, + const struct gl_pixelstore_attrib *srcPacking, GLuint transferOps, GLboolean clamp ) { ASSERT(dstFormat == GL_ALPHA || @@ -2547,7 +2551,7 @@ _mesa_unpack_float_color_span( GLcontext *ctx, if (srcFormat == GL_COLOR_INDEX) { GLuint indexes[MAX_WIDTH]; extract_uint_indexes(n, indexes, srcFormat, srcType, source, - unpacking); + srcPacking); if (transferOps & IMAGE_MAP_COLOR_BIT) { _mesa_map_ci(ctx, n, indexes); @@ -2571,7 +2575,7 @@ _mesa_unpack_float_color_span( GLcontext *ctx, } else { extract_float_rgba(n, rgba, srcFormat, srcType, source, - unpacking->SwapBytes); + srcPacking->SwapBytes); /* scale and bias colors */ if (transferOps & IMAGE_SCALE_BIAS_BIT) { @@ -2743,14 +2747,14 @@ _mesa_unpack_float_color_span( GLcontext *ctx, * dest - destination array * srcType - source pixel type * source - source data pointer - * unpacking - pixel unpacking parameters + * srcPacking - pixel unpacking parameters * transferOps - the pixel transfer operations to apply */ void _mesa_unpack_index_span( const GLcontext *ctx, GLuint n, GLenum dstType, GLvoid *dest, GLenum srcType, const GLvoid *source, - const struct gl_pixelstore_attrib *unpacking, + const struct gl_pixelstore_attrib *srcPacking, GLuint transferOps ) { ASSERT(srcType == GL_BITMAP || @@ -2777,7 +2781,7 @@ _mesa_unpack_index_span( const GLcontext *ctx, GLuint n, MEMCPY(dest, source, n * sizeof(GLubyte)); } else if (transferOps == 0 && srcType == GL_UNSIGNED_INT - && dstType == GL_UNSIGNED_INT && !unpacking->SwapBytes) { + && dstType == GL_UNSIGNED_INT && !srcPacking->SwapBytes) { MEMCPY(dest, source, n * sizeof(GLuint)); } else { @@ -2788,7 +2792,7 @@ _mesa_unpack_index_span( const GLcontext *ctx, GLuint n, assert(n <= MAX_WIDTH); extract_uint_indexes(n, indexes, GL_COLOR_INDEX, srcType, source, - unpacking); + srcPacking); if (transferOps & IMAGE_SHIFT_OFFSET_BIT) { /* shift and offset indexes */ @@ -2840,14 +2844,14 @@ _mesa_unpack_index_span( const GLcontext *ctx, GLuint n, * dest - destination array * srcType - source pixel type * source - source data pointer - * unpacking - pixel unpacking parameters + * srcPacking - pixel unpacking parameters * transferOps - apply offset/bias/lookup ops? */ void _mesa_unpack_stencil_span( const GLcontext *ctx, GLuint n, GLenum dstType, GLvoid *dest, GLenum srcType, const GLvoid *source, - const struct gl_pixelstore_attrib *unpacking, + const struct gl_pixelstore_attrib *srcPacking, GLuint transferOps ) { ASSERT(srcType == GL_BITMAP || @@ -2877,7 +2881,7 @@ _mesa_unpack_stencil_span( const GLcontext *ctx, GLuint n, else if (transferOps == 0 && srcType == GL_UNSIGNED_INT && dstType == GL_UNSIGNED_INT && - !unpacking->SwapBytes) { + !srcPacking->SwapBytes) { MEMCPY(dest, source, n * sizeof(GLuint)); } else { @@ -2888,7 +2892,7 @@ _mesa_unpack_stencil_span( const GLcontext *ctx, GLuint n, assert(n <= MAX_WIDTH); extract_uint_indexes(n, indexes, GL_COLOR_INDEX, srcType, source, - unpacking); + srcPacking); if (transferOps) { if (transferOps & IMAGE_SHIFT_OFFSET_BIT) { @@ -2940,7 +2944,7 @@ _mesa_unpack_stencil_span( const GLcontext *ctx, GLuint n, void _mesa_unpack_depth_span( const GLcontext *ctx, GLuint n, GLdepth *dest, GLenum srcType, const GLvoid *source, - const struct gl_pixelstore_attrib *unpacking, + const struct gl_pixelstore_attrib *srcPacking, GLuint transferOps ) { GLfloat *depth = MALLOC(n * sizeof(GLfloat)); diff --git a/src/mesa/main/image.h b/src/mesa/main/image.h index 4a18e1937c..e86e36f329 100644 --- a/src/mesa/main/image.h +++ b/src/mesa/main/image.h @@ -1,4 +1,4 @@ -/* $Id: image.h,v 1.11 2000/08/30 18:21:37 brianp Exp $ */ +/* $Id: image.h,v 1.12 2000/08/31 15:24:07 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -82,16 +82,16 @@ _mesa_pack_polygon_stipple( const GLuint pattern[32], GLubyte *dest, extern void _mesa_pack_float_rgba_span( GLcontext *ctx, GLuint n, CONST GLfloat rgba[][4], - GLenum format, GLenum type, GLvoid *dest, - const struct gl_pixelstore_attrib *packing, + GLenum dstFormat, GLenum dstType, GLvoid *dstAddr, + const struct gl_pixelstore_attrib *dstPacking, GLuint transferOps ); extern void _mesa_pack_rgba_span( GLcontext *ctx, GLuint n, CONST GLubyte rgba[][4], - GLenum format, GLenum type, GLvoid *dest, - const struct gl_pixelstore_attrib *packing, + GLenum dstFormat, GLenum dstType, GLvoid *dstAddr, + const struct gl_pixelstore_attrib *dstPacking, GLuint transferOps ); @@ -100,7 +100,7 @@ _mesa_unpack_ubyte_color_span( GLcontext *ctx, GLuint n, GLenum dstFormat, GLubyte dest[], GLenum srcFormat, GLenum srcType, const GLvoid *source, - const struct gl_pixelstore_attrib *unpacking, + const struct gl_pixelstore_attrib *srcPacking, GLuint transferOps ); @@ -109,7 +109,7 @@ _mesa_unpack_float_color_span( GLcontext *ctx, GLuint n, GLenum dstFormat, GLfloat dest[], GLenum srcFormat, GLenum srcType, const GLvoid *source, - const struct gl_pixelstore_attrib *unpacking, + const struct gl_pixelstore_attrib *srcPacking, GLuint transferOps, GLboolean clamp ); @@ -117,7 +117,7 @@ extern void _mesa_unpack_index_span( const GLcontext *ctx, GLuint n, GLenum dstType, GLvoid *dest, GLenum srcType, const GLvoid *source, - const struct gl_pixelstore_attrib *unpacking, + const struct gl_pixelstore_attrib *srcPacking, GLuint transferOps ); @@ -125,14 +125,14 @@ extern void _mesa_unpack_stencil_span( const GLcontext *ctx, GLuint n, GLenum dstType, GLvoid *dest, GLenum srcType, const GLvoid *source, - const struct gl_pixelstore_attrib *unpacking, + const struct gl_pixelstore_attrib *srcPacking, GLuint transferOps ); extern void _mesa_unpack_depth_span( const GLcontext *ctx, GLuint n, GLdepth *dest, GLenum srcType, const GLvoid *source, - const struct gl_pixelstore_attrib *unpacking, + const struct gl_pixelstore_attrib *srcPacking, GLuint transferOps ); -- cgit v1.2.3