summaryrefslogtreecommitdiff
path: root/Build/source/libs/xpdf/xpdf-src/splash/SplashXPath.h
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/xpdf/xpdf-src/splash/SplashXPath.h')
-rw-r--r--Build/source/libs/xpdf/xpdf-src/splash/SplashXPath.h54
1 files changed, 37 insertions, 17 deletions
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashXPath.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashXPath.h
index 5bcec61cd25..82d7889c447 100644
--- a/Build/source/libs/xpdf/xpdf-src/splash/SplashXPath.h
+++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashXPath.h
@@ -37,36 +37,48 @@ struct SplashXPathSeg {
int count; // EO/NZWN counter increment
//----- used by SplashXPathScanner
- SplashCoord xCur0, xCur1; // current x values
+ int iy;
+ SplashCoord sx0, sx1, mx;
+ SplashXPathSeg *prev, *next;
#if HAVE_STD_SORT
+
+ static bool cmpMX(const SplashXPathSeg &s0,
+ const SplashXPathSeg &s1) {
+ if (s0.iy != s1.iy) {
+ return s0.iy < s1.iy;
+ }
+ return s0.mx < s1.mx;
+ }
+
static bool cmpY(const SplashXPathSeg &seg0,
const SplashXPathSeg &seg1) {
return seg0.y0 < seg1.y0;
}
+
#else
- static int cmpY(const void *seg0, const void *seg1) {
+
+ static int cmpMX(const void *p0, const void *p1) {
+ SplashXPathSeg *s0 = (SplashXPathSeg *)p0;
+ SplashXPathSeg *s1 = (SplashXPathSeg *)p1;
SplashCoord cmp;
- cmp = ((SplashXPathSeg *)seg0)->y0
- - ((SplashXPathSeg *)seg1)->y0;
- return (cmp > 0) ? 1 : (cmp < 0) ? -1 : 0;
+ if (s0->iy != s1->iy) {
+ return s0->iy - s1->iy;
+ }
+ cmp = s0->mx - s1->mx;
+ return (cmp < 0) ? -1 : (cmp > 0) ? 1 : 0;
}
-#endif
- static int cmpX(SplashXPathSeg *seg0, SplashXPathSeg *seg1) {
+ static int cmpY(const void *seg0, const void *seg1) {
SplashCoord cmp;
- if ((cmp = seg0->xCur0 - seg1->xCur0) == 0) {
- cmp = seg0->dxdy - seg1->dxdy;
- }
+ cmp = ((SplashXPathSeg *)seg0)->y0
+ - ((SplashXPathSeg *)seg1)->y0;
return (cmp > 0) ? 1 : (cmp < 0) ? -1 : 0;
}
- static int cmpXi(const void *p0, const void *p1) {
- return cmpX(*(SplashXPathSeg **)p0, *(SplashXPathSeg **)p1);
- }
-
+#endif
};
//------------------------------------------------------------------------
@@ -81,7 +93,8 @@ public:
// space, via <matrix>. If <closeSubpaths> is true, closes all open
// subpaths.
SplashXPath(SplashPath *path, SplashCoord *matrix,
- SplashCoord flatness, GBool closeSubpaths);
+ SplashCoord flatness, GBool closeSubpaths,
+ GBool simplify, SplashStrokeAdjustMode strokeAdjMode);
// Copy an expanded path.
SplashXPath *copy() { return new SplashXPath(this); }
@@ -95,11 +108,13 @@ public:
private:
+ static void clampCoords(SplashCoord *x, SplashCoord *y);
SplashXPath(SplashXPath *xPath);
void transform(SplashCoord *matrix, SplashCoord xi, SplashCoord yi,
SplashCoord *xo, SplashCoord *yo);
- void strokeAdjust(SplashXPathPoint *pts,
- SplashPathHint *hints, int nHints);
+ GBool strokeAdjust(SplashXPathPoint *pts,
+ SplashPathHint *hints, int nHints,
+ SplashStrokeAdjustMode strokeAdjMode);
void grow(int nSegs);
void addCurve(SplashCoord x0, SplashCoord y0,
SplashCoord x1, SplashCoord y1,
@@ -107,14 +122,19 @@ private:
SplashCoord x3, SplashCoord y3,
SplashCoord flatness,
GBool first, GBool last, GBool end0, GBool end1);
+ void mergeSegments(int first);
void addSegment(SplashCoord x0, SplashCoord y0,
SplashCoord x1, SplashCoord y1);
+ void finishSegments();
SplashXPathSeg *segs;
int length, size; // length and size of segs array
int xMin, xMax;
int yMin, yMax;
+ GBool isRect;
+ SplashCoord rectX0, rectY0, rectX1, rectY1;
+
friend class SplashXPathScanner;
friend class SplashClip;
friend class Splash;