Bitmap.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: Bitmap.hpp 1644 2009-01-27 19:26:14Z ckiesch $"
00002 
00004 
00005 //============================================================================
00006 //
00007 //  This file is part of GPSTk, the GPS Toolkit.
00008 //
00009 //  The GPSTk is free software; you can redistribute it and/or modify
00010 //  it under the terms of the GNU Lesser General Public License as published
00011 //  by the Free Software Foundation; either version 2.1 of the License, or
00012 //  any later version.
00013 //
00014 //  The GPSTk is distributed in the hope that it will be useful,
00015 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 //  GNU Lesser General Public License for more details.
00018 //
00019 //  You should have received a copy of the GNU Lesser General Public
00020 //  License along with GPSTk; if not, write to the Free Software Foundation,
00021 //  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 //  
00023 //  Copyright 2004, The University of Texas at Austin
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       // ColorMap information
00145       CMType which;
00146       ColorMap cm;
00147       InterpolatedColorMap icm;
00148    }; // class Bitmap
00149 
00151 
00152 } // namespace vdraw
00153 
00154 #endif //VDRAW_BITMAP_H
00155 
00156 

Generated on Tue May 22 03:30:56 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1