GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-36359e2344
|
Raster Library - Raster cell value routines. More...
Go to the source code of this file.
Functions | |
int | Rast_raster_cmp (const void *v1, const void *v2, RASTER_MAP_TYPE data_type) |
Compares raster values. More... | |
void | Rast_raster_cpy (void *v1, const void *v2, int n, RASTER_MAP_TYPE data_type) |
Copies raster values. More... | |
void | Rast_set_c_value (void *rast, CELL cval, RASTER_MAP_TYPE data_type) |
Places a CELL raster value. More... | |
void | Rast_set_f_value (void *rast, FCELL fval, RASTER_MAP_TYPE data_type) |
Places a FCELL raster value. More... | |
void | Rast_set_d_value (void *rast, DCELL dval, RASTER_MAP_TYPE data_type) |
Places a DCELL raster value. More... | |
CELL | Rast_get_c_value (const void *rast, RASTER_MAP_TYPE data_type) |
Retrieves the value of give type from pointer p. More... | |
FCELL | Rast_get_f_value (const void *rast, RASTER_MAP_TYPE data_type) |
Retrieves the value of given raster type from pointer p (FCELL) More... | |
DCELL | Rast_get_d_value (const void *rast, RASTER_MAP_TYPE data_type) |
Retrieves the value of given type from pointer p (DCELL) More... | |
Raster Library - Raster cell value 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 raster/raster.c.
CELL Rast_get_c_value | ( | const void * | rast, |
RASTER_MAP_TYPE | data_type | ||
) |
Retrieves the value of give type from pointer p.
Retrieves the value of type data_type from pointer p, converts it to CELL type and returns the result. If null value is stored in p, returns CELL null value.
Used for retrieving CELL values from raster cells of any type.
Note: when data_type != CELL_TYPE, no quantization is used, only type conversion.
rast | pointer to raster cell value |
data_type | raster type (CELL, FCELL, DCELL) |
Definition at line 200 of file raster/raster.c.
DCELL Rast_get_d_value | ( | const void * | rast, |
RASTER_MAP_TYPE | data_type | ||
) |
Retrieves the value of given type from pointer p (DCELL)
Retrieves the value of type data_type from pointer p, converts it to DCELL type and returns the result. If null value is stored in p, returns DCELL null value.
Used for retrieving DCELL values from raster cells of any type.
rast | pointer to raster cell value |
data_type | raster type (CELL, FCELL, DCELL) |
Definition at line 268 of file raster/raster.c.
Referenced by Rast_set_cat().
FCELL Rast_get_f_value | ( | const void * | rast, |
RASTER_MAP_TYPE | data_type | ||
) |
Retrieves the value of given raster type from pointer p (FCELL)
Retrieves the value of type data_type from pointer p, converts it to FCELL type and returns the result. If null value is stored in p, returns FCELL null value.
Used for retrieving FCELL values from raster cells of any type.
rast | pointer to raster cell value |
data_type | raster type (CELL, FCELL, DCELL) |
Definition at line 234 of file raster/raster.c.
References CELL_TYPE, DCELL_TYPE, FCELL_TYPE, Rast_is_null_value(), and Rast_set_f_null_value().
int Rast_raster_cmp | ( | const void * | v1, |
const void * | v2, | ||
RASTER_MAP_TYPE | data_type | ||
) |
Compares raster values.
v1,v2 | values to be compared |
data_type | raster type (CELL, FCELL, DCELL) |
Definition at line 29 of file raster/raster.c.
References CELL_TYPE, DCELL_TYPE, FCELL_TYPE, and Rast_is_null_value().
void Rast_raster_cpy | ( | void * | v1, |
const void * | v2, | ||
int | n, | ||
RASTER_MAP_TYPE | data_type | ||
) |
Copies raster values.
If v2
is null value, sets v2
to null value. n
is typically size of the destination array and the source array is at least that large.
v1 | destination array for raster values |
v2 | source array with raster values |
n | number of values to copy |
data_type | raster type (CELL, FCELL, DCELL) |
Definition at line 79 of file raster/raster.c.
References Rast_cell_size().
void Rast_set_c_value | ( | void * | rast, |
CELL | cval, | ||
RASTER_MAP_TYPE | data_type | ||
) |
Places a CELL raster value.
If Rast_is_c_null_value() is true, sets p to null value. Converts CELL val to data_type (type of p) and stores result in p. Used for assigning CELL values to raster cells of any type.
rast | pointer to raster cell value |
cval | value to set |
data_type | raster type (CELL, FCELL, DCELL) |
Definition at line 95 of file raster/raster.c.
void Rast_set_d_value | ( | void * | rast, |
DCELL | dval, | ||
RASTER_MAP_TYPE | data_type | ||
) |
Places a DCELL raster value.
If Rast_is_d_null_value() is true, sets p to null value. Converts DCELL val to data_type (type of p) and stores result in p. Used for assigning DCELL values to raster cells of any type.
rast | pointer to raster cell value |
fval | value to set |
data_type | raster type (CELL, FCELL, DCELL) |
Definition at line 161 of file raster/raster.c.
Referenced by Rast_get_next_marked_cat().
void Rast_set_f_value | ( | void * | rast, |
FCELL | fval, | ||
RASTER_MAP_TYPE | data_type | ||
) |
Places a FCELL raster value.
If Rast_is_f_null_value() is true, sets p to null value. Converts FCELL val to data_type (type of p) and stores result in p. Used for assigning FCELL values to raster cells of any type.
rast | pointer to raster cell value |
fval | value to set |
data_type | raster type (CELL, FCELL, DCELL) |
Definition at line 128 of file raster/raster.c.
References CELL_TYPE, DCELL_TYPE, FCELL_TYPE, Rast_is_f_null_value, and Rast_set_null_value().