1
//========================================================================
3
// SplashXPathScanner.h
5
//========================================================================
7
#ifndef SPLASHXPATHSCANNER_H
8
#define SPLASHXPATHSCANNER_H
10
#ifdef USE_GCC_PRAGMAS
14
#include "SplashTypes.h"
18
struct SplashIntersect;
20
//------------------------------------------------------------------------
22
//------------------------------------------------------------------------
24
class SplashXPathScanner {
27
// Create a new SplashXPathScanner object. <xPathA> must be sorted.
28
SplashXPathScanner(SplashXPath *xPathA, GBool eoA);
30
~SplashXPathScanner();
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; }
36
// Return the path's bounding box.
37
void getBBoxAA(int *xMinA, int *yMinA, int *xMaxA, int *yMaxA);
39
// Return the min/max x values for the span at <y>.
40
void getSpanBounds(int y, int *spanXMin, int *spanXMax);
42
// Returns true if (<x>,<y>) is inside the path.
43
GBool test(int x, int y);
45
// Returns true if the entire span ([<x0>,<x1>], <y>) is inside the
47
GBool testSpan(int x0, int x1, int y);
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);
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);
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);
67
void computeIntersections(int y);
71
int xMin, yMin, xMax, yMax;
73
int interY; // current y value
74
int interIdx; // current index into <inter> - used by
76
int interCount; // current EO/NZWN counter - used by
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