1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
|
/************************************************************************
* 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")
Manipulates raster or point cloud 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 /BaseType=IntEnum/
{
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 -
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.py again *
************************************************************************/
|