21 #ifndef QGSCONTRASTENHANCEMENT_H 22 #define QGSCONTRASTENHANCEMENT_H 24 #include "qgis_core.h" 54 UserDefinedEnhancement
111 int enhanceContrast(
double value );
117 bool isValueInDisplayableRange(
double value );
144 void setMaximumValue(
double value,
bool generateTable =
true );
156 void setMinimumValue(
double value,
bool generateTable =
true );
158 void writeXml( QDomDocument &doc, QDomElement &parentElem )
const;
160 void readXml(
const QDomElement &elem );
169 void toSld( QDomDocument &doc, QDomElement &element )
const;
180 std::unique_ptr< QgsContrastEnhancementFunction > mContrastEnhancementFunction;
183 bool mEnhancementDirty =
false;
186 double mLookupTableOffset;
189 int *mLookupTable =
nullptr;
192 double mMinimumValue;
195 double mMaximumValue;
201 double mRasterDataTypeRange;
204 bool generateLookupTable();
207 int calculateContrastEnhancementValue(
double );
ContrastEnhancementAlgorithm contrastEnhancementAlgorithm() const
DataType
Raster data types.
A contrast enhancement function is the base class for all raster contrast enhancements.
double minimumValue() const
Returns the minimum value for the contrast enhancement range.
ContrastEnhancementAlgorithm
This enumerator describes the types of contrast enhancement algorithms that can be used...
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into allowing algorithms to be written in pure substantial changes are required in order to port existing x Processing algorithms for QGIS x The most significant changes are outlined not GeoAlgorithm For algorithms which operate on features one by consider subclassing the QgsProcessingFeatureBasedAlgorithm class This class allows much of the boilerplate code for looping over features from a vector layer to be bypassed and instead requires implementation of a processFeature method Ensure that your algorithm(or algorithm's parent class) implements the new pure virtual createInstance(self) call
double maximumValue() const
Returns the maximum value for the contrast enhancement range.
Manipulates raster pixel values so that they enhanceContrast or clip into a specified numerical range...
Eight bit unsigned integer (quint8)