QGIS API Documentation  2.99.0-Master (6a61179)
qgsninecellfilter.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsninecellfilter.h - description
3  -------------------
4  begin : August 6th, 2009
5  copyright : (C) 2009 by Marco Hugentobler
6  email : marco dot hugentobler at karto dot baug dot ethz dot ch
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSNINECELLFILTER_H
19 #define QGSNINECELLFILTER_H
20 
21 #include <QString>
22 #include "gdal.h"
23 
24 class QProgressDialog;
25 
31 class ANALYSIS_EXPORT QgsNineCellFilter
32 {
33  public:
35  QgsNineCellFilter( const QString& inputFile, const QString& outputFile, const QString& outputFormat );
36  virtual ~QgsNineCellFilter();
37 
41  int processRaster( QProgressDialog* p );
42 
43  double cellSizeX() const { return mCellSizeX; }
44  void setCellSizeX( double size ) { mCellSizeX = size; }
45  double cellSizeY() const { return mCellSizeY; }
46  void setCellSizeY( double size ) { mCellSizeY = size; }
47 
48  double zFactor() const { return mZFactor; }
49  void setZFactor( double factor ) { mZFactor = factor; }
50 
51  double inputNodataValue() const { return mInputNodataValue; }
52  void setInputNodataValue( double value ) { mInputNodataValue = value; }
53  double outputNodataValue() const { return mOutputNodataValue; }
54  void setOutputNodataValue( double value ) { mOutputNodataValue = value; }
55 
58  virtual float processNineCellWindow( float* x11, float* x21, float* x31,
59  float* x12, float* x22, float* x32,
60  float* x13, float* x23, float* x33 ) = 0;
61 
62  private:
63  //default constructor forbidden. We need input file, output file and format obligatory
65 
67  GDALDatasetH openInputFile( int& nCellsX, int& nCellsY );
68 
71  GDALDriverH openOutputDriver();
72 
75  GDALDatasetH openOutputFile( GDALDatasetH inputDataset, GDALDriverH outputDriver );
76 
77  protected:
78 
79  QString mInputFile;
80  QString mOutputFile;
81  QString mOutputFormat;
82 
83  double mCellSizeX;
84  double mCellSizeY;
90  double mZFactor;
91 };
92 
93 #endif // QGSNINECELLFILTER_H
void setZFactor(double factor)
void setCellSizeY(double size)
void setInputNodataValue(double value)
double inputNodataValue() const
void setCellSizeX(double size)
void * GDALDatasetH
double cellSizeX() const
float mOutputNodataValue
The nodata value of the output layer.
double outputNodataValue() const
double mZFactor
Scale factor for z-value if x-/y- units are different to z-units (111120 for degree->meters and 37040...
double zFactor() const
void setOutputNodataValue(double value)
float mInputNodataValue
The nodata value of the input layer.
double cellSizeY() const
Base class for raster analysis methods that work with a 3x3 cell filter and calculate the value of ea...