251 #define MIN(a,b) ((a) < (b) ? (a) : (b)) 252 #define MAX(a,b) ((a) > (b) ? (a) : (b)) 254 #define NO_DEFAULT_RULE (! r->defaultDRuleSet) 255 #define NO_LEFT_INFINITE_RULE (! r->infiniteLeftSet) 256 #define NO_RIGHT_INFINITE_RULE (! r->infiniteRightSet) 257 #define NO_FINITE_RULE (r->nofRules <= 0) 258 #define NO_EXPLICIT_RULE (NO_FINITE_RULE && \ 259 NO_LEFT_INFINITE_RULE && NO_RIGHT_INFINITE_RULE) 261 #define DEFAULT_MIN ((DCELL) 1) 262 #define DEFAULT_MAX ((DCELL) 255) 314 static void fpreclass_set_limits(
struct FPReclass *
r,
326 static void fpreclass_update_limits(
struct FPReclass *r,
331 fpreclass_set_limits(r, dLow, dHigh, rLow, rHigh);
395 static void fpreclass_table_increase(
struct FPReclass *r)
421 fpreclass_update_limits(r, dLeft, dLeft, c, c);
446 fpreclass_update_limits(r, dRight, dRight, c, c);
472 fpreclass_table_increase(r);
490 fpreclass_update_limits(r, dLow, dHigh, rLow, rHigh);
505 while (pLeft < pRight) {
541 static DCELL fpreclass_get_default_cell_value(
const struct FPReclass *r,
572 return fpreclass_get_default_cell_value(r, cellVal);
577 if ((cellVal >= p->
dLow) && (cellVal <= p->
dHigh))
597 for (i = 0; i < n; i++, dcell++)
611 for (i = 0; i < n; i++, dcell++)
625 for (i = 0; i < n; i++, dcell++)
639 for (i = 0; i < n; i++, fcell++)
653 for (i = 0; i < n; i++, fcell++)
667 for (i = 0; i < n; i++, fcell++)
677 const CELL * icell,
CELL * cell,
int n)
681 for (i = 0; i < n; i++, icell++)
695 for (i = 0; i < n; i++, icell++)
709 for (i = 0; i < n; i++, icell++)
void Rast_fpreclass_add_rule(struct FPReclass *r, DCELL dLow, DCELL dHigh, DCELL rLow, DCELL rHigh)
void Rast_fpreclass_perform_fi(const struct FPReclass *r, const FCELL *fcell, CELL *cell, int n)
void Rast_set_c_null_value(CELL *, int)
To set a number of CELL raster values to NULL.
#define NO_LEFT_INFINITE_RULE
#define Rast_is_d_null_value(dcellVal)
void Rast_fpreclass_set_range(struct FPReclass *r, DCELL low, DCELL high)
void Rast_fpreclass_set_neg_infinite_rule(struct FPReclass *r, DCELL dLeft, DCELL c)
int Rast_fpreclass_nof_rules(const struct FPReclass *r)
void G_free(void *)
Free allocated memory.
void Rast_fpreclass_perform_ff(const struct FPReclass *r, const FCELL *fcell, FCELL *cell, int n)
void Rast_fpreclass_reset(struct FPReclass *r)
#define Rast_is_f_null_value(fcellVal)
void Rast_fpreclass_init(struct FPReclass *r)
void Rast_fpreclass_perform_dd(const struct FPReclass *r, const DCELL *dcell, DCELL *cell, int n)
void Rast_fpreclass_perform_id(const struct FPReclass *r, const CELL *icell, DCELL *cell, int n)
void Rast_fpreclass_perform_fd(const struct FPReclass *r, const FCELL *fcell, DCELL *cell, int n)
void Rast_set_f_null_value(FCELL *, int)
To set a number of FCELL raster values to NULL.
int Rast_fpreclass_get_pos_infinite_rule(const struct FPReclass *r, DCELL *dRight, DCELL *c)
void Rast_fpreclass_perform_ii(const struct FPReclass *r, const CELL *icell, CELL *cell, int n)
void Rast_fpreclass_perform_df(const struct FPReclass *r, const DCELL *dcell, FCELL *cell, int n)
void Rast_fpreclass_perform_if(const struct FPReclass *r, const CELL *icell, FCELL *cell, int n)
int Rast_fpreclass_get_limits(const struct FPReclass *r, DCELL *dMin, DCELL *dMax, DCELL *rMin, DCELL *rMax)
DCELL Rast_fpreclass_get_cell_value(const struct FPReclass *r, DCELL cellVal)
void Rast_fpreclass_reverse_rule_order(struct FPReclass *r)
struct FPReclass_table * table
int Rast_fpreclass_get_neg_infinite_rule(const struct FPReclass *r, DCELL *dLeft, DCELL *c)
void Rast_fpreclass_perform_di(const struct FPReclass *r, const DCELL *dcell, CELL *cell, int n)
void Rast_fpreclass_clear(struct FPReclass *r)
void Rast_fpreclass_get_ith_rule(const struct FPReclass *r, int i, DCELL *dLow, DCELL *dHigh, DCELL *rLow, DCELL *rHigh)
#define NO_RIGHT_INFINITE_RULE
#define Rast_is_c_null_value(cellVal)
void Rast_set_d_null_value(DCELL *, int)
To set a number of DCELL raster values to NULL.
void Rast_fpreclass_set_pos_infinite_rule(struct FPReclass *r, DCELL dRight, DCELL c)
void Rast_fpreclass_set_domain(struct FPReclass *r, DCELL dLow, DCELL dHigh)