//
// ImageOutputDev.cc
//
-// Copyright 1998-2002 Glyph & Cog, LLC
+// Copyright 1998-2003 Glyph & Cog, LLC
//
//========================================================================
-#ifdef __GNUC__
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
#pragma implementation
#endif
-#include <aconf.h>
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
int *maskColors, GBool inlineImg) {
FILE *f;
ImageStream *imgStr;
- Guchar pixBuf[4];
+ Guchar *p;
GfxRGB rgb;
int x, y;
int c;
// 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();
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;