GRASS GIS 7 Programmer's Manual  7.5.svn(2017)-r71915
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
color_set.c File Reference

Raster Library - Set colors for raster maps. More...

#include <grass/gis.h>
#include <grass/raster.h>
Include dependency graph for color_set.c:

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) More...
 
void Rast_set_d_color (DCELL val, int r, int g, int b, struct Colors *colors)
 Set a category color (DCELL) More...
 
void Rast_set_null_value_color (int red, int grn, int blu, struct Colors *colors)
 Set color for NULL-value. More...
 
void Rast_set_default_color (int red, int grn, int blu, struct Colors *colors)
 Set default color value. More...
 

Detailed Description

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.

Author
Original author CERL

Definition in file color_set.c.

Function Documentation

void Rast_set_c_color ( CELL  cat,
int  r,
int  g,
int  b,
struct Colors colors 
)

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().

Parameters
catraster cell value
rred value
ggreen value
bblue value
colorspointer to Colors structure which holds color info

Definition at line 41 of file color_set.c.

References Rast_add_c_color_rule(), Rast_is_c_null_value(), and Rast_set_null_value_color().

Referenced by create_raster().

void Rast_set_d_color ( DCELL  val,
int  r,
int  g,
int  b,
struct Colors colors 
)

Set a category color (DCELL)

See Rast_set_c_color() for detailed information.

Parameters
valraster cell value
rred value
ggreen value
bblue value
colorspointer to Colors structure which holds color info

Definition at line 60 of file color_set.c.

References Rast_add_d_color_rule(), Rast_is_d_null_value(), and Rast_set_null_value_color().

Referenced by Rast_read_color_rules().

void Rast_set_default_color ( int  red,
int  grn,
int  blu,
struct Colors colors 
)

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.

Parameters
redred value
grngreen value
blublue value
colorspointer to Colors structure which holds color info

Definition at line 100 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().

void Rast_set_null_value_color ( int  red,
int  grn,
int  blu,
struct Colors colors 
)

Set color for NULL-value.

Sets the color (in colors) for the NULL-value to red, green, blue.

Parameters
redred value
grngreen value
blublue value
colorspointer 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().