~ubuntu-branches/ubuntu/vivid/emscripten/vivid

« back to all changes in this revision

Viewing changes to tests/poppler/splash/SplashXPathScanner.h

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-05-02 13:11:51 UTC
  • Revision ID: package-import@ubuntu.com-20130502131151-q8dvteqr1ef2x7xz
Tags: upstream-1.4.1~20130504~adb56cb
ImportĀ upstreamĀ versionĀ 1.4.1~20130504~adb56cb

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
16
class SplashXPath;
 
17
class SplashBitmap;
 
18
struct SplashIntersect;
 
19
 
 
20
//------------------------------------------------------------------------
 
21
// SplashXPathScanner
 
22
//------------------------------------------------------------------------
 
23
 
 
24
class SplashXPathScanner {
 
25
public:
 
26
 
 
27
  // Create a new SplashXPathScanner object.  <xPathA> must be sorted.
 
28
  SplashXPathScanner(SplashXPath *xPathA, GBool eoA);
 
29
 
 
30
  ~SplashXPathScanner();
 
31
 
 
32
  // Return the path's bounding box.
 
33
  void getBBox(int *xMinA, int *yMinA, int *xMaxA, int *yMaxA)
 
34
    { *xMinA = xMin; *yMinA = yMin; *xMaxA = xMax; *yMaxA = yMax; }
 
35
 
 
36
  // Return the path's bounding box.
 
37
  void getBBoxAA(int *xMinA, int *yMinA, int *xMaxA, int *yMaxA);
 
38
 
 
39
  // Return the min/max x values for the span at <y>.
 
40
  void getSpanBounds(int y, int *spanXMin, int *spanXMax);
 
41
 
 
42
  // Returns true if (<x>,<y>) is inside the path.
 
43
  GBool test(int x, int y);
 
44
 
 
45
  // Returns true if the entire span ([<x0>,<x1>], <y>) is inside the
 
46
  // path.
 
47
  GBool testSpan(int x0, int x1, int y);
 
48
 
 
49
  // Returns the next span inside the path at <y>.  If <y> is
 
50
  // different than the previous call to getNextSpan, this returns the
 
51
  // first span at <y>; otherwise it returns the next span (relative
 
52
  // to the previous call to getNextSpan).  Returns false if there are
 
53
  // no more spans at <y>.
 
54
  GBool getNextSpan(int y, int *x0, int *x1);
 
55
 
 
56
  // Renders one anti-aliased line into <aaBuf>.  Returns the min and
 
57
  // max x coordinates with non-zero pixels in <x0> and <x1>.
 
58
  void renderAALine(SplashBitmap *aaBuf, int *x0, int *x1, int y);
 
59
 
 
60
  // Clips an anti-aliased line by setting pixels to zero.  On entry,
 
61
  // all non-zero pixels are between <x0> and <x1>.  This function
 
62
  // will update <x0> and <x1>.
 
63
  void clipAALine(SplashBitmap *aaBuf, int *x0, int *x1, int y);
 
64
 
 
65
private:
 
66
 
 
67
  void computeIntersections(int y);
 
68
 
 
69
  SplashXPath *xPath;
 
70
  GBool eo;
 
71
  int xMin, yMin, xMax, yMax;
 
72
 
 
73
  int interY;                   // current y value
 
74
  int interIdx;                 // current index into <inter> - used by
 
75
                                //   getNextSpan 
 
76
  int interCount;               // current EO/NZWN counter - used by
 
77
                                //   getNextSpan
 
78
  int xPathIdx;                 // current index into <xPath> - used by
 
79
                                //   computeIntersections
 
80
  SplashIntersect *inter;       // intersections array for <interY>
 
81
  int interLen;                 // number of intersections in <inter>
 
82
  int interSize;                // size of the <inter> array
 
83
};
 
84
 
 
85
#endif