]> www.fi.muni.cz Git - evince.git/blob - pdf/xpdf/ImageOutputDev.h
file cursor-hand-open.png was initially added on branch gpdf-modes.
[evince.git] / pdf / xpdf / ImageOutputDev.h
1 //========================================================================
2 //
3 // ImageOutputDev.h
4 //
5 // Copyright 1998-2003 Glyph & Cog, LLC
6 //
7 //========================================================================
8
9 #ifndef IMAGEOUTPUTDEV_H
10 #define IMAGEOUTPUTDEV_H
11
12 #include <aconf.h>
13
14 #ifdef USE_GCC_PRAGMAS
15 #pragma interface
16 #endif
17
18 #include <stdio.h>
19 #include "gtypes.h"
20 #include "OutputDev.h"
21
22 class GfxState;
23
24 //------------------------------------------------------------------------
25 // ImageOutputDev
26 //------------------------------------------------------------------------
27
28 class ImageOutputDev: public OutputDev {
29 public:
30
31   // Create an OutputDev which will write images to files named
32   // <fileRoot>-NNN.<type>.  Normally, all images are written as PBM
33   // (.pbm) or PPM (.ppm) files.  If <dumpJPEG> is set, JPEG images are
34   // written as JPEG (.jpg) files.
35   ImageOutputDev(char *fileRootA, GBool dumpJPEGA);
36
37   // Destructor.
38   virtual ~ImageOutputDev();
39
40   // Check if file was successfully created.
41   virtual GBool isOk() { return ok; }
42
43   // Does this device use beginType3Char/endType3Char?  Otherwise,
44   // text in Type 3 fonts will be drawn with drawChar/drawString.
45   virtual GBool interpretType3Chars() { return gFalse; }
46
47   // Does this device need non-text content?
48   virtual GBool needNonText() { return gFalse; }
49
50   //---- get info about output device
51
52   // Does this device use upside-down coordinates?
53   // (Upside-down means (0,0) is the top left corner of the page.)
54   virtual GBool upsideDown() { return gTrue; }
55
56   // Does this device use drawChar() or drawString()?
57   virtual GBool useDrawChar() { return gFalse; }
58
59   //----- image drawing
60   virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
61                              int width, int height, GBool invert,
62                              GBool inlineImg);
63   virtual void drawImage(GfxState *state, Object *ref, Stream *str,
64                          int width, int height, GfxImageColorMap *colorMap,
65                          int *maskColors, GBool inlineImg);
66
67 private:
68
69   char *fileRoot;               // root of output file names
70   char *fileName;               // buffer for output file names
71   GBool dumpJPEG;               // set to dump native JPEG files
72   int imgNum;                   // current image number
73   GBool ok;                     // set up ok?
74 };
75
76 #endif