Graphviz 12.0.1~dev.20240716.0800
Loading...
Searching...
No Matches
gvcolor.c File Reference

flow colors through a ranked digraph More...

#include <assert.h>
#include <cgraph/agxbuf.h>
#include <cgraph/alloc.h>
#include <cgraph/cgraph.h>
#include <cgraph/exit.h>
#include <cgraph/ingraphs.h>
#include "colorxlate.h"
#include <math.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <getopt.h>
Include dependency graph for gvcolor.c:

Go to the source code of this file.

Data Structures

struct  Agnodeinfo_t
 

Macros

#define NC   3 /* size of HSB color vector */
 
#define ND_relrank(n)   (((Agnodeinfo_t*)((n)->base.data))->relrank)
 
#define ND_x(n)   (((Agnodeinfo_t*)((n)->base.data))->x)
 

Functions

static int cmpf (const void *x, const void *y)
 
static void setcolor (char *p, double *v)
 
static void usage (int v)
 
static void init (int argc, char *argv[])
 
static void color (Agraph_t *g)
 
int main (int argc, char **argv)
 

Variables

double Defcolor [NC] = { 0.0, 0.0, 1.0 }
 
int Forward = 1
 
int LR = 0
 
int AdjustSaturation
 
double MinRankSaturation
 
double MaxRankSaturation
 
static char ** Files
 
static char * useString
 

Macro Definition Documentation

◆ NC

#define NC   3 /* size of HSB color vector */

Definition at line 23 of file gvcolor.c.

◆ ND_relrank

#define ND_relrank (   n)    (((Agnodeinfo_t*)((n)->base.data))->relrank)

Definition at line 41 of file gvcolor.c.

◆ ND_x

#define ND_x (   n)    (((Agnodeinfo_t*)((n)->base.data))->x)

Definition at line 42 of file gvcolor.c.

Function Documentation

◆ cmpf()

static int cmpf ( const void *  x,
const void *  y 
)
static

Definition at line 56 of file gvcolor.c.

References ND_relrank.

Referenced by color().

Here is the caller graph for this function:

◆ color()

static void color ( Agraph_t g)
static

Definition at line 128 of file gvcolor.c.

References AdjustSaturation, agattr(), agfstedge(), agfstnode(), agget(), aghead, aginit(), agnnodes(), AGNODE, agnxtedge(), agnxtnode(), agset(), agtail, cmpf(), cnt(), Defcolor, Forward, free(), graphviz_exit(), gv_calloc(), LR, MaxRankSaturation, MinRankSaturation, NC, ND_relrank, ND_x, NULL, and setcolor().

Referenced by cairogen_add_color_stop_rgba(), cairogen_set_color(), color_interpolation(), color_string(), Color_Widget_bg(), colorx(), colorxlate(), doBorder(), drawtopfishedges(), drawtopfishnodes(), emit_clusters(), emit_edge_graphics(), emit_html_rules(), fig_resolve_color(), fig_textspan(), findFillDflt(), gdgen_resolve_color(), get_color_button_widget_to_attribute(), GetglCompColor(), gvrender_resolve_color(), gvrender_set_fillcolor(), gvrender_set_gradient_vals(), gvrender_set_pencolor(), Import_coord_clusters_from_dot(), LAB2RGB(), LAB2RGB_real_01(), linGradient(), main(), makeDotGraph(), parseSegs(), penColor(), point_gencode(), poly_gencode(), pov_color_as_str(), ps_set_color(), ps_set_color(), radGradient(), RGB2LAB(), RGB2XYZ(), set_color_button_widget(), setFill(), stripedBox(), svg_print_gradient_color(), svg_print_paint(), svg_print_stop(), tclGd_GetColor(), tclGdArcCmd(), tclGdColorClosestCmd(), tclGdColorExactCmd(), tclGdColorNewCmd(), tclGdColorResolveCmd(), tclGdColorTranspCmd(), tclGdFillCmd(), tclGdGetCmd(), tclGdLineCmd(), tclGdPolygonCmd(), tclGdRectCmd(), tclGdSetCmd(), tclGdTextCmd(), tkgen_print_color(), toGradString(), wedgedEllipse(), write_stops(), and XYZ2RGB().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init()

static void init ( int  argc,
char *  argv[] 
)
static

Definition at line 100 of file gvcolor.c.

References Files, graphviz_exit(), and usage.

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 250 of file gvcolor.c.

References agclose(), agwrite(), color(), Files, graphviz_exit(), init(), newIngraph(), and nextGraph().

Here is the call graph for this function:

◆ setcolor()

static void setcolor ( char *  p,
double *  v 
)
static

Definition at line 78 of file gvcolor.c.

References agxbfree(), agxbuse(), and colorxlate().

Referenced by color().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ usage()

static void usage ( int  v)
static

Definition at line 94 of file gvcolor.c.

References graphviz_exit(), and useString.

Here is the call graph for this function:

Variable Documentation

◆ AdjustSaturation

int AdjustSaturation

Definition at line 52 of file gvcolor.c.

Referenced by color().

◆ Defcolor

double Defcolor[NC] = { 0.0, 0.0, 1.0 }

Definition at line 48 of file gvcolor.c.

Referenced by color().

◆ Files

char** Files
static

Definition at line 88 of file gvcolor.c.

Referenced by init(), and main().

◆ Forward

int Forward = 1

Definition at line 49 of file gvcolor.c.

Referenced by color().

◆ LR

int LR = 0

Definition at line 50 of file gvcolor.c.

Referenced by color(), and parse_reclbl().

◆ MaxRankSaturation

double MaxRankSaturation

Definition at line 54 of file gvcolor.c.

Referenced by color().

◆ MinRankSaturation

double MinRankSaturation

Definition at line 53 of file gvcolor.c.

Referenced by color().

◆ useString

char* useString
static
Initial value:
= "Usage: gvcolor [-?] <files>\n\
-? - print usage\n\
If no files are specified, stdin is used\n"

Definition at line 90 of file gvcolor.c.

Referenced by usage().