color_read.c File Reference

#include <grass/gis.h>
#include <grass/glocale.h>
#include <string.h>

Include dependency graph for color_read.c:

Go to the source code of this file.

Functions

int G_read_colors (const char *name, const char *mapset, struct Colors *colors)
 read map layer color table
int G_mark_colors_as_fp (struct Colors *colors)
 Sets a flag in the colors structure that indicates that these colors should only be looked up using floating-point raster data (not integer data). In particular if this flag is set, the routine G_get_colors_min_max() should return min=-255$^3$ and max=255$^3$.


Function Documentation

int G_mark_colors_as_fp ( struct Colors *  colors  ) 

Sets a flag in the colors structure that indicates that these colors should only be looked up using floating-point raster data (not integer data). In particular if this flag is set, the routine G_get_colors_min_max() should return min=-255$^3$ and max=255$^3$.

Parameters:
colors 
Returns:
int

Definition at line 396 of file color_read.c.

Referenced by G_read_colors().

int G_read_colors ( const char *  name,
const char *  mapset,
struct Colors *  colors 
)

read map layer color table

The color table for the raster map name in the specified mapset is read into the colors structure. If the data layer has no color table, a default color table is generated and 0 is returned. If there is an error reading the color table, a diagnostic message is printed and -1 is returned. If the color table is read ok, 1 is returned.

Parameters:
name 
mapset 
colors 
Returns:
int
This routine reads the rules from the color file. If the input raster map is is a floating-point map it calls G_mark_colors_as_fp().

Returns:
int

Definition at line 62 of file color_read.c.

References G_find_cell(), G_get_fp_range_min_max(), G_get_range_min_max(), G_init_colors(), G_is_c_null_value(), G_is_d_null_value(), G_make_rainbow_colors(), G_make_rainbow_fp_colors(), G_mapset(), G_mark_colors_as_fp(), G_raster_map_is_fp(), G_read_fp_range(), G_read_range(), and G_warning().


Generated on Thu Jul 16 13:20:43 2009 for GRASS Programmer's Manual by  doxygen 1.5.6