]> www.fi.muni.cz Git - evince.git/blob - pdf/xpdf/ImageOutputDev.h
Synched with Xpdf 1.01
[evince.git] / pdf / xpdf / ImageOutputDev.h
1 //========================================================================
2 //
3 // ImageOutputDev.h
4 //
5 // Copyright 1998-2002 Glyph & Cog, LLC
6 //
7 //========================================================================
8
9 #ifndef IMAGEOUTPUTDEV_H
10 #define IMAGEOUTPUTDEV_H
11
12 #ifdef __GNUC__
13 #pragma interface
14 #endif
15
16 #include <stdio.h>
17 #include "gtypes.h"
18 #include "OutputDev.h"
19
20 class GfxState;
21
22 //------------------------------------------------------------------------
23 // ImageOutputDev
24 //------------------------------------------------------------------------
25
26 class ImageOutputDev: public OutputDev {
27 public:
28
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);
34
35   // Destructor.
36   virtual ~ImageOutputDev();
37
38   // Check if file was successfully created.
39   virtual GBool isOk() { return ok; }
40
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; }
44
45   // Does this device need non-text content?
46   virtual GBool needNonText() { return gFalse; }
47
48   //---- get info about output device
49
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; }
53
54   // Does this device use drawChar() or drawString()?
55   virtual GBool useDrawChar() { return gFalse; }
56
57   //----- image drawing
58   virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
59                              int width, int height, GBool invert,
60                              GBool inlineImg);
61   virtual void drawImage(GfxState *state, Object *ref, Stream *str,
62                          int width, int height, GfxImageColorMap *colorMap,
63                          int *maskColors, GBool inlineImg);
64
65 private:
66
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?
72 };
73
74 #endif