[poppler] poppler/qt4/src: poppler-page.cc, 1.8, 1.9 poppler-qt4.h, 1.16, 1.17

Albert Astals Cid aacid at freedesktop.org
Sat Dec 10 02:52:18 PST 2005


Update of /cvs/poppler/poppler/qt4/src
In directory gabe:/tmp/cvs-serv18249/qt4/src

Modified Files:
	poppler-page.cc poppler-qt4.h 
Log Message:
* qt4/src/poppler-page.cc:
* qt4/src/poppler-qt4.h:
* qt4/src/tests/test-poppler-qt4.cpp: The parameters x,y,w,h to the
  method splashRenderToPixmap are now used. Convenient
  defaults are provided. The test has been changed accordingly. Some
  added documentation. Patch by Stefan Kebekus


Index: poppler-page.cc
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/poppler-page.cc,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- poppler-page.cc	3 Dec 2005 21:35:46 -0000	1.8
+++ poppler-page.cc	10 Dec 2005 10:52:16 -0000	1.9
@@ -51,7 +51,7 @@
   delete m_page;
 }
 
-QPixmap *Page::splashRenderToPixmap(int x, int y, int w, int h, double xres, double yres) const
+QPixmap *Page::splashRenderToPixmap(double xres, double yres, int x, int y, int w, int h) const
 {
   SplashColor white;
   white[0] = 255;
@@ -61,7 +61,7 @@
   output_dev->startDoc(m_page->parentDoc->m_doc->doc.getXRef ());
   
   m_page->parentDoc->m_doc->doc.displayPageSlice(output_dev, m_page->index + 1, xres, yres,
-						 0, false, true, false, -1, -1, -1, -1);
+						 0, false, true, false, x, y, w, h);
   
   SplashBitmap *bitmap = output_dev->getBitmap ();
   int bw = bitmap->getWidth();

Index: poppler-qt4.h
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/poppler-qt4.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- poppler-qt4.h	7 Dec 2005 08:31:09 -0000	1.16
+++ poppler-qt4.h	10 Dec 2005 10:52:16 -0000	1.17
@@ -152,23 +152,38 @@
 delete pixmap;
 @endcode
 
-	   @param x UNUSED
+           If x=y=w=h=-1, the method will automatically compute the
+           size of the pixmap from the horizontal and vertical
+           resolutions specified in xres and yres. Otherwise, the
+           method renders only a part of the page, specified by the
+           parameters (x, y, w, h) in pixel coordinates. The QPixmap
+           returned then has size (w, h), independent of the page
+           size.
 
-	   @param y UNUSED
+	   @param x specifies the left x-coordinate of the box, in
+	   pixels.
 
-	   @param w UNUSED
+	   @param y specifies the top y-coordinate of the box, in
+	   pixels.
 
-	   @param h UNUSED
+	   @param w specifies the width of the box, in pixels.
+
+	   @param h specifies the height of the box, in pixels.
 
 	   @param xres horizontal resolution of the graphics device,
 	   in dots per inch
 
-	   @param yres vertical resolution of the graphics device,
-	   in dots per inch
+	   @param yres vertical resolution of the graphics device, in
+	   dots per inch
 
-	   @returns pointer to a QPixmap, or NULL on failure. The pixmap returned must be deleted.
+	   @warning The parameter (x,y,w,h) are not
+	   well-tested. Unusual or meaningless paramerts may lead to
+	   rather unexpexted results.
+
+	   @returns pointer to a QPixmap, or NULL on failure. The
+	   pixmap returned must be deleted.
 	 */
-	QPixmap *splashRenderToPixmap(int x, int y, int w, int h, double xres=72.0, double yres=72.0) const;
+	QPixmap *splashRenderToPixmap(double xres=72.0, double yres=72.0, int x=-1, int y=-1, int w=-1, int h=-1) const;
 	
 	/**
 	   Render the page to a pixmap using the Arthur (Qt4) renderer



More information about the poppler mailing list