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] = {0xFF, 0xFF, 0xFF, 0xFF};
143 for (i = 0; i < numVals; i++)
144 memcpy(&fcellVals[i], null_bits,
sizeof(null_bits));
155 static const unsigned char null_bits[8] = {0xFF, 0xFF, 0xFF, 0xFF,
156 0xFF, 0xFF, 0xFF, 0xFF};
159 for (i = 0; i < numVals; i++)
160 memcpy(&dcellVals[i], null_bits,
sizeof(null_bits));
189 G_warning(
"Rast_is_null_value: wrong data type!");
205 #ifndef Rast_is_c_null_value
209 return *cellVal == (
CELL)0x80000000;
238 #ifndef Rast_is_f_null_value
241 return *fcellVal != *fcellVal;
257 #ifndef Rast_is_d_null_value
260 return *dcellVal != *dcellVal;
279 EmbedGivenNulls(rast, null_row, data_type, ncols);
294 EmbedGivenNulls((
void *)cellVal, null_row,
CELL_TYPE, ncols);
306 EmbedGivenNulls((
void *)fcellVal, null_row,
FCELL_TYPE, ncols);
321 EmbedGivenNulls((
void *)dcellVal, null_row,
DCELL_TYPE, ncols);
341 if (bit_num < 0 || bit_num >= n)
343 "Rast__check_null_bit: index %d out of range (size = %d).", bit_num,
349 offset = bit_num & 7;
351 return ((flags[ind] & ((
unsigned char)0x80 >> offset)) != 0);
372 int col,
int n,
int ncols)
379 if (col == 0 && n == ncols) {
387 for (i = 0; i < size; i++) {
393 v = v | ((
unsigned char)zero_ones[
count - col] << k);
395 else if (
count < ncols) {
432 for (i = 0; i < size; i++) {
438 *v = *v | ((
unsigned char)zero_ones[
count] << k);
459 const unsigned char *v;
468 for (i = 0; i < size; i++) {
473 zero_ones[
count] = ((*v & ((
unsigned char)1 << k)) != 0);
500 for (i = 0; i < size; i++) {
501 if ((i + 1) * 8 <= cols) {
502 *v = (
unsigned char)255;
505 *v = (
unsigned char)255 << ((i + 1) * 8 - cols);
void G_zero(void *, int)
Zero out a buffer, buf, of length i.
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
void G_warning(const char *,...) __attribute__((format(printf
int Rast__null_bitstream_size(int)
Determines null bitstream size.
#define Rast_is_f_null_value(fcellVal)
size_t Rast_cell_size(RASTER_MAP_TYPE)
Returns size of a raster cell in bytes.
#define Rast_is_d_null_value(dcellVal)
#define Rast_is_c_null_value(cellVal)
void Rast_set_d_null_value(DCELL *dcellVals, int numVals)
To set a number of DCELL raster values to NULL.
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_set_null_value(void *buf, int numVals, RASTER_MAP_TYPE data_type)
To set one or more raster values to null.
int Rast__check_null_bit(const unsigned char *flags, int bit_num, int n)
Check NULL.
void Rast__init_null_bits(unsigned char *flags, int cols)
?
void Rast__convert_flags_01(char *zero_ones, const unsigned char *flags, int n)
?
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.
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_set_c_null_value(CELL *cellVals, int numVals)
To set a number of CELL raster values to NULL.
void Rast_set_f_null_value(FCELL *fcellVals, int numVals)
To set a number of FCELL raster values to NULL.
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.
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__convert_01_flags(const char *zero_ones, unsigned char *flags, int n)
?
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_insert_c_null_values(CELL *cellVal, char *null_row, int ncols)
To insert null values into an integer raster map (CELL)