GRASS Programmer's Manual  6.5.svn(2014)-r66266
 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 }
int G_zero_raster_buf(void *rast, RASTER_MAP_TYPE data_type)
Zero a raster buffer.
Definition: zero_cell.c:54
size_t G_raster_size(RASTER_MAP_TYPE data_type)
Returns size of a raster CELL in bytes.
Definition: alloc_cell.c:38
int G_window_cols(void)
Number of columns in active window.
Definition: window_map.c:306
char buf[GNAME_MAX+sizeof(G3D_DIRECTORY)+2]
Definition: g3drange.c:62
int G_zero_cell_buf(CELL *buf)
Zero a raster CELL buffer.
Definition: zero_cell.c:31