QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
Loading...
Searching...
No Matches
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
26class 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 );
39
44
46 Qgis::RasterRendererFlags flags() const override;
47
48 static QgsRasterRenderer *create( const QDomElement &elem, QgsRasterInterface *input ) SIP_FACTORY;
49
50 QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback = nullptr ) override SIP_FACTORY;
51
52 int redBand() const { return mRedBand; }
53 void setRedBand( int band ) { mRedBand = band; }
54 int greenBand() const { return mGreenBand; }
55 void setGreenBand( int band ) { mGreenBand = band; }
56 int blueBand() const { return mBlueBand; }
57 void setBlueBand( int band ) { mBlueBand = band; }
58
66 const QgsContrastEnhancement *redContrastEnhancement() const { return mRedContrastEnhancement; }
67
77 void setRedContrastEnhancement( QgsContrastEnhancement *ce SIP_TRANSFER );
78
86 const QgsContrastEnhancement *greenContrastEnhancement() const { return mGreenContrastEnhancement; }
87
97 void setGreenContrastEnhancement( QgsContrastEnhancement *ce SIP_TRANSFER );
98
106 const QgsContrastEnhancement *blueContrastEnhancement() const { return mBlueContrastEnhancement; }
107
117 void setBlueContrastEnhancement( QgsContrastEnhancement *ce SIP_TRANSFER );
118
119 void writeXml( QDomDocument &doc, QDomElement &parentElem ) const override;
120
121 QList<int> usesBands() const override;
122 QList<QgsLayerTreeModelLegendNode *> createLegendNodes( QgsLayerTreeLayer *nodeLayer ) SIP_FACTORY override;
123
124 void toSld( QDomDocument &doc, QDomElement &element, const QVariantMap &props = QVariantMap() ) const override;
125
126 private:
127#ifdef SIP_RUN
130#endif
131
132 int mRedBand;
133 int mGreenBand;
134 int mBlueBand;
135
136 QgsContrastEnhancement *mRedContrastEnhancement = nullptr;
137 QgsContrastEnhancement *mGreenContrastEnhancement = nullptr;
138 QgsContrastEnhancement *mBlueContrastEnhancement = nullptr;
139
140};
141
142#endif // QGSMULTIBANDCOLORRENDERER_H
The Qgis class provides global constants for use throughout the application.
Definition qgis.h:54
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 * greenContrastEnhancement() const
Returns the contrast enhancement to use for the green channel.
const QgsMultiBandColorRenderer & operator=(const QgsMultiBandColorRenderer &)=delete
QgsMultiBandColorRenderer cannot be copied. Use clone() instead.
const QgsContrastEnhancement * blueContrastEnhancement() const
Returns the contrast enhancement to use for the blue channel.
const QgsContrastEnhancement * redContrastEnhancement() const
Returns the contrast enhancement to use for the red 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.
virtual QList< int > usesBands() const
Returns a list of band numbers used by the renderer.
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.
const QgsRasterRenderer & operator=(const QgsRasterRenderer &)=delete
QgsRasterRenderer cannot be copied. Use clone() instead.
QgsRasterRenderer * clone() const override=0
Clone itself, create deep copy.
A rectangle specified with double values.
#define SIP_TRANSFER
Definition qgis_sip.h:36
#define SIP_FACTORY
Definition qgis_sip.h:76