1
//========================================================================
3
// SplashXPathScanner.h
5
//========================================================================
7
#ifndef SPLASHXPATHSCANNER_H
8
#define SPLASHXPATHSCANNER_H
12
#ifdef USE_GCC_PRAGMAS
16
#include "SplashTypes.h"
20
struct SplashIntersect;
22
//------------------------------------------------------------------------
24
//------------------------------------------------------------------------
26
class SplashXPathScanner {
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
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);
69
void computeIntersections(int y);
73
int xMin, yMin, xMax, yMax;
75
int interY; // current y value
76
int interIdx; // current index into <inter> - used by
78
int interCount; // current EO/NZWN counter - used by
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