Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
taper.c File Reference
#include "config.h"
#include <assert.h>
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <types.h>
#include <cgraph/list.h>
#include <common/render.h>
#include <common/utils.h>
#include <util/agxbuf.h>
#include <util/alloc.h>
#include <util/prisize_t.h>
Include dependency graph for taper.c:

Go to the source code of this file.

Data Structures

struct  pathpoint
 

Macros

#define BEZIERSUBDIVISION   20
 
#define M_PI   3.14159265358979323846
 
#define D2R(d)   (M_PI*(d)/180.0)
 
#define R2D(r)   (180.0*(r)/M_PI)
 
#define moveto(p, x, y)   addto(p,x,y)
 
#define lineto(p, x, y)   addto(p,x,y)
 

Typedefs

typedef double(* radfunc_t) (double curlen, double totallen, double initwid)
 

Functions

static void addto (stroke_t *p, double x, double y)
 
static double myatan (double y, double x)
 
static double mymod (double original, double modulus)
 
static void insertArr (vararr_t *arr, pointf p, double l)
 
static double l2dist (pointf p0, pointf p1)
 
static vararr_t pathtolines (bezier *bez)
 
static void drawbevel (double x, double lineout, bool forward, double dir, double dir2, stroke_t *p)
 
stroke_t taper (bezier *bez, radfunc_t radfunc, double initwid)
 

Variables

static double currentmiterlimit = 10.0
 

Macro Definition Documentation

◆ BEZIERSUBDIVISION

#define BEZIERSUBDIVISION   20

Definition at line 33 of file taper.c.

◆ D2R

#define D2R (   d)    (M_PI*(d)/180.0)

Definition at line 39 of file taper.c.

◆ lineto

#define lineto (   p,
  x,
 
)    addto(p,x,y)

Definition at line 45 of file taper.c.

◆ M_PI

#define M_PI   3.14159265358979323846

Definition at line 37 of file taper.c.

◆ moveto

#define moveto (   p,
  x,
 
)    addto(p,x,y)

Definition at line 44 of file taper.c.

◆ R2D

#define R2D (   r)    (180.0*(r)/M_PI)

Definition at line 40 of file taper.c.

Typedef Documentation

◆ radfunc_t

typedef double(* radfunc_t) (double curlen, double totallen, double initwid)

Definition at line 173 of file taper.c.

Function Documentation

◆ addto()

static void addto ( stroke_t p,
double  x,
double  y 
)
static

Definition at line 47 of file taper.c.

References gv_recalloc(), stroke_t::nvertices, stroke_t::vertices, pointf_s::x, and pointf_s::y.

Here is the call graph for this function:

◆ drawbevel()

static void drawbevel ( double  x,
double  lineout,
bool  forward,
double  dir,
double  dir2,
stroke_t p 
)
static

Definition at line 161 of file taper.c.

References lineto.

Referenced by taper().

Here is the caller graph for this function:

◆ insertArr()

static void insertArr ( vararr_t *  arr,
pointf  p,
double  l 
)
static

Definition at line 98 of file taper.c.

References pointf_s::x, pathpoint::x, and pointf_s::y.

Referenced by pathtolines().

Here is the caller graph for this function:

◆ l2dist()

static double l2dist ( pointf  p0,
pointf  p1 
)
static

Definition at line 116 of file taper.c.

References pointf_s::x, and pointf_s::y.

Referenced by pathtolines().

Here is the caller graph for this function:

◆ myatan()

static double myatan ( double  y,
double  x 
)
static

Definition at line 61 of file taper.c.

References M_PI.

Referenced by taper().

Here is the caller graph for this function:

◆ mymod()

static double mymod ( double  original,
double  modulus 
)
static

Definition at line 74 of file taper.c.

Referenced by taper().

Here is the caller graph for this function:

◆ pathtolines()

static vararr_t pathtolines ( bezier bez)
static

Definition at line 126 of file taper.c.

References A, Bezier(), BEZIERSUBDIVISION, insertArr(), l2dist(), bezier::list, NULL, bezier::size, and V.

Referenced by taper().

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

◆ taper()

stroke_t taper ( bezier bez,
radfunc_t  radfunc,
double  initwid 
)

Definition at line 181 of file taper.c.

References pathpoint::bevel, currentmiterlimit, D2R, pathpoint::dir, pathpoint::dir2, dist(), drawbevel(), free(), pathpoint::lengthsofar, lineto, pathpoint::lout, moveto, myatan(), mymod(), pathtolines(), SIZE_MAX, pathpoint::type, pathpoint::x, and pathpoint::y.

Referenced by emit_edge_graphics().

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

Variable Documentation

◆ currentmiterlimit

double currentmiterlimit = 10.0
static

Definition at line 42 of file taper.c.

Referenced by taper().