Graphviz 12.0.1~dev.20240716.0800
Loading...
Searching...
No Matches
gvrender_core_fig.c File Reference
#include "config.h"
#include <assert.h>
#include <math.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <common/macros.h>
#include <common/const.h>
#include <gvc/gvplugin_render.h>
#include <gvc/gvplugin_device.h>
#include <gvc/gvio.h>
#include <cgraph/agxbuf.h>
#include <cgraph/prisize_t.h>
#include <cgraph/streq.h>
#include <cgraph/unreachable.h>
#include <common/utils.h>
#include <common/color.h>
Include dependency graph for gvrender_core_fig.c:

Go to the source code of this file.

Macros

#define BEZIERSUBDIVISION   6
 
#define maxColors   512
 

Enumerations

enum  format_type { FORMAT_FIG }
 

Functions

static void figptarray (GVJ_t *job, pointf *A, size_t n, int close)
 
static int figColorResolve (bool *new, unsigned char r, unsigned char g, unsigned char b)
 
static void fig_resolve_color (GVJ_t *job, gvcolor_t *color)
 
static void fig_line_style (obj_state_t *obj, int *line_style, double *style_val)
 
static void fig_comment (GVJ_t *job, char *str)
 
static void fig_begin_graph (GVJ_t *job)
 
static void fig_end_graph (GVJ_t *job)
 
static void fig_begin_page (GVJ_t *job)
 
static void fig_begin_node (GVJ_t *job)
 
static void fig_end_node (GVJ_t *job)
 
static void fig_begin_edge (GVJ_t *job)
 
static void fig_end_edge (GVJ_t *job)
 
static void fig_textspan (GVJ_t *job, pointf p, textspan_t *span)
 
static void fig_ellipse (GVJ_t *job, pointf *A, int filled)
 
static void fig_bezier (GVJ_t *job, pointf *A, size_t n, int filled)
 
static void fig_polygon (GVJ_t *job, pointf *A, size_t n, int filled)
 
static void fig_polyline (GVJ_t *job, pointf *A, size_t n)
 

Variables

static int Depth
 
static char * figcolor []
 
gvrender_engine_t fig_engine
 
static char * fig_knowncolors []
 
gvrender_features_t render_features_fig
 
gvdevice_features_t device_features_fig
 
gvplugin_installed_t gvrender_fig_types []
 
gvplugin_installed_t gvdevice_fig_types []
 

Macro Definition Documentation

◆ BEZIERSUBDIVISION

#define BEZIERSUBDIVISION   6

Definition at line 32 of file gvrender_core_fig.c.

◆ maxColors

#define maxColors   512

Enumeration Type Documentation

◆ format_type

Enumerator
FORMAT_FIG 

Definition at line 34 of file gvrender_core_fig.c.

Function Documentation

◆ fig_begin_edge()

static void fig_begin_edge ( GVJ_t job)
static

Definition at line 193 of file gvrender_core_fig.c.

References Depth.

◆ fig_begin_graph()

static void fig_begin_graph ( GVJ_t job)
static

Definition at line 147 of file gvrender_core_fig.c.

References agnameof(), GVJ_s::common, obj_state_s::g, gvprintf(), gvputs(), GVCOMMON_s::info, GVJ_s::obj, GVJ_s::pagesArraySize, obj_state_s::u, point::x, and point::y.

Here is the call graph for this function:

◆ fig_begin_node()

static void fig_begin_node ( GVJ_t job)
static

Definition at line 179 of file gvrender_core_fig.c.

References Depth.

◆ fig_begin_page()

static void fig_begin_page ( GVJ_t job)
static

Definition at line 172 of file gvrender_core_fig.c.

References Depth.

◆ fig_bezier()

static void fig_bezier ( GVJ_t job,
pointf A,
size_t  n,
int  filled 
)
static

Definition at line 296 of file gvrender_core_fig.c.

References A, agxbfree(), agxbprint(), agxbuse(), Bezier(), BEZIERSUBDIVISION, Depth, fig_line_style(), obj_state_s::fillcolor, gvprintf(), gvputs(), color_s::index, NULL, GVJ_s::obj, obj_state_s::pencolor, obj_state_s::penwidth, color_s::u, and V.

Here is the call graph for this function:

◆ fig_comment()

static void fig_comment ( GVJ_t job,
char *  str 
)
static

Definition at line 142 of file gvrender_core_fig.c.

References gvprintf(), and str.

Here is the call graph for this function:

◆ fig_ellipse()

static void fig_ellipse ( GVJ_t job,
pointf A,
int  filled 
)
static

Definition at line 260 of file gvrender_core_fig.c.

References A, Depth, fig_line_style(), obj_state_s::fillcolor, gvprintf(), color_s::index, GVJ_s::obj, obj_state_s::pencolor, obj_state_s::penwidth, and color_s::u.

Here is the call graph for this function:

◆ fig_end_edge()

static void fig_end_edge ( GVJ_t job)
static

Definition at line 200 of file gvrender_core_fig.c.

References Depth.

◆ fig_end_graph()

static void fig_end_graph ( GVJ_t job)
static

Definition at line 167 of file gvrender_core_fig.c.

References gvputs().

Here is the call graph for this function:

◆ fig_end_node()

static void fig_end_node ( GVJ_t job)
static

Definition at line 186 of file gvrender_core_fig.c.

References Depth.

◆ fig_line_style()

static void fig_line_style ( obj_state_t obj,
int *  line_style,
double *  style_val 
)
static

Definition at line 123 of file gvrender_core_fig.c.

References obj_state_s::pen, PEN_DASHED, PEN_DOTTED, and PEN_SOLID.

Referenced by fig_bezier(), fig_ellipse(), fig_polygon(), and fig_polyline().

Here is the caller graph for this function:

◆ fig_polygon()

static void fig_polygon ( GVJ_t job,
pointf A,
size_t  n,
int  filled 
)
static

Definition at line 371 of file gvrender_core_fig.c.

References A, Depth, fig_line_style(), figptarray(), obj_state_s::fillcolor, gvprintf(), color_s::index, GVJ_s::obj, obj_state_s::pencolor, obj_state_s::penwidth, PRISIZE_T, and color_s::u.

Here is the call graph for this function:

◆ fig_polyline()

static void fig_polyline ( GVJ_t job,
pointf A,
size_t  n 
)
static

Definition at line 401 of file gvrender_core_fig.c.

References A, Depth, fig_line_style(), figptarray(), gvprintf(), color_s::index, GVJ_s::obj, obj_state_s::pencolor, obj_state_s::penwidth, PRISIZE_T, and color_s::u.

Here is the call graph for this function:

◆ fig_resolve_color()

static void fig_resolve_color ( GVJ_t job,
gvcolor_t color 
)
static

Definition at line 87 of file gvrender_core_fig.c.

References color(), COLOR_INDEX, COLOR_STRING, figcolor, figColorResolve(), gvprintf(), RGBA_BYTE, streq(), and UNREACHABLE.

Here is the call graph for this function:

◆ fig_textspan()

static void fig_textspan ( GVJ_t job,
pointf  p,
textspan_t span 
)
static

Definition at line 207 of file gvrender_core_fig.c.

References color(), Depth, font, textspan_t::font, gvprintf(), gvputs(), gvputs_nonascii(), color_s::index, textspan_t::just, M_PI, GVJ_s::obj, obj_state_s::pencolor, textfont_t::postscript_alias, GVJ_s::rotation, textfont_t::size, textspan_t::str, color_s::u, pointf_s::x, _PostscriptAlias::xfig_code, pointf_s::y, and GVJ_s::zoom.

Here is the call graph for this function:

◆ figColorResolve()

static int figColorResolve ( bool *  new,
unsigned char  r,
unsigned char  g,
unsigned char  b 
)
static

Definition at line 48 of file gvrender_core_fig.c.

References dist(), maxColors, and top().

Referenced by fig_resolve_color().

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

◆ figptarray()

static void figptarray ( GVJ_t job,
pointf A,
size_t  n,
int  close 
)
static

Definition at line 38 of file gvrender_core_fig.c.

References A, gvprintf(), and gvputs().

Referenced by fig_polygon(), and fig_polyline().

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

Variable Documentation

◆ Depth

◆ device_features_fig

gvdevice_features_t device_features_fig
Initial value:
= {
{0.,0.},
{0.,0.},
{1440.,1440.},
}
#define GVRENDER_Y_GOES_DOWN
Definition gvcjob.h:94
#define EMIT_COLORS
Definition gvcjob.h:83

Definition at line 480 of file gvrender_core_fig.c.

◆ fig_engine

gvrender_engine_t fig_engine

Definition at line 431 of file gvrender_core_fig.c.

◆ fig_knowncolors

char* fig_knowncolors[]
static
Initial value:
= {
"black", "blue", "cyan", "green", "magenta", "red", "white", "yellow",
}

Definition at line 466 of file gvrender_core_fig.c.

◆ figcolor

char* figcolor[]
static
Initial value:
= {"black", "blue", "green", "cyan", "red",
"magenta", "yellow", "white", NULL}
node NULL
Definition grammar.y:149

Definition at line 84 of file gvrender_core_fig.c.

Referenced by fig_resolve_color().

◆ gvdevice_fig_types

gvplugin_installed_t gvdevice_fig_types[]
Initial value:
= {
{FORMAT_FIG, "fig:fig", 1, NULL, &device_features_fig},
{0, NULL, 0, NULL, NULL}
}
gvdevice_features_t device_features_fig
@ FORMAT_FIG

Definition at line 502 of file gvrender_core_fig.c.

◆ gvrender_fig_types

gvplugin_installed_t gvrender_fig_types[]
Initial value:
= {
{0, NULL, 0, NULL, NULL}
}
gvrender_features_t render_features_fig
gvrender_engine_t fig_engine

Definition at line 497 of file gvrender_core_fig.c.

◆ render_features_fig

gvrender_features_t render_features_fig
Initial value:
= {
4.,
sizeof(fig_knowncolors) / sizeof(char *),
}
@ RGBA_BYTE
Definition color.h:26
static char * fig_knowncolors[]

Definition at line 471 of file gvrender_core_fig.c.