zero_cell.c

Go to the documentation of this file.
00001 /*
00002  ****************************************************************
00003  *  G_zero_cell_buf (buf)
00004  *     char *buf           cell buffer to be zeroed
00005  *
00006  *  G_zero_raster_buf (void *rast, RASTER_MAP_TYPE data_type)
00007  *
00008  *  Zeros out a cell buffer 
00009  ****************************************************************/
00010 
00011 #include "gis.h"
00012 
00024 int G_zero_cell_buf (register CELL *buf)
00025 {
00026     register int i ;
00027     i = G_window_cols() ;
00028 
00029     while(i--)
00030         *buf++ = 0 ;
00031 
00032     return 0;
00033 }
00034 
00035 int G_zero_raster_buf ( register void *rast,
00036     RASTER_MAP_TYPE data_type)
00037 {
00038     register int i ;
00039     register unsigned char *ptr;
00040     /* assuming that the size of unsigned char is 1 byte */
00041     i = G_window_cols() * G_raster_size(data_type) ;
00042     ptr = (unsigned char *) rast;
00043 
00044     while(i--)
00045         *ptr++ = 0 ;
00046 
00047     return 0;
00048 }

Generated on Mon Jan 1 19:49:26 2007 for GRASS by  doxygen 1.5.1