filters

ImageOutputDev.h

00001 //========================================================================
00002 //
00003 // ImageOutputDev.h
00004 //
00005 // Copyright 1998-2002 Glyph & Cog, LLC
00006 //
00007 //========================================================================
00008 
00009 #ifndef IMAGEOUTPUTDEV_H
00010 #define IMAGEOUTPUTDEV_H
00011 
00012 #include <aconf.h>
00013 
00014 #ifdef USE_GCC_PRAGMAS
00015 #pragma interface
00016 #endif
00017 
00018 #include <stdio.h>
00019 #include "gtypes.h"
00020 #include "OutputDev.h"
00021 
00022 class GfxState;
00023 
00024 //------------------------------------------------------------------------
00025 // ImageOutputDev
00026 //------------------------------------------------------------------------
00027 
00028 class ImageOutputDev: public OutputDev {
00029 public:
00030 
00031   // Create an OutputDev which will write images to files named
00032   // <fileRoot>-NNN.<type>.  Normally, all images are written as PBM
00033   // (.pbm) or PPM (.ppm) files.  If <dumpJPEG> is set, JPEG images are
00034   // written as JPEG (.jpg) files.
00035   ImageOutputDev(char *fileRootA, GBool dumpJPEGA);
00036 
00037   // Destructor.
00038   virtual ~ImageOutputDev();
00039 
00040   // Check if file was successfully created.
00041   virtual GBool isOk() { return ok; }
00042 
00043   // Does this device use beginType3Char/endType3Char?  Otherwise,
00044   // text in Type 3 fonts will be drawn with drawChar/drawString.
00045   virtual GBool interpretType3Chars() { return gFalse; }
00046 
00047   // Does this device need non-text content?
00048   virtual GBool needNonText() { return gFalse; }
00049 
00050   //---- get info about output device
00051 
00052   // Does this device use upside-down coordinates?
00053   // (Upside-down means (0,0) is the top left corner of the page.)
00054   virtual GBool upsideDown() { return gTrue; }
00055 
00056   // Does this device use drawChar() or drawString()?
00057   virtual GBool useDrawChar() { return gFalse; }
00058 
00059   //----- image drawing
00060   virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
00061                  int width, int height, GBool invert,
00062                  GBool inlineImg);
00063   virtual void drawImage(GfxState *state, Object *ref, Stream *str,
00064              int width, int height, GfxImageColorMap *colorMap,
00065              int *maskColors, GBool inlineImg);
00066 
00067 private:
00068 
00069   char *fileRoot;       // root of output file names
00070   char *fileName;       // buffer for output file names
00071   GBool dumpJPEG;       // set to dump native JPEG files
00072   int imgNum;           // current image number
00073   GBool ok;         // set up ok?
00074 };
00075 
00076 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys