dvi2bitmap  dvi2bitmap1.0
BitmapImage.h
Go to the documentation of this file.
1 /* This file is part of dvi2bitmap; see README for copyrights and licence */
2 
3 #ifndef BITMAPIMAGE_HEADER_READ
4 #define BITMAPIMAGE_HEADER_READ 1
5 
6 #include "Byte.h"
7 #include "verbosity.h"
8 #include "Bitmap.h" // for BitmapColour
9 
13 class BitmapImage {
14  public:
15  BitmapImage(const int w, const int h, const int bpp=1);
16  virtual ~BitmapImage();
17  void setBitmap (const Byte *B);
18  void setBitmapRow (const Byte *B);
19  //virtual void setColourTable (???) = 0;
20  void setTransparent (const bool sw) { isTransparent_ = sw; };
21  void setRGB (const bool fg, const Bitmap::BitmapColour* rgb) {
22  if (fg)
23  {
24  fg_.red=rgb->red; fg_.green=rgb->green; fg_.blue=rgb->blue;
25  }
26  else
27  {
28  bg_.red=rgb->red; bg_.green=rgb->green; bg_.blue=rgb->blue;
29  }
30  };
31  virtual void write (const string filename) = 0;
32  virtual string fileExtension() const = 0;
33 
34  // Information about environment
36  static void setInfo (const infoFields which, const string *s);
37 
39  (const string format, const int w, const int h, const int bpp=1);
40  static bool supportedBitmapImage (const string format);
41  // Return default bitmap format
42  static const char* firstBitmapImageFormat();
43  // After a call to firstBitmapImageFormat, successive calls to
44  // nextBitmapImageFormat return further allowable formats.
45  static const char* nextBitmapImageFormat();
46  static void verbosity (const verbosities level) { verbosity_ = level; }
47 
48  protected:
49  int w_, h_;
50  const int bpp_;
51  const Byte *bitmap_;
53  bool myBitmap_;
56  //Byte fg_red_, fg_green_, fg_blue_, bg_red_, bg_green_, bg_blue_;
58 
59  static const string *softwareversion;
60  static const string *inputfilename;
61  static const string *furtherinfo;
62  static const char* formats[];
63  static const int nformats;
64  static int iterator_index;
66 };
67 #endif // #ifndef BITMAPIMAGE_HEADER_READ