QGIS API Documentation  3.10.0-A Coruña (6c816b4204)
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 
58  const QgsContrastEnhancement *redContrastEnhancement() const { return mRedContrastEnhancement; }
60  void setRedContrastEnhancement( QgsContrastEnhancement *ce SIP_TRANSFER );
61 
62  const QgsContrastEnhancement *greenContrastEnhancement() const { return mGreenContrastEnhancement; }
64  void setGreenContrastEnhancement( QgsContrastEnhancement *ce SIP_TRANSFER );
65 
66  const QgsContrastEnhancement *blueContrastEnhancement() const { return mBlueContrastEnhancement; }
68  void setBlueContrastEnhancement( QgsContrastEnhancement *ce SIP_TRANSFER );
69 
70  void writeXml( QDomDocument &doc, QDomElement &parentElem ) const override;
71 
72  QList<int> usesBands() const override;
73 
74  void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props = QgsStringMap() ) const override;
75 
76  private:
77 #ifdef SIP_RUN
80 #endif
81 
82  int mRedBand;
83  int mGreenBand;
84  int mBlueBand;
85 
86  QgsContrastEnhancement *mRedContrastEnhancement = nullptr;
87  QgsContrastEnhancement *mGreenContrastEnhancement = nullptr;
88  QgsContrastEnhancement *mBlueContrastEnhancement = nullptr;
89 
90 };
91 
92 #endif // QGSMULTIBANDCOLORRENDERER_H
A rectangle specified with double values.
Definition: qgsrectangle.h:41
QgsRasterBlock * block(int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback=nullptr) override=0
Read block of data using given extent and size.
const QgsContrastEnhancement * blueContrastEnhancement() const
virtual void toSld(QDomDocument &doc, QDomElement &element, const QgsStringMap &props=QgsStringMap()) 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.
QMap< QString, QString > QgsStringMap
Definition: qgis.h:612
Raster data container.
#define SIP_TRANSFER
Definition: qgis_sip.h:36
#define SIP_FACTORY
Definition: qgis_sip.h:76
Base class for processing filters like renderers, reprojector, resampler etc.
const QgsContrastEnhancement * redContrastEnhancement() const
const QgsContrastEnhancement * greenContrastEnhancement() const
const QgsRasterRenderer & operator=(const QgsRasterRenderer &)=delete
QgsRasterRenderer cannot be copied. Use clone() instead.
QgsRasterRenderer * clone() const override=0
Clone itself, create deep copy.
Renderer for multiband images with the color components.
Manipulates raster pixel values so that they enhanceContrast or clip into a specified numerical range...
virtual void writeXml(QDomDocument &doc, QDomElement &parentElem) const
Write base class members to xml.
Feedback object tailored for raster block reading.
Raster renderer pipe that applies colors to a raster.