X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=pdf%2Fxpdf%2FImageOutputDev.cc;h=93d1c31237d2e7d7ad243f0f8a0f0eb6f97f9288;hb=e0bd0a5e28d6ac5fda6835ccfe1cb6eb4963a794;hp=00782fb590e2821d7bfe9aa128177dee637e3ef0;hpb=d9f9a6449f377b4c933b75d57541b19c6d088994;p=evince.git diff --git a/pdf/xpdf/ImageOutputDev.cc b/pdf/xpdf/ImageOutputDev.cc index 00782fb5..93d1c312 100644 --- a/pdf/xpdf/ImageOutputDev.cc +++ b/pdf/xpdf/ImageOutputDev.cc @@ -90,6 +90,7 @@ void ImageOutputDev::drawImage(GfxState *state, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool inlineImg) { FILE *f; + ImageStream *imgStr; Guchar pixBuf[4]; GfxColor color; int x, y; @@ -131,20 +132,23 @@ void ImageOutputDev::drawImage(GfxState *state, Stream *str, int width, fprintf(f, "255\n"); // initialize stream - str->resetImage(width, colorMap->getNumPixelComps(), colorMap->getBits()); + imgStr = new ImageStream(str, width, colorMap->getNumPixelComps(), + colorMap->getBits()); + imgStr->reset(); // for each line... for (y = 0; y < height; ++y) { // write the line for (x = 0; x < width; ++x) { - str->getImagePixel(pixBuf); + imgStr->getPixel(pixBuf); colorMap->getColor(pixBuf, &color); fputc((int)(color.getR() * 255 + 0.5), f); fputc((int)(color.getG() * 255 + 0.5), f); fputc((int)(color.getB() * 255 + 0.5), f); } } + delete imgStr; fclose(f); }