GRASS Programmer's Manual
6.4.2(2012)
|
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <grass/gis.h>
Go to the source code of this file.
Macros | |
#define | PRECISION 30 |
#define | THRESHOLD .0000000000000000000000000000005 |
Functions | |
int | G_write_colors (const char *name, const char *mapset, struct Colors *colors) |
write map layer color table | |
int | G__write_colors (FILE *fd, struct Colors *colors) |
#define PRECISION 30 |
Definition at line 23 of file color_write.c.
#define THRESHOLD .0000000000000000000000000000005 |
Definition at line 24 of file color_write.c.
int G__write_colors | ( | FILE * | fd, |
struct Colors * | colors | ||
) |
Definition at line 108 of file color_write.c.
References getenv().
Referenced by G3d_writeColors(), and G_write_colors().
int G_write_colors | ( | const char * | name, |
const char * | mapset, | ||
struct Colors * | colors | ||
) |
write map layer color table
The color table is written for the raster map name in the specified mapset from the colors structure. If there is an error, -1 is returned. No diagnostic is printed. Otherwise, 1 is returned. The colors structure must be created properly, i.e., G_init_colors to initialize the structure and G_add_color_rule to set the category colors.
name | |
mapset | |
colors |
The rules are written out using floating-point format, removing trailing zeros (possibly producing integers). The flag marking the colors as floating-point is not written.
Definition at line 77 of file color_write.c.
References G__name_is_fully_qualified(), G__write_colors(), G_fopen_new(), G_mapset(), and G_remove().
Referenced by IL_output_2d(), and IL_resample_output_2d().