QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
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 "qgis_core.h"
22#include "qgis_sip.h"
25
26#ifndef SIP_RUN
27
37{
38 public:
39
40 QSet< QString > usedAttributes() const override;
41 bool prepareBlock( const QgsPointCloudBlock *block ) override;
42 QColor pointColor( const QgsPointCloudBlock *block, int i, double z ) override;
43
44 QString redAttribute = QStringLiteral( "Red" );
45 QString greenAttribute = QStringLiteral( "Green" );
46 QString blueAttribute = QStringLiteral( "Blue" );
47 std::unique_ptr< QgsContrastEnhancement > redContrastEnhancement;
48 std::unique_ptr< QgsContrastEnhancement > greenContrastEnhancement;
49 std::unique_ptr< QgsContrastEnhancement > blueContrastEnhancement;
50
51 int redOffset = 0;
54 int greenOffset = 0;
57 int blueOffset = 0;
60};
61#endif
62
70{
71 public:
72
77
78 QString type() const override;
79 QgsPointCloudRenderer *clone() const override;
80 void renderBlock( const QgsPointCloudBlock *block, QgsPointCloudRenderContext &context ) override;
81 QDomElement save( QDomDocument &doc, const QgsReadWriteContext &context ) const override;
82 QSet< QString > usedAttributes( const QgsPointCloudRenderContext &context ) const override;
83 std::unique_ptr< QgsPreparedPointCloudRendererData > prepare() override SIP_SKIP;
84
88 static QgsPointCloudRenderer *create( QDomElement &element, const QgsReadWriteContext &context ) SIP_FACTORY;
89
97 QString redAttribute() const;
98
106 void setRedAttribute( const QString &attribute );
107
115 QString greenAttribute() const;
116
124 void setGreenAttribute( const QString &attribute );
125
133 QString blueAttribute() const;
134
142 void setBlueAttribute( const QString &attribute );
143
152
163
172
183
192
203
204 private:
205
206 QString mRedAttribute = QStringLiteral( "Red" );
207 QString mGreenAttribute = QStringLiteral( "Green" );
208 QString mBlueAttribute = QStringLiteral( "Blue" );
209
210 std::unique_ptr< QgsContrastEnhancement > mRedContrastEnhancement;
211 std::unique_ptr< QgsContrastEnhancement > mGreenContrastEnhancement;
212 std::unique_ptr< QgsContrastEnhancement > mBlueContrastEnhancement;
213
214};
215
216#endif // QGSPOINTCLOUDRGBRENDERER_H
Handles contrast enhancement and clipping.
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.
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
std::unique_ptr< QgsPreparedPointCloudRendererData > prepare() override
Returns prepared data container for bulk point color retrieval.
void setRedContrastEnhancement(QgsContrastEnhancement *enhancement)
Sets the contrast enhancement to use for the red channel.
QString redAttribute() const
Returns the attribute to use for the red channel.
static QgsPointCloudRenderer * create(QDomElement &element, const QgsReadWriteContext &context)
Creates an RGB renderer from an XML element.
QString greenAttribute() const
Returns the attribute to use for the green channel.
QString type() const override
Returns the identifier of the renderer type.
QDomElement save(QDomDocument &doc, const QgsReadWriteContext &context) const override
Saves the renderer configuration to an XML element.
void setBlueContrastEnhancement(QgsContrastEnhancement *enhancement)
Sets the contrast enhancement to use for the blue channel.
void renderBlock(const QgsPointCloudBlock *block, QgsPointCloudRenderContext &context) override
Renders a block of point cloud data using the specified render context.
const QgsContrastEnhancement * greenContrastEnhancement() const
Returns the contrast enhancement to use for the green channel.
QString blueAttribute() const
Returns the attribute to use for the blue channel.
QgsPointCloudRgbRenderer()
Constructor for QgsPointCloudRgbRenderer.
void setGreenContrastEnhancement(QgsContrastEnhancement *enhancement)
Sets the contrast enhancement to use for the green channel.
void setBlueAttribute(const QString &attribute)
Sets the attribute to use for the blue channel.
const QgsContrastEnhancement * blueContrastEnhancement() const
Returns the contrast enhancement to use for the blue channel.
void setGreenAttribute(const QString &attribute)
Sets the attribute to use for the green channel.
void setRedAttribute(const QString &attribute)
Sets the attribute to use for the red channel.
QgsPointCloudRenderer * clone() const override
Create a deep copy of this renderer.
const QgsContrastEnhancement * redContrastEnhancement() const
Returns the contrast enhancement to use for the red channel.
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.
A container for the context for various read/write operations on objects.
#define SIP_SKIP
Definition qgis_sip.h:134
#define SIP_TRANSFER
Definition qgis_sip.h:36
#define SIP_FACTORY
Definition qgis_sip.h:84