~ubuntu-branches/ubuntu/lucid/swftools/lucid

« back to all changes in this revision

Viewing changes to lib/pdf/xpdf/SplashXPathScanner.h

  • Committer: Bazaar Package Importer
  • Author(s): Fabrice Coutadeur
  • Date: 2009-04-30 05:22:19 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090430052219-l1n64qofzeq5pej8
Tags: 0.9.0-0ubuntu1
* New upstream release (LP: #369931)
  - patches/01_manpages: edited to match updated version of src/pdf2swf.1 and
    src/wav2swf.1
  - patches/02_faq: edited to match updated version of FAQ
  - patches/04_makefile: edited to delete the patch on lib/Makefile.in and 
    src/Makefile.in (applied upstream)
  - deleted patch 99_configure_for_python2.5_and_2.6 (applied upstream)
  - debian/swftools.doc: deleted installation of TODO and 
    pdf2swf/HOWTO_pdf2swf as they don't exist anymore

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
#include <aconf.h>
 
11
 
 
12
#ifdef USE_GCC_PRAGMAS
 
13
#pragma interface
 
14
#endif
 
15
 
 
16
#include "SplashTypes.h"
 
17
 
 
18
class SplashXPath;
 
19
class SplashBitmap;
 
20
struct SplashIntersect;
 
21
 
 
22
//------------------------------------------------------------------------
 
23
// SplashXPathScanner
 
24
//------------------------------------------------------------------------
 
25
 
 
26
class SplashXPathScanner {
 
27
public:
 
28
 
 
29
  // Create a new SplashXPathScanner object.  <xPathA> must be sorted.
 
30
  SplashXPathScanner(SplashXPath *xPathA, GBool eoA);
 
31
 
 
32
  ~SplashXPathScanner();
 
33
 
 
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; }
 
37
 
 
38
  // Return the path's bounding box.
 
39
  void getBBoxAA(int *xMinA, int *yMinA, int *xMaxA, int *yMaxA);
 
40
 
 
41
  // Return the min/max x values for the span at <y>.
 
42
  void getSpanBounds(int y, int *spanXMin, int *spanXMax);
 
43
 
 
44
  // Returns true if (<x>,<y>) is inside the path.
 
45
  GBool test(int x, int y);
 
46
 
 
47
  // Returns true if the entire span ([<x0>,<x1>], <y>) is inside the
 
48
  // path.
 
49
  GBool testSpan(int x0, int x1, int y);
 
50
 
 
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);
 
57
 
 
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);
 
61
 
 
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);
 
66
 
 
67
private:
 
68
 
 
69
  void computeIntersections(int y);
 
70
 
 
71
  SplashXPath *xPath;
 
72
  GBool eo;
 
73
  int xMin, yMin, xMax, yMax;
 
74
 
 
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
 
85
};
 
86
 
 
87
#endif