00001 /****************************************************************************\ 00002 * VRVis * 00003 * http://vrvis.sourceforge.net * 00004 * (C) 2004 by Alex Loeffler * 00005 * mailto:aloeffler@users.sourceforge.net * 00006 **************************************************************************** 00007 * License * 00008 * * 00009 * This library is free software; you can redistribute it and/or modify it * 00010 * under the terms of the GNU Library General Public License as published * 00011 * by the Free Software Foundation, version 2. * 00012 * * 00013 * This library is distributed in the hope that it will be useful, but * 00014 * WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00016 * Library General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU Library General Public * 00019 * License along with this library; if not, write to the Free Software * 00020 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 00021 \****************************************************************************/ 00022 00023 #ifndef IMAGE_HPP 00024 #define IMAGE_HPP 00025 00026 #include <string> 00027 #include <vector> 00028 #include "Common.hpp" 00029 00030 class GDALDataset; 00031 00032 namespace vrvis 00033 { 00034 00035 template <class DataTypeT> class ImageBand; 00036 00038 template <class DataTypeT> 00039 class Image 00040 { 00041 // ================================================================== PUBLIC 00042 00043 public: 00044 00045 // ----------------------------------------------- Constructor & Destructor. 00047 00049 Image(const std::string& crFilename); 00051 ~Image(void); 00052 00054 // -------------------------------------------------------------- Accessors. 00056 00058 const std::string& getFilename(void) const; 00060 int getSizeX(void) const; 00062 int getSizeY(void) const; 00064 int getNumBands(void) const; 00065 00067 DataTypeT getLowerHistogramLimit(void) const; 00069 DataTypeT getUpperHistogramLimit(void) const; 00070 00072 ImageBand<DataTypeT>* getBand(const int cNumBand) const; 00073 00075 // ----------------------------------------------------------- Type mapping. 00076 00078 static int mapGDALType(void); 00079 00080 // ================================================================= PRIVATE 00081 00082 private: 00083 00084 // ---------------------------------------------------------------- Friends. 00085 00087 friend class ImageBand<DataTypeT>; 00088 00089 // --------------------------------------------------------------- Typedefs. 00090 00092 typedef ImageBand<DataTypeT> Band; 00094 typedef std::vector<Band*> BandVector; 00095 00096 // ---------------------------------------------------- Member Construction. 00097 00099 static GDALDataset* constructDataset(const std::string& crFilename); 00100 00101 // -------------------------------------------------------------- Accessors. 00102 00104 GDALDataset* getGDALDataset(void) const; 00105 00106 // ---------------------------------------------------------------- Members. 00107 00108 const std::string mcFilename; 00109 00110 GDALDataset* mpGDALDataset; 00111 00112 const int mcSizeX; 00113 const int mcSizeY; 00114 const int mcNumBands; 00115 00116 //DataTypeT mMinimumBandValue; //!< Minimum value contained in any band. 00117 //DataTypeT mMaximumBandValue; //!< Maximum value contained in any band. 00118 00120 DataTypeT mLowerHistogramLimit; 00122 DataTypeT mUpperHistogramLimit; 00123 00124 BandVector mBands; 00125 }; 00126 00127 } // End namespace. 00128 00129 // Include template implementation. 00130 #include "Image.inl" 00131 00132 #endif // IMAGE_HPP