[poppler] [PATCH 3/5] user getline in drawImageMask

Jeff Muizelaar jrmuizel at nit.ca
Fri Mar 4 11:33:58 PST 2005


2005-03-02  Jeff Muizelaar  <jrmuizel at nit.ca>

	* poppler/CairoOutputDev.cc (CairoOutputDev::drawImageMask):
	Use getLine instead of getPixel.


diff -urp 04-type3-null/poppler/CairoOutputDev.cc 05-mask-getline/poppler/CairoOutputDev.cc
--- 04-type3-null/poppler/CairoOutputDev.cc	2005-03-02 12:43:36.000000000 -0500
+++ 05-mask-getline/poppler/CairoOutputDev.cc	2005-03-02 14:52:13.000000000 -0500
@@ -457,7 +457,6 @@ void CairoOutputDev::drawImageMask(GfxSt
   cairo_surface_t *image;
   int x, y;
   ImageStream *imgStr;
-  Guchar pix;
   double *ctm;
   cairo_matrix_t *mat;
 
@@ -474,13 +473,10 @@ void CairoOutputDev::drawImageMask(GfxSt
   imgStr->reset();
 
   for (y = 0; y < height; y++) {
+    Guchar *pix = imgStr->getLine();
     dest = buffer + y * width;
     for (x = 0; x < width; x++) {
-      imgStr->getPixel(&pix);
-      if (invert)
-	pix ^= 1;
-      
-      if (pix)
+      if (invert ? !pix[x] : pix[x])
 	*dest++ = 0;
       else
 	*dest++ = 255;


More information about the poppler mailing list