QGIS API Documentation
2.18.21-Las Palmas (9fba24a)
|
Manipulates raster pixel values so that they enhanceContrast or clip into a specified numerical range according to the specified ContrastEnhancementAlgorithm. More...
#include <qgscontrastenhancement.h>
Public Types | |
enum | ContrastEnhancementAlgorithm { NoEnhancement, StretchToMinimumMaximum, StretchAndClipToMinimumMaximum, ClipToMinimumMaximum, UserDefinedEnhancement } |
This enumerator describes the types of contrast enhancement algorithms that can be used. More... | |
Public Member Functions | |
QgsContrastEnhancement (QGis::DataType theDatatype=QGis::Byte) | |
QgsContrastEnhancement (const QgsContrastEnhancement &ce) | |
~QgsContrastEnhancement () | |
ContrastEnhancementAlgorithm | contrastEnhancementAlgorithm () const |
int | enhanceContrast (double) |
Apply the contrast enhancement to a value. More... | |
bool | isValueInDisplayableRange (double) |
Return true if pixel is in stretable range, false if pixel is outside of range (i.e., clipped) More... | |
double | maximumValue () const |
Return the maximum value for the contrast enhancement range. More... | |
double | minimumValue () const |
Return the minimum value for the contrast enhancement range. More... | |
void | readXML (const QDomElement &elem) |
void | setContrastEnhancementAlgorithm (ContrastEnhancementAlgorithm, bool generateTable=true) |
Set the contrast enhancement algorithm. More... | |
void | setContrastEnhancementFunction (QgsContrastEnhancementFunction *) |
A public method that allows the user to set their own custom contrast enhancment function. More... | |
void | setMaximumValue (double, bool generateTable=true) |
Set the maximum value for the contrast enhancement range. More... | |
void | setMinimumValue (double, bool generateTable=true) |
Return the minimum value for the contrast enhancement range. More... | |
void | writeXML (QDomDocument &doc, QDomElement &parentElem) const |
Static Public Member Functions | |
static ContrastEnhancementAlgorithm | contrastEnhancementAlgorithmFromString (const QString &contrastEnhancementString) |
static QString | contrastEnhancementAlgorithmString (ContrastEnhancementAlgorithm algorithm) |
static double | maximumValuePossible (QGis::DataType) |
Helper function that returns the maximum possible value for a GDAL data type. More... | |
static double | minimumValuePossible (QGis::DataType) |
Helper function that returns the minimum possible value for a GDAL data type. More... | |
Manipulates raster pixel values so that they enhanceContrast or clip into a specified numerical range according to the specified ContrastEnhancementAlgorithm.
Definition at line 38 of file qgscontrastenhancement.h.
This enumerator describes the types of contrast enhancement algorithms that can be used.
Enumerator | |
---|---|
NoEnhancement | |
StretchToMinimumMaximum | |
StretchAndClipToMinimumMaximum | |
ClipToMinimumMaximum | |
UserDefinedEnhancement |
Definition at line 44 of file qgscontrastenhancement.h.
QgsContrastEnhancement::QgsContrastEnhancement | ( | QGis::DataType | theDatatype = QGis::Byte | ) |
Definition at line 32 of file qgscontrastenhancement.cpp.
QgsContrastEnhancement::QgsContrastEnhancement | ( | const QgsContrastEnhancement & | ce | ) |
Definition at line 55 of file qgscontrastenhancement.cpp.
QgsContrastEnhancement::~QgsContrastEnhancement | ( | ) |
Definition at line 76 of file qgscontrastenhancement.cpp.
|
inline |
Definition at line 79 of file qgscontrastenhancement.h.
|
static |
Definition at line 450 of file qgscontrastenhancement.cpp.
|
static |
Definition at line 432 of file qgscontrastenhancement.cpp.
int QgsContrastEnhancement::enhanceContrast | ( | double | theValue | ) |
Apply the contrast enhancement to a value.
Public function to generate the enhanced for enhanceContrasted value for a given input.
Return values are 0 - 254, -1 means the pixel was clipped and should not be displayed
theValue | The pixel value to enhance |
Definition at line 174 of file qgscontrastenhancement.cpp.
bool QgsContrastEnhancement::isValueInDisplayableRange | ( | double | theValue | ) |
Return true if pixel is in stretable range, false if pixel is outside of range (i.e., clipped)
Determine if a pixel is within in the displayable range.
theValue | The pixel value to examine |
Definition at line 232 of file qgscontrastenhancement.cpp.
|
inline |
Return the maximum value for the contrast enhancement range.
Definition at line 74 of file qgscontrastenhancement.h.
|
static |
Helper function that returns the maximum possible value for a GDAL data type.
Simple function to compute the maximum possible value for a data types.
Definition at line 90 of file qgscontrastenhancement.cpp.
|
inline |
Return the minimum value for the contrast enhancement range.
Definition at line 77 of file qgscontrastenhancement.h.
|
static |
Helper function that returns the minimum possible value for a GDAL data type.
Simple function to compute the minimum possible value for a data type.
Definition at line 128 of file qgscontrastenhancement.cpp.
void QgsContrastEnhancement::readXML | ( | const QDomElement & | elem | ) |
Definition at line 385 of file qgscontrastenhancement.cpp.
void QgsContrastEnhancement::setContrastEnhancementAlgorithm | ( | ContrastEnhancementAlgorithm | theAlgorithm, |
bool | generateTable = true |
||
) |
Set the contrast enhancement algorithm.
The second parameter is optional and is for performace improvements. If you know you are immediately going to set the Minimum or Maximum value, you can elect to not generate the lookup tale. By default it will be generated.
theAlgorithm | The new contrast enhancement algorithm |
generateTable | Flag to override automatic look up table generation |
Definition at line 248 of file qgscontrastenhancement.cpp.
void QgsContrastEnhancement::setContrastEnhancementFunction | ( | QgsContrastEnhancementFunction * | theFunction | ) |
A public method that allows the user to set their own custom contrast enhancment function.
A public function that allows the user to set their own custom contrast enhancement function.
theFunction | The new contrast enhancement function |
Definition at line 287 of file qgscontrastenhancement.cpp.
void QgsContrastEnhancement::setMaximumValue | ( | double | theValue, |
bool | generateTable = true |
||
) |
Set the maximum value for the contrast enhancement range.
Set the maximum value for the contrast enhancement.
The second parameter is option an is for performace improvements. If you know you are immediately going to set the Minimum value or the contrast enhancement algorithm, you can elect to not generate the lookup tale. By default it will be generated.
theValue | The new maximum value for the band |
generateTable | Flag to override automatic look up table generation |
Definition at line 306 of file qgscontrastenhancement.cpp.
void QgsContrastEnhancement::setMinimumValue | ( | double | theValue, |
bool | generateTable = true |
||
) |
Return the minimum value for the contrast enhancement range.
Set the maximum value for the contrast enhancement.
The second parameter is option an is for performace improvements. If you know you are immediately going to set the Maximum value or the contrast enhancement algorithm, you can elect to not generate the lookup tale. By default it will be generated.
theValue | The new minimum value for the band |
generateTable | Flag to override automatic look up table generation |
Definition at line 338 of file qgscontrastenhancement.cpp.
void QgsContrastEnhancement::writeXML | ( | QDomDocument & | doc, |
QDomElement & | parentElem | ||
) | const |
Definition at line 364 of file qgscontrastenhancement.cpp.