mirror of
				https://github.com/qgis/QGIS.git
				synced 2025-11-04 00:04:25 -05:00 
			
		
		
		
	
		
			
				
	
	
		
			152 lines
		
	
	
		
			5.3 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			152 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.pl 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
 | 
						|
    {
 | 
						|
      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.pl again   *
 | 
						|
 ************************************************************************/
 |