home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 110 / EnigmaAmiga110CD.iso / indispensabili / utility / apdf / xpdf-0.80 / xpdf / imageoutputdev.h < prev    next >
C/C++ Source or Header  |  1998-11-27  |  2KB  |  68 lines

  1. //========================================================================
  2. //
  3. // ImageOutputDev.h
  4. //
  5. // Copyright 1998 Derek B. Noonburg
  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 *fileRoot1, GBool dumpJPEG1);
  34.  
  35.   // Destructor.
  36.   virtual ~ImageOutputDev();
  37.  
  38.   // Check if file was successfully created.
  39.   virtual GBool isOk() { return ok; }
  40.  
  41.   //---- get info about output device
  42.  
  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; }
  46.  
  47.   // Does this device use drawChar() or drawString()?
  48.   virtual GBool useDrawChar() { return gFalse; }
  49.  
  50.   //----- image drawing
  51.   virtual void drawImageMask(GfxState *state, Stream *str,
  52.                  int width, int height, GBool invert,
  53.                  GBool inlineImg);
  54.   virtual void drawImage(GfxState *state, Stream *str, int width,
  55.              int height, GfxImageColorMap *colorMap,
  56.              GBool inlineImg);
  57.  
  58. private:
  59.  
  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?
  65. };
  66.  
  67. #endif
  68.