Skip to content
Permalink
Browse files

Add contrast enhancement options for point cloud RGB renderer

  • Loading branch information
nyalldawson committed Nov 16, 2020
1 parent 171f435 commit bf8ccad89ecb48ba628271c2a3ef2d9cdff10bcb
@@ -126,6 +126,8 @@ Abstract base class for 2d point cloud renderers.
%End
public:

QgsPointCloudRenderer();

virtual ~QgsPointCloudRenderer();

virtual QString type() const = 0;
@@ -139,6 +141,8 @@ Create a deep copy of this renderer. Should be implemented by all subclasses
and generate a proper subclass.
%End



virtual void renderBlock( const QgsPointCloudBlock *block, QgsPointCloudRenderContext &context ) = 0;
%Docstring
Renders a ``block`` of point cloud data using the specified render ``context``.
@@ -205,6 +209,8 @@ Calls to :py:func:`~QgsPointCloudRenderer.stopRender` must always be preceded by
Retrieves the x and y coordinate for the point at index ``i``.
%End

private:
QgsPointCloudRenderer( const QgsPointCloudRenderer &other );
};

/************************************************************************
@@ -9,6 +9,7 @@




class QgsPointCloudRgbRenderer : QgsPointCloudRenderer
{
%Docstring
@@ -26,6 +27,7 @@ An RGB renderer for 2d visualisation of point clouds using embedded red, green a
%Docstring
Constructor for QgsPointCloudRgbRenderer.
%End

virtual QString type() const;

virtual QgsPointCloudRenderer *clone() const;
@@ -120,6 +122,78 @@ Sets the ``attribute`` to use for the blue channel.
.. seealso:: :py:func:`setGreenAttribute`

.. seealso:: :py:func:`blueAttribute`
%End

const QgsContrastEnhancement *redContrastEnhancement() const;
%Docstring
Returns the contrast enchancement to use for the red channel.

.. seealso:: :py:func:`setRedContrastEnhancement`

.. seealso:: :py:func:`greenContrastEnhancement`

.. seealso:: :py:func:`blueContrastEnhancement`
%End

void setRedContrastEnhancement( QgsContrastEnhancement *enhancement /Transfer/ );
%Docstring
Sets the contrast ``enchancement`` to use for the red channel.

Ownership of ``enhancement`` is transferred.

.. seealso:: :py:func:`redContrastEnhancement`

.. seealso:: :py:func:`setGreenContrastEnhancement`

.. seealso:: :py:func:`setBlueContrastEnhancement`
%End

const QgsContrastEnhancement *greenContrastEnhancement() const;
%Docstring
Returns the contrast enchancement to use for the green channel.

.. seealso:: :py:func:`setGreenContrastEnhancement`

.. seealso:: :py:func:`redContrastEnhancement`

.. seealso:: :py:func:`blueContrastEnhancement`
%End

void setGreenContrastEnhancement( QgsContrastEnhancement *enhancement /Transfer/ );
%Docstring
Sets the contrast ``enchancement`` to use for the green channel.

Ownership of ``enhancement`` is transferred.

.. seealso:: :py:func:`greenContrastEnhancement`

.. seealso:: :py:func:`setRedContrastEnhancement`

.. seealso:: :py:func:`setBlueContrastEnhancement`
%End

const QgsContrastEnhancement *blueContrastEnhancement() const;
%Docstring
Returns the contrast enchancement to use for the blue channel.

.. seealso:: :py:func:`setBlueContrastEnhancement`

.. seealso:: :py:func:`redContrastEnhancement`

.. seealso:: :py:func:`greenContrastEnhancement`
%End

void setBlueContrastEnhancement( QgsContrastEnhancement *enhancement /Transfer/ );
%Docstring
Sets the contrast ``enchancement`` to use for the blue channel.

Ownership of ``enhancement`` is transferred.

.. seealso:: :py:func:`blueContrastEnhancement`

.. seealso:: :py:func:`setRedContrastEnhancement`

.. seealso:: :py:func:`setGreenContrastEnhancement`
%End

};
@@ -14,7 +14,7 @@
class QgsContrastEnhancement
{
%Docstring
Manipulates raster pixel values so that they enhanceContrast or clip into a
Manipulates raster or point cloud pixel values so that they enhanceContrast or clip into a
specified numerical range according to the specified
ContrastEnhancementAlgorithm.
%End
@@ -40,12 +40,12 @@ ContrastEnhancementAlgorithm.

static double maximumValuePossible( Qgis::DataType dataType );
%Docstring
Helper function that returns the maximum possible value for a GDAL data type.
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 GDAL data type.
Helper function that returns the minimum possible value for a data type.
%End

static QString contrastEnhancementAlgorithmString( ContrastEnhancementAlgorithm algorithm );
@@ -45,21 +45,75 @@ QgsMultiBandColorRenderer cannot be copied. Use :py:func:`~QgsMultiBandColorRend
void setBlueBand( int band );

const QgsContrastEnhancement *redContrastEnhancement() const;
%Docstring
Returns the contrast enchancement to use for the red channel.

.. seealso:: :py:func:`setRedContrastEnhancement`

.. seealso:: :py:func:`greenContrastEnhancement`

.. seealso:: :py:func:`blueContrastEnhancement`
%End

void setRedContrastEnhancement( QgsContrastEnhancement *ce /Transfer/ );
%Docstring
Takes ownership
Sets the contrast enchancement to use for the red channel.

Ownership of the enhancement is transferred.

.. seealso:: :py:func:`redContrastEnhancement`

.. seealso:: :py:func:`setGreenContrastEnhancement`

.. seealso:: :py:func:`setBlueContrastEnhancement`
%End

const QgsContrastEnhancement *greenContrastEnhancement() const;
%Docstring
Returns the contrast enchancement to use for the green channel.

.. seealso:: :py:func:`setGreenContrastEnhancement`

.. seealso:: :py:func:`redContrastEnhancement`

.. seealso:: :py:func:`blueContrastEnhancement`
%End

void setGreenContrastEnhancement( QgsContrastEnhancement *ce /Transfer/ );
%Docstring
Takes ownership
Sets the contrast enchancement to use for the green channel.

Ownership of the enhancement is transferred.

.. seealso:: :py:func:`greenContrastEnhancement`

.. seealso:: :py:func:`setRedContrastEnhancement`

.. seealso:: :py:func:`setBlueContrastEnhancement`
%End

const QgsContrastEnhancement *blueContrastEnhancement() const;
%Docstring
Returns the contrast enchancement to use for the blue channel.

.. seealso:: :py:func:`setBlueContrastEnhancement`

.. seealso:: :py:func:`redContrastEnhancement`

.. seealso:: :py:func:`greenContrastEnhancement`
%End

void setBlueContrastEnhancement( QgsContrastEnhancement *ce /Transfer/ );
%Docstring
Takes ownership
Sets the contrast enchancement to use for the blue channel.

Ownership of the enhancement is transferred.

.. seealso:: :py:func:`blueContrastEnhancement`

.. seealso:: :py:func:`setRedContrastEnhancement`

.. seealso:: :py:func:`setGreenContrastEnhancement`
%End

virtual void writeXml( QDomDocument &doc, QDomElement &parentElem ) const;
@@ -162,6 +162,8 @@ class CORE_EXPORT QgsPointCloudRenderer

public:

QgsPointCloudRenderer() = default;

virtual ~QgsPointCloudRenderer() = default;

/**
@@ -175,6 +177,12 @@ class CORE_EXPORT QgsPointCloudRenderer
*/
virtual QgsPointCloudRenderer *clone() const = 0 SIP_FACTORY;

//! QgsPointCloudRenderer cannot be copied -- use clone() instead
QgsPointCloudRenderer( const QgsPointCloudRenderer &other ) = delete;

//! QgsPointCloudRenderer cannot be copied -- use clone() instead
QgsPointCloudRenderer &operator=( const QgsPointCloudRenderer &other ) = delete;

/**
* Renders a \a block of point cloud data using the specified render \a context.
*/
@@ -242,6 +250,10 @@ class CORE_EXPORT QgsPointCloudRenderer
}

private:
#ifdef SIP_RUN
QgsPointCloudRenderer( const QgsPointCloudRenderer &other );
#endif

#ifdef QGISDEBUG
//! Pointer to thread in which startRender was first called
QThread *mThread = nullptr;

0 comments on commit bf8ccad

Please sign in to comment.
You can’t perform that action at this time.