[poppler] poppler/glib: poppler-page.cc, 1.23, 1.24 poppler-page.h, 1.15, 1.16 test-poppler-glib.c, 1.12, 1.13

Kristian Hogsberg krh at freedesktop.org
Thu Jun 30 12:44:36 PDT 2005


Update of /cvs/poppler/poppler/glib
In directory gabe:/tmp/cvs-serv5162/glib

Modified Files:
	poppler-page.cc poppler-page.h test-poppler-glib.c 
Log Message:
2005-06-30  Kristian Høgsberg  <krh at redhat.com>

        * glib/poppler-page.h: * glib/poppler-page.cc
        (poppler_page_copy_to_pixbuf): Fix splash compilation (patch from
        Marco).
        (poppler_page_render_to_pixbuf): Drop dest_x and dest_y
        coordinates from this function.  This functionality can be
        achieved using a sub-GdkPixbuf.

        * glib/test-poppler-glib.c (main): Update test case.



Index: poppler-page.cc
===================================================================
RCS file: /cvs/poppler/poppler/glib/poppler-page.cc,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- poppler-page.cc	30 Jun 2005 00:36:01 -0000	1.23
+++ poppler-page.cc	30 Jun 2005 19:44:33 -0000	1.24
@@ -199,7 +199,7 @@
   output_dev->setSurface (surface);
 }
 
-void
+static void
 poppler_page_copy_to_pixbuf (PopplerPage *page,
 			     GdkPixbuf *pixbuf,
 			     OutputDevData *output_dev_data)
@@ -254,6 +254,7 @@
   /* pft */
 }
 
+static void
 poppler_page_copy_to_pixbuf(PopplerPage *page,
 			    GdkPixbuf *pixbuf,
 			    OutputDevData *data)
@@ -279,18 +280,17 @@
   pixbuf_rowstride = gdk_pixbuf_get_rowstride (pixbuf);
   pixbuf_n_channels = gdk_pixbuf_get_n_channels (pixbuf);
 
-  if (dest_x + splash_width > gdk_pixbuf_get_width (pixbuf))
-    splash_width = gdk_pixbuf_get_width (pixbuf) - dest_x;
-  if (dest_y + splash_height > gdk_pixbuf_get_height (pixbuf))
-    splash_height = gdk_pixbuf_get_height (pixbuf) - dest_y;
+  if (splash_width > gdk_pixbuf_get_width (pixbuf))
+    splash_width = gdk_pixbuf_get_width (pixbuf);
+  if (splash_height > gdk_pixbuf_get_height (pixbuf))
+    splash_height = gdk_pixbuf_get_height (pixbuf);
 
   for (y = 0; y < splash_height; y++)
     {
       SplashRGB8 *src;
 
       src = (SplashRGB8 *) (color_ptr.rgb8p + y * splash_rowstride);
-      dst = pixbuf_data + (dest_y + y) * pixbuf_rowstride +
-	dest_x * pixbuf_n_channels;
+      dst = pixbuf_data + y * pixbuf_rowstride;
       for (x = 0; x < splash_width; x++) 
 	{
 	  dst[0] = splashRGB8R(*src);
@@ -313,22 +313,17 @@
  * @src_height: height of rectangle to render
  * @ppp: pixels per point
  * @pixbuf: pixbuf to render into
- * @dest_x: x coordinate of offset into destination
- * @dest_y: y cooridnate of offset into destination
  *
  * First scale the document to match the specified pixels per point,
  * then render the rectangle given by the upper left corner at
- * (src_x, src_y) and src_width and src_height.  The rectangle is
- * rendered into the specified pixmap with the upper left corner
- * placed at (dest_x, dest_y).
+ * (src_x, src_y) and src_width and src_height.
  **/
 void
 poppler_page_render_to_pixbuf (PopplerPage *page,
 			       int src_x, int src_y,
 			       int src_width, int src_height,
 			       double scale,
-			       GdkPixbuf *pixbuf,
-			       int dest_x, int dest_y)
+			       GdkPixbuf *pixbuf)
 {
   OutputDevData data;
 
@@ -418,9 +413,7 @@
 			       PopplerRectangle *old_selection)
 {
   TextOutputDev *text_dev;
-  CairoOutputDev *output_dev;
-  cairo_surface_t *surface;
-  unsigned char *cairo_data;
+  OutputDev *output_dev;
   OutputDevData data;
   PDFRectangle pdf_selection(selection->x1, selection->y1,
 			     selection->x2, selection->y2);

Index: poppler-page.h
===================================================================
RCS file: /cvs/poppler/poppler/glib/poppler-page.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- poppler-page.h	29 Jun 2005 21:24:56 -0000	1.15
+++ poppler-page.h	30 Jun 2005 19:44:33 -0000	1.16
@@ -40,9 +40,7 @@
 						       int                 src_width,
 						       int                 src_height,
 						       double              scale,
-						       GdkPixbuf          *pixbuf,
-						       int                 dest_x,
-						       int                 dest_y);
+						       GdkPixbuf          *pixbuf);
 void                poppler_page_get_size             (PopplerPage        *page,
 						       double             *width,
 						       double             *height);

Index: test-poppler-glib.c
===================================================================
RCS file: /cvs/poppler/poppler/glib/test-poppler-glib.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- test-poppler-glib.c	13 Jun 2005 16:09:33 -0000	1.12
+++ test-poppler-glib.c	30 Jun 2005 19:44:33 -0000	1.13
@@ -135,7 +135,7 @@
 
   pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, 220, 220);
   gdk_pixbuf_fill (pixbuf, 0x00106000);
-  poppler_page_render_to_pixbuf (page, 100, 100, 200, 200, 1, pixbuf, 10, 10);
+  poppler_page_render_to_pixbuf (page, 100, 100, 200, 200, 1, pixbuf);
 
   gdk_pixbuf_save (pixbuf, "slice.png", "png", &error, NULL);
   printf ("\tslice:\t\tsaved 200x200 slice at (100, 100) as slice.png\n");



More information about the poppler mailing list