aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2000-03-21 01:03:40 +0000
committerBrian Paul <[email protected]>2000-03-21 01:03:40 +0000
commitb7d076fc96ac27117421653a043d00a95f789d24 (patch)
tree2b4671840c28b6a1232325e7bc609d265096b275 /src/mesa
parent43911c8ef06c44d486a17cf9a8fa8ea263b08ade (diff)
changed imaging functions to _mesa_ prefix
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/glide/fxdd.c2
-rw-r--r--src/mesa/main/colortab.c12
-rw-r--r--src/mesa/main/drawpix.c14
-rw-r--r--src/mesa/main/image.c114
-rw-r--r--src/mesa/main/image.h45
-rw-r--r--src/mesa/main/teximage.c43
6 files changed, 119 insertions, 111 deletions
diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c
index 5bb4d2d98f0..c6aa6b42d68 100644
--- a/src/mesa/drivers/glide/fxdd.c
+++ b/src/mesa/drivers/glide/fxdd.c
@@ -463,7 +463,7 @@ static GLboolean fxDDDrawBitMap(GLcontext *ctx, GLint px, GLint py,
+ (winX + px);
for (row = 0; row < height; row++) {
- const GLubyte *src = (const GLubyte *) gl_pixel_addr_in_image( finalUnpack,
+ const GLubyte *src = (const GLubyte *) _mesa_image_address( finalUnpack,
bitmap, width, height, GL_COLOR_INDEX, GL_BITMAP, 0, row, 0 );
if (finalUnpack->LsbFirst) {
/* least significan bit first */
diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c
index 713e7c66202..b94dbde8fd7 100644
--- a/src/mesa/main/colortab.c
+++ b/src/mesa/main/colortab.c
@@ -1,4 +1,4 @@
-/* $Id: colortab.c,v 1.9 2000/02/28 20:38:37 brianp Exp $ */
+/* $Id: colortab.c,v 1.10 2000/03/21 01:03:40 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -163,7 +163,7 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat,
assert(palette);
- if (!gl_is_legal_format_and_type(format, type)) {
+ if (!_mesa_is_legal_format_and_type(format, type)) {
gl_error(ctx, GL_INVALID_ENUM, "glColorTable(format or type)");
return;
}
@@ -246,7 +246,7 @@ _mesa_ColorSubTable( GLenum target, GLsizei start,
assert(palette);
- if (!gl_is_legal_format_and_type(format, type)) {
+ if (!_mesa_is_legal_format_and_type(format, type)) {
gl_error(ctx, GL_INVALID_ENUM, "glColorSubTable(format or type)");
return;
}
@@ -256,7 +256,7 @@ _mesa_ColorSubTable( GLenum target, GLsizei start,
return;
}
- comps = gl_components_in_format(format);
+ comps = _mesa_components_in_format(format);
assert(comps > 0); /* error should be caught sooner */
if (start + count > palette->Size) {
@@ -370,8 +370,8 @@ _mesa_GetColorTable( GLenum target, GLenum format,
return;
}
- gl_pack_rgba_span(ctx, palette->Size, (const GLubyte (*)[]) rgba,
- format, type, table, &ctx->Pack, GL_FALSE);
+ _mesa_pack_rgba_span(ctx, palette->Size, (const GLubyte (*)[]) rgba,
+ format, type, table, &ctx->Pack, GL_FALSE);
(void) format;
(void) type;
diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c
index 49321a94593..111bdf8b713 100644
--- a/src/mesa/main/drawpix.c
+++ b/src/mesa/main/drawpix.c
@@ -1,4 +1,4 @@
-/* $Id: drawpix.c,v 1.14 2000/03/03 17:54:56 brianp Exp $ */
+/* $Id: drawpix.c,v 1.15 2000/03/21 01:03:40 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -425,7 +425,7 @@ draw_index_pixels( GLcontext *ctx, GLint x, GLint y,
*/
for (row = 0; row < height; row++, y++) {
GLuint indexes[MAX_WIDTH];
- const GLvoid *source = gl_pixel_addr_in_image(&ctx->Unpack,
+ const GLvoid *source = _mesa_image_address(&ctx->Unpack,
pixels, width, height, GL_COLOR_INDEX, type, 0, row, 0);
_mesa_unpack_index_span(ctx, drawWidth, GL_UNSIGNED_INT, indexes,
type, source, &ctx->Unpack, GL_TRUE);
@@ -471,7 +471,7 @@ draw_stencil_pixels( GLcontext *ctx, GLint x, GLint y,
GLstencil values[MAX_WIDTH];
GLenum destType = (sizeof(GLstencil) == sizeof(GLubyte))
? GL_UNSIGNED_BYTE : GL_UNSIGNED_SHORT;
- const GLvoid *source = gl_pixel_addr_in_image(&ctx->Unpack,
+ const GLvoid *source = _mesa_image_address(&ctx->Unpack,
pixels, width, height, GL_COLOR_INDEX, type, 0, row, 0);
_mesa_unpack_index_span(ctx, drawWidth, destType, values,
type, source, &ctx->Unpack, GL_TRUE);
@@ -541,7 +541,7 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y,
GLint row;
for (row = 0; row < height; row++, y++) {
GLdepth zspan[MAX_WIDTH];
- const GLushort *zptr = gl_pixel_addr_in_image(&ctx->Unpack,
+ const GLushort *zptr = _mesa_image_address(&ctx->Unpack,
pixels, width, height, GL_DEPTH_COMPONENT, type, 0, row, 0);
GLint i;
for (i = 0; i < width; i++)
@@ -554,7 +554,7 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y,
/* Special case: directly write 32-bit depth values */
GLint row;
for (row = 0; row < height; row++, y++) {
- const GLuint *zptr = gl_pixel_addr_in_image(&ctx->Unpack,
+ const GLuint *zptr = _mesa_image_address(&ctx->Unpack,
pixels, width, height, GL_DEPTH_COMPONENT, type, 0, row, 0);
gl_write_rgba_span( ctx, width, x, y, zptr, rgba, GL_BITMAP );
}
@@ -564,7 +564,7 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y,
GLint row;
for (row = 0; row < height; row++, y++) {
GLdepth zspan[MAX_WIDTH];
- const GLvoid *src = gl_pixel_addr_in_image(&ctx->Unpack,
+ const GLvoid *src = _mesa_image_address(&ctx->Unpack,
pixels, width, height, GL_DEPTH_COMPONENT, type, 0, row, 0);
_mesa_unpack_depth_span( ctx, drawWidth, zspan, type, src,
&ctx->Unpack, GL_TRUE );
@@ -640,7 +640,7 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y,
if (width > MAX_WIDTH)
width = MAX_WIDTH;
for (row = 0; row < height; row++, y++) {
- const GLvoid *source = gl_pixel_addr_in_image(unpack,
+ const GLvoid *source = _mesa_image_address(unpack,
pixels, width, height, format, type, 0, row, 0);
_mesa_unpack_ubyte_color_span(ctx, width, GL_RGBA, (void*) rgba,
format, type, source, unpack, GL_TRUE);
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index 9869d8cf949..133f79ab29a 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -1,4 +1,4 @@
-/* $Id: image.c,v 1.21 2000/03/21 00:48:53 brianp Exp $ */
+/* $Id: image.c,v 1.22 2000/03/21 01:03:40 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -63,7 +63,8 @@ struct gl_pixelstore_attrib _mesa_native_packing = {
/*
* Flip the 8 bits in each byte of the given array.
*/
-void gl_flip_bytes( GLubyte *p, GLuint n )
+static void
+flip_bytes( GLubyte *p, GLuint n )
{
register GLuint i, a, b;
@@ -85,7 +86,8 @@ void gl_flip_bytes( GLubyte *p, GLuint n )
/*
* Flip the order of the 2 bytes in each word in the given array.
*/
-void gl_swap2( GLushort *p, GLuint n )
+void
+_mesa_swap2( GLushort *p, GLuint n )
{
register GLuint i;
@@ -99,7 +101,8 @@ void gl_swap2( GLushort *p, GLuint n )
/*
* Flip the order of the 4 bytes in each word in the given array.
*/
-void gl_swap4( GLuint *p, GLuint n )
+void
+_mesa_swap4( GLuint *p, GLuint n )
{
register GLuint i, a, b;
@@ -121,7 +124,7 @@ void gl_swap4( GLuint *p, GLuint n )
* Return 0 if GL_BITMAP.
* Return -1 if invalid type enum.
*/
-GLint gl_sizeof_type( GLenum type )
+GLint _mesa_sizeof_type( GLenum type )
{
switch (type) {
case GL_BITMAP:
@@ -147,10 +150,10 @@ GLint gl_sizeof_type( GLenum type )
/*
- * Same as gl_sizeof_packed_type() but we also accept the
+ * Same as _mesa_sizeof_packed_type() but we also accept the
* packed pixel format datatypes.
*/
-GLint gl_sizeof_packed_type( GLenum type )
+GLint _mesa_sizeof_packed_type( GLenum type )
{
switch (type) {
case GL_BITMAP:
@@ -204,7 +207,7 @@ GLint gl_sizeof_packed_type( GLenum type )
* Return the number of components in a GL enum pixel type.
* Return -1 if bad format.
*/
-GLint gl_components_in_format( GLenum format )
+GLint _mesa_components_in_format( GLenum format )
{
switch (format) {
case GL_COLOR_INDEX:
@@ -244,9 +247,9 @@ GLint gl_components_in_format( GLenum format )
* Return bytes per pixel for given format and type
* Return -1 if bad format or type.
*/
-GLint gl_bytes_per_pixel( GLenum format, GLenum type )
+GLint _mesa_bytes_per_pixel( GLenum format, GLenum type )
{
- GLint comps = gl_components_in_format( format );
+ GLint comps = _mesa_components_in_format( format );
if (comps < 0)
return -1;
@@ -302,7 +305,8 @@ GLint gl_bytes_per_pixel( GLenum format, GLenum type )
* Test if the given pixel format and type are legal.
* Return GL_TRUE for legal, GL_FALSE for illegal.
*/
-GLboolean gl_is_legal_format_and_type( GLenum format, GLenum type )
+GLboolean
+_mesa_is_legal_format_and_type( GLenum format, GLenum type )
{
switch (format) {
case GL_COLOR_INDEX:
@@ -400,10 +404,11 @@ GLboolean gl_is_legal_format_and_type( GLenum format, GLenum type )
* row, column - location of pixel in the image
* Return: address of pixel at (image,row,column) in image or NULL if error.
*/
-GLvoid *gl_pixel_addr_in_image( const struct gl_pixelstore_attrib *packing,
- const GLvoid *image, GLsizei width,
- GLsizei height, GLenum format, GLenum type,
- GLint img, GLint row, GLint column )
+GLvoid *
+_mesa_image_address( const struct gl_pixelstore_attrib *packing,
+ const GLvoid *image, GLsizei width,
+ GLsizei height, GLenum format, GLenum type,
+ GLint img, GLint row, GLint column )
{
GLint alignment; /* 1, 2 or 4 */
GLint pixels_per_row;
@@ -438,13 +443,13 @@ GLvoid *gl_pixel_addr_in_image( const struct gl_pixelstore_attrib *packing,
GLint bytes_per_image;
/* Compute bytes per component */
- bytes_per_comp = gl_sizeof_packed_type( type );
+ bytes_per_comp = _mesa_sizeof_packed_type( type );
if (bytes_per_comp<0) {
return NULL;
}
/* Compute number of components per pixel */
- comp_per_pixel = gl_components_in_format( format );
+ comp_per_pixel = _mesa_components_in_format( format );
if (comp_per_pixel<0 && type != GL_BITMAP) {
return NULL;
}
@@ -463,7 +468,7 @@ GLvoid *gl_pixel_addr_in_image( const struct gl_pixelstore_attrib *packing,
/* Non-BITMAP data */
GLint bytes_per_pixel, bytes_per_row, remainder, bytes_per_image;
- bytes_per_pixel = gl_bytes_per_pixel( format, type );
+ bytes_per_pixel = _mesa_bytes_per_pixel( format, type );
/* The pixel type and format should have been error checked earlier */
assert(bytes_per_pixel > 0);
@@ -511,7 +516,7 @@ _mesa_image_row_stride( const struct gl_pixelstore_attrib *packing,
}
else {
/* Non-BITMAP data */
- const GLint bytesPerPixel = gl_bytes_per_pixel(format, type);
+ const GLint bytesPerPixel = _mesa_bytes_per_pixel(format, type);
if (bytesPerPixel <= 0)
return -1; /* error */
if (packing->RowLength == 0) {
@@ -595,11 +600,12 @@ _mesa_pack_polygon_stipple( const GLuint pattern[32], GLubyte *dest,
* packing - pixel packing parameters
* applyTransferOps - apply scale/bias/lookup-table ops?
*/
-void gl_pack_rgba_span( const GLcontext *ctx,
- GLuint n, CONST GLubyte rgba[][4],
- GLenum format, GLenum type, GLvoid *destination,
- const struct gl_pixelstore_attrib *packing,
- GLboolean applyTransferOps )
+void
+_mesa_pack_rgba_span( const GLcontext *ctx,
+ GLuint n, CONST GLubyte rgba[][4],
+ GLenum format, GLenum type, GLvoid *destination,
+ const struct gl_pixelstore_attrib *packing,
+ GLboolean applyTransferOps )
{
applyTransferOps &= (ctx->Pixel.ScaleOrBiasRGBA || ctx->Pixel.MapColorFlag);
@@ -627,7 +633,7 @@ void gl_pack_rgba_span( const GLcontext *ctx,
const GLfloat gscale = 1.0F / 255.0F;
const GLfloat bscale = 1.0F / 255.0F;
const GLfloat ascale = 1.0F / 255.0F;
- const GLint comps = gl_components_in_format(format);
+ const GLint comps = _mesa_components_in_format(format);
GLuint i;
assert(n <= MAX_WIDTH);
@@ -732,7 +738,7 @@ void gl_pack_rgba_span( const GLcontext *ctx,
}
break;
default:
- gl_problem(ctx, "bad format in gl_pack_rgba_span\n");
+ gl_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
}
}
break;
@@ -804,7 +810,7 @@ void gl_pack_rgba_span( const GLcontext *ctx,
}
break;
default:
- gl_problem(ctx, "bad format in gl_pack_rgba_span\n");
+ gl_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
}
}
break;
@@ -877,10 +883,10 @@ void gl_pack_rgba_span( const GLcontext *ctx,
}
break;
default:
- gl_problem(ctx, "bad format in gl_pack_rgba_span\n");
+ gl_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
}
if (packing->SwapBytes) {
- gl_swap2( (GLushort *) dst, n * comps);
+ _mesa_swap2( (GLushort *) dst, n * comps);
}
}
break;
@@ -952,10 +958,10 @@ void gl_pack_rgba_span( const GLcontext *ctx,
}
break;
default:
- gl_problem(ctx, "bad format in gl_pack_rgba_span\n");
+ gl_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
}
if (packing->SwapBytes) {
- gl_swap2( (GLushort *) dst, n * comps );
+ _mesa_swap2( (GLushort *) dst, n * comps );
}
}
break;
@@ -1028,10 +1034,10 @@ void gl_pack_rgba_span( const GLcontext *ctx,
}
break;
default:
- gl_problem(ctx, "bad format in gl_pack_rgba_span\n");
+ gl_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
}
if (packing->SwapBytes) {
- gl_swap4( (GLuint *) dst, n * comps );
+ _mesa_swap4( (GLuint *) dst, n * comps );
}
}
break;
@@ -1104,10 +1110,10 @@ void gl_pack_rgba_span( const GLcontext *ctx,
}
break;
default:
- gl_problem(ctx, "bad format in gl_pack_rgba_span\n");
+ gl_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
}
if (packing->SwapBytes) {
- gl_swap4( (GLuint *) dst, n * comps );
+ _mesa_swap4( (GLuint *) dst, n * comps );
}
}
break;
@@ -1180,10 +1186,10 @@ void gl_pack_rgba_span( const GLcontext *ctx,
}
break;
default:
- gl_problem(ctx, "bad format in gl_pack_rgba_span\n");
+ gl_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
}
if (packing->SwapBytes) {
- gl_swap4( (GLuint *) dst, n * comps );
+ _mesa_swap4( (GLuint *) dst, n * comps );
}
}
break;
@@ -1388,7 +1394,7 @@ void gl_pack_rgba_span( const GLcontext *ctx,
}
break;
default:
- gl_problem( ctx, "bad type in gl_pack_rgba_span" );
+ gl_problem( ctx, "bad type in _mesa_pack_rgba_span" );
}
}
}
@@ -2196,7 +2202,7 @@ _mesa_unpack_ubyte_color_span( const GLcontext *ctx,
}
}
else if (dstFormat == srcFormat) {
- GLint comps = gl_components_in_format(srcFormat);
+ GLint comps = _mesa_components_in_format(srcFormat);
assert(comps > 0);
MEMCPY( dest, source, n * comps * sizeof(GLubyte) );
return;
@@ -2211,7 +2217,7 @@ _mesa_unpack_ubyte_color_span( const GLcontext *ctx,
GLint dstRedIndex, dstGreenIndex, dstBlueIndex, dstAlphaIndex;
GLint dstLuminanceIndex, dstIntensityIndex;
- dstComponents = gl_components_in_format( dstFormat );
+ dstComponents = _mesa_components_in_format( dstFormat );
/* source & dest image formats should have been error checked by now */
assert(dstComponents > 0);
@@ -2721,8 +2727,8 @@ _mesa_unpack_image( GLsizei width, GLsizei height, GLsizei depth,
compsPerRow = 0;
}
else {
- const GLint bytesPerPixel = gl_bytes_per_pixel(format, type);
- const GLint components = gl_components_in_format(format);
+ const GLint bytesPerPixel = _mesa_bytes_per_pixel(format, type);
+ const GLint components = _mesa_components_in_format(format);
GLint bytesPerComp;
if (bytesPerPixel <= 0 || components <= 0)
return NULL; /* bad format or type. generate error later */
@@ -2745,18 +2751,18 @@ _mesa_unpack_image( GLsizei width, GLsizei height, GLsizei depth,
dst = destBuffer;
for (img = 0; img < depth; img++) {
for (row = 0; row < height; row++) {
- const GLvoid *src = gl_pixel_addr_in_image(unpack, pixels,
+ const GLvoid *src = _mesa_image_address(unpack, pixels,
width, height, format, type, img, row, 0);
MEMCPY(dst, src, bytesPerRow);
/* byte flipping/swapping */
if (flipBytes) {
- gl_flip_bytes((GLubyte *) dst, bytesPerRow);
+ flip_bytes((GLubyte *) dst, bytesPerRow);
}
else if (swap2) {
- gl_swap2((GLushort*) dst, compsPerRow);
+ _mesa_swap2((GLushort*) dst, compsPerRow);
}
else if (swap4) {
- gl_swap4((GLuint*) dst, compsPerRow);
+ _mesa_swap4((GLuint*) dst, compsPerRow);
}
dst += bytesPerRow;
}
@@ -2790,9 +2796,9 @@ _mesa_unpack_bitmap( GLint width, GLint height, const GLubyte *pixels,
width_in_bytes = CEILING( width, 8 );
dst = buffer;
for (row = 0; row < height; row++) {
- GLubyte *src = gl_pixel_addr_in_image( packing, pixels, width, height,
- GL_COLOR_INDEX, GL_BITMAP,
- 0, row, 0 );
+ GLubyte *src = _mesa_image_address( packing, pixels, width, height,
+ GL_COLOR_INDEX, GL_BITMAP,
+ 0, row, 0 );
if (!src) {
FREE(buffer);
return NULL;
@@ -2801,7 +2807,7 @@ _mesa_unpack_bitmap( GLint width, GLint height, const GLubyte *pixels,
if (packing->SkipPixels == 0) {
MEMCPY( dst, src, width_in_bytes );
if (packing->LsbFirst) {
- gl_flip_bytes( dst, width_in_bytes );
+ flip_bytes( dst, width_in_bytes );
}
}
else {
@@ -2885,16 +2891,16 @@ _mesa_pack_bitmap( GLint width, GLint height, const GLubyte *source,
width_in_bytes = CEILING( width, 8 );
src = source;
for (row = 0; row < height; row++) {
- GLubyte *dst = gl_pixel_addr_in_image( packing, dest, width, height,
- GL_COLOR_INDEX, GL_BITMAP,
- 0, row, 0 );
+ GLubyte *dst = _mesa_image_address( packing, dest, width, height,
+ GL_COLOR_INDEX, GL_BITMAP,
+ 0, row, 0 );
if (!dst)
return;
if (packing->SkipPixels == 0) {
MEMCPY( dst, src, width_in_bytes );
if (packing->LsbFirst) {
- gl_flip_bytes( dst, width_in_bytes );
+ flip_bytes( dst, width_in_bytes );
}
}
else {
diff --git a/src/mesa/main/image.h b/src/mesa/main/image.h
index 758213995df..77a65f97935 100644
--- a/src/mesa/main/image.h
+++ b/src/mesa/main/image.h
@@ -1,4 +1,4 @@
-/* $Id: image.h,v 1.5 2000/03/21 00:48:53 brianp Exp $ */
+/* $Id: image.h,v 1.6 2000/03/21 01:03:40 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -35,30 +35,33 @@
extern struct gl_pixelstore_attrib _mesa_native_packing;
-extern void gl_flip_bytes( GLubyte *p, GLuint n );
-
-
-extern void gl_swap2( GLushort *p, GLuint n );
-
-extern void gl_swap4( GLuint *p, GLuint n );
+extern void
+_mesa_swap2( GLushort *p, GLuint n );
+extern void
+_mesa_swap4( GLuint *p, GLuint n );
-extern GLint gl_sizeof_type( GLenum type );
+extern GLint
+_mesa_sizeof_type( GLenum type );
-extern GLint gl_sizeof_packed_type( GLenum type );
+extern GLint
+_mesa_sizeof_packed_type( GLenum type );
-extern GLint gl_components_in_format( GLenum format );
+extern GLint
+_mesa_components_in_format( GLenum format );
-extern GLint gl_bytes_per_pixel( GLenum format, GLenum type );
+extern GLint
+_mesa_bytes_per_pixel( GLenum format, GLenum type );
-extern GLboolean gl_is_legal_format_and_type( GLenum format, GLenum type );
+extern GLboolean
+_mesa_is_legal_format_and_type( GLenum format, GLenum type );
extern GLvoid *
-gl_pixel_addr_in_image( const struct gl_pixelstore_attrib *packing,
- const GLvoid *image, GLsizei width,
- GLsizei height, GLenum format, GLenum type,
- GLint img, GLint row, GLint column );
+_mesa_image_address( const struct gl_pixelstore_attrib *packing,
+ const GLvoid *image, GLsizei width,
+ GLsizei height, GLenum format, GLenum type,
+ GLint img, GLint row, GLint column );
extern GLint
@@ -77,11 +80,11 @@ _mesa_pack_polygon_stipple( const GLuint pattern[32], GLubyte *dest,
extern void
-gl_pack_rgba_span( const GLcontext *ctx,
- GLuint n, CONST GLubyte rgba[][4],
- GLenum format, GLenum type, GLvoid *dest,
- const struct gl_pixelstore_attrib *packing,
- GLboolean applyTransferOps );
+_mesa_pack_rgba_span( const GLcontext *ctx,
+ GLuint n, CONST GLubyte rgba[][4],
+ GLenum format, GLenum type, GLvoid *dest,
+ const struct gl_pixelstore_attrib *packing,
+ GLboolean applyTransferOps );
extern void
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index b28beb4ef23..aa48024029b 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -1,4 +1,4 @@
-/* $Id: teximage.c,v 1.22 2000/03/21 00:49:33 brianp Exp $ */
+/* $Id: teximage.c,v 1.23 2000/03/21 01:03:40 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -483,7 +483,7 @@ make_texture_image( GLcontext *ctx,
/* This will cover the common GL_RGB, GL_RGBA, GL_ALPHA,
* GL_LUMINANCE_ALPHA, etc. texture formats.
*/
- const GLubyte *src = (const GLubyte *) gl_pixel_addr_in_image(
+ const GLubyte *src = (const GLubyte *) _mesa_image_address(
unpacking, pixels, width, height, srcFormat, srcType, 0, 0, 0);
const GLint srcStride = _mesa_image_row_stride(unpacking, width,
srcFormat, srcType);
@@ -504,7 +504,7 @@ make_texture_image( GLcontext *ctx,
}
else if (srcFormat == GL_RGBA && internalFormat == GL_RGB) {
/* commonly used by Quake */
- const GLubyte *src = (const GLubyte *) gl_pixel_addr_in_image(
+ const GLubyte *src = (const GLubyte *) _mesa_image_address(
unpacking, pixels, width, height, srcFormat, srcType, 0, 0, 0);
const GLint srcStride = _mesa_image_row_stride(unpacking, width,
srcFormat, srcType);
@@ -536,7 +536,7 @@ make_texture_image( GLcontext *ctx,
GLint img, row;
for (img = 0; img < depth; img++) {
for (row = 0; row < height; row++) {
- const GLvoid *source = gl_pixel_addr_in_image(unpacking,
+ const GLvoid *source = _mesa_image_address(unpacking,
pixels, width, height, srcFormat, srcType, img, row, 0);
_mesa_unpack_index_span(ctx, width, dstType, dest,
srcType, source, unpacking, GL_TRUE);
@@ -552,7 +552,7 @@ make_texture_image( GLcontext *ctx,
GLint img, row;
for (img = 0; img < depth; img++) {
for (row = 0; row < height; row++) {
- const GLvoid *source = gl_pixel_addr_in_image(unpacking,
+ const GLvoid *source = _mesa_image_address(unpacking,
pixels, width, height, srcFormat, srcType, img, row, 0);
_mesa_unpack_ubyte_color_span(ctx, width, dstFormat, dest,
srcFormat, srcType, source, unpacking, GL_TRUE);
@@ -725,7 +725,7 @@ texture_error_check( GLcontext *ctx, GLenum target,
return GL_TRUE;
}
- if (!gl_is_legal_format_and_type( format, type )) {
+ if (!_mesa_is_legal_format_and_type( format, type )) {
/* Yes, generate GL_INVALID_OPERATION, not GL_INVALID_ENUM, if there
* is a type/format mismatch. See 1.2 spec page 94, sec 3.6.4.
*/
@@ -841,7 +841,7 @@ subtexture_error_check( GLcontext *ctx, GLuint dimensions,
}
}
- if (!gl_is_legal_format_and_type(format, type)) {
+ if (!_mesa_is_legal_format_and_type(format, type)) {
char message[100];
sprintf(message, "glTexSubImage%dD(format or type)", dimensions);
gl_error(ctx, GL_INVALID_ENUM, message);
@@ -1297,7 +1297,7 @@ get_teximage_from_driver( GLcontext *ctx, GLenum target, GLint level,
assert(destComponents > 0);
numPixels = texImage->Width * texImage->Height * texImage->Depth;
assert(numPixels > 0);
- srcBytesPerTexel = gl_bytes_per_pixel(imgFormat, imgType);
+ srcBytesPerTexel = _mesa_bytes_per_pixel(imgFormat, imgType);
assert(srcBytesPerTexel > 0);
if (!texImage->Data) {
@@ -1373,12 +1373,12 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format,
return;
}
- if (gl_sizeof_type(type) <= 0) {
+ if (_mesa_sizeof_type(type) <= 0) {
gl_error( ctx, GL_INVALID_ENUM, "glGetTexImage(type)" );
return;
}
- if (gl_components_in_format(format) <= 0) {
+ if (_mesa_components_in_format(format) <= 0) {
gl_error( ctx, GL_INVALID_ENUM, "glGetTexImage(format)" );
return;
}
@@ -1423,16 +1423,15 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format,
for (row = 0; row < height; row++) {
/* compute destination address in client memory */
- GLvoid *dest = gl_pixel_addr_in_image( &ctx->Unpack, pixels,
+ GLvoid *dest = _mesa_image_address( &ctx->Unpack, pixels,
width, height,
format, type, 0, row, 0);
assert(dest);
if (texImage->Format == GL_RGBA) {
const GLubyte *src = texImage->Data + row * width * 4 * sizeof(GLubyte);
- gl_pack_rgba_span( ctx, width, (CONST GLubyte (*)[4]) src,
- format, type, dest,
- &ctx->Pack, GL_TRUE );
+ _mesa_pack_rgba_span( ctx, width, (CONST GLubyte (*)[4]) src,
+ format, type, dest, &ctx->Pack, GL_TRUE );
}
else {
/* fetch RGBA row from texture image then pack it in client mem */
@@ -1495,8 +1494,8 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format,
default:
gl_problem( ctx, "bad format in gl_GetTexImage" );
}
- gl_pack_rgba_span( ctx, width, (const GLubyte (*)[4])rgba,
- format, type, dest, &ctx->Pack, GL_TRUE );
+ _mesa_pack_rgba_span( ctx, width, (const GLubyte (*)[4])rgba,
+ format, type, dest, &ctx->Pack, GL_TRUE );
}
}
@@ -1542,14 +1541,14 @@ _mesa_TexSubImage1D( GLenum target, GLint level,
GLubyte *dst = destTex->Data + xoffsetb * texComponents;
if (texFormat == GL_COLOR_INDEX) {
/* color index texture */
- const GLvoid *src = gl_pixel_addr_in_image(&ctx->Unpack, pixels,
+ const GLvoid *src = _mesa_image_address(&ctx->Unpack, pixels,
width, 1, format, type, 0, 0, 0);
_mesa_unpack_index_span(ctx, width, GL_UNSIGNED_BYTE, dst,
type, src, &ctx->Unpack, GL_TRUE);
}
else {
/* color texture */
- const GLvoid *src = gl_pixel_addr_in_image(&ctx->Unpack, pixels,
+ const GLvoid *src = _mesa_image_address(&ctx->Unpack, pixels,
width, 1, format, type, 0, 0, 0);
_mesa_unpack_ubyte_color_span(ctx, width, texFormat, dst,
format, type, src, &ctx->Unpack, GL_TRUE);
@@ -1616,7 +1615,7 @@ _mesa_TexSubImage2D( GLenum target, GLint level,
const GLint stride = destTex->Width * sizeof(GLubyte);
GLint row;
for (row = 0; row < height; row++) {
- const GLvoid *src = gl_pixel_addr_in_image(&ctx->Unpack, pixels,
+ const GLvoid *src = _mesa_image_address(&ctx->Unpack, pixels,
width, height, format, type, 0, row, 0);
_mesa_unpack_index_span(ctx, width, GL_UNSIGNED_BYTE, dst,
type, src, &ctx->Unpack, GL_TRUE);
@@ -1628,7 +1627,7 @@ _mesa_TexSubImage2D( GLenum target, GLint level,
const GLint stride = destTex->Width * texComponents * sizeof(GLubyte);
GLint row;
for (row = 0; row < height; row++) {
- const GLvoid *src = gl_pixel_addr_in_image(&ctx->Unpack, pixels,
+ const GLvoid *src = _mesa_image_address(&ctx->Unpack, pixels,
width, height, format, type, 0, row, 0);
_mesa_unpack_ubyte_color_span(ctx, width, texFormat, dst,
format, type, src, &ctx->Unpack, GL_TRUE);
@@ -1702,7 +1701,7 @@ _mesa_TexSubImage3D( GLenum target, GLint level,
GLint img, row;
for (img = 0; img < depth; img++) {
for (row = 0; row < height; row++) {
- const GLvoid *src = gl_pixel_addr_in_image(&ctx->Unpack, pixels,
+ const GLvoid *src = _mesa_image_address(&ctx->Unpack, pixels,
width, height, format, type, img, row, 0);
_mesa_unpack_index_span(ctx, width, GL_UNSIGNED_BYTE, dst,
type, src, &ctx->Unpack, GL_TRUE);
@@ -1716,7 +1715,7 @@ _mesa_TexSubImage3D( GLenum target, GLint level,
GLint img, row;
for (img = 0; img < depth; img++) {
for (row = 0; row < height; row++) {
- const GLvoid *src = gl_pixel_addr_in_image(&ctx->Unpack, pixels,
+ const GLvoid *src = _mesa_image_address(&ctx->Unpack, pixels,
width, height, format, type, img, row, 0);
_mesa_unpack_ubyte_color_span(ctx, width, texFormat, dst,
format, type, src, &ctx->Unpack, GL_TRUE);