-/* $Id: image.c,v 1.5 1999/10/10 13:04:17 brianp Exp $ */
+/* $Id: image.c,v 1.6 1999/10/13 18:42:50 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
static struct gl_image *alloc_image( void )
{
- return GL_CALLOC_STRUCT(gl_image);
+ return CALLOC_STRUCT(gl_image);
}
void gl_free_image( struct gl_image *image )
{
if (image->Data) {
- GL_FREE(image->Data);
+ FREE(image->Data);
}
- GL_FREE(image);
+ FREE(image);
}
image->Format = GL_DEPTH_COMPONENT;
if (type==GL_UNSIGNED_SHORT) {
image->Type = GL_UNSIGNED_SHORT;
- image->Data = GL_ALLOC( width * height * sizeof(GLushort));
+ image->Data = MALLOC( width * height * sizeof(GLushort));
}
else if (type==GL_UNSIGNED_INT) {
image->Type = GL_UNSIGNED_INT;
- image->Data = GL_ALLOC( width * height * sizeof(GLuint));
+ image->Data = MALLOC( width * height * sizeof(GLuint));
}
else {
image->Type = GL_FLOAT;
- image->Data = GL_ALLOC( width * height * sizeof(GLfloat));
+ image->Data = MALLOC( width * height * sizeof(GLfloat));
}
image->RefCount = 0;
if (!image->Data)
image->Components = 1;
image->Format = GL_STENCIL_INDEX;
image->Type = GL_UNSIGNED_BYTE;
- image->Data = GL_ALLOC( width * height * sizeof(GLubyte));
+ image->Data = MALLOC( width * height * sizeof(GLubyte));
image->RefCount = 0;
if (!image->Data)
return image;
/* Alloc dest storage */
bytes = ((width+7)/8 * height);
if (bytes>0 && pixels!=NULL) {
- buffer = (GLubyte *) GL_ALLOC( bytes );
+ buffer = (GLubyte *) MALLOC( bytes );
if (!buffer) {
return NULL;
}
GL_COLOR_INDEX, GL_BITMAP,
0, i, 0 );
if (!src) {
- GL_FREE(buffer);
+ FREE(buffer);
return NULL;
}
MEMCPY( dst, src, width_in_bytes );
image->RefCount = 0;
}
else {
- GL_FREE( buffer );
+ FREE( buffer );
return NULL;
}
components = gl_components_in_format( format );
width_in_bytes = width * components * sizeof(GLubyte);
- buffer = (GLubyte *) GL_ALLOC( height * width_in_bytes * depth );
+ buffer = (GLubyte *) MALLOC( height * width_in_bytes * depth );
if (!buffer) {
return NULL;
}
pixels, width, height, format, GL_UNSIGNED_BYTE,
d, i, 0 );
if (!src) {
- GL_FREE(buffer);
+ FREE(buffer);
return NULL;
}
MEMCPY( dst, src, width_in_bytes );
image->RefCount = 0;
}
else {
- GL_FREE( buffer );
+ FREE( buffer );
}
return image;
else
image->Format = format;
image->Type = GL_FLOAT;
- image->Data = GL_ALLOC( elems_per_row * height * depth * sizeof(GLfloat));
+ image->Data = MALLOC( elems_per_row * height * depth * sizeof(GLfloat));
image->RefCount = 0;
if (!image->Data)
return image;