Commit 6cbe76bc authored by Marco Pesenti Gritti's avatar Marco Pesenti Gritti

2005-09-16 Marco Pesenti Gritti <mpg@redhat.com>

        * poppler/SplashOutputDev.h:
        * splash/Splash.cc:
        * splash/Splash.h:

        Modified region support from xpdf 3.01
parent a9df3f32
2005-09-16 Marco Pesenti Gritti <mpg@redhat.com>
* poppler/SplashOutputDev.h:
* splash/Splash.cc:
* splash/Splash.h:
Modified region support from xpdf 3.01
2005-09-16 Marco Pesenti Gritti <mpg@redhat.com>
* goo/Makefile.am:
......
......@@ -148,6 +148,11 @@ public:
// is passed to Splash::setFillPattern, so it should not be used
// after calling this function.
void xorRectangle(int x0, int y0, int x1, int y1, SplashPattern *pattern);
// Get the modified region.
void getModRegion(int *xMin, int *yMin, int *xMax, int *yMax);
// Clear the modified region.
void clearModRegion();
// Set the Splash fill color.
void setFillColor(int r, int g, int b);
......
......@@ -34,6 +34,7 @@
Splash::Splash(SplashBitmap *bitmapA) {
bitmap = bitmapA;
state = new SplashState(bitmap->width, bitmap->height);
clearModRegion();
debugMode = gFalse;
}
......@@ -180,6 +181,36 @@ SplashError Splash::restoreState() {
return splashOk;
}
//------------------------------------------------------------------------
//------------------------------------------------------------------------
// modified region
//------------------------------------------------------------------------
void Splash::clearModRegion() {
modXMin = bitmap->getWidth();
modYMin = bitmap->getHeight();
modXMax = -1;
modYMax = -1;
}
inline void Splash::updateModX(int x) {
if (x < modXMin) {
modXMin = x;
}
if (x > modXMax) {
modXMax = x;
}
}
inline void Splash::updateModY(int y) {
if (y < modYMin) {
modYMin = y;
}
if (y > modYMax) {
modYMax = y;
}
}
//------------------------------------------------------------------------
// drawing operations
//------------------------------------------------------------------------
......
......@@ -148,11 +148,21 @@ public:
// Return the associated bitmap.
SplashBitmap *getBitmap() { return bitmap; }
// Get a bounding box which includes all modifications since the
// last call to clearModRegion.
void getModRegion(int *xMin, int *yMin, int *xMax, int *yMax)
{ *xMin = modXMin; *yMin = modYMin; *xMax = modXMax; *yMax = modYMax; }
// Clear the modified region bounding box.
void clearModRegion();
// Toggle debug mode on or off.
void setDebugMode(GBool debugModeA) { debugMode = debugModeA; }
private:
void updateModX(int x);
void updateModY(int y);
void strokeNarrow(SplashXPath *xPath);
void strokeWide(SplashXPath *xPath);
SplashXPath *makeDashedPath(SplashXPath *xPath);
......@@ -168,6 +178,7 @@ private:
SplashBitmap *bitmap;
SplashState *state;
int modXMin, modYMin, modXMax, modYMax;
GBool debugMode;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment