GRASS Programmer's Manual
6.5.svn(2014)-r66266
|
#include <math.h>
#include <grass/gis.h>
Go to the source code of this file.
Functions | |
int | G_lookup_colors (const CELL *cell, unsigned char *red, unsigned char *grn, unsigned char *blu, unsigned char *set, int n, struct Colors *colors) |
lookup an array of colors More... | |
int | G_lookup_c_raster_colors (const 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). More... | |
int | G_lookup_raster_colors (const 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);. More... | |
int | G_lookup_f_raster_colors (const 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. More... | |
int | G_lookup_d_raster_colors (const 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. More... | |
int | G__lookup_colors (const 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, const struct _Color_Rule_ *rule) |
int G__interpolate_color_rule | ( | DCELL | val, |
unsigned char * | red, | ||
unsigned char * | grn, | ||
unsigned char * | blu, | ||
const struct _Color_Rule_ * | rule | ||
) |
int G__lookup_colors | ( | const 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 231 of file color_look.c.
References b, cat, dmax, dmin, 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(), int, max, min, 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 | ( | const 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 76 of file color_look.c.
References G__lookup_colors(), G__organize_colors(), and G_zero().
Referenced by G_lookup_colors().
int G_lookup_colors | ( | const 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 |
Modified to return a color for NULL-values.
Definition at line 38 of file color_look.c.
References G_lookup_c_raster_colors().
Referenced by G_get_color(), Gs_build_256lookup(), and Gs_pack_colors().
int G_lookup_d_raster_colors | ( | const 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 193 of file color_look.c.
References G__lookup_colors(), G__organize_colors(), and G_zero().
int G_lookup_f_raster_colors | ( | const 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 155 of file color_look.c.
References G__lookup_colors(), G__organize_colors(), and G_zero().
Referenced by Gs_pack_colors_float().
int G_lookup_raster_colors | ( | const 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 118 of file color_look.c.
References G__lookup_colors(), G__organize_colors(), and G_zero().
Referenced by D_draw_raster_RGB(), G_get_raster_color(), and G_get_raster_row_colors().