1 //========================================================================
5 //========================================================================
7 //========================================================================
9 // Modified under the Poppler project - http://poppler.freedesktop.org
11 // All changes made under the Poppler project to this file are licensed
12 // under GPL version 2 or later
14 // Copyright (C) 2013 Thomas Freitag <Thomas.Freitag@alfa.de>
16 // To see a description of the changes please see the Changelog file that
17 // came with your tarball or type make ChangeLog if you are building from git
19 //========================================================================
24 #ifdef USE_GCC_PRAGMAS
28 #include "SplashTypes.h"
31 struct SplashXPathAdjust
;
33 //------------------------------------------------------------------------
35 #define splashMaxCurveSplits (1 << 10)
37 //------------------------------------------------------------------------
39 //------------------------------------------------------------------------
41 struct SplashXPathSeg
{
42 SplashCoord x0
, y0
; // first endpoint
43 SplashCoord x1
, y1
; // second endpoint
44 SplashCoord dxdy
; // slope: delta-x / delta-y
45 SplashCoord dydx
; // slope: delta-y / delta-x
49 #define splashXPathHoriz 0x01 // segment is vertical (y0 == y1)
51 #define splashXPathVert 0x02 // segment is horizontal (x0 == x1)
53 #define splashXPathFlip 0x04 // y0 > y1
55 //------------------------------------------------------------------------
57 //------------------------------------------------------------------------
62 // Expands (converts to segments) and flattens (converts curves to
63 // lines) <path>. Transforms all points from user space to device
64 // space, via <matrix>. If <closeSubpaths> is true, closes all open
66 SplashXPath(SplashPath
*path
, SplashCoord
*matrix
,
67 SplashCoord flatness
, GBool closeSubpaths
,
68 GBool adjustLines
= gFalse
, int linePosI
= 0);
70 // Copy an expanded path.
71 SplashXPath
*copy() { return new SplashXPath(this); }
75 // Multiply all coordinates by splashAASize, in preparation for
76 // anti-aliased rendering.
79 // Sort by upper coordinate (lower y), in y-major order.
84 SplashXPath(SplashXPath
*xPath
);
85 void transform(SplashCoord
*matrix
, SplashCoord xi
, SplashCoord yi
,
86 SplashCoord
*xo
, SplashCoord
*yo
);
87 void strokeAdjust(SplashXPathAdjust
*adjust
,
88 SplashCoord
*xp
, SplashCoord
*yp
);
90 void addCurve(SplashCoord x0
, SplashCoord y0
,
91 SplashCoord x1
, SplashCoord y1
,
92 SplashCoord x2
, SplashCoord y2
,
93 SplashCoord x3
, SplashCoord y3
,
95 GBool first
, GBool last
, GBool end0
, GBool end1
);
96 void addSegment(SplashCoord x0
, SplashCoord y0
,
97 SplashCoord x1
, SplashCoord y1
);
100 int length
, size
; // length and size of segs array
102 friend class SplashXPathScanner
;
103 friend class SplashClip
;