Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

omggdal.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2005 by Tim Sutton   *
00003  *   tim@linfiniti.com   *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 #ifndef OMGGDAL_H
00021 #define OMGGDAL_H
00022 
00023 #include <QObject>
00024 #include "gdal_priv.h"
00025 class QString;
00026 
00030 struct BandStats {
00031         QString bandName;
00032         int bandNo;
00033         double minValDouble;
00034         double maxValDouble;
00035         //the distance between min & max
00036         double rangeDouble;
00037         double meanDouble;
00038         double sumSqrDevDouble; //used to calculate stddev
00039         double stdDevDouble;
00040         double sumDouble;
00041         int elementCountInt;
00042         double noDataDouble;
00043 };
00044 
00045   int CPL_STDCALL progressCallback( double dfComplete, const char *pszMessage,
00046                        void * pProgressArg );
00047 
00052 class OMG_LIB_EXPORT OmgGdal : public QObject
00053 {
00054   Q_OBJECT;
00055 
00056 public:
00057   //declare eums first!
00058   enum FileType {GeoTiff,ArcInfoAscii};
00059 
00060   OmgGdal();
00061   ~OmgGdal();
00062 
00063   const QString getWorldFile(const QString theFileName) ;
00064   const QString getAsciiHeader(const QString theFileName) ;
00073   const bool convert(const QString theInputFile, const QString theOutputFileName, const FileType theOutputFileType) ;
00074 
00084   //  const bool gdalResize(const QString theFileName, const QString theOutputFileName, const int theWidth, const int theHeight){};
00085 
00091   void buildSupportedRasterFileFilter(QString & theFileFiltersString);
00092 
00099   const QString contour(const QString theInputFile);
00104   void showProgress (int theProgress,int theMaximum);
00110   static bool isValidGdalFile(const QString theFilename);
00116   static bool isValidGdalProj(const QString theFilename);
00117 
00125   void writeImage(QString theInputFileString, 
00126     QString theOutputFileString,
00127     int theWidth,
00128     int theHeight);
00132   const bool makeLegend(const QString theOutputFileName, const int theWidth);
00138   const bool gdal2gdal(const QString theFileName, 
00139     const QString theOutputFileName,
00140     const QString theFormat);
00141   const bool gdal2Tiff(const QString theFileName, const QString theOutputFileName);
00142   const bool gdal2Ascii(const QString theFileName, const QString theOutputFileName);
00143 signals:
00144   void error (QString theError);
00150   void updateProgress (int theProgress,int theMaximum);
00151 
00152 private:
00153 
00155   void calculateStats(BandStats * theBandStats,GDALDataset * gdalDataset);
00156 
00157 };
00158 #endif //OMGGDAL_H

Generated on Mon Apr 28 15:08:33 2008 for openModellerDesktop by  doxygen 1.4.1-20050210