QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
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
22#include "qgis_core.h"
23#include "qgis_sip.h"
24
26
27
28#ifndef SIP_RUN
29
39{
40 public:
41
42 QSet< QString > usedAttributes() const override;
43 bool prepareBlock( const QgsPointCloudBlock *block ) override;
44 QColor pointColor( const QgsPointCloudBlock *block, int i, double z ) override;
45
46 QString redAttribute = QStringLiteral( "Red" );
47 QString greenAttribute = QStringLiteral( "Green" );
48 QString blueAttribute = QStringLiteral( "Blue" );
49 std::unique_ptr< QgsContrastEnhancement > redContrastEnhancement;
50 std::unique_ptr< QgsContrastEnhancement > greenContrastEnhancement;
51 std::unique_ptr< QgsContrastEnhancement > blueContrastEnhancement;
52
53 int redOffset = 0;
55 bool useRedContrastEnhancement = false;
56 int greenOffset = 0;
58 bool useGreenContrastEnhancement = false;
59 int blueOffset = 0;
61 bool useBlueContrastEnhancement = false;
62};
63#endif
64
72{
73 public:
74
79
80 QString type() const override;
81 QgsPointCloudRenderer *clone() const override;
82 void renderBlock( const QgsPointCloudBlock *block, QgsPointCloudRenderContext &context ) override;
83 QDomElement save( QDomDocument &doc, const QgsReadWriteContext &context ) const override;
84 QSet< QString > usedAttributes( const QgsPointCloudRenderContext &context ) const override;
85 std::unique_ptr< QgsPreparedPointCloudRendererData > prepare() override SIP_SKIP;
86
90 static QgsPointCloudRenderer *create( QDomElement &element, const QgsReadWriteContext &context ) SIP_FACTORY;
91
99 QString redAttribute() const;
100
108 void setRedAttribute( const QString &attribute );
109
117 QString greenAttribute() const;
118
126 void setGreenAttribute( const QString &attribute );
127
135 QString blueAttribute() const;
136
144 void setBlueAttribute( const QString &attribute );
145
153 const QgsContrastEnhancement *redContrastEnhancement() const;
154
164 void setRedContrastEnhancement( QgsContrastEnhancement *enhancement SIP_TRANSFER );
165
173 const QgsContrastEnhancement *greenContrastEnhancement() const;
174
184 void setGreenContrastEnhancement( QgsContrastEnhancement *enhancement SIP_TRANSFER );
185
193 const QgsContrastEnhancement *blueContrastEnhancement() const;
194
204 void setBlueContrastEnhancement( QgsContrastEnhancement *enhancement SIP_TRANSFER );
205
206 private:
207
208 QString mRedAttribute = QStringLiteral( "Red" );
209 QString mGreenAttribute = QStringLiteral( "Green" );
210 QString mBlueAttribute = QStringLiteral( "Blue" );
211
212 std::unique_ptr< QgsContrastEnhancement > mRedContrastEnhancement;
213 std::unique_ptr< QgsContrastEnhancement > mGreenContrastEnhancement;
214 std::unique_ptr< QgsContrastEnhancement > mBlueContrastEnhancement;
215
216};
217
218#endif // QGSPOINTCLOUDRGBRENDERER_H
Manipulates raster or point cloud pixel values so that they enhanceContrast or clip into a specified ...
DataType
Systems of unit measurement.
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.
Prepared data container for QgsPointCloudRgbRenderer.
std::unique_ptr< QgsContrastEnhancement > redContrastEnhancement
std::unique_ptr< QgsContrastEnhancement > greenContrastEnhancement
std::unique_ptr< QgsContrastEnhancement > blueContrastEnhancement
QgsPointCloudAttribute::DataType blueType
QgsPointCloudAttribute::DataType redType
QgsPointCloudAttribute::DataType greenType
An RGB renderer for 2d visualisation of point clouds using embedded red, green and blue attributes.
Base class for 2d point cloud renderer prepared data containers.
virtual QColor pointColor(const QgsPointCloudBlock *block, int i, double z)=0
An optimised method of retrieving the color of a point from a point cloud block.
virtual bool prepareBlock(const QgsPointCloudBlock *block)=0
Prepares the renderer for using the specified block.
virtual QSet< QString > usedAttributes() const =0
Returns the set of attributes used by the prepared point cloud renderer.
The class is used as a container of context for various read/write operations on other objects.
#define SIP_SKIP
Definition: qgis_sip.h:126
#define SIP_TRANSFER
Definition: qgis_sip.h:36
#define SIP_FACTORY
Definition: qgis_sip.h:76