Commit e632a1d4 authored by Kristian Høgsberg's avatar Kristian Høgsberg

2005-03-11 Kristian Høgsberg <krh@redhat.com>

        From  Jeff Muizelaar  <jrmuizel@nit.ca>:

        * poppler/CairoOutputDev.cc (CairoOutputDev::drawImageMask): Use
        getLine instead of getPixel.
parent 83e90445
......@@ -2,6 +2,9 @@
From Jeff Muizelaar <jrmuizel@nit.ca>:
* poppler/CairoOutputDev.cc (CairoOutputDev::drawImageMask): Use
getLine instead of getPixel.
* configure.ac: Add checks for libjpeg.
* DCTStream.cc, DCTStream.h, Stream.cc, Stream.h, Makefile.am:
......
......@@ -463,35 +463,33 @@ void CairoOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
cairo_surface_t *image;
int x, y;
ImageStream *imgStr;
Guchar pix;
Guchar *pix;
double *ctm;
cairo_matrix_t *mat;
int invert_bit;
buffer = (char *)malloc (width * height * 4);
if (buffer == NULL) {
error(-1, "Unable to allocate memory for image.");
return;
}
/* TODO: Do we want to cache these? */
imgStr = new ImageStream(str, width,
1, 1);
imgStr = new ImageStream(str, width, 1, 1);
imgStr->reset();
invert_bit = invert ? 1 : 0;
for (y = 0; y < height; y++) {
pix = imgStr->getLine();
dest = buffer + y * width * 4;
for (x = 0; x < width; x++) {
imgStr->getPixel(&pix);
*dest++ = soutRound(255 * fill_color.b);
*dest++ = soutRound(255 * fill_color.g);
*dest++ = soutRound(255 * fill_color.r);
if (invert)
pix ^= 1;
if (pix)
if (pix[x] ^ invert_bit)
*dest++ = 0;
else
*dest++ = 255;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment