]>
git.ipfire.org Git - thirdparty/cups.git/blob - pdftops/SplashClip.h
1 //========================================================================
5 //========================================================================
12 #ifdef USE_GCC_PRAGMAS
16 #include "SplashTypes.h"
20 class SplashXPathScanner
;
22 //------------------------------------------------------------------------
24 enum SplashClipResult
{
30 //------------------------------------------------------------------------
32 //------------------------------------------------------------------------
37 // Create a clip, for the given rectangle.
38 SplashClip(SplashCoord x0
, SplashCoord y0
,
39 SplashCoord x1
, SplashCoord y1
);
42 SplashClip
*copy() { return new SplashClip(this); }
46 // Reset the clip to a rectangle.
47 void resetToRect(SplashCoord x0
, SplashCoord y0
,
48 SplashCoord x1
, SplashCoord y1
);
50 // Intersect the clip with a rectangle.
51 SplashError
clipToRect(SplashCoord x0
, SplashCoord y0
,
52 SplashCoord x1
, SplashCoord y1
);
54 // Interesect the clip with <path>.
55 SplashError
clipToPath(SplashPath
*path
, SplashCoord flatness
,
58 // Returns true if (<x>,<y>) is inside the clip.
59 GBool
test(int x
, int y
);
61 // Tests a rectangle against the clipping region. Returns one of:
62 // - splashClipAllInside if the entire rectangle is inside the
63 // clipping region, i.e., all pixels in the rectangle are
65 // - splashClipAllOutside if the entire rectangle is outside the
66 // clipping region, i.e., all the pixels in the rectangle are
68 // - splashClipPartial if the rectangle is part inside and part
69 // outside the clipping region
70 SplashClipResult
testRect(int rectXMin
, int rectYMin
,
71 int rectXMax
, int rectYMax
);
73 // Similar to testRect, but tests a horizontal span.
74 SplashClipResult
testSpan(int spanXMin
, int spanXMax
, int spanY
);
76 // Get the rectangle part of the clip region.
77 int getXMin() { return xMin
; }
78 int getXMax() { return xMax
; }
79 int getYMin() { return yMin
; }
80 int getYMax() { return yMax
; }
82 // Get the number of arbitrary paths used by the clip region.
83 int getNumPaths() { return length
; }
87 SplashClip(SplashClip
*clip
);
88 void grow(int nPaths
);
90 int xMin
, yMin
, xMax
, yMax
;
93 SplashXPathScanner
**scanners
;