Fix for initialization of scalos preferences library. Library is now loaded only...
[AROS-Contrib.git] / arospdf / splash / SplashXPathScanner.h
blobab02fcc999ea62fb235e9a5f89ba61c8486c4cfb
1 //========================================================================
2 //
3 // SplashXPathScanner.h
4 //
5 //========================================================================
7 #ifndef SPLASHXPATHSCANNER_H
8 #define SPLASHXPATHSCANNER_H
10 #include <aconf.h>
12 #ifdef USE_GCC_PRAGMAS
13 #pragma interface
14 #endif
16 #include "SplashTypes.h"
18 class SplashXPath;
19 class SplashBitmap;
20 struct SplashIntersect;
22 //------------------------------------------------------------------------
23 // SplashXPathScanner
24 //------------------------------------------------------------------------
26 class SplashXPathScanner {
27 public:
29 // Create a new SplashXPathScanner object. <xPathA> must be sorted.
30 SplashXPathScanner(SplashXPath *xPathA, GBool eoA);
32 ~SplashXPathScanner();
34 // Return the path's bounding box.
35 void getBBox(int *xMinA, int *yMinA, int *xMaxA, int *yMaxA)
36 { *xMinA = xMin; *yMinA = yMin; *xMaxA = xMax; *yMaxA = yMax; }
38 // Return the path's bounding box.
39 void getBBoxAA(int *xMinA, int *yMinA, int *xMaxA, int *yMaxA);
41 // Return the min/max x values for the span at <y>.
42 void getSpanBounds(int y, int *spanXMin, int *spanXMax);
44 // Returns true if (<x>,<y>) is inside the path.
45 GBool test(int x, int y);
47 // Returns true if the entire span ([<x0>,<x1>], <y>) is inside the
48 // path.
49 GBool testSpan(int x0, int x1, int y);
51 // Returns the next span inside the path at <y>. If <y> is
52 // different than the previous call to getNextSpan, this returns the
53 // first span at <y>; otherwise it returns the next span (relative
54 // to the previous call to getNextSpan). Returns false if there are
55 // no more spans at <y>.
56 GBool getNextSpan(int y, int *x0, int *x1);
58 // Renders one anti-aliased line into <aaBuf>. Returns the min and
59 // max x coordinates with non-zero pixels in <x0> and <x1>.
60 void renderAALine(SplashBitmap *aaBuf, int *x0, int *x1, int y);
62 // Clips an anti-aliased line by setting pixels to zero. On entry,
63 // all non-zero pixels are between <x0> and <x1>. This function
64 // will update <x0> and <x1>.
65 void clipAALine(SplashBitmap *aaBuf, int *x0, int *x1, int y);
67 private:
69 void computeIntersections(int y);
71 SplashXPath *xPath;
72 GBool eo;
73 int xMin, yMin, xMax, yMax;
75 int interY; // current y value
76 int interIdx; // current index into <inter> - used by
77 // getNextSpan
78 int interCount; // current EO/NZWN counter - used by
79 // getNextSpan
80 int xPathIdx; // current index into <xPath> - used by
81 // computeIntersections
82 SplashIntersect *inter; // intersections array for <interY>
83 int interLen; // number of intersections in <inter>
84 int interSize; // size of the <inter> array
87 #endif