GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-d6dec75dd4
|
Raster Library - Raster allocation routines. More...
Go to the source code of this file.
Macros | |
#define | F2I(map_type) (map_type == CELL_TYPE ? 0 : (map_type == FCELL_TYPE ? 1 : 2)) |
Functions | |
size_t | Rast_cell_size (RASTER_MAP_TYPE data_type) |
Returns size of a raster cell in bytes. More... | |
void * | Rast_allocate_buf (RASTER_MAP_TYPE data_type) |
Allocate memory for a raster map of given type. More... | |
CELL * | Rast_allocate_c_buf (void) |
Allocate memory for a CELL type raster map. More... | |
FCELL * | Rast_allocate_f_buf (void) |
Allocates memory for a raster map of type FCELL. More... | |
DCELL * | Rast_allocate_d_buf (void) |
Allocates memory for a raster map of type DCELL. More... | |
char * | Rast_allocate_null_buf (void) |
Allocates memory for a null buffer. More... | |
unsigned char * | Rast__allocate_null_bits (int cols) |
Allocates memory for null bits. More... | |
int | Rast__null_bitstream_size (int cols) |
Determines null bitstream size. More... | |
void * | Rast_allocate_input_buf (RASTER_MAP_TYPE data_type) |
CELL * | Rast_allocate_c_input_buf (void) |
FCELL * | Rast_allocate_f_input_buf (void) |
DCELL * | Rast_allocate_d_input_buf (void) |
char * | Rast_allocate_null_input_buf (void) |
void * | Rast_allocate_output_buf (RASTER_MAP_TYPE data_type) |
CELL * | Rast_allocate_c_output_buf (void) |
FCELL * | Rast_allocate_f_output_buf (void) |
DCELL * | Rast_allocate_d_output_buf (void) |
char * | Rast_allocate_null_output_buf (void) |
Raster Library - Raster allocation routines.
(C) 2001-2009 by the GRASS Development Team
This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.
Definition in file alloc_cell.c.
#define F2I | ( | map_type | ) | (map_type == CELL_TYPE ? 0 : (map_type == FCELL_TYPE ? 1 : 2)) |
Definition at line 21 of file alloc_cell.c.
unsigned char* Rast__allocate_null_bits | ( | int | cols | ) |
Allocates memory for null bits.
Allocates an array of unsigned char based on cols.
cols | number of columns in region |
Definition at line 134 of file alloc_cell.c.
References G_calloc, and Rast__null_bitstream_size().
int Rast__null_bitstream_size | ( | int | cols | ) |
Determines null bitstream size.
cols | number of columns |
Definition at line 147 of file alloc_cell.c.
References _, and G_fatal_error().
Referenced by Rast__allocate_null_bits(), Rast__convert_01_flags(), Rast__convert_flags_01(), Rast__init_null_bits(), and Rast__write_null_bits().
void* Rast_allocate_buf | ( | RASTER_MAP_TYPE | data_type | ) |
Allocate memory for a raster map of given type.
Allocate an array of CELL, FCELL, or DCELL (depending on data_type) based on the number of columns in the current region.
data_type | raster type (CELL, FCELL, DCELL) |
Definition at line 54 of file alloc_cell.c.
References G_calloc, Rast_cell_size(), and Rast_window_cols().
CELL* Rast_allocate_c_buf | ( | void | ) |
Allocate memory for a CELL type raster map.
Allocate an array of CELL based on the number of columns in the current region.
This routine allocates a buffer of type CELL just large enough to hold one row of raster data based on the number of columns in the active region.
If larger buffers are required, the routine G_malloc() can be used. The routine is generally used with each open cell file.
Prints error message and calls exit() on error.
Definition at line 81 of file alloc_cell.c.
References G_calloc, and Rast_window_cols().
Referenced by IL_create_bitmask(), and open_band_files().
CELL* Rast_allocate_c_input_buf | ( | void | ) |
Definition at line 161 of file alloc_cell.c.
References G_calloc, and Rast_input_window_cols().
CELL* Rast_allocate_c_output_buf | ( | void | ) |
Definition at line 186 of file alloc_cell.c.
References G_calloc, and Rast_output_window_cols().
DCELL* Rast_allocate_d_buf | ( | void | ) |
Allocates memory for a raster map of type DCELL.
Allocate an array of DCELL based on the number of columns in the current region.
Definition at line 107 of file alloc_cell.c.
References G_calloc, and Rast_window_cols().
DCELL* Rast_allocate_d_input_buf | ( | void | ) |
Definition at line 171 of file alloc_cell.c.
References G_calloc, and Rast_input_window_cols().
DCELL* Rast_allocate_d_output_buf | ( | void | ) |
Definition at line 196 of file alloc_cell.c.
References G_calloc, and Rast_output_window_cols().
FCELL* Rast_allocate_f_buf | ( | void | ) |
Allocates memory for a raster map of type FCELL.
Allocate an array of FCELL based on the number of columns in the current region.
Definition at line 94 of file alloc_cell.c.
References G_calloc, and Rast_window_cols().
FCELL* Rast_allocate_f_input_buf | ( | void | ) |
Definition at line 166 of file alloc_cell.c.
References G_calloc, and Rast_input_window_cols().
FCELL* Rast_allocate_f_output_buf | ( | void | ) |
Definition at line 191 of file alloc_cell.c.
References G_calloc, and Rast_output_window_cols().
void* Rast_allocate_input_buf | ( | RASTER_MAP_TYPE | data_type | ) |
Definition at line 156 of file alloc_cell.c.
References G_calloc, Rast_cell_size(), and Rast_input_window_cols().
Referenced by Rast_get_vrt_row().
char* Rast_allocate_null_buf | ( | void | ) |
Allocates memory for a null buffer.
Allocate an array of char based on the number of columns in the current region.
Definition at line 120 of file alloc_cell.c.
References G_calloc, and Rast_window_cols().
char* Rast_allocate_null_input_buf | ( | void | ) |
Definition at line 176 of file alloc_cell.c.
References G_calloc, and Rast_input_window_cols().
char* Rast_allocate_null_output_buf | ( | void | ) |
Definition at line 201 of file alloc_cell.c.
References G_calloc, and Rast_output_window_cols().
void* Rast_allocate_output_buf | ( | RASTER_MAP_TYPE | data_type | ) |
Definition at line 181 of file alloc_cell.c.
References G_calloc, Rast_cell_size(), and Rast_output_window_cols().
size_t Rast_cell_size | ( | RASTER_MAP_TYPE | data_type | ) |
Returns size of a raster cell in bytes.
data_type | raster type (CELL, FCELL, DCELL) |
Definition at line 38 of file alloc_cell.c.
Referenced by f_median(), f_nmedian(), Rast__set_null_value(), Rast_allocate_buf(), Rast_allocate_input_buf(), Rast_allocate_output_buf(), Rast_get_vrt_row(), Rast_raster_cpy(), Rast_row_update_fp_range(), Rast_zero_buf(), Rast_zero_input_buf(), and Rast_zero_output_buf().