X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;ds=sidebyside;f=pdf%2Fxpdf%2FImageOutputDev.cc;h=29c7f0f956c137c4c1750de605b9a9dab427d744;hb=refs%2Ftags%2FGNOME_2_8_ANCHOR;hp=d6c2eb3e7fc8284393ff554c84e39e5edb58c48c;hpb=2a393c134fe3fe8eb85bf818cb7ad6ae4396322a;p=evince.git diff --git a/pdf/xpdf/ImageOutputDev.cc b/pdf/xpdf/ImageOutputDev.cc index d6c2eb3e..29c7f0f9 100644 --- a/pdf/xpdf/ImageOutputDev.cc +++ b/pdf/xpdf/ImageOutputDev.cc @@ -2,15 +2,16 @@ // // ImageOutputDev.cc // -// Copyright 1998-2002 Glyph & Cog, LLC +// Copyright 1998-2003 Glyph & Cog, LLC // //======================================================================== -#ifdef __GNUC__ +#include + +#ifdef USE_GCC_PRAGMAS #pragma implementation #endif -#include #include #include #include @@ -98,7 +99,7 @@ void ImageOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int *maskColors, GBool inlineImg) { FILE *f; ImageStream *imgStr; - Guchar pixBuf[4]; + Guchar *p; GfxRGB rgb; int x, y; int c; @@ -148,7 +149,7 @@ void ImageOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, // copy the stream size = height * ((width + 7) / 8); for (i = 0; i < size; ++i) { - fputc(str->getChar(), f); + fputc(str->getChar() ^ 0xff, f); } str->close(); @@ -177,12 +178,13 @@ void ImageOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, for (y = 0; y < height; ++y) { // write the line + p = imgStr->getLine(); for (x = 0; x < width; ++x) { - imgStr->getPixel(pixBuf); - colorMap->getRGB(pixBuf, &rgb); + colorMap->getRGB(p, &rgb); fputc((int)(rgb.r * 255 + 0.5), f); fputc((int)(rgb.g * 255 + 0.5), f); fputc((int)(rgb.b * 255 + 0.5), f); + p += colorMap->getNumPixelComps(); } } delete imgStr;