|
GRASS 8 Programmer's Manual 8.6.0dev(2026)-5f4f7ad06c
|
Raster Library - Get colors from a raster map. More...

Go to the source code of this file.
Functions | |
| int | Rast_get_color (const void *rast, int *red, int *grn, int *blu, struct Colors *colors, RASTER_MAP_TYPE map_type) |
| Gets color from raster map. | |
| int | Rast_get_c_color (const CELL *rast, int *red, int *grn, int *blu, struct Colors *colors) |
| Gets color from raster map (CELL) | |
| int | Rast_get_f_color (const FCELL *rast, int *red, int *grn, int *blu, struct Colors *colors) |
| Gets color from raster map (FCELL) | |
| int | Rast_get_d_color (const DCELL *rast, int *red, int *grn, int *blu, struct Colors *colors) |
| Gets color from raster map (DCELL) | |
| void | Rast_get_null_value_color (int *red, int *grn, int *blu, const struct Colors *colors) |
| Gets color for null value. | |
| void | Rast_get_default_color (int *red, int *grn, int *blu, const struct Colors *colors) |
| Gets default color. | |
Raster Library - Get colors from a raster map.
(C) 2001-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_get.c.
Gets color from raster map (CELL)
Looks up the rgb colors for rast in the color table colors.
| rast | raster cell value | |
| [out] | red | red value |
| [out] | grn | green value |
| [out] | blu | blue value |
| colors | pointer to Colors structure which holds color info |
Definition at line 67 of file color_get.c.
References CELL_TYPE, and Rast_get_color().
Referenced by Gp_load_sites_thematic(), gsd_put_legend(), and Gv_load_vect_thematic().
| int Rast_get_color | ( | const void * | rast, |
| int * | red, | ||
| int * | grn, | ||
| int * | blu, | ||
| struct Colors * | colors, | ||
| RASTER_MAP_TYPE | map_type | ||
| ) |
Gets color from raster map.
Looks up the rgb colors for rast in the color table colors.
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 -
| rast | raster cell value | |
| [out] | red | red value |
| [out] | grn | green value |
| [out] | blu | blue value |
| colors | pointer to Colors structure which holds color info | |
| map_type | map type (CELL, FCELL, DCELL) |
Definition at line 38 of file color_get.c.
References b, g, r, and Rast_lookup_colors().
Referenced by D_color_of_type(), Rast_get_c_color(), Rast_get_d_color(), and Rast_get_f_color().
| int Rast_get_d_color | ( | const DCELL * | rast, |
| int * | red, | ||
| int * | grn, | ||
| int * | blu, | ||
| struct Colors * | colors | ||
| ) |
Gets color from raster map (DCELL)
Looks up the rgb colors for rast in the color table colors.
| rast | raster cell value | |
| [out] | red | red value |
| [out] | grn | green value |
| [out] | blu | blue value |
| colors | pointer to Colors structure which holds color info |
Definition at line 109 of file color_get.c.
References DCELL_TYPE, and Rast_get_color().
Referenced by gsd_put_legend(), Rast_abs_log_colors(), Rast_histogram_eq_colors(), Rast_histogram_eq_fp_colors(), and Rast_log_colors().
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 |
| colors | pointer to Colors structure which holds color info |
Definition at line 154 of file color_get.c.
References Colors::undef_blu, Colors::undef_grn, Colors::undef_red, and Colors::undef_set.
Referenced by Rast__lookup_colors(), Rast_abs_log_colors(), Rast_histogram_eq_colors(), Rast_histogram_eq_fp_colors(), Rast_log_colors(), Rast_print_colors(), and Rast_print_json_colors().
| int Rast_get_f_color | ( | const FCELL * | rast, |
| int * | red, | ||
| int * | grn, | ||
| int * | blu, | ||
| struct Colors * | colors | ||
| ) |
Gets color from raster map (FCELL)
Looks up the rgb colors for rast in the color table colors.
| rast | raster cell value | |
| [out] | red | red value |
| [out] | grn | green value |
| [out] | blu | blue value |
| colors | pointer to Colors structure which holds color info |
Definition at line 88 of file color_get.c.
References FCELL_TYPE, and Rast_get_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 |
| colors | pointer to Colors structure which holds color info |
Definition at line 126 of file color_get.c.
References Colors::null_blu, Colors::null_grn, Colors::null_red, Colors::null_set, Colors::undef_blu, Colors::undef_grn, Colors::undef_red, and Colors::undef_set.
Referenced by Rast__lookup_colors(), Rast_abs_log_colors(), Rast_histogram_eq_colors(), Rast_histogram_eq_fp_colors(), Rast_log_colors(), Rast_print_colors(), and Rast_print_json_colors().