source: trunk/poppler/mypoppler/splash/SplashXPathScanner.h @ 2

Last change on this file since 2 was 2, checked in by Eugene Romanenko, 15 years ago

First import

File size: 2.1 KB
Line 
1//========================================================================
2//
3// SplashXPathScanner.h
4//
5//========================================================================
6
7#ifndef SPLASHXPATHSCANNER_H
8#define SPLASHXPATHSCANNER_H
9
10#ifdef USE_GCC_PRAGMAS
11#pragma interface
12#endif
13
14#include "SplashTypes.h"
15
16class SplashXPath;
17struct SplashIntersect;
18
19//------------------------------------------------------------------------
20// SplashXPathScanner
21//------------------------------------------------------------------------
22
23class SplashXPathScanner {
24public:
25
26  // Create a new SplashXPathScanner object.  <xPathA> must be sorted.
27  SplashXPathScanner(SplashXPath *xPathA, GBool eoA);
28
29  ~SplashXPathScanner();
30
31  // Return the path's bounding box.
32  void getBBox(int *xMinA, int *yMinA, int *xMaxA, int *yMaxA)
33    { *xMinA = xMin; *yMinA = yMin; *xMaxA = xMax; *yMaxA = yMax; }
34
35  // Return the min/max x values for the span at <y>.
36  void getSpanBounds(int y, int *spanXMin, int *spanXMax);
37
38  // Returns true if (<x>,<y>) is inside the path.
39  GBool test(int x, int y);
40
41  // Returns true if the entire span ([<x0>,<x1>], <y>) is inside the
42  // path.
43  GBool testSpan(int x0, int x1, int y);
44
45  // Returns the next span inside the path at <y>.  If <y> is
46  // different than the previous call to getNextSpan, this returns the
47  // first span at <y>; otherwise it returns the next span (relative
48  // to the previous call to getNextSpan).  Returns false if there are
49  // no more spans at <y>.
50  GBool getNextSpan(int y, int *x0, int *x1);
51
52private:
53
54  void computeIntersections(int y);
55
56  SplashXPath *xPath;
57  GBool eo;
58  int xMin, yMin, xMax, yMax;
59
60  int interY;                   // current y value
61  int interIdx;                 // current index into <inter> - used by
62                                //   getNextSpan
63  int interCount;               // current EO/NZWN counter - used by
64                                //   getNextSpan
65  int xPathIdx;                 // current index into <xPath> - used by
66                                //   computeIntersections
67  SplashIntersect *inter;       // intersections array for <interY>
68  int interLen;                 // number of intersections in <inter>
69  int interSize;                // size of the <inter> array
70};
71
72#endif
Note: See TracBrowser for help on using the repository browser.