QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
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 "qgsrasterrenderer.h"
22 
24 class QDomElement;
25 
30 {
31  public:
32  QgsMultiBandColorRenderer( QgsRasterInterface* input, int redBand, int greenBand, int blueBand,
33  QgsContrastEnhancement* redEnhancement = nullptr, QgsContrastEnhancement* greenEnhancement = nullptr,
34  QgsContrastEnhancement* blueEnhancement = nullptr );
36  QgsMultiBandColorRenderer * clone() const override;
37 
38  static QgsRasterRenderer* create( const QDomElement& elem, QgsRasterInterface* input );
39 
40  QgsRasterBlock* block( int bandNo, const QgsRectangle & extent, int width, int height ) override;
41  QgsRasterBlock* block2( int bandNo, const QgsRectangle & extent, int width, int height, QgsRasterBlockFeedback* feedback = nullptr ) override;
42 
43  int redBand() const { return mRedBand; }
44  void setRedBand( int band ) { mRedBand = band; }
45  int greenBand() const { return mGreenBand; }
46  void setGreenBand( int band ) { mGreenBand = band; }
47  int blueBand() const { return mBlueBand; }
48  void setBlueBand( int band ) { mBlueBand = band; }
49 
50  const QgsContrastEnhancement* redContrastEnhancement() const { return mRedContrastEnhancement; }
52  void setRedContrastEnhancement( QgsContrastEnhancement* ce );
53 
54  const QgsContrastEnhancement* greenContrastEnhancement() const { return mGreenContrastEnhancement; }
56  void setGreenContrastEnhancement( QgsContrastEnhancement* ce );
57 
58  const QgsContrastEnhancement* blueContrastEnhancement() const { return mBlueContrastEnhancement; }
60  void setBlueContrastEnhancement( QgsContrastEnhancement* ce );
61 
62  void writeXML( QDomDocument& doc, QDomElement& parentElem ) const override;
63 
64  QList<int> usesBands() const override;
65 
66  private:
67  int mRedBand;
68  int mGreenBand;
69  int mBlueBand;
70 
71  QgsContrastEnhancement* mRedContrastEnhancement;
72  QgsContrastEnhancement* mGreenContrastEnhancement;
73  QgsContrastEnhancement* mBlueContrastEnhancement;
74 
76  const QgsMultiBandColorRenderer& operator=( const QgsMultiBandColorRenderer& );
77 };
78 
79 #endif // QGSMULTIBANDCOLORRENDERER_H
A rectangle specified with double values.
Definition: qgsrectangle.h:35
const QgsContrastEnhancement * blueContrastEnhancement() const
virtual QList< int > usesBands() const
Returns a list of band numbers used by the renderer.
virtual QgsRasterBlock * block2(int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback=nullptr)
Read block of data using given extent and size.
Raster data container.
virtual void writeXML(QDomDocument &doc, QDomElement &parentElem) const
Write base class members to xml.
Base class for processing filters like renderers, reprojector, resampler etc.
const QgsContrastEnhancement * redContrastEnhancement() const
const QgsContrastEnhancement * greenContrastEnhancement() const
virtual QgsRasterBlock * block(int bandNo, const QgsRectangle &extent, int width, int height)=0
Read block of data using given extent and size.
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...
Feedback object tailored for raster block reading.
Raster renderer pipe that applies colors to a raster.