Quantum GIS API Documentation  1.8
src/analysis/raster/qgsninecellfilter.h
Go to the documentation of this file.
00001 /***************************************************************************
00002                           qgsninecellfilter.h  -  description
00003                              -------------------
00004     begin                : August 6th, 2009
00005     copyright            : (C) 2009 by Marco Hugentobler
00006     email                : marco dot hugentobler at karto dot baug dot ethz dot ch
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
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     //default constructor forbidden. We need input file, output file and format obligatory
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
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines