QGIS/python/core/auto_generated/raster/qgscontrastenhancement.sip.in
Nyall Dawson f5c21a0fbd Optimize QgsContrastEnhancementFunction
Allow some methods to be inlined, and precalculate maximum/minimum values
possible instead of recalculating them for every pixel
2019-09-27 08:21:26 +10:00

149 lines
5.2 KiB
Plaintext

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/raster/qgscontrastenhancement.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsContrastEnhancement
{
%Docstring
Manipulates raster pixel values so that they enhanceContrast or clip into a
specified numerical range according to the specified
ContrastEnhancementAlgorithm.
%End
%TypeHeaderCode
#include "qgscontrastenhancement.h"
%End
public:
enum ContrastEnhancementAlgorithm
{
NoEnhancement,
StretchToMinimumMaximum,
StretchAndClipToMinimumMaximum,
ClipToMinimumMaximum,
UserDefinedEnhancement
};
QgsContrastEnhancement( Qgis::DataType datatype = Qgis::Byte );
QgsContrastEnhancement( const QgsContrastEnhancement &ce );
~QgsContrastEnhancement();
static double maximumValuePossible( Qgis::DataType dataType );
%Docstring
Helper function that returns the maximum possible value for a GDAL data type.
%End
static double minimumValuePossible( Qgis::DataType dataType );
%Docstring
Helper function that returns the minimum possible value for a GDAL data type.
%End
static QString contrastEnhancementAlgorithmString( ContrastEnhancementAlgorithm algorithm );
%Docstring
Returns a string to serialize ContrastEnhancementAlgorithm.
%End
static ContrastEnhancementAlgorithm contrastEnhancementAlgorithmFromString( const QString &contrastEnhancementString );
%Docstring
Deserialize ContrastEnhancementAlgorithm.
%End
double maximumValue() const;
%Docstring
Returns the maximum value for the contrast enhancement range.
%End
double minimumValue() const;
%Docstring
Returns the minimum value for the contrast enhancement range.
%End
ContrastEnhancementAlgorithm contrastEnhancementAlgorithm() const;
int enhanceContrast( double value );
%Docstring
Applies the contrast enhancement to a ``value``. Return values are 0 - 254, -1 means the pixel was clipped and should not be displayed.
%End
bool isValueInDisplayableRange( double value );
%Docstring
Returns ``True`` if a pixel ``value`` is in displayable range, ``False`` if pixel
is outside of range (i.e. clipped).
%End
void setContrastEnhancementAlgorithm( ContrastEnhancementAlgorithm algorithm, bool generateTable = true );
%Docstring
Sets the contrast enhancement ``algorithm``.
The ``generateTable`` parameter is optional and is for performance 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.
%End
void setContrastEnhancementFunction( QgsContrastEnhancementFunction *function /Transfer/ );
%Docstring
Allows the user to set their own custom contrast enhancement ``function``. Ownership of
``function`` is transferred.
%End
void setMaximumValue( double value, bool generateTable = true );
%Docstring
Sets the maximum ``value`` for the contrast enhancement range.
The ``generateTable`` parameter is optional and is for performance 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 table.
By default it will be generated.
.. seealso:: :py:func:`setMinimumValue`
%End
void setMinimumValue( double value, bool generateTable = true );
%Docstring
Sets the minimum ``value`` for the contrast enhancement range.
The ``generateTable`` parameter is optional and is for performance 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 table.
By default it will be generated.
.. seealso:: :py:func:`setMaximumValue`
%End
void writeXml( QDomDocument &doc, QDomElement &parentElem ) const;
void readXml( const QDomElement &elem );
void toSld( QDomDocument &doc, QDomElement &element ) const;
%Docstring
Write ContrastEnhancement tags following SLD v1.0 specs
SLD1.0 is limited to the parameters listed in:
https://docs.geoserver.org/stable/en/user/styling/sld/reference/rastersymbolizer.html#contrastenhancement
Btw only sld:Normalize + vendor options are supported because there is no clear mapping
of ContrastEnhancement parameters to support sld:Histogram or sld:GammaValue
.. versionadded:: 3.6
%End
private:
const QgsContrastEnhancement &operator=( const QgsContrastEnhancement & );
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/raster/qgscontrastenhancement.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/