21static int read_new_colors(
FILE *,
struct Colors *);
22static int read_old_colors(
FILE *,
struct Colors *);
77 snprintf(buf,
sizeof(buf),
"colr2/%s", mapset);
129 if (
fgets(buf,
sizeof buf, fd) ==
NULL) {
140 stat = read_new_colors(fd, colors);
144 stat = read_old_colors(fd, colors);
168static int read_new_colors(
FILE *fd,
struct Colors *colors)
189 while (
fgets(buf,
sizeof buf, fd)) {
306 G_debug(3,
"adding rule %ld=%.2lf %d %d %d %ld=%.2lf %d %d %d",
cat1,
312static int read_old_colors(
FILE *fd,
struct Colors *colors)
345 while (
fgets(buf,
sizeof buf, fd)) {
355 switch (
sscanf(buf,
"%d %d %d", &red, &grn, &blu)) {
377 colors->
cmax = n - 1;
const char * G_find_raster(char *, const char *)
Find a raster map.
void G_warning(const char *,...) __attribute__((format(printf
void G_fseek(FILE *, off_t, int)
Change the file position of the stream.
FILE * G_fopen_old(const char *, const char *, const char *)
Open a database file for reading.
void G_strip(char *)
Removes all leading and trailing white space from string.
int G_debug(int, const char *,...) __attribute__((format(printf
const char * G_mapset(void)
Get current mapset name.
void Rast_add_d_color_rule(const DCELL *, int, int, int, const DCELL *, int, int, int, struct Colors *)
Adds the floating-point color rule (DCELL version)
int Rast__insert_color_into_lookup(CELL, int, int, int, struct _Color_Info_ *)
int Rast_read_fp_range(const char *, const char *, struct FPRange *)
Read floating-point range.
void Rast_set_null_value_color(int, int, int, struct Colors *)
Set color for NULL-value.
int Rast_add_modular_c_color_rule(const CELL *, int, int, int, const CELL *, int, int, int, struct Colors *)
Add modular integer color rule (CELL version)
void Rast_get_fp_range_min_max(const struct FPRange *, DCELL *, DCELL *)
Get minimum and maximum value from fp range.
void Rast_add_c_color_rule(const CELL *, int, int, int, const CELL *, int, int, int, struct Colors *)
Adds the integer color rule (CELL version)
void Rast_get_range_min_max(const struct Range *, CELL *, CELL *)
Get range min and max.
void Rast_init_colors(struct Colors *)
Initialize color structure.
int Rast_read_range(const char *, const char *, struct Range *)
Read raster range (CELL)
void Rast_set_d_color_range(DCELL, DCELL, struct Colors *)
Set color range (DCELL version)
int Rast_map_is_fp(const char *, const char *)
Check if raster map is floating-point.
int Rast_add_modular_d_color_rule(const DCELL *, int, int, int, const DCELL *, int, int, int, struct Colors *)
Add modular floating-point color rule (DCELL version)
void Rast_make_fp_colors(struct Colors *, const char *, DCELL, DCELL)
Load color rules from predefined floating-point color table.
#define Rast_is_d_null_value(dcellVal)
#define Rast_is_c_null_value(cellVal)
void Rast_invert_colors(struct Colors *)
void Rast_make_colors(struct Colors *, const char *, CELL, CELL)
Load color rules from predefined color table.
void Rast_set_default_color(int, int, int, struct Colors *)
Set default color value.
void Rast_shift_d_colors(DCELL, struct Colors *)
#define DEFAULT_COLOR_TABLE
int Rast__read_colors(const char *element, const char *name, const char *mapset, struct Colors *colors)
int Rast_read_colors(const char *name, const char *mapset, struct Colors *colors)
Read color table of raster map.
void Rast_mark_colors_as_fp(struct Colors *colors)
Mark colors as floating-point.
struct _Color_Info_ fixed
SYMBOL * err(FILE *fp, SYMBOL *s, char *msg)