home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
vis-ftp.cs.umass.edu
/
vis-ftp.cs.umass.edu.tar
/
vis-ftp.cs.umass.edu
/
pub
/
Software
/
ASCENDER
/
ascendMar8.tar
/
UMass
/
BoldtNew
/
LLVS
/
new_plane.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-01-31
|
1KB
|
45 lines
#include <llvs_per_plane.h>
/*
* new_plane(plane, plane_info, type, level, row_dim, col_dim, row_loc,
* col_loc, background_value) - allocate a new, empty plane
*/
new_plane(plane, plane_info, type, level, row_dim, col_dim, row_loc,
col_loc, background_value)
PLANE **plane;
PLANE_INFO **plane_info;
int type, level, row_dim, col_dim, row_loc, col_loc;
union {int iback; float fback;} *background_value;
{
int plsize; /* plane size */
/* allocate plane info struct */
*plane_info = (PLANE_INFO *) malloc(sizeof(PLANE_INFO));
if (*plane_info == NULL) {
return(-1);
}
/* fill in plane info slots */
(*plane_info)->datatype = type;
(*plane_info)->level = level;
(*plane_info)->row_location = row_loc;
(*plane_info)->column_location = col_loc;
(*plane_info)->background.fixnum = background_value->iback;
(*plane_info)->row_dimension = row_dim;
(*plane_info)->column_dimension = col_dim;
plsize = plane_size(*plane_info); /* compute plane size */
/* allocate plane it self */
*plane = (PLANE *) calloc(plsize,sizeof(unsigned char));
if (*plane == NULL) {
return(-1);
}
return(0);
}