QGIS/python/core/auto_generated/raster/qgscontrastenhancement.sip.in
Nyall Dawson 3f6b490218 Sipify
2025-04-02 11:11:10 +10:00

157 lines
5.3 KiB
Plaintext

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/raster/qgscontrastenhancement.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsContrastEnhancement
{
%Docstring(signature="appended")
Handles contrast enhancement and clipping.
Manipulates raster or point cloud pixel values so that they enhance
contrast 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::DataType::Byte );
%Docstring
Constructor for QgsContrastEnhancement, for the specified data type.
%End
QgsContrastEnhancement( const QgsContrastEnhancement &ce );
~QgsContrastEnhancement();
static double maximumValuePossible( Qgis::DataType dataType );
%Docstring
Helper function that returns the maximum possible value for a data type.
%End
static double minimumValuePossible( Qgis::DataType dataType );
%Docstring
Helper function that returns the minimum possible value for a 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 -
255, -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.py again *
************************************************************************/