23 static void add_color_rule(
const void *,
int,
int,
int,
const void *,
int,
int,
39 const DCELL *val2,
int r2,
int g2,
int b2,
42 add_color_rule(val1, r1, g1, b1, val2, r2, g2, b2, &colors->
fixed,
58 const FCELL *cat2,
int r2,
int g2,
int b2,
61 add_color_rule(cat1, r1, g1, b1, cat2, r2, g2, b2, &colors->
fixed,
77 const CELL *cat2,
int r2,
int g2,
int b2,
80 add_color_rule(cat1, r1, g1, b1, cat2, r2, g2, b2, &colors->
fixed,
105 const void *val2,
int r2,
int g2,
int b2,
108 add_color_rule(val1, r1, g1, b1, val2, r2, g2, b2, &colors->
fixed,
125 const DCELL *val2,
int r2,
int g2,
int b2,
134 add_color_rule(val1, r1, g1, b1, val2, r2, g2, b2, &colors->
modular, 0,
155 const FCELL *val2,
int r2,
int g2,
int b2,
164 add_color_rule(val1, r1, g1, b1, val2, r2, g2, b2, &colors->
modular, 0,
185 const CELL *val2,
int r2,
int g2,
int b2,
194 add_color_rule(val1, r1, g1, b1, val2, r2, g2, b2, &colors->
modular, 0,
219 const void *val2,
int r2,
int g2,
int b2,
229 add_color_rule(val1, r1, g1, b1, val2, r2, g2, b2, &colors->
modular, 0,
230 &colors->
cmin, &colors->
cmax, data_type);
237 static void add_color_rule(
const void *pt1,
int r1,
int g1,
int b1,
238 const void *pt2,
int r2,
int g2,
int b2,
243 unsigned char red, grn, blu;
264 rule->low.value = rule->
high.
value = val1;
265 rule->low.red = rule->
high.
red = (r1 + r2) / 2;
266 rule->low.grn = rule->
high.
grn = (g1 + g2) / 2;
267 rule->low.blu = rule->
high.
blu = (b1 + b2) / 2;
269 else if (val1 < val2) {
270 rule->low.value = val1;
281 rule->low.value = val2;
297 min = rule->low.value;
348 min = rule->low.value;
351 for (rule = rule->
next; rule; rule =
next) {
353 if (min <= rule->low.value &&
max >= rule->
high.
value) {
int Rast_add_modular_c_color_rule(const CELL *val1, int r1, int g1, int b1, const CELL *val2, int r2, int g2, int b2, struct Colors *colors)
Add modular integer color rule (CELL version)
void Rast_add_d_color_rule(const DCELL *val1, int r1, int g1, int b1, const DCELL *val2, int r2, int g2, int b2, struct Colors *colors)
Adds the floating-point color rule (DCELL version)
void Rast_add_c_color_rule(const CELL *cat1, int r1, int g1, int b1, const CELL *cat2, int r2, int g2, int b2, struct Colors *colors)
Adds the integer color rule (CELL version)
int Rast_add_modular_color_rule(const void *val1, int r1, int g1, int b1, const void *val2, int r2, int g2, int b2, struct Colors *colors, RASTER_MAP_TYPE data_type)
Add modular color rule.
void Rast_add_f_color_rule(const FCELL *cat1, int r1, int g1, int b1, const FCELL *cat2, int r2, int g2, int b2, struct Colors *colors)
Adds the floating-point color rule (FCELL version)
int Rast_add_modular_d_color_rule(const DCELL *val1, int r1, int g1, int b1, const DCELL *val2, int r2, int g2, int b2, struct Colors *colors)
Add modular floating-point color rule (DCELL version)
void Rast_add_color_rule(const void *val1, int r1, int g1, int b1, const void *val2, int r2, int g2, int b2, struct Colors *colors, RASTER_MAP_TYPE data_type)
Adds the color rule.
int Rast_add_modular_f_color_rule(const FCELL *val1, int r1, int g1, int b1, const FCELL *val2, int r2, int g2, int b2, struct Colors *colors)
Add modular floating-point color rule (FCELL version)
void G_free(void *)
Free allocated memory.
int Rast__insert_color_into_lookup(CELL, int, int, int, struct _Color_Info_ *)
void Rast__color_free_fp_lookup(struct _Color_Info_ *)
Free color rules structure.
#define Rast_is_d_null_value(dcellVal)
void Rast__color_free_lookup(struct _Color_Info_ *)
Free color rules structure.
void Rast__interpolate_color_rule(DCELL, unsigned char *, unsigned char *, unsigned char *, const struct _Color_Rule_ *)
Interpolate color rules.
DCELL Rast_get_d_value(const void *, RASTER_MAP_TYPE)
Retrieves the value of given type from pointer p (DCELL)
struct _Color_Info_ fixed
struct _Color_Info_ modular
struct _Color_Rule_ * rules
struct _Color_Rule_ * prev
struct _Color_Rule_ * next
struct _Color_Value_ low high