1 //========================================================================
5 // Copyright 1998-2002 Glyph & Cog, LLC
7 //========================================================================
9 #ifndef IMAGEOUTPUTDEV_H
10 #define IMAGEOUTPUTDEV_H
18 #include "OutputDev.h"
22 //------------------------------------------------------------------------
24 //------------------------------------------------------------------------
26 class ImageOutputDev: public OutputDev {
29 // Create an OutputDev which will write images to files named
30 // <fileRoot>-NNN.<type>. Normally, all images are written as PBM
31 // (.pbm) or PPM (.ppm) files. If <dumpJPEG> is set, JPEG images are
32 // written as JPEG (.jpg) files.
33 ImageOutputDev(char *fileRootA, GBool dumpJPEGA);
36 virtual ~ImageOutputDev();
38 // Check if file was successfully created.
39 virtual GBool isOk() { return ok; }
41 // Does this device use beginType3Char/endType3Char? Otherwise,
42 // text in Type 3 fonts will be drawn with drawChar/drawString.
43 virtual GBool interpretType3Chars() { return gFalse; }
45 // Does this device need non-text content?
46 virtual GBool needNonText() { return gFalse; }
48 //---- get info about output device
50 // Does this device use upside-down coordinates?
51 // (Upside-down means (0,0) is the top left corner of the page.)
52 virtual GBool upsideDown() { return gTrue; }
54 // Does this device use drawChar() or drawString()?
55 virtual GBool useDrawChar() { return gFalse; }
58 virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
59 int width, int height, GBool invert,
61 virtual void drawImage(GfxState *state, Object *ref, Stream *str,
62 int width, int height, GfxImageColorMap *colorMap,
63 int *maskColors, GBool inlineImg);
67 char *fileRoot; // root of output file names
68 char *fileName; // buffer for output file names
69 GBool dumpJPEG; // set to dump native JPEG files
70 int imgNum; // current image number
71 GBool ok; // set up ok?