Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

BitmapImage.h

Go to the documentation of this file.
00001 // This file is part of dvi2bitmap. 00002 // Copyright 1999--2002, Council for the Central Laboratory of the Research Councils 00003 // 00004 // This program is part of the Starlink Software Distribution: see 00005 // http://www.starlink.ac.uk 00006 // 00007 // dvi2bitmap is free software; you can redistribute it and/or modify 00008 // it under the terms of the GNU General Public License as published by 00009 // the Free Software Foundation; either version 2 of the License, or 00010 // (at your option) any later version. 00011 // 00012 // dvi2bitmap is distributed in the hope that it will be useful, 00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 // GNU General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU General Public License 00018 // along with dvi2bitmap; if not, write to the Free Software 00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 // 00021 // The General Public License is distributed along with this 00022 // program in the file LICENCE. 00023 // 00024 // Author: Norman Gray <norman@astro.gla.ac.uk> 00025 // $Id: BitmapImage.h,v 1.16 2003/02/16 21:48:06 norman Exp $ 00026 00027 00028 #ifndef BITMAPIMAGE_HEADER_READ 00029 #define BITMAPIMAGE_HEADER_READ 1 00030 00031 #include "Byte.h" 00032 #include "verbosity.h" 00033 #include "Bitmap.h" // for BitmapColour 00034 00035 class BitmapImage { 00036 public: 00037 BitmapImage(const int w, const int h, const int bpp=1); 00038 virtual ~BitmapImage(); 00039 void setBitmap (const Byte *B); 00040 void setBitmapRow (const Byte *B); 00041 //virtual void setColourTable (???) = 0; 00042 void setTransparent (const bool sw) { isTransparent_ = sw; }; 00043 void setRGB (const bool fg, const Bitmap::BitmapColour* rgb) { 00044 if (fg) 00045 { 00046 fg_.red=rgb->red; fg_.green=rgb->green; fg_.blue=rgb->blue; 00047 } 00048 else 00049 { 00050 bg_.red=rgb->red; bg_.green=rgb->green; bg_.blue=rgb->blue; 00051 } 00052 }; 00053 virtual void write (const string filename) = 0; 00054 virtual string fileExtension() const = 0; 00055 00056 // Information about environment 00057 enum infoFields {SOFTWAREVERSION, INPUTFILENAME, FURTHERINFO}; 00058 static void setInfo (const infoFields which, const string *s); 00059 00060 static BitmapImage *newBitmapImage 00061 (const string format, const int w, const int h, const int bpp=1); 00062 static bool supportedBitmapImage (const string format); 00063 // Return default bitmap format 00064 static const char* firstBitmapImageFormat(); 00065 // After a call to firstBitmapImageFormat, successive calls to 00066 // nextBitmapImageFormat return further allowable formats. 00067 static const char* nextBitmapImageFormat(); 00068 static void verbosity (const verbosities level) { verbosity_ = level; } 00069 00070 protected: 00071 int w_, h_; 00072 const int bpp_; 00073 const Byte *bitmap_; 00074 Byte *allocBitmap_; 00075 bool myBitmap_; 00076 int bitmapRows_; 00077 bool isTransparent_; 00078 //Byte fg_red_, fg_green_, fg_blue_, bg_red_, bg_green_, bg_blue_; 00079 Bitmap::BitmapColour fg_, bg_; 00080 00081 static const string *softwareversion; 00082 static const string *inputfilename; 00083 static const string *furtherinfo; 00084 static const char* formats[]; 00085 static const int nformats; 00086 static int iterator_index; 00087 static verbosities verbosity_; 00088 }; 00089 #endif // #ifndef BITMAPIMAGE_HEADER_READ

Generated on Sun Aug 21 18:21:02 2005 for dvi2bitmap by doxygen 1.3.8