[poppler] poppler/ArthurOutputDev.cc poppler/ArthurOutputDev.h poppler/CairoOutputDev.cc poppler/CairoOutputDev.h poppler/Gfx.cc poppler/OutputDev.cc poppler/OutputDev.h poppler/PreScanOutputDev.cc poppler/PreScanOutputDev.h poppler/PSOutputDev.cc poppler/PSOutputDev.h poppler/SplashOutputDev.cc poppler/SplashOutputDev.h utils/HtmlOutputDev.cc utils/HtmlOutputDev.h utils/ImageOutputDev.cc utils/ImageOutputDev.h

Carlos Garcia Campos carlosgc at kemper.freedesktop.org
Fri Jun 19 00:38:44 PDT 2009


 poppler/ArthurOutputDev.cc  |    4 -
 poppler/ArthurOutputDev.h   |    5 +-
 poppler/CairoOutputDev.cc   |   92 +++++++++++++++++++++++++-------------------
 poppler/CairoOutputDev.h    |   48 ++++++++++++----------
 poppler/Gfx.cc              |   49 ++++++++++++++++++++---
 poppler/OutputDev.cc        |   17 +++++---
 poppler/OutputDev.h         |   13 +++---
 poppler/PSOutputDev.cc      |    8 ++-
 poppler/PSOutputDev.h       |    8 ++-
 poppler/PreScanOutputDev.cc |   25 ++++++++++-
 poppler/PreScanOutputDev.h  |   25 ++++++++++-
 poppler/SplashOutputDev.cc  |   16 +++++--
 poppler/SplashOutputDev.h   |   12 +++--
 utils/HtmlOutputDev.cc      |   16 +++----
 utils/HtmlOutputDev.h       |    7 +--
 utils/ImageOutputDev.cc     |   20 ++++-----
 utils/ImageOutputDev.h      |   12 +++--
 17 files changed, 248 insertions(+), 129 deletions(-)

New commits:
commit 7248da095f67d57c3999cee7d980e62fd8a7cf49
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date:   Fri Jun 19 09:37:02 2009 +0200

    Use Interpolate flag to decide whether applying image interpolation during rendering
    
    Fixes bug #9860

diff --git a/poppler/ArthurOutputDev.cc b/poppler/ArthurOutputDev.cc
index 306fbfa..ea00f59 100644
--- a/poppler/ArthurOutputDev.cc
+++ b/poppler/ArthurOutputDev.cc
@@ -665,7 +665,7 @@ void ArthurOutputDev::endTextObject(GfxState *state)
 
 void ArthurOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
 				    int width, int height, GBool invert,
-				    GBool inlineImg)
+				    GBool interpolate, GBool inlineImg)
 {
   qDebug() << "drawImageMask";
 #if 0
@@ -743,7 +743,7 @@ void ArthurOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
 void ArthurOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
 				int width, int height,
 				GfxImageColorMap *colorMap,
-				int *maskColors, GBool inlineImg)
+				GBool interpolate, int *maskColors, GBool inlineImg)
 {
   unsigned char *buffer;
   unsigned int *dest;
diff --git a/poppler/ArthurOutputDev.h b/poppler/ArthurOutputDev.h
index 35a147e..1b80088 100644
--- a/poppler/ArthurOutputDev.h
+++ b/poppler/ArthurOutputDev.h
@@ -15,6 +15,7 @@
 //
 // Copyright (C) 2005 Brad Hards <bradh at frogmouth.net>
 // Copyright (C) 2005 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2009 Carlos Garcia Campos <carlosgc at gnome.org>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -126,10 +127,10 @@ public:
   //----- image drawing
   virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
 			     int width, int height, GBool invert,
-			     GBool inlineImg);
+			     GBool interpolate, GBool inlineImg);
   virtual void drawImage(GfxState *state, Object *ref, Stream *str,
 			 int width, int height, GfxImageColorMap *colorMap,
-			 int *maskColors, GBool inlineImg);
+			 GBool interpolate, int *maskColors, GBool inlineImg);
 
   //----- Type 3 font operators
   virtual void type3D0(GfxState *state, double wx, double wy);
diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc
index 199e5ea..2fa9815 100644
--- a/poppler/CairoOutputDev.cc
+++ b/poppler/CairoOutputDev.cc
@@ -475,8 +475,6 @@ void CairoOutputDev::updateFont(GfxState *state) {
   if (!currentFont)
     return;
 
-  LOG(printf ("font matrix: %f %f %f %f\n", m11, m12, m21, m22));
-  
   font_face = currentFont->getFontFace();
   cairo_set_font_face (cairo, font_face);
  
@@ -493,6 +491,8 @@ void CairoOutputDev::updateFont(GfxState *state) {
   matrix.x0 = 0;
   matrix.y0 = 0;
 
+  LOG(printf ("font matrix: %f %f %f %f\n", matrix.xx, matrix.yx, matrix.xy, matrix.yy));
+
  /* Make sure the font matrix is invertible before setting it.  cairo
   * will blow up if we give it a matrix that's not invertible, so we
   * need to check before passing it to cairo_set_font_matrix. Ignoring it
@@ -1105,8 +1105,8 @@ void CairoOutputDev::endMaskClip(GfxState *state) {
 }
 
 void CairoOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
-				    int width, int height, GBool invert,
-				    GBool inlineImg) {
+				   int width, int height, GBool invert,
+				   GBool interpolate, GBool inlineImg) {
 
   /* FIXME: Doesn't the image mask support any colorspace? */
   cairo_set_source (cairo, fill_pattern);
@@ -1133,15 +1133,15 @@ void CairoOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
   //XXX: it is possible that we should only do sub pixel positioning if 
   // we are rendering fonts */
   if (!printing && prescaleImages && matrix.xy == 0.0 && matrix.yx == 0.0) {
-    drawImageMaskPrescaled(state, ref, str, width, height, invert, inlineImg);
+    drawImageMaskPrescaled(state, ref, str, width, height, invert, interpolate, inlineImg);
   } else {
-    drawImageMaskRegular(state, ref, str, width, height, invert, inlineImg);
+    drawImageMaskRegular(state, ref, str, width, height, invert, interpolate, inlineImg);
   }
 }
 
 void CairoOutputDev::drawImageMaskRegular(GfxState *state, Object *ref, Stream *str,
-				    int width, int height, GBool invert,
-				    GBool inlineImg) {
+					  int width, int height, GBool invert,
+					  GBool interpolate, GBool inlineImg) {
   unsigned char *buffer;
   unsigned char *dest;
   cairo_surface_t *image;
@@ -1200,7 +1200,8 @@ void CairoOutputDev::drawImageMaskRegular(GfxState *state, Object *ref, Stream *
   /* we should actually be using CAIRO_FILTER_NEAREST here. However,
    * cairo doesn't yet do minifaction filtering causing scaled down
    * images with CAIRO_FILTER_NEAREST to look really bad */
-  cairo_pattern_set_filter (pattern, CAIRO_FILTER_BEST);
+  cairo_pattern_set_filter (pattern,
+			    interpolate ? CAIRO_FILTER_BEST : CAIRO_FILTER_FAST);
 
   cairo_mask (cairo, pattern);
 
@@ -1230,8 +1231,8 @@ void CairoOutputDev::drawImageMaskRegular(GfxState *state, Object *ref, Stream *
 
 
 void CairoOutputDev::drawImageMaskPrescaled(GfxState *state, Object *ref, Stream *str,
-				    int width, int height, GBool invert,
-				    GBool inlineImg) {
+					    int width, int height, GBool invert,
+					    GBool interpolate, GBool inlineImg) {
   unsigned char *buffer;
   cairo_surface_t *image;
   cairo_pattern_t *pattern;
@@ -1458,7 +1459,8 @@ void CairoOutputDev::drawImageMaskPrescaled(GfxState *state, Object *ref, Stream
   /* we should actually be using CAIRO_FILTER_NEAREST here. However,
    * cairo doesn't yet do minifaction filtering causing scaled down
    * images with CAIRO_FILTER_NEAREST to look really bad */
-  cairo_pattern_set_filter (pattern, CAIRO_FILTER_BEST);
+  cairo_pattern_set_filter (pattern,
+			    interpolate ? CAIRO_FILTER_BEST : CAIRO_FILTER_FAST);
 
   cairo_save (cairo);
 
@@ -1503,10 +1505,12 @@ void CairoOutputDev::drawImageMaskPrescaled(GfxState *state, Object *ref, Stream
 }
 
 void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref,
-				Stream *str, int width, int height,
-				GfxImageColorMap *colorMap,
-				Stream *maskStr, int maskWidth,
-				int maskHeight, GBool maskInvert)
+				     Stream *str, int width, int height,
+				     GfxImageColorMap *colorMap,
+				     GBool interpolate,
+				     Stream *maskStr, int maskWidth,
+				     int maskHeight, GBool maskInvert,
+				     GBool maskInterpolate)
 {
   ImageStream *maskImgStr;
   maskImgStr = new ImageStream(maskStr, maskWidth, 1, 1);
@@ -1594,7 +1598,10 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref,
   cairo_pattern_set_matrix (pattern, &matrix);
   cairo_pattern_set_matrix (maskPattern, &matrix);
 
-  cairo_pattern_set_filter (pattern, CAIRO_FILTER_BILINEAR);
+  cairo_pattern_set_filter (pattern,
+			    interpolate ? CAIRO_FILTER_BILINEAR : CAIRO_FILTER_FAST);
+  cairo_pattern_set_filter (maskPattern,
+			    maskInterpolate ? CAIRO_FILTER_BILINEAR : CAIRO_FILTER_FAST);
   cairo_set_source (cairo, pattern);
   cairo_mask (cairo, maskPattern);
 
@@ -1627,11 +1634,13 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref,
 
 //XXX: is this affect by AIS(alpha is shape)?
 void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
-				int width, int height,
-				GfxImageColorMap *colorMap,
-				Stream *maskStr,
-				int maskWidth, int maskHeight,
-				GfxImageColorMap *maskColorMap)
+					 int width, int height,
+					 GfxImageColorMap *colorMap,
+					 GBool interpolate,
+					 Stream *maskStr,
+					 int maskWidth, int maskHeight,
+					 GfxImageColorMap *maskColorMap,
+					 GBool maskInterpolate)
 {
   ImageStream *maskImgStr;
   maskImgStr = new ImageStream(maskStr, maskWidth,
@@ -1716,8 +1725,10 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s
   cairo_pattern_set_matrix (maskPattern, &maskMatrix);
 
   //XXX: should set mask filter
-  cairo_pattern_set_filter (pattern, CAIRO_FILTER_BILINEAR);
-  cairo_pattern_set_filter (maskPattern, CAIRO_FILTER_BILINEAR);
+  cairo_pattern_set_filter (pattern,
+			    interpolate ? CAIRO_FILTER_BILINEAR : CAIRO_FILTER_FAST);
+  cairo_pattern_set_filter (maskPattern,
+			    maskInterpolate ? CAIRO_FILTER_BILINEAR : CAIRO_FILTER_FAST);
   cairo_set_source (cairo, pattern);
   cairo_mask (cairo, maskPattern);
 
@@ -1748,9 +1759,10 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s
   delete imgStr;
 }
 void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
-				int width, int height,
-				GfxImageColorMap *colorMap,
-				int *maskColors, GBool inlineImg)
+			       int width, int height,
+			       GfxImageColorMap *colorMap,
+			       GBool interpolate,
+			       int *maskColors, GBool inlineImg)
 {
   unsigned char *buffer;
   unsigned int *dest;
@@ -1830,7 +1842,8 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
 
   cairo_pattern_set_matrix (pattern, &matrix);
 
-  cairo_pattern_set_filter (pattern, CAIRO_FILTER_BILINEAR);
+  cairo_pattern_set_filter (pattern,
+			    interpolate ? CAIRO_FILTER_BILINEAR : CAIRO_FILTER_FAST);
   cairo_set_source (cairo, pattern);
   cairo_paint (cairo);
 
@@ -1891,7 +1904,7 @@ void CairoImageOutputDev::saveImage(CairoImage *image)
 
 void CairoImageOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
 					int width, int height, GBool invert,
-					GBool inlineImg)
+					GBool interpolate, GBool inlineImg)
 {
   cairo_t *cr;
   cairo_surface_t *surface;
@@ -1923,7 +1936,7 @@ void CairoImageOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *st
     cairo_translate (cr, 0, height);
     cairo_scale (cr, width, -height);
 
-    CairoOutputDev::drawImageMask(state, ref, str, width, height, invert, inlineImg);
+    CairoOutputDev::drawImageMask(state, ref, str, width, height, invert, interpolate, inlineImg);
     image->setImage (surface);
 
     setCairo (NULL);
@@ -1934,7 +1947,7 @@ void CairoImageOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *st
 
 void CairoImageOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
 				    int width, int height, GfxImageColorMap *colorMap,
-				    int *maskColors, GBool inlineImg)
+				    GBool interpolate, int *maskColors, GBool inlineImg)
 {
   cairo_t *cr;
   cairo_surface_t *surface;
@@ -1966,7 +1979,7 @@ void CairoImageOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
     cairo_translate (cr, 0, height);
     cairo_scale (cr, width, -height);
     
-    CairoOutputDev::drawImage(state, ref, str, width, height, colorMap, maskColors, inlineImg);
+    CairoOutputDev::drawImage(state, ref, str, width, height, colorMap, interpolate, maskColors, inlineImg);
     image->setImage (surface);
     
     setCairo (NULL);
@@ -1978,9 +1991,11 @@ void CairoImageOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
 void CairoImageOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
 					      int width, int height,
 					      GfxImageColorMap *colorMap,
+					      GBool interpolate,
 					      Stream *maskStr,
 					      int maskWidth, int maskHeight,
-					      GfxImageColorMap *maskColorMap)
+					      GfxImageColorMap *maskColorMap,
+					      GBool maskInterpolate)
 {
   cairo_t *cr;
   cairo_surface_t *surface;
@@ -2012,8 +2027,8 @@ void CairoImageOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stre
     cairo_translate (cr, 0, height);
     cairo_scale (cr, width, -height);
     
-    CairoOutputDev::drawSoftMaskedImage(state, ref, str, width, height, colorMap,
-					maskStr, maskWidth, maskHeight, maskColorMap);
+    CairoOutputDev::drawSoftMaskedImage(state, ref, str, width, height, colorMap, interpolate,
+					maskStr, maskWidth, maskHeight, maskColorMap, maskInterpolate);
     image->setImage (surface);
     
     setCairo (NULL);
@@ -2025,9 +2040,10 @@ void CairoImageOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stre
 void CairoImageOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str,
 					  int width, int height,
 					  GfxImageColorMap *colorMap,
+					  GBool interpolate,
 					  Stream *maskStr,
 					  int maskWidth, int maskHeight,
-					  GBool maskInvert)
+					  GBool maskInvert, GBool maskInterpolate)
 {
   cairo_t *cr;
   cairo_surface_t *surface;
@@ -2059,8 +2075,8 @@ void CairoImageOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *
     cairo_translate (cr, 0, height);
     cairo_scale (cr, width, -height);
     
-    CairoOutputDev::drawMaskedImage(state, ref, str, width, height, colorMap,
-				    maskStr, maskWidth, maskHeight, maskInvert);
+    CairoOutputDev::drawMaskedImage(state, ref, str, width, height, colorMap, interpolate,
+				    maskStr, maskWidth, maskHeight, maskInvert, maskInterpolate);
     image->setImage (surface);
     
     setCairo (NULL);
diff --git a/poppler/CairoOutputDev.h b/poppler/CairoOutputDev.h
index 7a9283f..5af832d 100644
--- a/poppler/CairoOutputDev.h
+++ b/poppler/CairoOutputDev.h
@@ -17,7 +17,7 @@
 // Copyright (C) 2005-2008 Jeff Muizelaar <jeff at infidigm.net>
 // Copyright (C) 2005, 2006 Kristian Høgsberg <krh at redhat.com>
 // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev at yandex.ru>
-// Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc at gnome.org>
+// Copyright (C) 2006-2009 Carlos Garcia Campos <carlosgc at gnome.org>
 // Copyright (C) 2008 Adrian Johnson <ajohnson at redneon.com>
 // Copyright (C) 2008 Michael Vrable <mvrable at cs.ucsd.edu>
 //
@@ -180,31 +180,34 @@ public:
 
   //----- image drawing
   virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
-			     int width, int height, GBool invert,
+			     int width, int height, GBool invert, GBool interpolate,
 			     GBool inlineImg);
   void drawImageMaskPrescaled(GfxState *state, Object *ref, Stream *str,
-			     int width, int height, GBool invert,
-			     GBool inlineImg);
+			      int width, int height, GBool invert, GBool interpolate,
+			      GBool inlineImg);
   void drawImageMaskRegular(GfxState *state, Object *ref, Stream *str,
-			     int width, int height, GBool invert,
-			     GBool inlineImg);
+			    int width, int height, GBool invert, GBool interpolate,
+			    GBool inlineImg);
 
   virtual void drawImage(GfxState *state, Object *ref, Stream *str,
 			 int width, int height, GfxImageColorMap *colorMap,
-			 int *maskColors, GBool inlineImg);
+			 GBool interpolate, int *maskColors, GBool inlineImg);
   virtual void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
-				int width, int height,
-				GfxImageColorMap *colorMap,
-				Stream *maskStr,
-				int maskWidth, int maskHeight,
-				GfxImageColorMap *maskColorMap);
+				   int width, int height,
+				   GfxImageColorMap *colorMap,
+				   GBool interpolate,
+				   Stream *maskStr,
+				   int maskWidth, int maskHeight,
+				   GfxImageColorMap *maskColorMap,
+				   GBool maskInterpolate);
 
   virtual void drawMaskedImage(GfxState *state, Object *ref, Stream *str,
-				int width, int height,
-				GfxImageColorMap *colorMap,
-				Stream *maskStr,
-				int maskWidth, int maskHeight,
-				GBool maskInvert);
+			       int width, int height,
+			       GfxImageColorMap *colorMap,
+			       GBool interpolate,
+			       Stream *maskStr,
+			       int maskWidth, int maskHeight,
+			       GBool maskInvert, GBool maskInterpolate);
 
   //----- transparency groups and soft masks
   virtual void beginTransparencyGroup(GfxState * /*state*/, double * /*bbox*/,
@@ -365,22 +368,25 @@ public:
   //----- image drawing
   virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
 			     int width, int height, GBool invert,
-			     GBool inlineImg);
+			     GBool interpolate, GBool inlineImg);
   virtual void drawImage(GfxState *state, Object *ref, Stream *str,
 			 int width, int height, GfxImageColorMap *colorMap,
-			 int *maskColors, GBool inlineImg);
+			 GBool interpolate, int *maskColors, GBool inlineImg);
   virtual void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
 				   int width, int height,
 				   GfxImageColorMap *colorMap,
+				   GBool interpolate,
 				   Stream *maskStr,
 				   int maskWidth, int maskHeight,
-				   GfxImageColorMap *maskColorMap);
+				   GfxImageColorMap *maskColorMap,
+				   GBool maskInterpolate);
   virtual void drawMaskedImage(GfxState *state, Object *ref, Stream *str,
 			       int width, int height,
 			       GfxImageColorMap *colorMap,
+			       GBool interpolate,
 			       Stream *maskStr,
 			       int maskWidth, int maskHeight,
-			       GBool maskInvert);
+			       GBool maskInvert, GBool maskInterpolate);
 
   //----- transparency groups and soft masks
   virtual void beginTransparencyGroup(GfxState * /*state*/, double * /*bbox*/,
diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc
index 1b6c3e6..63793a5 100644
--- a/poppler/Gfx.cc
+++ b/poppler/Gfx.cc
@@ -17,7 +17,7 @@
 // Copyright (C) 2005-2009 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2006 Thorkild Stray <thorkild at ifi.uio.no>
 // Copyright (C) 2006 Kristian Høgsberg <krh at redhat.com>
-// Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc at gnome.org>
+// Copyright (C) 2006-2009 Carlos Garcia Campos <carlosgc at gnome.org>
 // Copyright (C) 2006, 2007 Jeff Muizelaar <jeff at infidigm.net>
 // Copyright (C) 2007, 2008 Brad Hards <bradh at kde.org>
 // Copyright (C) 2007 Adrian Johnson <ajohnson at redneon.com>
@@ -3681,6 +3681,7 @@ void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) {
   Dict *dict, *maskDict;
   int width, height;
   int bits, maskBits;
+  GBool interpolate;
   StreamColorSpaceMode csMode;
   GBool mask;
   GBool invert;
@@ -3691,6 +3692,7 @@ void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) {
   int maskColors[2*gfxColorMaxComps];
   int maskWidth, maskHeight;
   GBool maskInvert;
+  GBool maskInterpolate;
   Stream *maskStr;
   Object obj1, obj2;
   int i;
@@ -3732,6 +3734,19 @@ void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) {
   if (width < 1 || height < 1)
     goto err1;
 
+  // image interpolation
+  dict->lookup("Interpolate", &obj1);
+  if (obj1.isNull()) {
+    obj1.free();
+    dict->lookup("I", &obj1);
+  }
+  if (obj1.isBool())
+    interpolate = obj1.getBool();
+  else
+    interpolate = gFalse;
+  obj1.free();
+  maskInterpolate = gFalse;
+
   // image or mask?
   dict->lookup("ImageMask", &obj1);
   if (obj1.isNull()) {
@@ -3786,7 +3801,7 @@ void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) {
 
     // draw it
     if (!contentIsHidden()) {
-      out->drawImageMask(state, ref, str, width, height, invert, inlineImg);
+	out->drawImageMask(state, ref, str, width, height, invert, interpolate, inlineImg);
       if (out->fillMaskCSPattern(state)) {
         maskHaveCSPattern = gTrue;
         doPatternFill(gTrue);
@@ -3873,6 +3888,16 @@ void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) {
       }
       maskHeight = obj1.getInt();
       obj1.free();
+      maskDict->lookup("Interpolate", &obj1);
+      if (obj1.isNull()) {
+        obj1.free();
+        maskDict->lookup("I", &obj1);
+      }
+      if (obj1.isBool())
+        maskInterpolate = obj1.getBool();
+      else
+        maskInterpolate = gFalse;
+      obj1.free();
       maskDict->lookup("BitsPerComponent", &obj1);
       if (obj1.isNull()) {
 	obj1.free();
@@ -3961,6 +3986,16 @@ void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) {
       }
       maskHeight = obj1.getInt();
       obj1.free();
+      maskDict->lookup("Interpolate", &obj1);
+      if (obj1.isNull()) {
+        obj1.free();
+	maskDict->lookup("I", &obj1);
+      }
+      if (obj1.isBool())
+        maskInterpolate = obj1.getBool();
+      else
+        maskInterpolate = gFalse;
+      obj1.free();
       maskDict->lookup("ImageMask", &obj1);
       if (obj1.isNull()) {
 	obj1.free();
@@ -3992,15 +4027,15 @@ void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) {
     // draw it
     if (haveSoftMask) {
       if (!contentIsHidden()) {
-        out->drawSoftMaskedImage(state, ref, str, width, height, colorMap,
-				 maskStr, maskWidth, maskHeight, maskColorMap);
+        out->drawSoftMaskedImage(state, ref, str, width, height, colorMap, interpolate,
+				 maskStr, maskWidth, maskHeight, maskColorMap, maskInterpolate);
       }
       delete maskColorMap;
     } else if (haveExplicitMask && !contentIsHidden ()) {
-      out->drawMaskedImage(state, ref, str, width, height, colorMap,
-			   maskStr, maskWidth, maskHeight, maskInvert);
+      out->drawMaskedImage(state, ref, str, width, height, colorMap, interpolate,
+			   maskStr, maskWidth, maskHeight, maskInvert, maskInterpolate);
     } else if (!contentIsHidden()) {
-      out->drawImage(state, ref, str, width, height, colorMap,
+      out->drawImage(state, ref, str, width, height, colorMap, interpolate,
 		     haveColorKeyMask ? maskColors : (int *)NULL, inlineImg);
     }
     delete colorMap;
diff --git a/poppler/OutputDev.cc b/poppler/OutputDev.cc
index 627ab06..cff10bc 100644
--- a/poppler/OutputDev.cc
+++ b/poppler/OutputDev.cc
@@ -16,6 +16,7 @@
 // Copyright (C) 2005 Jonathan Blandford <jrb at redhat.com>
 // Copyright (C) 2006 Thorkild Stray <thorkild at ifi.uio.no>
 // Copyright (C) 2007 Adrian Johnson <ajohnson at redneon.com>
+// Copyright (C) 2009 Carlos Garcia Campos <carlosgc at gnome.org>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -94,7 +95,7 @@ GBool OutputDev::beginType3Char(GfxState *state, double x, double y,
 
 void OutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
 			      int width, int height, GBool invert,
-			      GBool inlineImg) {
+			      GBool interpolate, GBool inlineImg) {
   int i, j;
 
   if (inlineImg) {
@@ -108,7 +109,7 @@ void OutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
 
 void OutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
 			  int width, int height, GfxImageColorMap *colorMap,
-			  int *maskColors, GBool inlineImg) {
+			  GBool interpolate, int *maskColors, GBool inlineImg) {
   int i, j;
 
   if (inlineImg) {
@@ -124,19 +125,23 @@ void OutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
 void OutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str,
 				int width, int height,
 				GfxImageColorMap *colorMap,
+				GBool interpolate,
 				Stream *maskStr,
 				int maskWidth, int maskHeight,
-				GBool maskInvert) {
-  drawImage(state, ref, str, width, height, colorMap, NULL, gFalse);
+				GBool maskInvert,
+				GBool maskInterpolate) {
+  drawImage(state, ref, str, width, height, colorMap, interpolate, NULL, gFalse);
 }
 
 void OutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
 				    int width, int height,
 				    GfxImageColorMap *colorMap,
+				    GBool interpolate,
 				    Stream *maskStr,
 				    int maskWidth, int maskHeight,
-				    GfxImageColorMap *maskColorMap) {
-  drawImage(state, ref, str, width, height, colorMap, NULL, gFalse);
+				    GfxImageColorMap *maskColorMap,
+				    GBool maskInterpolate) {
+  drawImage(state, ref, str, width, height, colorMap, interpolate, NULL, gFalse);
 }
 
 void OutputDev::endMarkedContent(GfxState *state) {
diff --git a/poppler/OutputDev.h b/poppler/OutputDev.h
index 4866631..35adadd 100644
--- a/poppler/OutputDev.h
+++ b/poppler/OutputDev.h
@@ -18,6 +18,7 @@
 // Copyright (C) 2007 Jeff Muizelaar <jeff at infidigm.net>
 // Copyright (C) 2007 Adrian Johnson <ajohnson at redneon.com>
 // Copyright (C) 2009 Thomas Freitag <Thomas.Freitag at alfa.de>
+// Copyright (C) 2009 Carlos Garcia Campos <carlosgc at gnome.org>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -222,22 +223,24 @@ public:
 
   //----- image drawing
   virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
-			     int width, int height, GBool invert,
+			     int width, int height, GBool invert, GBool interpolate,
 			     GBool inlineImg);
   virtual void drawImage(GfxState *state, Object *ref, Stream *str,
 			 int width, int height, GfxImageColorMap *colorMap,
-			 int *maskColors, GBool inlineImg);
+			 GBool interpolate, int *maskColors, GBool inlineImg);
   virtual void drawMaskedImage(GfxState *state, Object *ref, Stream *str,
 			       int width, int height,
-			       GfxImageColorMap *colorMap,
+			       GfxImageColorMap *colorMap, GBool interpolate,
 			       Stream *maskStr, int maskWidth, int maskHeight,
-			       GBool maskInvert);
+			       GBool maskInvert, GBool maskInterpolate);
   virtual void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
 				   int width, int height,
 				   GfxImageColorMap *colorMap,
+				   GBool interpolate,
 				   Stream *maskStr,
 				   int maskWidth, int maskHeight,
-				   GfxImageColorMap *maskColorMap);
+				   GfxImageColorMap *maskColorMap,
+				   GBool maskInterpolate);
 
   //----- grouping operators
 
diff --git a/poppler/PSOutputDev.cc b/poppler/PSOutputDev.cc
index d65d03f..204894a 100644
--- a/poppler/PSOutputDev.cc
+++ b/poppler/PSOutputDev.cc
@@ -22,6 +22,7 @@
 // Copyright (C) 2008 Hib Eris <hib at hiberis.nl>
 // Copyright (C) 2009 Thomas Freitag <Thomas.Freitag at alfa.de>
 // Copyright (C) 2009 Till Kamppeter <till.kamppeter at gmail.com>
+// Copyright (C) 2009 Carlos Garcia Campos <carlosgc at gnome.org>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -4371,7 +4372,7 @@ void PSOutputDev::endMaskClip(GfxState * state) {
 
 void PSOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
 				int width, int height, GBool invert,
-				GBool inlineImg) {
+				GBool interpolate, GBool inlineImg) {
   int len;
 
   len = height * ((width + 7) / 8);
@@ -4399,7 +4400,7 @@ void PSOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
 
 void PSOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
 			    int width, int height, GfxImageColorMap *colorMap,
-			    int *maskColors, GBool inlineImg) {
+			    GBool interpolate, int *maskColors, GBool inlineImg) {
   int len;
 
   len = height * ((width * colorMap->getNumPixelComps() *
@@ -4429,9 +4430,10 @@ void PSOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
 void PSOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str,
 				  int width, int height,
 				  GfxImageColorMap *colorMap,
+				  GBool interpolate,
 				  Stream *maskStr,
 				  int maskWidth, int maskHeight,
-				  GBool maskInvert) {
+				  GBool maskInvert, GBool maskInterpolate) {
   int len;
 
   len = height * ((width * colorMap->getNumPixelComps() *
diff --git a/poppler/PSOutputDev.h b/poppler/PSOutputDev.h
index ac2416c..82378a9 100644
--- a/poppler/PSOutputDev.h
+++ b/poppler/PSOutputDev.h
@@ -19,6 +19,7 @@
 // Copyright (C) 2007 Brad Hards <bradh at kde.org>
 // Copyright (C) 2009 Thomas Freitag <Thomas.Freitag at alfa.de>
 // Copyright (C) 2009 Till Kamppeter <till.kamppeter at gmail.com>
+// Copyright (C) 2009 Carlos Garcia Campos <carlosgc at gnome.org>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -231,15 +232,16 @@ public:
   //----- image drawing
   virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
 			     int width, int height, GBool invert,
-			     GBool inlineImg);
+			     GBool interpolate, GBool inlineImg);
   virtual void drawImage(GfxState *state, Object *ref, Stream *str,
 			 int width, int height, GfxImageColorMap *colorMap,
-			 int *maskColors, GBool inlineImg);
+			 GBool interpolate, int *maskColors, GBool inlineImg);
   virtual void drawMaskedImage(GfxState *state, Object *ref, Stream *str,
 			       int width, int height,
 			       GfxImageColorMap *colorMap,
+			       GBool interpolate,
 			       Stream *maskStr, int maskWidth, int maskHeight,
-			       GBool maskInvert);
+			       GBool maskInvert, GBool maskInterpolate);
   // If current colorspace ist pattern,
   // need this device special handling for masks in pattern colorspace?
   // Default is false
diff --git a/poppler/PreScanOutputDev.cc b/poppler/PreScanOutputDev.cc
index 8fcebd4..7c3f522 100644
--- a/poppler/PreScanOutputDev.cc
+++ b/poppler/PreScanOutputDev.cc
@@ -6,6 +6,20 @@
 //
 //========================================================================
 
+//========================================================================
+//
+// Modified under the Poppler project - http://poppler.freedesktop.org
+//
+// All changes made under the Poppler project to this file are licensed
+// under GPL version 2 or later
+//
+// Copyright (C) 2009 Carlos Garcia Campos <carlosgc at gnome.org>
+//
+// To see a description of the changes please see the Changelog file that
+// came with your tarball or type make ChangeLog if you are building from git
+//
+//========================================================================
+
 #ifdef USE_GCC_PRAGMAS
 #pragma implementation
 #endif
@@ -120,7 +134,7 @@ void PreScanOutputDev::endType3Char(GfxState * /*state*/) {
 
 void PreScanOutputDev::drawImageMask(GfxState *state, Object * /*ref*/, Stream *str,
 				     int width, int height, GBool /*invert*/,
-				     GBool inlineImg) {
+				     GBool /*interpolate*/, GBool inlineImg) {
   int i, j;
 
   check(state->getFillColorSpace(), state->getFillColor(),
@@ -139,7 +153,7 @@ void PreScanOutputDev::drawImageMask(GfxState *state, Object * /*ref*/, Stream *
 void PreScanOutputDev::drawImage(GfxState *state, Object * /*ref*/, Stream *str,
 				 int width, int height,
 				 GfxImageColorMap *colorMap,
-				 int * /*maskColors*/, GBool inlineImg) {
+				 GBool /*interpolate*/, int * /*maskColors*/, GBool inlineImg) {
   GfxColorSpace *colorSpace;
   int i, j;
 
@@ -171,9 +185,10 @@ void PreScanOutputDev::drawMaskedImage(GfxState *state, Object * /*ref*/,
 				       Stream * /*str*/,
 				       int /*width*/, int /*height*/,
 				       GfxImageColorMap *colorMap,
+				       GBool /*interpolate*/,
 				       Stream * /*maskStr*/,
 				       int /*maskWidth*/, int /*maskHeight*/,
-				       GBool /*maskInvert*/) {
+				       GBool /*maskInvert*/, GBool /*maskInterpolate*/) {
   GfxColorSpace *colorSpace;
 
   colorSpace = colorMap->getColorSpace();
@@ -195,9 +210,11 @@ void PreScanOutputDev::drawSoftMaskedImage(GfxState * /*state*/, Object * /*ref*
 					   Stream * /*str*/,
 					   int /*width*/, int /*height*/,
 					   GfxImageColorMap *colorMap,
+					   GBool /*interpolate*/,
 					   Stream * /*maskStr*/,
 					   int /*maskWidth*/, int /*maskHeight*/,
-					   GfxImageColorMap * /*maskColorMap*/) {
+					   GfxImageColorMap * /*maskColorMap*/,
+					   GBool /*maskInterpolate*/) {
   GfxColorSpace *colorSpace;
 
   colorSpace = colorMap->getColorSpace();
diff --git a/poppler/PreScanOutputDev.h b/poppler/PreScanOutputDev.h
index 8a2e2ef..39c7819 100644
--- a/poppler/PreScanOutputDev.h
+++ b/poppler/PreScanOutputDev.h
@@ -6,6 +6,20 @@
 //
 //========================================================================
 
+//========================================================================
+//
+// Modified under the Poppler project - http://poppler.freedesktop.org
+//
+// All changes made under the Poppler project to this file are licensed
+// under GPL version 2 or later
+//
+// Copyright (C) 2009 Carlos Garcia Campos <carlosgc at gnome.org>
+//
+// To see a description of the changes please see the Changelog file that
+// came with your tarball or type make ChangeLog if you are building from git
+//
+//========================================================================
+
 #ifndef PRESCANOUTPUTDEV_H
 #define PRESCANOUTPUTDEV_H
 
@@ -71,21 +85,24 @@ public:
   //----- image drawing
   virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
 			     int width, int height, GBool invert,
-			     GBool inlineImg);
+			     GBool interpolate, GBool inlineImg);
   virtual void drawImage(GfxState *state, Object *ref, Stream *str,
 			 int width, int height, GfxImageColorMap *colorMap,
-			 int *maskColors, GBool inlineImg);
+			 GBool interpolate, int *maskColors, GBool inlineImg);
   virtual void drawMaskedImage(GfxState *state, Object *ref, Stream *str,
 			       int width, int height,
 			       GfxImageColorMap *colorMap,
+			       GBool interpolate,
 			       Stream *maskStr, int maskWidth, int maskHeight,
-			       GBool maskInvert);
+			       GBool maskInvert, GBool maskInterpolate);
   virtual void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
 				   int width, int height,
 				   GfxImageColorMap *colorMap,
+				   GBool interpolate,
 				   Stream *maskStr,
 				   int maskWidth, int maskHeight,
-				   GfxImageColorMap *maskColorMap);
+				   GfxImageColorMap *maskColorMap,
+				   GBool maskInterpolate);
 
   //----- transparency groups and soft masks
   virtual void beginTransparencyGroup(GfxState *state, double *bbox,
diff --git a/poppler/SplashOutputDev.cc b/poppler/SplashOutputDev.cc
index 7f810fe..0ef5c6b 100644
--- a/poppler/SplashOutputDev.cc
+++ b/poppler/SplashOutputDev.cc
@@ -21,6 +21,7 @@
 // Copyright (C) 2007 Koji Otani <sho at bbr.jp>
 // Copyright (C) 2009 Petr Gajdos <pgajdos at novell.com>
 // Copyright (C) 2009 Thomas Freitag <Thomas.Freitag at alfa.de>
+// Copyright (C) 2009 Carlos Garcia Campos <carlosgc at gnome.org>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -1970,7 +1971,7 @@ void SplashOutputDev::endMaskClip(GfxState * state) {
 
 void SplashOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
 				    int width, int height, GBool invert,
-				    GBool inlineImg) {
+				    GBool inlineImg, GBool interpolate) {
   double *ctm;
   SplashCoord mat[6];
   SplashOutImageMaskData imgMaskData;
@@ -2242,6 +2243,7 @@ GBool SplashOutputDev::alphaImageSrc(void *data, SplashColorPtr colorLine,
 void SplashOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
 				int width, int height,
 				GfxImageColorMap *colorMap,
+				GBool interpolate,
 				int *maskColors, GBool inlineImg) {
   double *ctm;
   SplashCoord mat[6];
@@ -2456,8 +2458,10 @@ GBool SplashOutputDev::maskedImageSrc(void *data, SplashColorPtr colorLine,
 void SplashOutputDev::drawMaskedImage(GfxState *state, Object *ref,
 				      Stream *str, int width, int height,
 				      GfxImageColorMap *colorMap,
+				      GBool interpolate,
 				      Stream *maskStr, int maskWidth,
-				      int maskHeight, GBool maskInvert) {
+				      int maskHeight, GBool maskInvert,
+				      GBool maskInterpolate) {
   GfxImageColorMap *maskColorMap;
   Object maskDecode, decodeLow, decodeHigh;
   double *ctm;
@@ -2487,8 +2491,8 @@ void SplashOutputDev::drawMaskedImage(GfxState *state, Object *ref,
     maskColorMap = new GfxImageColorMap(1, &maskDecode,
 					new GfxDeviceGrayColorSpace());
     maskDecode.free();
-    drawSoftMaskedImage(state, ref, str, width, height, colorMap,
-			maskStr, maskWidth, maskHeight, maskColorMap);
+    drawSoftMaskedImage(state, ref, str, width, height, colorMap, interpolate,
+			maskStr, maskWidth, maskHeight, maskColorMap, maskInterpolate);
     delete maskColorMap;
 
   } else {
@@ -2611,9 +2615,11 @@ void SplashOutputDev::drawMaskedImage(GfxState *state, Object *ref,
 void SplashOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref,
 					  Stream *str, int width, int height,
 					  GfxImageColorMap *colorMap,
+					  GBool interpolate,
 					  Stream *maskStr,
 					  int maskWidth, int maskHeight,
-					  GfxImageColorMap *maskColorMap) {
+					  GfxImageColorMap *maskColorMap,
+					  GBool maskInterpolate) {
   double *ctm;
   SplashCoord mat[6];
   SplashOutImageData imgData;
diff --git a/poppler/SplashOutputDev.h b/poppler/SplashOutputDev.h
index b9a7aad..eec6516 100644
--- a/poppler/SplashOutputDev.h
+++ b/poppler/SplashOutputDev.h
@@ -15,6 +15,7 @@
 //
 // Copyright (C) 2005 Takashi Iwai <tiwai at suse.de>
 // Copyright (C) 2009 Thomas Freitag <Thomas.Freitag at alfa.de>
+// Copyright (C) 2009 Carlos Garcia Campos <carlosgc at gnome.org>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -143,21 +144,24 @@ public:
   //----- image drawing
   virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
 			     int width, int height, GBool invert,
-			     GBool inlineImg);
+			     GBool interpolate, GBool inlineImg);
   virtual void drawImage(GfxState *state, Object *ref, Stream *str,
 			 int width, int height, GfxImageColorMap *colorMap,
-			 int *maskColors, GBool inlineImg);
+			 GBool interpolate, int *maskColors, GBool inlineImg);
   virtual void drawMaskedImage(GfxState *state, Object *ref, Stream *str,
 			       int width, int height,
 			       GfxImageColorMap *colorMap,
+			       GBool interpolate,
 			       Stream *maskStr, int maskWidth, int maskHeight,
-			       GBool maskInvert);
+			       GBool maskInvert, GBool maskInterpolate);
   virtual void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
 				   int width, int height,
 				   GfxImageColorMap *colorMap,
+				   GBool interpolate,
 				   Stream *maskStr,
 				   int maskWidth, int maskHeight,
-				   GfxImageColorMap *maskColorMap);
+				   GfxImageColorMap *maskColorMap,
+				   GBool maskInterpolate);
   // If current colorspace ist pattern,
   // need this device special handling for masks in pattern colorspace?
   // Default is false
diff --git a/utils/HtmlOutputDev.cc b/utils/HtmlOutputDev.cc
index 6095e10..97b229d 100644
--- a/utils/HtmlOutputDev.cc
+++ b/utils/HtmlOutputDev.cc
@@ -1144,11 +1144,11 @@ void HtmlOutputDev::drawChar(GfxState *state, double x, double y,
 }
 
 void HtmlOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
-			      int width, int height, GBool invert,
-			      GBool inlineImg) {
+				  int width, int height, GBool invert,
+				  GBool interpolate, GBool inlineImg) {
 
   if (ignore||complexMode) {
-    OutputDev::drawImageMask(state, ref, str, width, height, invert, inlineImg);
+    OutputDev::drawImageMask(state, ref, str, width, height, invert, interpolate, inlineImg);
     return;
   }
   
@@ -1222,16 +1222,16 @@ void HtmlOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
   if (fName) imgList->append(fName);
   }
   else {
-    OutputDev::drawImageMask(state, ref, str, width, height, invert, inlineImg);
+    OutputDev::drawImageMask(state, ref, str, width, height, invert, interpolate, inlineImg);
   }
 }
 
 void HtmlOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
-			  int width, int height, GfxImageColorMap *colorMap,
-			  int *maskColors, GBool inlineImg) {
+			      int width, int height, GfxImageColorMap *colorMap,
+			      GBool interpolate, int *maskColors, GBool inlineImg) {
 
   if (ignore||complexMode) {
-    OutputDev::drawImage(state, ref, str, width, height, colorMap, 
+    OutputDev::drawImage(state, ref, str, width, height, colorMap, interpolate,
 			 maskColors, inlineImg);
     return;
   }
@@ -1418,7 +1418,7 @@ void HtmlOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
     imgStr->close();
     delete imgStr;
 #else
-    OutputDev::drawImage(state, ref, str, width, height, colorMap,
+    OutputDev::drawImage(state, ref, str, width, height, colorMap, interpolate,
 			 maskColors, inlineImg);
 #endif
   }
diff --git a/utils/HtmlOutputDev.h b/utils/HtmlOutputDev.h
index a048a72..613448a 100644
--- a/utils/HtmlOutputDev.h
+++ b/utils/HtmlOutputDev.h
@@ -16,6 +16,7 @@
 //
 // Copyright (C) 2006-2007 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2008-2009 Warren Toomey <wkt at tuhs.org>
+// Copyright (C) 2009 Carlos Garcia Campos <carlosgc at gnome.org>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -279,10 +280,10 @@ public:
   virtual void drawImageMask(GfxState *state, Object *ref, 
 			     Stream *str,
 			     int width, int height, GBool invert,
-			     GBool inlineImg);
+			     GBool interpolate, GBool inlineImg);
   virtual void drawImage(GfxState *state, Object *ref, Stream *str,
-			  int width, int height, GfxImageColorMap *colorMap,
-			 int *maskColors, GBool inlineImg);
+			 int width, int height, GfxImageColorMap *colorMap,
+			 GBool interpolate, int *maskColors, GBool inlineImg);
 
   //new feature    
   virtual int DevType() {return 1234;}
diff --git a/utils/ImageOutputDev.cc b/utils/ImageOutputDev.cc
index 5d4876f..da54fd6 100644
--- a/utils/ImageOutputDev.cc
+++ b/utils/ImageOutputDev.cc
@@ -60,7 +60,7 @@ ImageOutputDev::~ImageOutputDev() {
 
 void ImageOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
 				   int width, int height, GBool invert,
-				   GBool inlineImg) {
+				   GBool interpolate, GBool inlineImg) {
   FILE *f;
   int c;
   int size, i;
@@ -117,7 +117,7 @@ void ImageOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
 void ImageOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
 			       int width, int height,
 			       GfxImageColorMap *colorMap,
-			       int *maskColors, GBool inlineImg) {
+			       GBool interpolate, int *maskColors, GBool inlineImg) {
   FILE *f;
   ImageStream *imgStr;
   Guchar *p;
@@ -227,19 +227,19 @@ void ImageOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
 
 void ImageOutputDev::drawMaskedImage(
   GfxState *state, Object *ref, Stream *str,
-  int width, int height, GfxImageColorMap *colorMap,
-  Stream *maskStr, int maskWidth, int maskHeight, GBool maskInvert) {
-  drawImage(state, ref, str, width, height, colorMap, NULL, gFalse);
-  drawImageMask(state, ref, maskStr, maskWidth, maskHeight,
+  int width, int height, GfxImageColorMap *colorMap, GBool interpolate,
+  Stream *maskStr, int maskWidth, int maskHeight, GBool maskInvert, GBool maskInterpolate) {
+  drawImage(state, ref, str, width, height, colorMap, interpolate, NULL, gFalse);
+  drawImageMask(state, ref, maskStr, maskWidth, maskHeight, maskInterpolate,
 		maskInvert, gFalse);
 }
 
 void ImageOutputDev::drawSoftMaskedImage(
   GfxState *state, Object *ref, Stream *str,
-  int width, int height, GfxImageColorMap *colorMap,
+  int width, int height, GfxImageColorMap *colorMap, GBool interpolate,
   Stream *maskStr, int maskWidth, int maskHeight,
-  GfxImageColorMap *maskColorMap) {
-  drawImage(state, ref, str, width, height, colorMap, NULL, gFalse);
+  GfxImageColorMap *maskColorMap, GBool maskInterpolate) {
+  drawImage(state, ref, str, width, height, colorMap, interpolate, NULL, gFalse);
   drawImage(state, ref, maskStr, maskWidth, maskHeight,
-	    maskColorMap, NULL, gFalse);
+	    maskColorMap, maskInterpolate, NULL, gFalse);
 }
diff --git a/utils/ImageOutputDev.h b/utils/ImageOutputDev.h
index e64cf56..eb56a36 100644
--- a/utils/ImageOutputDev.h
+++ b/utils/ImageOutputDev.h
@@ -15,6 +15,7 @@
 //
 // Copyright (C) 2006 Rainer Keller <class321 at gmx.de>
 // Copyright (C) 2008 Timothy Lee <timothy.lee at siriushk.com>
+// Copyright (C) 2009 Carlos Garcia Campos <carlosgc at gnome.org>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -74,21 +75,24 @@ public:
   //----- image drawing
   virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
 			     int width, int height, GBool invert,
-			     GBool inlineImg);
+			     GBool interpolate, GBool inlineImg);
   virtual void drawImage(GfxState *state, Object *ref, Stream *str,
 			 int width, int height, GfxImageColorMap *colorMap,
-			 int *maskColors, GBool inlineImg);
+			 GBool interpolate, int *maskColors, GBool inlineImg);
   virtual void drawMaskedImage(GfxState *state, Object *ref, Stream *str,
 			       int width, int height,
 			       GfxImageColorMap *colorMap,
+			       GBool interpolate,
 			       Stream *maskStr, int maskWidth, int maskHeight,
-			       GBool maskInvert);
+			       GBool maskInvert, GBool maskInterpolate);
   virtual void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
 				   int width, int height,
 				   GfxImageColorMap *colorMap,
+				   GBool interpolate,
 				   Stream *maskStr,
 				   int maskWidth, int maskHeight,
-				   GfxImageColorMap *maskColorMap);
+				   GfxImageColorMap *maskColorMap,
+				   GBool maskInterpolate);
 
 private:
 


More information about the poppler mailing list