36 return (
void *)((
const unsigned char *)ptr + size);
54 int G_raster_cmp(
const void *v1,
const void *v2, RASTER_MAP_TYPE data_type)
67 if (*((
const CELL *)v1) > *((
const CELL *)v2))
69 else if (*((
const CELL *)v1) == *((
const CELL *)v2))
74 if (*((
const FCELL *)v1) > *((
const FCELL *)v2))
76 else if (*((
const FCELL *)v1) == *((
const FCELL *)v2))
81 if (*((
const DCELL *)v1) > *((
const DCELL *)v2))
83 else if (*((
const DCELL *)v1) == *((
const DCELL *)v2))
105 int G_raster_cpy(
void *v1,
const void *v2,
int n, RASTER_MAP_TYPE data_type)
136 *((CELL *) rast) = cval;
139 *((FCELL *) rast) = (FCELL) cval;
142 *((DCELL *) rast) = (DCELL) cval;
174 *((CELL *) rast) = (CELL) fval;
177 *((FCELL *) rast) = fval;
180 *((DCELL *) rast) = (DCELL) fval;
212 *((CELL *) rast) = (CELL) dval;
215 *((FCELL *) rast) = (FCELL) dval;
218 *((DCELL *) rast) = dval;
253 return *((
const CELL *)rast);
255 return (CELL) * ((
const FCELL *)rast);
257 return (CELL) * ((
const DCELL *)rast);
288 return (FCELL) * ((
const CELL *)rast);
290 return *((
const FCELL *)rast);
292 return (FCELL) * ((
const DCELL *)rast);
323 return (DCELL) * ((
const CELL *)rast);
325 return (DCELL) * ((
const FCELL *)rast);
327 return *((
const DCELL *)rast);
int G_is_c_null_value(const CELL *cellVal)
Returns 1 if cell is NULL, 0 otherwise. This will test if the value cell is the largest int...
void G_set_d_null_value(DCELL *dcellVals, int numVals)
int G_raster_cpy(void *v1, const void *v2, int n, RASTER_MAP_TYPE data_type)
Copies raster values q into p.
int G_copy(void *a, const void *b, int n)
Copies n bytes starting at address b into address a.
CELL G_get_raster_value_c(const void *rast, RASTER_MAP_TYPE data_type)
Retrieves the value of type data_type from pointer p.
void * G_incr_void_ptr(const void *ptr, const size_t size)
Advance void pointer.
FCELL G_get_raster_value_f(const void *rast, RASTER_MAP_TYPE data_type)
Retrieves the value of type data_type from pointer p.
int G_set_raster_value_c(void *rast, CELL cval, RASTER_MAP_TYPE data_type)
Places a CELL raster value.
int G_is_d_null_value(const DCELL *dcellVal)
Returns 1 if dcell is NULL, 0 otherwise. This will test if the value dcell is a NaN. Same test as in G_is_f_null_value().
int G_is_f_null_value(const FCELL *fcellVal)
Returns 1 if fcell is NULL, 0 otherwise. This will test if the value fcell is a NaN. It isn't good enough to test for a particular NaN bit pattern since the machine code may change this bit pattern to a different NaN. The test will be.
size_t G_raster_size(RASTER_MAP_TYPE data_type)
Returns size of a raster CELL in bytes.
int G_set_raster_value_d(void *rast, DCELL dval, RASTER_MAP_TYPE data_type)
Places a DCELL raster value.
void G_set_f_null_value(FCELL *fcellVals, int numVals)
void G_set_null_value(void *buf, int numVals, RASTER_MAP_TYPE data_type)
int G_raster_cmp(const void *v1, const void *v2, RASTER_MAP_TYPE data_type)
Compares raster values p and q.
void G_set_c_null_value(CELL *cellVals, int numVals)
DCELL G_get_raster_value_d(const void *rast, RASTER_MAP_TYPE data_type)
Retrieves the value of type data_type from pointer p,.
int G_is_null_value(const void *rast, RASTER_MAP_TYPE data_type)
If the data_type is CELL_TYPE, calls G_is_c_null_value ((CELL *) rast); If the data_type is FCELL_TYP...
int G_set_raster_value_f(void *rast, FCELL fval, RASTER_MAP_TYPE data_type)
Places a FCELL raster value.