21 static int r0 = -1, g0 = -1, b0 = -1;
23 if (v0 == *val && r0 ==
r && g0 ==
g && b0 ==
b)
25 v0 = *val, r0 =
r, g0 =
g, b0 =
b;
28 fprintf(fp,
"%g%% %d:%d:%d\n", 100 * (*val - *
min) / (*
max - *
min),
r,
31 fprintf(fp,
"%g %d:%d:%d\n", *val,
r,
g,
b);
54 for (i = lo; i <= hi; i++) {
55 unsigned char r,
g,
b, set;
59 write_rule(&val, &
min, &
max,
r,
g,
b, fp, perc);
65 for (i = 0; i <
count; i++) {
67 unsigned char r1, g1, b1, r2, g2, b2;
70 colors,
count - 1 - i);
72 write_rule(&val1, &
min, &
max, r1, g1, b1, fp, perc);
73 write_rule(&val2, &
min, &
max, r2, g2, b2, fp, perc);
81 fprintf(fp,
"nv %d:%d:%d\n",
r,
g,
b);
83 fprintf(fp,
"default %d:%d:%d\n",
r,
g,
b);
void Rast_print_colors(struct Colors *colors, DCELL min, DCELL max, FILE *fp, int perc)
Print color table.
int Rast_colors_count(const struct Colors *)
Get both modular and fixed rules count.
void Rast_get_c_color_range(CELL *, CELL *, const struct Colors *)
Get color range values (CELL)
int Rast_get_fp_color_rule(DCELL *, unsigned char *, unsigned char *, unsigned char *, DCELL *, unsigned char *, unsigned char *, unsigned char *, const struct Colors *, int)
Get color rule from both modular and fixed rules.
void Rast_get_null_value_color(int *, int *, int *, const struct Colors *)
Gets color for null value.
void Rast_lookup_c_colors(const CELL *, unsigned char *, unsigned char *, unsigned char *, unsigned char *, int, struct Colors *)
Lookup an array of colors.
void Rast_get_default_color(int *, int *, int *, const struct Colors *)
Gets default color.