QGIS API Documentation  3.20.0-Odense (decaadbb31)
qgspointcloudrgbrenderer.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgspointcloudrgbrenderer.h
3  --------------------
4  begin : October 2020
5  copyright : (C) 2020 by Nyall Dawson
6  email : nyall dot dawson at gmail dot com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSPOINTCLOUDRGBRENDERER_H
19 #define QGSPOINTCLOUDRGBRENDERER_H
20 
21 #include "qgspointcloudrenderer.h"
22 #include "qgis_core.h"
23 #include "qgis_sip.h"
24 
25 #include "qgscontrastenhancement.h"
26 
34 {
35  public:
36 
41 
42  QString type() const override;
43  QgsPointCloudRenderer *clone() const override;
44  void renderBlock( const QgsPointCloudBlock *block, QgsPointCloudRenderContext &context ) override;
45  QDomElement save( QDomDocument &doc, const QgsReadWriteContext &context ) const override;
46  QSet< QString > usedAttributes( const QgsPointCloudRenderContext &context ) const override;
47 
51  static QgsPointCloudRenderer *create( QDomElement &element, const QgsReadWriteContext &context ) SIP_FACTORY;
52 
60  QString redAttribute() const;
61 
69  void setRedAttribute( const QString &attribute );
70 
78  QString greenAttribute() const;
79 
87  void setGreenAttribute( const QString &attribute );
88 
96  QString blueAttribute() const;
97 
105  void setBlueAttribute( const QString &attribute );
106 
114  const QgsContrastEnhancement *redContrastEnhancement() const;
115 
125  void setRedContrastEnhancement( QgsContrastEnhancement *enhancement SIP_TRANSFER );
126 
134  const QgsContrastEnhancement *greenContrastEnhancement() const;
135 
145  void setGreenContrastEnhancement( QgsContrastEnhancement *enhancement SIP_TRANSFER );
146 
154  const QgsContrastEnhancement *blueContrastEnhancement() const;
155 
165  void setBlueContrastEnhancement( QgsContrastEnhancement *enhancement SIP_TRANSFER );
166 
167  private:
168 
169  QString mRedAttribute = QStringLiteral( "Red" );
170  QString mGreenAttribute = QStringLiteral( "Green" );
171  QString mBlueAttribute = QStringLiteral( "Blue" );
172 
173  std::unique_ptr< QgsContrastEnhancement > mRedContrastEnhancement;
174  std::unique_ptr< QgsContrastEnhancement > mGreenContrastEnhancement;
175  std::unique_ptr< QgsContrastEnhancement > mBlueContrastEnhancement;
176 
177 };
178 
179 #endif // QGSPOINTCLOUDRGBRENDERER_H
Manipulates raster or point cloud pixel values so that they enhanceContrast or clip into a specified ...
Base class for storing raw data from point cloud nodes.
Encapsulates the render context for a 2D point cloud rendering operation.
Abstract base class for 2d point cloud renderers.
virtual QDomElement save(QDomDocument &doc, const QgsReadWriteContext &context) const =0
Saves the renderer configuration to an XML element.
virtual void renderBlock(const QgsPointCloudBlock *block, QgsPointCloudRenderContext &context)=0
Renders a block of point cloud data using the specified render context.
virtual QgsPointCloudRenderer * clone() const =0
Create a deep copy of this renderer.
virtual QSet< QString > usedAttributes(const QgsPointCloudRenderContext &context) const
Returns a list of attributes required by this renderer.
virtual QString type() const =0
Returns the identifier of the renderer type.
An RGB renderer for 2d visualisation of point clouds using embedded red, green and blue attributes.
The class is used as a container of context for various read/write operations on other objects.
#define SIP_TRANSFER
Definition: qgis_sip.h:36
#define SIP_FACTORY
Definition: qgis_sip.h:76