48 for (i = 0; i < ncols; i++) {
64 G_warning(
_(
"EmbedGivenNulls: wrong data type"));
114 G_warning(
_(
"Rast_set_null_value: wrong data type!"));
128 for (i = 0; i < numVals; i++)
129 cellVals[i] = (
int)0x80000000;
140 static const unsigned char null_bits[4] = {
141 0xFF, 0xFF, 0xFF, 0xFF
145 for (i = 0; i < numVals; i++)
146 memcpy(&fcellVals[i], null_bits,
sizeof(null_bits));
157 static const unsigned char null_bits[8] = {
158 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
162 for (i = 0; i < numVals; i++)
163 memcpy(&dcellVals[i], null_bits,
sizeof(null_bits));
192 G_warning(
"Rast_is_null_value: wrong data type!");
208 #ifndef Rast_is_c_null_value 212 return *cellVal == (
CELL) 0x80000000;
241 #ifndef Rast_is_f_null_value 244 return *fcellVal != *fcellVal;
260 #ifndef Rast_is_d_null_value 263 return *dcellVal != *dcellVal;
282 EmbedGivenNulls(rast, null_row, data_type, ncols);
297 EmbedGivenNulls((
void *)cellVal, null_row,
CELL_TYPE, ncols);
309 EmbedGivenNulls((
void *)fcellVal, null_row,
FCELL_TYPE, ncols);
324 EmbedGivenNulls((
void *)dcellVal, null_row,
DCELL_TYPE, ncols);
344 if (bit_num < 0 || bit_num >= n)
345 G_fatal_error(
"Rast__check_null_bit: index %d out of range (size = %d).",
352 offset = bit_num & 7;
354 return ((flags[ind] & ((
unsigned char)0x80 >> offset)) != 0);
375 int col,
int n,
int ncols)
382 if (col == 0 && n == ncols) {
390 for (i = 0; i < size; i++) {
395 if (count >= col && count < (col + n)) {
396 v = v | ((
unsigned char)zero_ones[count - col] << k);
398 else if (count < ncols) {
436 for (i = 0; i < size; i++) {
442 *v = *v | ((
unsigned char)zero_ones[count] << k);
464 const unsigned char *v;
473 for (i = 0; i < size; i++) {
478 zero_ones[
count] = ((*v & ((
unsigned char)1 << k)) != 0);
505 for (i = 0; i < size; i++) {
506 if ((i + 1) * 8 <= cols) {
507 *v = (
unsigned char)255;
510 *v = (
unsigned char)255 << ((i + 1) * 8 - cols);
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
void Rast__convert_flags_01(char *zero_ones, const unsigned char *flags, int n)
?
#define Rast_is_d_null_value(dcellVal)
int G__set_flags_from_01_random(const char *zero_ones, unsigned char *flags, int col, int n, int ncols)
Given array of 0/1 of length n starting from column.
void Rast__convert_01_flags(const char *zero_ones, unsigned char *flags, int n)
?
void Rast__set_null_value(void *rast, int numVals, int null_is_zero, RASTER_MAP_TYPE data_type)
To set one or more raster values to null.
#define Rast_is_f_null_value(fcellVal)
void Rast_set_null_value(void *buf, int numVals, RASTER_MAP_TYPE data_type)
To set one or more raster values to null.
void Rast_set_c_null_value(CELL *cellVals, int numVals)
To set a number of CELL raster values to NULL.
int Rast__null_bitstream_size(int)
Determines null bitstream size.
size_t Rast_cell_size(RASTER_MAP_TYPE)
Returns size of a raster cell in bytes.
int Rast_is_null_value(const void *rast, RASTER_MAP_TYPE data_type)
To check if a raster value is set to NULL.
void Rast_insert_null_values(void *rast, char *null_row, int ncols, RASTER_MAP_TYPE data_type)
To check if a CELL raster value is set to NULL.
void Rast_set_f_null_value(FCELL *fcellVals, int numVals)
To set a number of FCELL raster values to NULL.
void Rast_insert_d_null_values(DCELL *dcellVal, char *null_row, int ncols)
To insert null values into an floating-point raster map (FCELL)
void Rast_set_d_null_value(DCELL *dcellVals, int numVals)
To set a number of DCELL raster values to NULL.
void G_zero(void *, int)
Zero out a buffer, buf, of length i.
int Rast__check_null_bit(const unsigned char *flags, int bit_num, int n)
Check NULL.
void G_warning(const char *,...) __attribute__((format(printf
void Rast_insert_f_null_values(FCELL *fcellVal, char *null_row, int ncols)
To insert null values into an floating-point raster map (FCELL)
void Rast_insert_c_null_values(CELL *cellVal, char *null_row, int ncols)
To insert null values into an integer raster map (CELL)
#define Rast_is_c_null_value(cellVal)
void Rast__init_null_bits(unsigned char *flags, int cols)
?