QGIS API Documentation  3.23.0-Master (eb871beae0)
qgsmultibandcolorrenderer.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmultibandcolorrenderer.h
3  ---------------------------
4  begin : December 2011
5  copyright : (C) 2011 by Marco Hugentobler
6  email : marco at sourcepole dot ch
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 QGSMULTIBANDCOLORRENDERER_H
19 #define QGSMULTIBANDCOLORRENDERER_H
20 
21 #include "qgis_core.h"
22 #include "qgis_sip.h"
23 #include "qgsrasterrenderer.h"
24 
26 class QDomElement;
27 
33 {
34  public:
35  QgsMultiBandColorRenderer( QgsRasterInterface *input, int redBand, int greenBand, int blueBand,
36  QgsContrastEnhancement *redEnhancement = nullptr, QgsContrastEnhancement *greenEnhancement = nullptr,
37  QgsContrastEnhancement *blueEnhancement = nullptr );
38  ~QgsMultiBandColorRenderer() override;
39 
44 
46 
47  static QgsRasterRenderer *create( const QDomElement &elem, QgsRasterInterface *input ) SIP_FACTORY;
48 
49  QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback = nullptr ) override SIP_FACTORY;
50 
51  int redBand() const { return mRedBand; }
52  void setRedBand( int band ) { mRedBand = band; }
53  int greenBand() const { return mGreenBand; }
54  void setGreenBand( int band ) { mGreenBand = band; }
55  int blueBand() const { return mBlueBand; }
56  void setBlueBand( int band ) { mBlueBand = band; }
57 
65  const QgsContrastEnhancement *redContrastEnhancement() const { return mRedContrastEnhancement; }
66 
76  void setRedContrastEnhancement( QgsContrastEnhancement *ce SIP_TRANSFER );
77 
85  const QgsContrastEnhancement *greenContrastEnhancement() const { return mGreenContrastEnhancement; }
86 
96  void setGreenContrastEnhancement( QgsContrastEnhancement *ce SIP_TRANSFER );
97 
105  const QgsContrastEnhancement *blueContrastEnhancement() const { return mBlueContrastEnhancement; }
106 
116  void setBlueContrastEnhancement( QgsContrastEnhancement *ce SIP_TRANSFER );
117 
118  void writeXml( QDomDocument &doc, QDomElement &parentElem ) const override;
119 
120  QList<int> usesBands() const override;
121  QList<QgsLayerTreeModelLegendNode *> createLegendNodes( QgsLayerTreeLayer *nodeLayer ) SIP_FACTORY override;
122 
123  void toSld( QDomDocument &doc, QDomElement &element, const QVariantMap &props = QVariantMap() ) const override;
124 
125  private:
126 #ifdef SIP_RUN
129 #endif
130 
131  int mRedBand;
132  int mGreenBand;
133  int mBlueBand;
134 
135  QgsContrastEnhancement *mRedContrastEnhancement = nullptr;
136  QgsContrastEnhancement *mGreenContrastEnhancement = nullptr;
137  QgsContrastEnhancement *mBlueContrastEnhancement = nullptr;
138 
139 };
140 
141 #endif // QGSMULTIBANDCOLORRENDERER_H
Manipulates raster or point cloud pixel values so that they enhanceContrast or clip into a specified ...
Layer tree node points to a map layer.
Renderer for multiband images with the color components.
QgsMultiBandColorRenderer(const QgsMultiBandColorRenderer &)=delete
QgsMultiBandColorRenderer cannot be copied. Use clone() instead.
const QgsContrastEnhancement * redContrastEnhancement() const
Returns the contrast enhancement to use for the red channel.
const QgsContrastEnhancement * blueContrastEnhancement() const
Returns the contrast enhancement to use for the blue channel.
const QgsMultiBandColorRenderer & operator=(const QgsMultiBandColorRenderer &)=delete
QgsMultiBandColorRenderer cannot be copied. Use clone() instead.
const QgsContrastEnhancement * greenContrastEnhancement() const
Returns the contrast enhancement to use for the green channel.
Feedback object tailored for raster block reading.
Raster data container.
Base class for processing filters like renderers, reprojector, resampler etc.
virtual void writeXml(QDomDocument &doc, QDomElement &parentElem) const
Write base class members to xml.
Raster renderer pipe that applies colors to a raster.
const QgsRasterRenderer & operator=(const QgsRasterRenderer &)=delete
QgsRasterRenderer cannot be copied. Use clone() instead.
QgsRasterRenderer * clone() const override=0
Clone itself, create deep copy.
virtual QList< QgsLayerTreeModelLegendNode * > createLegendNodes(QgsLayerTreeLayer *nodeLayer)
Creates a set of legend nodes representing the renderer.
virtual void toSld(QDomDocument &doc, QDomElement &element, const QVariantMap &props=QVariantMap()) const
Used from subclasses to create SLD Rule elements following SLD v1.0 specs.
virtual QList< int > usesBands() const
Returns a list of band numbers used by the renderer.
A rectangle specified with double values.
Definition: qgsrectangle.h:42
#define SIP_TRANSFER
Definition: qgis_sip.h:36
#define SIP_FACTORY
Definition: qgis_sip.h:76