[poppler] poppler/splash: Splash.cc,1.2,1.3 Splash.h,1.1.1.1,1.2

Marco Pesenti Gritti marco at freedesktop.org
Fri Sep 16 11:32:32 PDT 2005


Update of /cvs/poppler/poppler/splash
In directory gabe:/tmp/cvs-serv4782/splash

Modified Files:
	Splash.cc Splash.h 
Log Message:
2005-09-16  Marco Pesenti Gritti  <mpg at redhat.com>

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

        Modified region support from xpdf 3.01



Index: Splash.cc
===================================================================
RCS file: /cvs/poppler/poppler/splash/Splash.cc,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Splash.cc	22 Jul 2005 10:33:54 -0000	1.2
+++ Splash.cc	16 Sep 2005 18:32:30 -0000	1.3
@@ -34,6 +34,7 @@
 Splash::Splash(SplashBitmap *bitmapA) {
   bitmap = bitmapA;
   state = new SplashState(bitmap->width, bitmap->height);
+  clearModRegion();
   debugMode = gFalse;
 }
 
@@ -181,6 +182,36 @@
 }
 
 //------------------------------------------------------------------------
+//------------------------------------------------------------------------
+// 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
 //------------------------------------------------------------------------
 

Index: Splash.h
===================================================================
RCS file: /cvs/poppler/poppler/splash/Splash.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- Splash.h	3 Mar 2005 19:45:59 -0000	1.1.1.1
+++ Splash.h	16 Sep 2005 18:32:30 -0000	1.2
@@ -148,11 +148,21 @@
   // 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 @@
 
   SplashBitmap *bitmap;
   SplashState *state;
+  int modXMin, modYMin, modXMax, modYMax;
   GBool debugMode;
 };
 



More information about the poppler mailing list