00001 00017 #include <grass/gis.h> 00018 00019 00031 int G_zero_cell_buf(CELL * buf) 00032 { 00033 int i = G_window_cols(); 00034 00035 while (i--) 00036 *buf++ = 0; 00037 00038 return 0; 00039 } 00040 00041 00054 int G_zero_raster_buf(void *rast, RASTER_MAP_TYPE data_type) 00055 { 00056 int i; 00057 unsigned char *ptr; 00058 00059 /* assuming that the size of unsigned char is 1 byte */ 00060 i = G_window_cols() * G_raster_size(data_type); 00061 ptr = (unsigned char *)rast; 00062 00063 while (i--) 00064 *ptr++ = 0; 00065 00066 return 0; 00067 }