Graphviz 12.0.1~dev.20240716.0800
Loading...
Searching...
No Matches
gvrender_core_pic.c File Reference
#include "config.h"
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <gvc/gvplugin_render.h>
#include <gvc/gvplugin_device.h>
#include <gvc/gvio.h>
#include <cgraph/agxbuf.h>
#include <cgraph/strview.h>
#include <common/utils.h>
#include <common/color.h>
#include <common/colorprocs.h>
#include <common/const.h>
Include dependency graph for gvrender_core_pic.c:

Go to the source code of this file.

Data Structures

struct  fontinfo
 

Macros

#define BEZIERSUBDIVISION   6
 

Enumerations

enum  { FORMAT_PIC }
 

Functions

static void unsupported (char *s)
 
static const void * memrchr (const void *s, int c, size_t n)
 
static const char * picfontname (strview_t psname)
 
static void picptarray (GVJ_t *job, pointf *A, size_t n, int close)
 
static void pic_comment (GVJ_t *job, char *str)
 
static void pic_begin_graph (GVJ_t *job)
 
static void pic_end_graph (GVJ_t *job)
 
static void pic_begin_page (GVJ_t *job)
 
static void pic_end_page (GVJ_t *job)
 
static void pic_textspan (GVJ_t *job, pointf p, textspan_t *span)
 
static void pic_ellipse (GVJ_t *job, pointf *A, int filled)
 
static void pic_bezier (GVJ_t *job, pointf *A, size_t n, int filled)
 
static void pic_polygon (GVJ_t *job, pointf *A, size_t n, int filled)
 
static void pic_polyline (GVJ_t *job, pointf *A, size_t n)
 

Variables

static bool onetime = true
 
static double Fontscale
 
static const char pic_comments [] = "# "
 
static const char troff_comments [] = ".\\\" "
 
static const char picgen_msghdr [] = "dot pic plugin: "
 
static const fontinfo fonttab []
 
static const size_t fonttab_size = sizeof(fonttab) / sizeof(fonttab[0])
 
gvrender_engine_t pic_engine
 
static gvrender_features_t render_features_pic
 
static gvdevice_features_t device_features_pic
 
gvplugin_installed_t gvrender_pic_types []
 
gvplugin_installed_t gvdevice_pic_types []
 

Macro Definition Documentation

◆ BEZIERSUBDIVISION

#define BEZIERSUBDIVISION   6

Definition at line 31 of file gvrender_core_pic.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
FORMAT_PIC 

Definition at line 33 of file gvrender_core_pic.c.

Function Documentation

◆ memrchr()

static const void * memrchr ( const void *  s,
int  c,
size_t  n 
)
static

Definition at line 113 of file gvrender_core_pic.c.

References NULL, SIZE_MAX, and str.

Referenced by picfontname().

Here is the caller graph for this function:

◆ pic_begin_graph()

static void pic_begin_graph ( GVJ_t job)
static

Definition at line 159 of file gvrender_core_pic.c.

References agnameof(), GVJ_s::common, obj_state_s::g, gvprintf(), GVCOMMON_s::info, GVJ_s::obj, troff_comments, and obj_state_s::u.

Here is the call graph for this function:

◆ pic_begin_page()

static void pic_begin_page ( GVJ_t job)
static

Definition at line 178 of file gvrender_core_pic.c.

References Fontscale, gvprintf(), box::LL, onetime, GVJ_s::pageBoundingBox, pic_comments, PS2INCH, GVJ_s::rotation, unsupported(), box::UR, point::x, and point::y.

Here is the call graph for this function:

◆ pic_bezier()

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

Definition at line 339 of file gvrender_core_pic.c.

References A, Bezier(), BEZIERSUBDIVISION, gvprintf(), gvputs(), NULL, V, and pointf_s::x.

Here is the call graph for this function:

◆ pic_comment()

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

Definition at line 154 of file gvrender_core_pic.c.

References gvprintf(), pic_comments, and str.

Here is the call graph for this function:

◆ pic_ellipse()

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

Definition at line 326 of file gvrender_core_pic.c.

References A, gvprintf(), and PS2INCH.

Here is the call graph for this function:

◆ pic_end_graph()

static void pic_end_graph ( GVJ_t job)
static

Definition at line 171 of file gvrender_core_pic.c.

References gvprintf(), and troff_comments.

Here is the call graph for this function:

◆ pic_end_page()

static void pic_end_page ( GVJ_t job)
static

Definition at line 286 of file gvrender_core_pic.c.

References gvprintf().

Here is the call graph for this function:

◆ pic_polygon()

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

Definition at line 364 of file gvrender_core_pic.c.

References A, and picptarray().

Here is the call graph for this function:

◆ pic_polyline()

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

Definition at line 369 of file gvrender_core_pic.c.

References A, and picptarray().

Here is the call graph for this function:

◆ pic_textspan()

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

Definition at line 292 of file gvrender_core_pic.c.

References textspan_t::font, Fontscale, gvprintf(), gvputc(), gvputs_nonascii(), textspan_t::just, textfont_t::name, picfontname(), POINTS_PER_INCH, textfont_t::size, textspan_t::size, textspan_t::str, strview(), pointf_s::x, and pointf_s::y.

Here is the call graph for this function:

◆ picfontname()

static const char * picfontname ( strview_t  psname)
static

Definition at line 124 of file gvrender_core_pic.c.

References agerrorf(), strview_t::data, fonttab, fonttab_size, memrchr(), NULL, picfontname(), picgen_msghdr, prefix, strview_t::size, strview_str_eq(), and fontinfo::trname.

Referenced by pic_textspan(), and picfontname().

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

◆ picptarray()

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

Definition at line 140 of file gvrender_core_pic.c.

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

Referenced by pic_polygon(), and pic_polyline().

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

◆ unsupported()

static void unsupported ( char *  s)
static

Definition at line 63 of file gvrender_core_pic.c.

References agwarningf(), and picgen_msghdr.

Referenced by pic_begin_page().

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

Variable Documentation

◆ device_features_pic

gvdevice_features_t device_features_pic
static
Initial value:
= {
0,
{0.,0.},
{0.,0.},
{72.,72.},
}

Definition at line 415 of file gvrender_core_pic.c.

◆ Fontscale

double Fontscale
static

Definition at line 36 of file gvrender_core_pic.c.

Referenced by pic_begin_page(), and pic_textspan().

◆ fonttab

const fontinfo fonttab[]
static

Definition at line 73 of file gvrender_core_pic.c.

Referenced by picfontname().

◆ fonttab_size

const size_t fonttab_size = sizeof(fonttab) / sizeof(fonttab[0])
static

Definition at line 108 of file gvrender_core_pic.c.

Referenced by picfontname().

◆ gvdevice_pic_types

gvplugin_installed_t gvdevice_pic_types[]
Initial value:
= {
{FORMAT_PIC, "pic:pic", -1, NULL, &device_features_pic},
{0, NULL, 0, NULL, NULL}
}
node NULL
Definition grammar.y:149
@ FORMAT_PIC
static gvdevice_features_t device_features_pic

Definition at line 427 of file gvrender_core_pic.c.

◆ gvrender_pic_types

gvplugin_installed_t gvrender_pic_types[]
Initial value:
= {
{0, NULL, 0, NULL, NULL}
}
gvrender_engine_t pic_engine
static gvrender_features_t render_features_pic

Definition at line 422 of file gvrender_core_pic.c.

◆ onetime

bool onetime = true
static

Definition at line 35 of file gvrender_core_pic.c.

Referenced by pic_begin_page(), and safefile().

◆ pic_comments

const char pic_comments[] = "# "
static

Definition at line 59 of file gvrender_core_pic.c.

Referenced by pic_begin_page(), and pic_comment().

◆ pic_engine

gvrender_engine_t pic_engine

Definition at line 373 of file gvrender_core_pic.c.

◆ picgen_msghdr

const char picgen_msghdr[] = "dot pic plugin: "
static

Definition at line 61 of file gvrender_core_pic.c.

Referenced by picfontname(), and unsupported().

◆ render_features_pic

gvrender_features_t render_features_pic
static
Initial value:
= {
0,
4.,
NULL,
0,
}
@ HSVA_DOUBLE
Definition color.h:26

Definition at line 407 of file gvrender_core_pic.c.

◆ troff_comments

const char troff_comments[] = ".\\\" "
static

Definition at line 60 of file gvrender_core_pic.c.

Referenced by pic_begin_graph(), and pic_end_graph().