GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-36359e2344
|
Raster Library - Lookup array of colors. More...
Go to the source code of this file.
Functions | |
void | Rast_lookup_c_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... | |
void | Rast_lookup_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) |
Lookup an array of colors. More... | |
void | Rast_lookup_f_colors (const FCELL *fcell, unsigned char *red, unsigned char *grn, unsigned char *blu, unsigned char *set, int n, struct Colors *colors) |
Lookup an array of colors (FCELL) More... | |
void | Rast_lookup_d_colors (const DCELL *dcell, unsigned char *red, unsigned char *grn, unsigned char *blu, unsigned char *set, int n, struct Colors *colors) |
Lookup an array of colors (DCELL) More... | |
void | Rast__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) |
Lookup an array of colors. More... | |
void | Rast__interpolate_color_rule (DCELL val, unsigned char *red, unsigned char *grn, unsigned char *blu, const struct _Color_Rule_ *rule) |
Interpolate color rules. More... | |
Raster Library - Lookup array of colors.
(C) 1999-2009 by the GRASS Development Team
This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.
Definition in file color_look.c.
void Rast__interpolate_color_rule | ( | DCELL | val, |
unsigned char * | red, | ||
unsigned char * | grn, | ||
unsigned char * | blu, | ||
const struct _Color_Rule_ * | rule | ||
) |
Interpolate color rules.
val | raster cell value | |
[out] | red | red value |
[out] | grn | green value |
[out] | blu | blue value |
rule | pointer to _Color_Rule which holds color rules info |
Definition at line 422 of file color_look.c.
References _Color_Value_::blu, _Color_Value_::grn, _Color_Rule_::high, _Color_Value_::red, and _Color_Value_::value.
void Rast__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 | ||
) |
Lookup an array of colors.
raster | raster cell value | |
[out] | red | red value |
[out] | grn | green value |
[out] | blu | blue value |
set | array which indicates if color is set or not | |
n | number of values | |
colors | pointer to Colors structure which holds color info | |
mod | ||
rules_only | ||
data_type | raster type (CELL, FCELL, DCELL) |
Definition at line 195 of file color_look.c.
void Rast_lookup_c_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 cell values. The colors for the n values in the cell array are stored in the red, green, and blue arrays. The values in the set array will indicate if the corresponding cell 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.
Modified to return a color for NULL-values.
cell | raster cell value | |
[out] | red | red value |
[out] | grn | green value |
[out] | blu | blue value |
set | array which indicates if color is set or not | |
n | number of values | |
colors | pointer to Colors structure which holds color info |
Definition at line 45 of file color_look.c.
void Rast_lookup_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 | ||
) |
Lookup an array of colors.
raster | raster cell value | |
[out] | red | red value |
[out] | grn | green value |
[out] | blu | blue value |
set | array which indicates if color is set or not | |
n | number of values | |
colors | pointer to Colors structure which holds color info | |
map_type | raster type (CELL, FCELL, DCELL) |
Definition at line 79 of file color_look.c.
void Rast_lookup_d_colors | ( | const DCELL * | dcell, |
unsigned char * | red, | ||
unsigned char * | grn, | ||
unsigned char * | blu, | ||
unsigned char * | set, | ||
int | n, | ||
struct Colors * | colors | ||
) |
Lookup an array of colors (DCELL)
Converts the n double-precision values in the dcell array to their r,g,b color components. Embedded NULL-values are handled properly as well.
dcell | raster cell value | |
[out] | red | red value |
[out] | grn | green value |
[out] | blu | blue value |
set | array which indicates if color is set or not | |
n | number of values | |
colors | pointer to Colors structure which holds color info |
Definition at line 146 of file color_look.c.
void Rast_lookup_f_colors | ( | const FCELL * | fcell, |
unsigned char * | red, | ||
unsigned char * | grn, | ||
unsigned char * | blu, | ||
unsigned char * | set, | ||
int | n, | ||
struct Colors * | colors | ||
) |
Lookup an array of colors (FCELL)
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 | raster cell value | |
[out] | red | red value |
[out] | grn | green value |
[out] | blu | blue value |
set | array which indicates if color is set or not | |
n | number of values | |
colors | pointer to Colors structure which holds color info |
Definition at line 112 of file color_look.c.