grass  7.8.6
About: GRASS (Geographic Resources Analysis Support System) is a raster- and vector-based GIS, image processing system, graphics production system and spatial modeling system.
  Fossies Dox: grass-7.8.6.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

color.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <grass/gis.h>
#include <grass/raster.h>
#include <grass/glocale.h>
#include "raster3d_intern.h"
Include dependency graph for color.c:

Go to the source code of this file.

Functions

static int read_colors (const char *, const char *, struct Colors *)
 
static int read_new_colors (FILE *, struct Colors *)
 
static int read_old_colors (FILE *, struct Colors *)
 
int Rast3d_remove_color (const char *name)
 Removes the primary and/or secondary color file. More...
 
int Rast3d_read_colors (const char *name, const char *mapset, struct Colors *colors)
 Reads color file for map name in mapset into the Colors structure. More...
 
int Rast3d_write_colors (const char *name, const char *mapset, struct Colors *colors)
 Writes the colors for map name in mapset into a color file. More...
 

Function Documentation

◆ Rast3d_read_colors()

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

Reads color file for map name in mapset into the Colors structure.

Parameters
name3D raster map name
mapsetmapset name
colorscolors to be associated with a map
See also
Rast3d_write_colors, Rast_read_colors

Definition at line 44 of file color.c.

References colors, DEFAULT_COLOR_TABLE, err(), G_warning(), name, Rast3d_read_range(), Rast_get_fp_range_min_max(), Rast_init_colors(), Rast_is_d_null_value(), Rast_make_fp_colors(), Rast_mark_colors_as_fp(), and read_colors().

Referenced by Gvl_load_colors_data().

◆ Rast3d_remove_color()

int Rast3d_remove_color ( const char *  name)

Removes the primary and/or secondary color file.

Todo:
Is primary and/or secondary color file still valid for 7?
See also
G_remove_colr

Definition at line 27 of file color.c.

References G_remove_misc(), name, RASTER3D_COLOR_ELEMENT, and RASTER3D_DIRECTORY.

Referenced by close_new().

◆ Rast3d_write_colors()

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

Writes the colors for map name in mapset into a color file.

Parameters
name3D raster map name
mapsetmapset name
colorscolors to be associated with a map
See also
Rast3d_read_colors, Rast3d_remove_color, Rast_write_colors

Definition at line 348 of file color.c.

References _, colors, G_fopen_new_misc(), G_mapset(), G_warning(), name, Rast__write_colors(), RASTER3D_COLOR_ELEMENT, and RASTER3D_DIRECTORY.

◆ read_colors()

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

◆ read_new_colors()

◆ read_old_colors()

static int read_old_colors ( FILE *  fd,
struct Colors colors 
)
static

Definition at line 267 of file color.c.

References colors, G_strip(), min, NULL, Rast__insert_color_into_lookup(), and Rast_init_colors().

Referenced by read_colors().