Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pdf/xpdf/ImageOutputDev.cc
diff options
context:
space:
mode:
authorMartin Kretzschmar <mkretzschmar@src.gnome.org>2002-09-18 20:32:18 (GMT)
committer Martin Kretzschmar <mkretzschmar@src.gnome.org>2002-09-18 20:32:18 (GMT)
commit7aac8dc8533347e21311b15186e0af82f1b22fd6 (patch)
tree02650bb02c8a1d8468c22f50ff151885d233016b /pdf/xpdf/ImageOutputDev.cc
parentd99fb4f4acd14fcdbda968abd907547dcc7af40c (diff)
Synched with Xpdf 0.92
this adds "decryption" support testing this code after six weeks immediately gives me segfaults (image drawing) :-O must have fixed that later without knowing :-O
Diffstat (limited to 'pdf/xpdf/ImageOutputDev.cc')
-rw-r--r--pdf/xpdf/ImageOutputDev.cc21
1 files changed, 11 insertions, 10 deletions
diff --git a/pdf/xpdf/ImageOutputDev.cc b/pdf/xpdf/ImageOutputDev.cc
index 93d1c31..9cd1280 100644
--- a/pdf/xpdf/ImageOutputDev.cc
+++ b/pdf/xpdf/ImageOutputDev.cc
@@ -35,7 +35,7 @@ ImageOutputDev::~ImageOutputDev() {
gfree(fileRoot);
}
-void ImageOutputDev::drawImageMask(GfxState *state, Stream *str,
+void ImageOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
int width, int height, GBool invert,
GBool inlineImg) {
FILE *f;
@@ -86,18 +86,19 @@ void ImageOutputDev::drawImageMask(GfxState *state, Stream *str,
}
}
-void ImageOutputDev::drawImage(GfxState *state, Stream *str, int width,
- int height, GfxImageColorMap *colorMap,
- GBool inlineImg) {
+void ImageOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
+ int width, int height,
+ GfxImageColorMap *colorMap, GBool inlineImg) {
FILE *f;
ImageStream *imgStr;
Guchar pixBuf[4];
- GfxColor color;
+ GfxRGB rgb;
int x, y;
int c;
// dump JPEG file
- if (dumpJPEG && str->getKind() == strDCT) {
+ if (dumpJPEG && str->getKind() == strDCT &&
+ colorMap->getNumPixelComps() == 3) {
// open the image file
sprintf(fileName, "%s-%03d.jpg", fileRoot, imgNum);
@@ -142,10 +143,10 @@ void ImageOutputDev::drawImage(GfxState *state, Stream *str, int width,
// write the line
for (x = 0; x < width; ++x) {
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);
+ colorMap->getRGB(pixBuf, &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);
}
}
delete imgStr;