00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef QGSNINECELLFILTER_H
00019 #define QGSNINECELLFILTER_H
00020
00021 #include <QString>
00022 #include "gdal.h"
00023
00024 class QProgressDialog;
00025
00030 class ANALYSIS_EXPORT QgsNineCellFilter
00031 {
00032 public:
00034 QgsNineCellFilter( const QString& inputFile, const QString& outputFile, const QString& outputFormat );
00035 virtual ~QgsNineCellFilter();
00039 int processRaster( QProgressDialog* p );
00040
00041 double cellSizeX() const { return mCellSizeX; }
00042 void setCellSizeX( double size ) { mCellSizeX = size; }
00043 double cellSizeY() const { return mCellSizeY; }
00044 void setCellSizeY( double size ) { mCellSizeY = size; }
00045
00046 double zFactor() const { return mZFactor; }
00047 void setZFactor( double factor ) { mZFactor = factor; }
00048
00049 double inputNodataValue() const { return mInputNodataValue; }
00050 void setInputNodataValue( double value ) { mInputNodataValue = value; }
00051 double outputNodataValue() const { return mOutputNodataValue; }
00052 void setOutputNodataValue( double value ) { mOutputNodataValue = value; }
00053
00056 virtual float processNineCellWindow( float* x11, float* x21, float* x31,
00057 float* x12, float* x22, float* x32,
00058 float* x13, float* x23, float* x33 ) = 0;
00059
00060 private:
00061
00062 QgsNineCellFilter();
00063
00065 GDALDatasetH openInputFile( int& nCellsX, int& nCellsY );
00068 GDALDriverH openOutputDriver();
00071 GDALDatasetH openOutputFile( GDALDatasetH inputDataset, GDALDriverH outputDriver );
00072
00073 protected:
00074
00075 QString mInputFile;
00076 QString mOutputFile;
00077 QString mOutputFormat;
00078
00079 double mCellSizeX;
00080 double mCellSizeY;
00082 float mInputNodataValue;
00084 float mOutputNodataValue;
00086 double mZFactor;
00087 };
00088
00089 #endif // QGSNINECELLFILTER_H