1 //========================================================================
5 // Copyright 1998 Derek B. Noonburg
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 *fileRoot1, GBool dumpJPEG1);
36 virtual ~ImageOutputDev();
38 // Check if file was successfully created.
39 virtual GBool isOk() { return ok; }
41 //---- get info about output device
43 // Does this device use upside-down coordinates?
44 // (Upside-down means (0,0) is the top left corner of the page.)
45 virtual GBool upsideDown() { return gTrue; }
47 // Does this device use drawChar() or drawString()?
48 virtual GBool useDrawChar() { return gFalse; }
51 virtual void drawImageMask(GfxState *state, Stream *str,
52 int width, int height, GBool invert,
54 virtual void drawImage(GfxState *state, Stream *str, int width,
55 int height, GfxImageColorMap *colorMap,
60 char *fileRoot; // root of output file names
61 char *fileName; // buffer for output file names
62 GBool dumpJPEG; // set to dump native JPEG files
63 int imgNum; // current image number
64 GBool ok; // set up ok?