1 //========================================================================
5 //========================================================================
10 #ifdef USE_GCC_PRAGMAS
14 #include "SplashTypes.h"
18 //------------------------------------------------------------------------
20 //------------------------------------------------------------------------
22 struct SplashXPathSeg
{
23 SplashCoord x0
, y0
; // first endpoint
24 SplashCoord x1
, y1
; // second endpoint
25 SplashCoord dxdy
; // slope: delta-x / delta-y
26 SplashCoord dydx
; // slope: delta-y / delta-x
30 #define splashXPathFirst 0x01 // first segment of a subpath
31 #define splashXPathLast 0x02 // last segment of a subpath
32 #define splashXPathEnd0 0x04 // first endpoint is end of an open subpath
33 #define splashXPathEnd1 0x08 // second endpoint is end of an open subpath
34 #define splashXPathHoriz 0x10 // segment is vertical (y0 == y1)
36 #define splashXPathVert 0x20 // segment is horizontal (x0 == x1)
38 #define splashXPathFlip 0x40 // y0 > y1
40 //------------------------------------------------------------------------
42 //------------------------------------------------------------------------
47 // Expands (converts to segments) and flattens (converts curves to
48 // lines) <path>. If <closeSubpaths> is true, closes all open
50 SplashXPath(SplashPath
*path
, SplashCoord flatness
,
53 // Copy an expanded path.
54 SplashXPath
*copy() { return new SplashXPath(this); }
58 // Sort by upper coordinate (lower y), in y-major order.
64 SplashXPath(SplashXPath
*xPath
);
66 void addCurve(SplashCoord x0
, SplashCoord y0
,
67 SplashCoord x1
, SplashCoord y1
,
68 SplashCoord x2
, SplashCoord y2
,
69 SplashCoord x3
, SplashCoord y3
,
71 GBool first
, GBool last
, GBool end0
, GBool end1
);
72 void addArc(SplashCoord x0
, SplashCoord y0
,
73 SplashCoord x1
, SplashCoord y1
,
74 SplashCoord xc
, SplashCoord yc
,
75 SplashCoord r
, int quad
,
77 GBool first
, GBool last
, GBool end0
, GBool end1
);
78 void addSegment(SplashCoord x0
, SplashCoord y0
,
79 SplashCoord x1
, SplashCoord y1
,
80 GBool first
, GBool last
, GBool end0
, GBool end1
);
83 int length
, size
; // length and size of segs array
85 friend class SplashXPathScanner
;
86 friend class SplashClip
;