GRASS Programmer's Manual
6.5.svn(2014)-r66266
|
GIS Library - Functions to get colors from a raster map. More...
#include <grass/gis.h>
Go to the source code of this file.
Functions | |
int | G_get_color (CELL n, int *red, int *grn, int *blu, struct Colors *colors) |
Get a category color. More... | |
int | G_get_raster_color (const void *rast, int *red, int *grn, int *blu, struct Colors *colors, RASTER_MAP_TYPE map_type) |
Gets color from raster. More... | |
int | G_get_c_raster_color (const CELL *rast, int *red, int *grn, int *blu, struct Colors *colors) |
Gets color for a CELL raster. More... | |
int | G_get_f_raster_color (const FCELL *rast, int *red, int *grn, int *blu, struct Colors *colors) |
Gets color for a FCELL raster. More... | |
int | G_get_d_raster_color (const DCELL *rast, int *red, int *grn, int *blu, struct Colors *colors) |
Gets color for a DCELL raster. More... | |
int | G_get_null_value_color (int *red, int *grn, int *blu, const struct Colors *colors) |
Gets color for null value. More... | |
int | G_get_default_color (int *red, int *grn, int *blu, const struct Colors *colors) |
Gets default color. More... | |
GIS Library - Functions to get colors from a raster map.
(C) 2001-2008 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_get.c.
int G_get_c_raster_color | ( | const CELL * | rast, |
int * | red, | ||
int * | grn, | ||
int * | blu, | ||
struct Colors * | colors | ||
) |
Gets color for a CELL raster.
Looks up the rgb colors for CELL rast in the color table colors
[in] | rast | input CELL raster |
[out] | red | red value |
[out] | grn | green value |
[out] | blu | blue value |
[in] | colors | Colors struct |
Definition at line 97 of file color_get.c.
References G_get_raster_color().
Get a category color.
The red, green, and blue intensities for the color associated with category n are extracted from the colors structure. The intensities will be in the range 0 - 255. Also works for null cells.
[in] | n | CELL to get color from |
[out] | red | red value |
[out] | grn | green value |
[out] | blu | blue value |
[in] | colors | Colors struct |
Definition at line 36 of file color_get.c.
References b, cat, g, G_lookup_colors(), int, n, r, and main::set.
Referenced by Gp_set_color(), and gsd_put_legend().
int G_get_d_raster_color | ( | const DCELL * | rast, |
int * | red, | ||
int * | grn, | ||
int * | blu, | ||
struct Colors * | colors | ||
) |
Gets color for a DCELL raster.
Looks up the rgb colors for DCELL rast in the color table colors
[in] | rast | input DCELL raster |
[out] | red | red value |
[out] | grn | green value |
[out] | blu | blue value |
[in] | colors | Colors struct |
Definition at line 139 of file color_get.c.
References G_get_raster_color().
Referenced by G_abs_log_colors(), G_histogram_eq_colors(), G_histogram_eq_colors_fp(), G_log_colors(), and gsd_put_legend().
Gets default color.
Puts the red, green, and blue components of the "default"
color into red, grn, and blu.
[out] | red | red value |
[out] | grn | green value |
[out] | blu | blue value |
[in] | colors | Colors struct |
Definition at line 192 of file color_get.c.
References int.
Referenced by G__lookup_colors(), G_abs_log_colors(), G_histogram_eq_colors(), G_histogram_eq_colors_fp(), and G_log_colors().
int G_get_f_raster_color | ( | const FCELL * | rast, |
int * | red, | ||
int * | grn, | ||
int * | blu, | ||
struct Colors * | colors | ||
) |
Gets color for a FCELL raster.
Looks up the rgb colors for FCELL rast in the color table colors
[in] | rast | input FCELL raster |
[out] | red | red value |
[out] | grn | green value |
[out] | blu | blue value |
[in] | colors | Colors struct |
Definition at line 118 of file color_get.c.
References G_get_raster_color().
Referenced by Gvl_get_color_for_value().
Gets color for null value.
Puts the red, green, and blue components of colors for the NULL-value into red, grn, and blu.
[out] | red | red value |
[out] | grn | green value |
[out] | blu | blue value |
[in] | colors | Colors struct |
Definition at line 159 of file color_get.c.
References int.
Referenced by G__lookup_colors(), G_abs_log_colors(), G_histogram_eq_colors(), G_histogram_eq_colors_fp(), and G_log_colors().
int G_get_raster_color | ( | const void * | rast, |
int * | red, | ||
int * | grn, | ||
int * | blu, | ||
struct Colors * | colors, | ||
RASTER_MAP_TYPE | map_type | ||
) |
Gets color from raster.
Looks up the rgb colors for rast in the color table colors
[in] | rast | input raster map |
[out] | red | red value |
[out] | grn | green value |
[out] | blu | blue value |
[in] | colors | Colors struct |
[in] | map_type | type of map (CELL_TYPE,FCELL_TYPE,DCELL_TYPE) |
Definition at line 67 of file color_get.c.
References b, g, G_lookup_raster_colors(), int, r, and main::set.
Referenced by D_color_of_type(), G_get_c_raster_color(), G_get_d_raster_color(), and G_get_f_raster_color().