Manipulates raster pixel values so that they enhanceContrast or clip into a specified numerical range according to the specified ContrastEnhancementAlgorithm.
More...
#include <qgscontrastenhancement.h>
Detailed Description
Manipulates raster pixel values so that they enhanceContrast or clip into a specified numerical range according to the specified ContrastEnhancementAlgorithm.
Member Enumeration Documentation
This enumerator describes the types of contrast enhancement algorithms that can be used.
- Enumerator:
NoEnhancement |
|
StretchToMinimumMaximum |
|
StretchAndClipToMinimumMaximum |
|
ClipToMinimumMaximum |
|
UserDefinedEnhancement |
|
Constructor & Destructor Documentation
QgsContrastEnhancement::~QgsContrastEnhancement |
( |
| ) |
|
Member Function Documentation
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
- Parameters
-
theValue | The pixel value to enhance |
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.
- Parameters
-
theValue | The pixel value to examine |
double QgsContrastEnhancement::maximumValue |
( |
| ) |
const |
|
inline |
Return the maximum value for the contrast enhancement range.
double QgsContrastEnhancement::maximumValuePossible |
( |
QGis::DataType |
theDataType | ) |
|
|
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.
double QgsContrastEnhancement::minimumValue |
( |
| ) |
const |
|
inline |
Return the minimum value for the contrast enhancement range.
double QgsContrastEnhancement::minimumValuePossible |
( |
QGis::DataType |
theDataType | ) |
|
|
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.
void QgsContrastEnhancement::readXML |
( |
const QDomElement & |
elem | ) |
|
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.
- Parameters
-
theAlgorithm | The new contrast enhancement algorithm |
generateTable | Flag to overide automatic look up table generation |
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.
- Parameters
-
theFunction | The new contrast enhancement function |
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.
- Parameters
-
theValue | The new maximum value for the band |
generateTable | Flag to overide automatic look up table generation |
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.
- Parameters
-
theValue | The new minimum value for the band |
generateTable | Flag to overide automatic look up table generation |
void QgsContrastEnhancement::writeXML |
( |
QDomDocument & |
doc, |
|
|
QDomElement & |
parentElem |
|
) |
| const |
The documentation for this class was generated from the following files: