GRASS 8 Programmer's Manual 8.6.0dev(2026)-4bb960b182
Loading...
Searching...
No Matches
zero_cell.c
Go to the documentation of this file.
1/*!
2 * \file lib/raster/zero_cell.c
3 *
4 * \brief Raster Library - Zero cell buffer functions.
5 *
6 * SPDX-FileCopyrightText: 2001-2009 GRASS Development Team
7 * SPDX-License-Identifier: GPL-2.0-or-later
8 *
9 * \author Original author CERL
10 */
11
12#include <string.h>
13#include <grass/gis.h>
14#include <grass/raster.h>
15
16/*!
17 * \brief Zero a raster buffer.
18 *
19 * This routines assigns each member of the raster buffer array
20 * <i>rast</i> to zero. It assumes that <i>rast</i> has been allocated
21 * using Rast_allocate_c_buf().
22 *
23 * \param rast data buffer
24 * \param data_type raster type (CELL_TYPE, FCELL_TYPE, DCELL_TYPE)
25 */
26void Rast_zero_buf(void *rast, RASTER_MAP_TYPE data_type)
27{
28 memset(rast, 0, Rast_window_cols() * Rast_cell_size(data_type));
29}
30
32{
34}
35
37{
39}
size_t Rast_cell_size(RASTER_MAP_TYPE)
Returns size of a raster cell in bytes.
Definition alloc_cell.c:35
int Rast_input_window_cols(void)
Number of columns in active input window.
int Rast_window_cols(void)
Number of columns in active window.
int Rast_output_window_cols(void)
Number of columns in active output window.
int RASTER_MAP_TYPE
Definition raster.h:25
void Rast_zero_input_buf(void *rast, RASTER_MAP_TYPE data_type)
Definition zero_cell.c:31
void Rast_zero_buf(void *rast, RASTER_MAP_TYPE data_type)
Zero a raster buffer.
Definition zero_cell.c:26
void Rast_zero_output_buf(void *rast, RASTER_MAP_TYPE data_type)
Definition zero_cell.c:36