GRASS GIS 8 Programmer's Manual  8.5.0dev(2025)-fbabf32052
json_color_out.c File Reference

Raster Library - Print color table in json format. More...

#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <grass/gis.h>
#include <grass/gjson.h>
#include <grass/glocale.h>
#include <grass/raster.h>
Include dependency graph for json_color_out.c:

Go to the source code of this file.

Macros

#define COLOR_STRING_LENGTH   30
 

Functions

void Rast_print_json_colors (struct Colors *colors, DCELL min, DCELL max, FILE *fp, int perc, ColorFormat clr_frmt)
 Print color table in JSON format. More...
 

Detailed Description

Raster Library - Print color table in json format.

(C) 2010-2024 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
Nishant Bansal

Definition in file json_color_out.c.

Macro Definition Documentation

◆ COLOR_STRING_LENGTH

#define COLOR_STRING_LENGTH   30

Definition at line 25 of file json_color_out.c.

Function Documentation

◆ Rast_print_json_colors()

void Rast_print_json_colors ( struct Colors colors,
DCELL  min,
DCELL  max,
FILE *  fp,
int  perc,
ColorFormat  clr_frmt 
)

Print color table in JSON format.

Parameters
colorspointer to Colors structure
min,maxminimum and maximum value for percentage output (used only when perc is non-zero)
fpfile where to print color table rules
percTRUE for percentage output
clr_frmtcolor format to be used (RBG, HEX, HSV, TRIPLET).

Definition at line 183 of file json_color_out.c.