QGIS/python/core/auto_generated/raster/qgscontrastenhancement.sip.in

151 lines
5.1 KiB
Plaintext
Raw Normal View History

2017-06-01 10:54:33 +02:00
/************************************************************************
* 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
{
2017-06-01 10:54:33 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Manipulates raster pixel values so that they enhanceContrast or clip into a
specified numerical range according to the specified
ContrastEnhancementAlgorithm.
%End
2017-06-01 10:54:33 +02:00
%TypeHeaderCode
#include "qgscontrastenhancement.h"
%End
public:
enum ContrastEnhancementAlgorithm
{
2017-06-01 10:54:33 +02:00
NoEnhancement,
StretchToMinimumMaximum,
StretchAndClipToMinimumMaximum,
ClipToMinimumMaximum,
UserDefinedEnhancement
};
QgsContrastEnhancement( Qgis::DataType datatype = Qgis::Byte );
2017-06-01 10:54:33 +02:00
QgsContrastEnhancement( const QgsContrastEnhancement &ce );
~QgsContrastEnhancement();
2017-06-01 10:54:33 +02:00
static double maximumValuePossible( Qgis::DataType );
2017-06-01 10:54:33 +02:00
%Docstring
Helper function that returns the maximum possible value for a GDAL data type.
2017-06-01 10:54:33 +02:00
%End
static double minimumValuePossible( Qgis::DataType );
2017-06-01 10:54:33 +02:00
%Docstring
Helper function that returns the minimum possible value for a GDAL data type.
2017-06-01 10:54:33 +02:00
%End
static QString contrastEnhancementAlgorithmString( ContrastEnhancementAlgorithm algorithm );
%Docstring
Returns a string to serialize ContrastEnhancementAlgorithm.
2017-06-01 10:54:33 +02:00
%End
static ContrastEnhancementAlgorithm contrastEnhancementAlgorithmFromString( const QString &contrastEnhancementString );
%Docstring
Deserialize ContrastEnhancementAlgorithm.
2017-06-01 10:54:33 +02:00
%End
double maximumValue() const;
2017-06-01 10:54:33 +02:00
%Docstring
Returns the maximum value for the contrast enhancement range.
2017-06-01 10:54:33 +02:00
%End
double minimumValue() const;
2017-06-01 10:54:33 +02:00
%Docstring
Returns the minimum value for the contrast enhancement range.
2017-06-01 10:54:33 +02:00
%End
ContrastEnhancementAlgorithm contrastEnhancementAlgorithm() const;
int enhanceContrast( double value );
2017-06-01 10:54:33 +02:00
%Docstring
Applies the contrast enhancement to a ``value``. Return values are 0 - 254, -1 means the pixel was clipped and should not be displayed.
2017-06-01 10:54:33 +02:00
%End
bool isValueInDisplayableRange( double value );
2017-06-01 10:54:33 +02:00
%Docstring
2019-02-26 19:54:09 +10:00
Returns ``True`` if a pixel ``value`` is in displayable range, ``False`` if pixel
is outside of range (i.e. clipped).
2017-06-01 10:54:33 +02:00
%End
void setContrastEnhancementAlgorithm( ContrastEnhancementAlgorithm algorithm, bool generateTable = true );
2017-06-01 10:54:33 +02:00
%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.
2017-06-01 10:54:33 +02:00
%End
void setContrastEnhancementFunction( QgsContrastEnhancementFunction *function /Transfer/ );
2017-06-01 10:54:33 +02:00
%Docstring
Allows the user to set their own custom contrast enhancement ``function``. Ownership of
2018-04-03 10:11:27 +10:00
``function`` is transferred.
2017-06-01 10:54:33 +02:00
%End
void setMaximumValue( double value, bool generateTable = true );
2017-06-01 10:54:33 +02:00
%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`
2017-06-01 10:54:33 +02:00
%End
void setMinimumValue( double value, bool generateTable = true );
2017-06-01 10:54:33 +02:00
%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`
2017-06-01 10:54:33 +02:00
%End
void writeXml( QDomDocument &doc, QDomElement &parentElem ) const;
void readXml( const QDomElement &elem );
2018-12-18 19:03:02 +01:00
void toSld( QDomDocument &doc, QDomElement &element ) const;
%Docstring
2019-02-01 14:42:36 +01:00
Write ContrastEnhancement tags following SLD v1.0 specs
2018-12-18 19:03:02 +01:00
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
2018-12-18 19:03:02 +01:00
.. versionadded:: 3.6
%End
private:
2017-06-01 10:54:33 +02:00
const QgsContrastEnhancement &operator=( const QgsContrastEnhancement & );
};
2017-06-01 10:54:33 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/raster/qgscontrastenhancement.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/