18#ifndef QGSALGORITHMRASTERFREQUENCYBYCOMPARISON_H
19#define QGSALGORITHMRASTERFREQUENCYBYCOMPARISON_H
34 QgsRasterFrequencyByComparisonOperatorBase() =
default;
35 void initAlgorithm(
const QVariantMap &configuration = QVariantMap() )
override;
36 QString
group()
const override;
37 QString
groupId()
const override;
42 virtual int applyComparisonOperator(
double value, std::vector<double>cellValueStack ) = 0;
45 std::unique_ptr< QgsRasterInterface > mInputValueRasterInterface;
46 int mInputValueRasterBand;
47 std::vector< QgsRasterAnalysisUtils::RasterLogicInput > mInputs;
49 double mNoDataValue = -9999;
54 double mRasterUnitsPerPixelX;
55 double mRasterUnitsPerPixelY;
58class QgsRasterFrequencyByEqualOperatorAlgorithm :
public QgsRasterFrequencyByComparisonOperatorBase
61 QgsRasterFrequencyByEqualOperatorAlgorithm() =
default;
62 QString name()
const override;
63 QString displayName()
const override;
64 QStringList tags()
const override;
65 QString shortHelpString()
const override;
66 QgsRasterFrequencyByEqualOperatorAlgorithm *createInstance() const override
SIP_FACTORY;
69 int applyComparisonOperator(
double searchValue, std::vector<
double>cellValueStack ) override;
72class QgsRasterFrequencyByGreaterThanOperatorAlgorithm : public QgsRasterFrequencyByComparisonOperatorBase
75 QgsRasterFrequencyByGreaterThanOperatorAlgorithm() =
default;
76 QString name()
const override;
77 QString displayName()
const override;
78 QStringList tags()
const override;
79 QString shortHelpString()
const override;
80 QgsRasterFrequencyByGreaterThanOperatorAlgorithm *createInstance() const override
SIP_FACTORY;
83 int applyComparisonOperator(
double value, std::vector<
double>cellValueStack ) override;
86class QgsRasterFrequencyByLessThanOperatorAlgorithm : public QgsRasterFrequencyByComparisonOperatorBase
89 QgsRasterFrequencyByLessThanOperatorAlgorithm() =
default;
90 QString name()
const override;
91 QString displayName()
const override;
92 QStringList tags()
const override;
93 QString shortHelpString()
const override;
94 QgsRasterFrequencyByLessThanOperatorAlgorithm *createInstance() const override
SIP_FACTORY;
97 int applyComparisonOperator(
double value, std::vector<
double>cellValueStack ) override;
This class represents a coordinate reference system (CRS).
Abstract base class for processing algorithms.
virtual QString group() const
Returns the name of the group this algorithm belongs to.
virtual QString groupId() const
Returns the unique ID of the group this algorithm belongs to.
virtual QVariantMap processAlgorithm(const QVariantMap ¶meters, QgsProcessingContext &context, QgsProcessingFeedback *feedback) SIP_THROW(QgsProcessingException)=0
Runs the algorithm using the specified parameters.
virtual bool prepareAlgorithm(const QVariantMap ¶meters, QgsProcessingContext &context, QgsProcessingFeedback *feedback) SIP_THROW(QgsProcessingException)
Prepares the algorithm to run using the specified parameters.
virtual void initAlgorithm(const QVariantMap &configuration=QVariantMap())=0
Initializes the algorithm using the specified configuration.
Contains information about the context in which a processing algorithm is executed.
Base class for providing feedback from a processing algorithm.
A rectangle specified with double values.