|
GRASS 8 Programmer's Manual 8.6.0dev(2026)-56a9afeb9f
|
Raster Library - Set colors for raster maps. More...

Go to the source code of this file.
Functions | |
| void | Rast_set_c_color (CELL cat, int r, int g, int b, struct Colors *colors) |
| Set a category color (CELL) | |
| void | Rast_set_d_color (DCELL val, int r, int g, int b, struct Colors *colors) |
| Set a category color (DCELL) | |
| void | Rast_set_null_value_color (int red, int grn, int blu, struct Colors *colors) |
| Set color for NULL-value. | |
| void | Rast_set_default_color (int red, int grn, int blu, struct Colors *colors) |
| Set default color value. | |
Raster Library - Set colors for raster maps.
(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_set.c.
Set a category color (CELL)
The red, green, and blue intensities for the color associated with category cat are set in the colors structure. The intensities must be in the range 0 - 255. Values below zero are set as zero, values above 255 are set as 255.
Warning: Use of this routine is discouraged because it defeats the new color logic.
It is provided only for backward compatibility. Overuse can create large color tables. Rast_add_c_color_rule() should be used whenever possible.
Note: The colors structure must have been initialized by G_init_color().
| cat | raster cell value |
| r | red value |
| g | green value |
| b | blue value |
| colors | pointer to Colors structure which holds color info |
Definition at line 41 of file color_set.c.
References b, g, r, Rast_add_c_color_rule(), Rast_is_c_null_value, and Rast_set_null_value_color().
Referenced by create_raster().
Set a category color (DCELL)
See Rast_set_c_color() for detailed information.
| val | raster cell value |
| r | red value |
| g | green value |
| b | blue value |
| colors | pointer to Colors structure which holds color info |
Definition at line 60 of file color_set.c.
References b, g, r, Rast_add_d_color_rule(), Rast_is_d_null_value, and Rast_set_null_value_color().
Referenced by Rast_read_color_rules().
Set default color value.
Sets the default color (in colors) to red, green, blue. This is the color for values which do not have an explicit rule.
| red | red value |
| grn | green value |
| blu | blue value |
| colors | pointer to Colors structure which holds color info |
Definition at line 99 of file color_set.c.
References Colors::undef_blu, Colors::undef_grn, Colors::undef_red, and Colors::undef_set.
Referenced by Rast_abs_log_colors(), Rast_histogram_eq_colors(), Rast_histogram_eq_fp_colors(), Rast_log_colors(), and Rast_read_color_rules().
Set color for NULL-value.
Sets the color (in colors) for the NULL-value to red, green, blue.
| red | red value |
| grn | green value |
| blu | blue value |
| colors | pointer to Colors structure which holds color info |
Definition at line 79 of file color_set.c.
References Colors::null_blu, Colors::null_grn, Colors::null_red, and Colors::null_set.
Referenced by Rast_abs_log_colors(), Rast_histogram_eq_colors(), Rast_histogram_eq_fp_colors(), Rast_log_colors(), Rast_make_histogram_eq_colors(), Rast_make_histogram_log_colors(), Rast_read_color_rules(), Rast_set_c_color(), and Rast_set_d_color().