24#include <grass/raster.h>
25#include <grass/bitmap.h>
26#include <grass/linkm.h>
27#include <grass/interpf.h>
28#include <grass/glocale.h>
39 int i, j, cfmask = -1, irev, MASKfd;
41 CELL *cellmask, *MASK;
44 if ((MASKfd = Rast_maskfd()) >= 0)
45 MASK = Rast_allocate_c_buf();
58 cellmask = Rast_allocate_c_buf();
59 cfmask = Rast_open_old(params->
maskmap, mapsetm);
64 for (i = 0; i < params->
nsizr; i++) {
65 irev = params->
nsizr - i - 1;
67 Rast_get_c_row(cfmask, cellmask, i);
69 Rast_get_c_row(MASKfd, MASK, i);
70 for (j = 0; j < params->
nsizc; j++) {
71 if ((cellmask && (cellmask[j] == 0 ||
72 Rast_is_c_null_value(&cellmask[j]))) ||
73 (MASK && (MASK[j] == 0 || Rast_is_c_null_value(&MASK[j]))))
74 BM_set(bitmask, j, irev, 0);
76 BM_set(bitmask, j, irev, 1);
91 double numberz,
int n_leafs)
105 for (ii = 0; ii < n_leafs; ii++)
114 for (i = 0; i < ((
struct quaddata *)(tree->
data))->n_points; i++) {
struct BM * BM_create(int x, int y)
Create bitmap of dimension x/y and return structure token.
int BM_set(struct BM *map, int x, int y, int val)
Sets bitmap value to 'val' at location 'x' 'y'.
const char * G_find_raster2(const char *name, const char *mapset)
Find a raster map (look but don't touch)
void G_fatal_error(const char *msg,...)
Print a fatal error message to stderr.
void G_message(const char *msg,...)
Print a message to stderr.