00001 #pragma ident "$Id: Bitmap.hpp 1644 2009-01-27 19:26:14Z ckiesch $"
00002
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef VDRAW_BITMAP_H
00028 #define VDRAW_BITMAP_H
00029
00030 #include "ColorMap.hpp"
00031 #include "InterpolatedColorMap.hpp"
00032
00033 namespace vdraw
00034 {
00037
00042 class Bitmap {
00043
00044 public:
00045
00047 enum CMType { CM, ICM };
00048
00050 double x1;
00051
00053 double y1;
00054
00056 double x2;
00057
00059 double y2;
00060
00062 int osr;
00063
00065 int osc;
00066
00068 bool boxes;
00069
00078 Bitmap(double ix1, double iy1, double ix2, double iy2,
00079 const ColorMap &c);
00080
00089 Bitmap(double ix1, double iy1, double ix2, double iy2,
00090 const InterpolatedColorMap &ic);
00091
00093 Bitmap(const Bitmap& o);
00094
00096 ~Bitmap() {}
00097
00100 bool getCM(ColorMap *c) const
00101 {
00102 if(which!=CM) return false;
00103 *c = cm;
00104 return true;
00105 }
00106
00109 bool getICM(InterpolatedColorMap *c) const
00110 {
00111 if(which!=ICM) return false;
00112 *c = icm;
00113 return true;
00114 }
00115
00117 inline void oversample(int scale) { oversample(scale,scale); }
00118
00125 inline void oversample(int rscale, int cscale)
00126 {
00127 osr = rscale;
00128 osc = cscale;
00129 if(osr<1) osr=1;
00130 if(osc<1) osr=1;
00131 }
00132
00134 inline void useBoxes(bool useboxes) { boxes = useboxes; }
00135
00136 protected:
00137
00138 private:
00139
00142 void fixPoints();
00143
00144
00145 CMType which;
00146 ColorMap cm;
00147 InterpolatedColorMap icm;
00148 };
00149
00151
00152 }
00153
00154 #endif //VDRAW_BITMAP_H
00155
00156