GRASS Programmer's Manual  6.4.2(2012)
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
zero_cell.c
Go to the documentation of this file.
1 
17 #include <grass/gis.h>
18 
19 
31 int G_zero_cell_buf(CELL * buf)
32 {
33  int i = G_window_cols();
34 
35  while (i--)
36  *buf++ = 0;
37 
38  return 0;
39 }
40 
41 
54 int G_zero_raster_buf(void *rast, RASTER_MAP_TYPE data_type)
55 {
56  int i;
57  unsigned char *ptr;
58 
59  /* assuming that the size of unsigned char is 1 byte */
60  i = G_window_cols() * G_raster_size(data_type);
61  ptr = (unsigned char *)rast;
62 
63  while (i--)
64  *ptr++ = 0;
65 
66  return 0;
67 }