#include <grass/gis.h>
Go to the source code of this file.
Defines | |
#define | LIMIT(x) if (x < 0) x = 0; else if (x > 255) x = 255; |
Functions | |
int | G_add_d_raster_color_rule (DCELL *val1, int r1, int g1, int b1, DCELL *val2, int r2, int g2, int b2, struct Colors *colors) |
Adds the floating-point rule that the range [v1,v2] gets a linear ramp of colors from [r1,g1,b1] to [r2,g2,b2]. If either v1 or v2 is the NULL-value, this call is converted into G_set_null_value_color (r1, g1, b1, colors) . | |
int | G_add_f_raster_color_rule (FCELL *cat1, int r1, int g1, int b1, FCELL *cat2, int r2, int g2, int b2, struct Colors *colors) |
Adds the floating-point rule that the range [v1,v2] gets a linear ramp of colors from [r1,g1,b1] to [r2,g2,b2]. If either v1 or v2 is the NULL-value, this call is converted into G_set_null_value_color (r1, g1, b1, colors) . | |
int | G_add_c_raster_color_rule (CELL *cat1, int r1, int g1, int b1, CELL *cat2, int r2, int g2, int b2, struct Colors *colors) |
Calls G_add_color_rule(*v1, r1, g1, b1, *v2, r2, g2, b2, colors). | |
int | G_add_raster_color_rule (void *val1, int r1, int g1, int b1, void *val2, int r2, int g2, int b2, struct Colors *colors, RASTER_MAP_TYPE data_type) |
If map_type is CELL_TYPE, calls G_add_c_raster_color_rule ((CELL *) v1, r1, g1, b1, (CELL *) v2, r2, g2, b2, colors); If map_type is FCELL_TYPE, calls G_add_f_raster_color_rule ((FCELL *) v1, r1, g1, b1, (FCELL *) v2, r2, g2, b2, colors); If map_type is DCELL_TYPE, calls G_add_d_raster_color_rule ((DCELL *) v1, r1, g1, b1, (DCELL *) v2, r2, g2, b2, colors);. | |
int | G_add_color_rule (CELL cat1, int r1, int g1, int b1, CELL cat2, int r2, int g2, int b2, struct Colors *colors) |
set colors | |
int | G_add_modular_d_raster_color_rule (DCELL *val1, int r1, int g1, int b1, DCELL *val2, int r2, int g2, int b2, struct Colors *colors) |
int | G_add_modular_f_raster_color_rule (FCELL *val1, int r1, int g1, int b1, FCELL *val2, int r2, int g2, int b2, struct Colors *colors) |
int | G_add_modular_c_raster_color_rule (CELL *val1, int r1, int g1, int b1, CELL *val2, int r2, int g2, int b2, struct Colors *colors) |
int | G_add_modular_raster_color_rule (void *val1, int r1, int g1, int b1, void *val2, int r2, int g2, int b2, struct Colors *colors, RASTER_MAP_TYPE data_type) |
int | G_add_modular_color_rule (CELL cat1, int r1, int g1, int b1, CELL cat2, int r2, int g2, int b2, struct Colors *colors) |
#define LIMIT | ( | x | ) | if (x < 0) x = 0; else if (x > 255) x = 255; |
Definition at line 3 of file color_rule.c.
int G_add_c_raster_color_rule | ( | CELL * | cat1, | |
int | r1, | |||
int | g1, | |||
int | b1, | |||
CELL * | cat2, | |||
int | r2, | |||
int | g2, | |||
int | b2, | |||
struct Colors * | colors | |||
) |
Calls G_add_color_rule(*v1, r1, g1, b1, *v2, r2, g2, b2, colors).
v1 | ||
r1 | ||
g1 | ||
b1 | ||
v2 | ||
r2 | ||
g2 | ||
b2 | ||
colors |
Definition at line 89 of file color_rule.c.
int G_add_color_rule | ( | CELL | cat1, | |
int | r1, | |||
int | g1, | |||
int | b1, | |||
CELL | cat2, | |||
int | r2, | |||
int | g2, | |||
int | b2, | |||
struct Colors * | colors | |||
) |
set colors
This is the heart and soul of the new color logic. It adds a color rule to the colors structure. The colors defined by the red, green, and blue values r1,g1,b1 and r2,g2,b2 are assigned to cat1 and cat2 respectively. Colors for data values between cat1 and cat2 are not stored in the structure but are interpolated when queried by G_lookup_colors andG_get_color. The color components r1,g1,b1 and r2,g2,b2 must be in the range 0 -- 255. For example, to create a linear grey scale for the range 200 -- 1000:
struct Colors colr; G_init_colors (&colr); G_add_color_rule ((CELL)200, 0,0,0, (CELL)1000, 255,255,255);
cat1 | ||
r1 | ||
g1 | ||
b1 | ||
cat2 | ||
r2 | ||
g2 | ||
b2 | ||
colors |
Definition at line 166 of file color_rule.c.
Referenced by G_make_histogram_eq_colors(), G_make_histogram_log_colors(), and G_set_color().
int G_add_d_raster_color_rule | ( | DCELL * | val1, | |
int | r1, | |||
int | g1, | |||
int | b1, | |||
DCELL * | val2, | |||
int | r2, | |||
int | g2, | |||
int | b2, | |||
struct Colors * | colors | |||
) |
Adds the floating-point rule that the range [v1,v2] gets a linear ramp of colors from [r1,g1,b1] to [r2,g2,b2]. If either v1 or v2 is the NULL-value, this call is converted into G_set_null_value_color (r1, g1, b1, colors)
.
v1 | ||
r1 | ||
g1 | ||
b1 | ||
v2 | ||
r2 | ||
g2 | ||
b2 | ||
colors |
Definition at line 33 of file color_rule.c.
Referenced by G_set_d_color().
int G_add_f_raster_color_rule | ( | FCELL * | cat1, | |
int | r1, | |||
int | g1, | |||
int | b1, | |||
FCELL * | cat2, | |||
int | r2, | |||
int | g2, | |||
int | b2, | |||
struct Colors * | colors | |||
) |
Adds the floating-point rule that the range [v1,v2] gets a linear ramp of colors from [r1,g1,b1] to [r2,g2,b2]. If either v1 or v2 is the NULL-value, this call is converted into G_set_null_value_color (r1, g1, b1, colors)
.
v1 | ||
r1 | ||
g1 | ||
b1 | ||
v2 | ||
r2 | ||
g2 | ||
b2 | ||
colors |
Definition at line 63 of file color_rule.c.
int G_add_modular_c_raster_color_rule | ( | CELL * | val1, | |
int | r1, | |||
int | g1, | |||
int | b1, | |||
CELL * | val2, | |||
int | r2, | |||
int | g2, | |||
int | b2, | |||
struct Colors * | colors | |||
) |
int G_add_modular_color_rule | ( | CELL | cat1, | |
int | r1, | |||
int | g1, | |||
int | b1, | |||
CELL | cat2, | |||
int | r2, | |||
int | g2, | |||
int | b2, | |||
struct Colors * | colors | |||
) |
Definition at line 228 of file color_rule.c.
Referenced by G_add_modular_c_raster_color_rule(), and G_make_random_colors().
int G_add_modular_d_raster_color_rule | ( | DCELL * | val1, | |
int | r1, | |||
int | g1, | |||
int | b1, | |||
DCELL * | val2, | |||
int | r2, | |||
int | g2, | |||
int | b2, | |||
struct Colors * | colors | |||
) |
Definition at line 174 of file color_rule.c.
int G_add_modular_f_raster_color_rule | ( | FCELL * | val1, | |
int | r1, | |||
int | g1, | |||
int | b1, | |||
FCELL * | val2, | |||
int | r2, | |||
int | g2, | |||
int | b2, | |||
struct Colors * | colors | |||
) |
Definition at line 190 of file color_rule.c.
int G_add_modular_raster_color_rule | ( | void * | val1, | |
int | r1, | |||
int | g1, | |||
int | b1, | |||
void * | val2, | |||
int | r2, | |||
int | g2, | |||
int | b2, | |||
struct Colors * | colors, | |||
RASTER_MAP_TYPE | data_type | |||
) |
Definition at line 212 of file color_rule.c.
int G_add_raster_color_rule | ( | void * | val1, | |
int | r1, | |||
int | g1, | |||
int | b1, | |||
void * | val2, | |||
int | r2, | |||
int | g2, | |||
int | b2, | |||
struct Colors * | colors, | |||
RASTER_MAP_TYPE | data_type | |||
) |
If map_type is CELL_TYPE, calls G_add_c_raster_color_rule ((CELL *) v1, r1, g1, b1, (CELL *) v2, r2, g2, b2, colors); If map_type is FCELL_TYPE, calls G_add_f_raster_color_rule ((FCELL *) v1, r1, g1, b1, (FCELL *) v2, r2, g2, b2, colors); If map_type is DCELL_TYPE, calls G_add_d_raster_color_rule ((DCELL *) v1, r1, g1, b1, (DCELL *) v2, r2, g2, b2, colors);.
v1 | ||
r1 | ||
g1 | ||
b1 | ||
v2 | ||
r2 | ||
g2 | ||
b2 | ||
colors | ||
map_type |
Definition at line 121 of file color_rule.c.