QGIS API Documentation  2.99.0-Master (0a63d1f)
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 "qgsrasterrenderer.h"
23 
25 class QDomElement;
26 
31 {
32  public:
33  QgsMultiBandColorRenderer( QgsRasterInterface* input, int redBand, int greenBand, int blueBand,
34  QgsContrastEnhancement* redEnhancement = nullptr, QgsContrastEnhancement* greenEnhancement = nullptr,
35  QgsContrastEnhancement* blueEnhancement = nullptr );
37 
42 
43  QgsMultiBandColorRenderer * clone() const override;
44 
45  static QgsRasterRenderer* create( const QDomElement& elem, QgsRasterInterface* input );
46 
47  QgsRasterBlock* block( int bandNo, const QgsRectangle & extent, int width, int height, QgsRasterBlockFeedback* feedback = nullptr ) override;
48 
49  int redBand() const { return mRedBand; }
50  void setRedBand( int band ) { mRedBand = band; }
51  int greenBand() const { return mGreenBand; }
52  void setGreenBand( int band ) { mGreenBand = band; }
53  int blueBand() const { return mBlueBand; }
54  void setBlueBand( int band ) { mBlueBand = band; }
55 
56  const QgsContrastEnhancement* redContrastEnhancement() const { return mRedContrastEnhancement; }
58  void setRedContrastEnhancement( QgsContrastEnhancement* ce );
59 
60  const QgsContrastEnhancement* greenContrastEnhancement() const { return mGreenContrastEnhancement; }
62  void setGreenContrastEnhancement( QgsContrastEnhancement* ce );
63 
64  const QgsContrastEnhancement* blueContrastEnhancement() const { return mBlueContrastEnhancement; }
66  void setBlueContrastEnhancement( QgsContrastEnhancement* ce );
67 
68  void writeXml( QDomDocument& doc, QDomElement& parentElem ) const override;
69 
70  QList<int> usesBands() const override;
71 
72  private:
73  int mRedBand;
74  int mGreenBand;
75  int mBlueBand;
76 
77  QgsContrastEnhancement* mRedContrastEnhancement;
78  QgsContrastEnhancement* mGreenContrastEnhancement;
79  QgsContrastEnhancement* mBlueContrastEnhancement;
80 
81 };
82 
83 #endif // QGSMULTIBANDCOLORRENDERER_H
A rectangle specified with double values.
Definition: qgsrectangle.h:36
const QgsContrastEnhancement * blueContrastEnhancement() const
virtual QList< int > usesBands() const
Returns a list of band numbers used by the renderer.
Raster data container.
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.
virtual 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.