27 #include "qgis_analysis.h"
42 ReliefColor(
const QColor &
c,
double min,
double max ): color(
c ), minElevation( min ), maxElevation( max ) { }
48 QgsRelief(
const QString &inputFile,
const QString &outputFile,
const QString &outputFormat );
60 int processRaster(
QgsFeedback *feedback =
nullptr );
62 double zFactor()
const {
return mZFactor; }
65 void clearReliefColors();
67 QList< QgsRelief::ReliefColor >
reliefColors()
const {
return mReliefColors; }
73 QList< QgsRelief::ReliefColor > calculateOptimizedReliefClasses();
76 bool exportFrequencyDistributionToCsv(
const QString &file );
85 QString mOutputFormat;
87 double mCellSizeX = 0.0;
88 double mCellSizeY = 0.0;
90 float mInputNodataValue = -1;
92 float mOutputNodataValue = -1;
96 std::unique_ptr< QgsSlopeFilter > mSlopeFilter;
97 std::unique_ptr< QgsAspectFilter > mAspectFilter;
98 std::unique_ptr< QgsHillshadeFilter > mHillshadeFilter285;
99 std::unique_ptr< QgsHillshadeFilter > mHillshadeFilter300;
100 std::unique_ptr< QgsHillshadeFilter > mHillshadeFilter315;
103 QList< ReliefColor > mReliefColors;
105 bool processNineCellWindow(
float *x1,
float *x2,
float *x3,
float *x4,
float *x5,
float *x6,
float *x7,
float *x8,
float *x9,
106 unsigned char *red,
unsigned char *green,
unsigned char *blue );
114 GDALDriverH openOutputDriver();
122 bool setElevationColor(
double elevation,
int *red,
int *green,
int *blue );
125 void setDefaultReliefColors();
130 int frequencyClassForElevation(
double elevation,
double minElevation,
double elevationClassRange );
132 void optimiseClassBreaks( QList<int> &breaks,
double *frequencies );
140 bool calculateRegression(
const QList< QPair < int, double > > &input,
double &a,
double &b );
144 #endif // QGSRELIEF_H