Commit 7248da09 authored by Carlos Garcia Campos's avatar Carlos Garcia Campos

Use Interpolate flag to decide whether applying image interpolation during rendering

Fixes bug #9860
parent 37e3f877
......@@ -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;
......
......@@ -15,6 +15,7 @@
//
// Copyright (C) 2005 Brad Hards <bradh@frogmouth.net>
// Copyright (C) 2005 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2009 Carlos Garcia Campos <carlosgc@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);
......
This diff is collapsed.
......@@ -17,7 +17,7 @@
// Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net>
// Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com>
// Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru>
// Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org>
// Copyright (C) 2006-2009 Carlos Garcia Campos <carlosgc@gnome.org>
// Copyright (C) 2008 Adrian Johnson <ajohnson@redneon.com>
// Copyright (C) 2008 Michael Vrable <mvrable@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*/,
......
......@@ -17,7 +17,7 @@
// Copyright (C) 2005-2009 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2006 Thorkild Stray <thorkild@ifi.uio.no>
// Copyright (C) 2006 Kristian Høgsberg <krh@redhat.com>
// Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org>
// Copyright (C) 2006-2009 Carlos Garcia Campos <carlosgc@gnome.org>
// Copyright (C) 2006, 2007 Jeff Muizelaar <jeff@infidigm.net>
// Copyright (C) 2007, 2008 Brad Hards <bradh@kde.org>
// Copyright (C) 2007 Adrian Johnson <ajohnson@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;
......
......@@ -16,6 +16,7 @@
// Copyright (C) 2005 Jonathan Blandford <jrb@redhat.com>
// Copyright (C) 2006 Thorkild Stray <thorkild@ifi.uio.no>
// Copyright (C) 2007 Adrian Johnson <ajohnson@redneon.com>
// Copyright (C) 2009 Carlos Garcia Campos <carlosgc@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) {
......
......@@ -18,6 +18,7 @@
// Copyright (C) 2007 Jeff Muizelaar <jeff@infidigm.net>
// Copyright (C) 2007 Adrian Johnson <ajohnson@redneon.com>
// Copyright (C) 2009 Thomas Freitag <Thomas.Freitag@alfa.de>
// Copyright (C) 2009 Carlos Garcia Campos <carlosgc@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
......
......@@ -22,6 +22,7 @@
// Copyright (C) 2008 Hib Eris <hib@hiberis.nl>
// Copyright (C) 2009 Thomas Freitag <Thomas.Freitag@alfa.de>
// Copyright (C) 2009 Till Kamppeter <till.kamppeter@gmail.com>
// Copyright (C) 2009 Carlos Garcia Campos <carlosgc@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() *
......
......@@ -19,6 +19,7 @@
// Copyright (C) 2007 Brad Hards <bradh@kde.org>
// Copyright (C) 2009 Thomas Freitag <Thomas.Freitag@alfa.de>
// Copyright (C) 2009 Till Kamppeter <till.kamppeter@gmail.com>
// Copyright (C) 2009 Carlos Garcia Campos <carlosgc@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
......
......@@ -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@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();
......
......@@ -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@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,
......
......@@ -21,6 +21,7 @@
// Copyright (C) 2007 Koji Otani <sho@bbr.jp>
// Copyright (C) 2009 Petr Gajdos <pgajdos@novell.com>
// Copyright (C) 2009 Thomas Freitag <Thomas.Freitag@alfa.de>
// Copyright (C) 2009 Carlos Garcia Campos <carlosgc@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;
......
......@@ -15,6 +15,7 @@
//
// Copyright (C) 2005 Takashi Iwai <tiwai@suse.de>
// Copyright (C) 2009 Thomas Freitag <Thomas.Freitag@alfa.de>
// Copyright (C) 2009 Carlos Garcia Campos <carlosgc@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
......
......@@ -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
}
......
......@@ -16,6 +16,7 @@
//
// Copyright (C) 2006-2007 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2008-2009 Warren Toomey <wkt@tuhs.org>
// Copyright (C) 2009 Carlos Garcia Campos <carlosgc@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;}
......
......@@ -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);
}