#include <math.h>
#include <grass/gis.h>
Go to the source code of this file.
Functions | |
int | G_lookup_colors (CELL *cell, unsigned char *red, unsigned char *grn, unsigned char *blu, unsigned char *set, int n, struct Colors *colors) |
lookup an array of colors | |
int | G_lookup_c_raster_colors (CELL *cell, unsigned char *red, unsigned char *grn, unsigned char *blu, unsigned char *set, int n, struct Colors *colors) |
The same as G_lookup_colors(cell, r, g, b, set, n, colors). | |
int | G_lookup_raster_colors (void *raster, unsigned char *red, unsigned char *grn, unsigned char *blu, unsigned char *set, int n, struct Colors *colors, RASTER_MAP_TYPE map_type) |
If the cell_type is CELL_TYPE, calls G_lookup_colors((CELL *)cell, r, g, b, set, n, colors); If the cell_type is FCELL_TYPE, calls G_lookup_f_raster_colors(FCELL *)cell, r, g, b, set, n, colors); If the cell_type is DCELL_TYPE, calls G_lookup_d_raster_colors(DCELL *)cell, r, g, b, set, n, colors);. | |
int | G_lookup_f_raster_colors (FCELL *fcell, unsigned char *red, unsigned char *grn, unsigned char *blu, unsigned char *set, int n, struct Colors *colors) |
Converts the n floating-point values in the fcell array to their r,g,b color components. Embedded NULL-values are handled properly as well. | |
int | G_lookup_d_raster_colors (DCELL *dcell, unsigned char *red, unsigned char *grn, unsigned char *blu, unsigned char *set, int n, struct Colors *colors) |
Converts the n floating-point values in the dcell array to their r,g,b color components. Embedded NULL-values are handled properly as well. | |
int | G__lookup_colors (void *raster, unsigned char *red, unsigned char *grn, unsigned char *blu, unsigned char *set, int n, struct Colors *colors, int mod, int rules_only, RASTER_MAP_TYPE data_type) |
int | G__interpolate_color_rule (DCELL val, unsigned char *red, unsigned char *grn, unsigned char *blu, struct _Color_Rule_ *rule) |
int G__interpolate_color_rule | ( | DCELL | val, | |
unsigned char * | red, | |||
unsigned char * | grn, | |||
unsigned char * | blu, | |||
struct _Color_Rule_ * | rule | |||
) |
int G__lookup_colors | ( | void * | raster, | |
unsigned char * | red, | |||
unsigned char * | grn, | |||
unsigned char * | blu, | |||
unsigned char * | set, | |||
int | n, | |||
struct Colors * | colors, | |||
int | mod, | |||
int | rules_only, | |||
RASTER_MAP_TYPE | data_type | |||
) |
Definition at line 228 of file color_look.c.
References b, g, G__interpolate_color_rule(), G_get_default_color(), G_get_null_value_color(), G_get_raster_value_d(), G_incr_void_ptr(), G_is_null_value(), G_raster_cmp(), G_raster_size(), NULL, and r.
Referenced by G_lookup_c_raster_colors(), G_lookup_d_raster_colors(), G_lookup_f_raster_colors(), and G_lookup_raster_colors().
int G_lookup_c_raster_colors | ( | CELL * | cell, | |
unsigned char * | red, | |||
unsigned char * | grn, | |||
unsigned char * | blu, | |||
unsigned char * | set, | |||
int | n, | |||
struct Colors * | colors | |||
) |
The same as G_lookup_colors(cell, r, g, b, set, n, colors).
cell | ||
r | ||
g | ||
b | ||
set | ||
n | ||
colors |
Definition at line 78 of file color_look.c.
References G__lookup_colors(), G__organize_colors(), and G_zero().
Referenced by G_lookup_colors().
int G_lookup_colors | ( | CELL * | cell, | |
unsigned char * | red, | |||
unsigned char * | grn, | |||
unsigned char * | blu, | |||
unsigned char * | set, | |||
int | n, | |||
struct Colors * | colors | |||
) |
lookup an array of colors
Extracts colors for an array of raster values. The colors for the n values in the raster array are stored in the red, green, and blue arrays. The values in the set array will indicate if the corresponding raster value has a color or not (1 means it does, 0 means it does not). The programmer must allocate the red, green, blue, and set arrays to be at least dimension n. Note. The red, green, and blue intensities will be in the range 0 - 255.
raster | ||
red | ||
green | ||
blue | ||
set | ||
n | ||
colors |
Definition at line 38 of file color_look.c.
References G_lookup_c_raster_colors().
Referenced by G_get_color().
int G_lookup_d_raster_colors | ( | DCELL * | dcell, | |
unsigned char * | red, | |||
unsigned char * | grn, | |||
unsigned char * | blu, | |||
unsigned char * | set, | |||
int | n, | |||
struct Colors * | colors | |||
) |
Converts the n floating-point values in the dcell array to their r,g,b color components. Embedded NULL-values are handled properly as well.
dcell | ||
r | ||
g | ||
b | ||
set | ||
n | ||
colors |
Definition at line 195 of file color_look.c.
References G__lookup_colors(), G__organize_colors(), and G_zero().
int G_lookup_f_raster_colors | ( | FCELL * | fcell, | |
unsigned char * | red, | |||
unsigned char * | grn, | |||
unsigned char * | blu, | |||
unsigned char * | set, | |||
int | n, | |||
struct Colors * | colors | |||
) |
Converts the n floating-point values in the fcell array to their r,g,b color components. Embedded NULL-values are handled properly as well.
fcell | ||
r | ||
g | ||
b | ||
set | ||
n | ||
colors |
Definition at line 160 of file color_look.c.
References G__lookup_colors(), G__organize_colors(), and G_zero().
int G_lookup_raster_colors | ( | void * | raster, | |
unsigned char * | red, | |||
unsigned char * | grn, | |||
unsigned char * | blu, | |||
unsigned char * | set, | |||
int | n, | |||
struct Colors * | colors, | |||
RASTER_MAP_TYPE | map_type | |||
) |
If the cell_type is CELL_TYPE, calls G_lookup_colors((CELL *)cell, r, g, b, set, n, colors); If the cell_type is FCELL_TYPE, calls G_lookup_f_raster_colors(FCELL *)cell, r, g, b, set, n, colors); If the cell_type is DCELL_TYPE, calls G_lookup_d_raster_colors(DCELL *)cell, r, g, b, set, n, colors);.
rast | ||
r | ||
g | ||
b | ||
set | ||
n | ||
colors | ||
cell_type |
Definition at line 120 of file color_look.c.
References G__lookup_colors(), G__organize_colors(), and G_zero().
Referenced by G_get_c_raster_color(), G_get_d_raster_color(), G_get_f_raster_color(), G_get_raster_color(), and G_get_raster_row_colors().