QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 = 0, QgsContrastEnhancement* greenEnhancement = 0,
34  QgsContrastEnhancement* blueEnhancement = 0 );
36  QgsRasterInterface * clone() const;
37 
38  static QgsRasterRenderer* create( const QDomElement& elem, QgsRasterInterface* input );
39 
40  QgsRasterBlock* block( int bandNo, const QgsRectangle & extent, int width, int height );
41 
42  int redBand() const { return mRedBand; }
43  void setRedBand( int band ) { mRedBand = band; }
44  int greenBand() const { return mGreenBand; }
45  void setGreenBand( int band ) { mGreenBand = band; }
46  int blueBand() const { return mBlueBand; }
47  void setBlueBand( int band ) { mBlueBand = band; }
48 
49  const QgsContrastEnhancement* redContrastEnhancement() const { return mRedContrastEnhancement; }
51  void setRedContrastEnhancement( QgsContrastEnhancement* ce );
52 
53  const QgsContrastEnhancement* greenContrastEnhancement() const { return mGreenContrastEnhancement; }
55  void setGreenContrastEnhancement( QgsContrastEnhancement* ce );
56 
57  const QgsContrastEnhancement* blueContrastEnhancement() const { return mBlueContrastEnhancement; }
59  void setBlueContrastEnhancement( QgsContrastEnhancement* ce );
60 
61  void writeXML( QDomDocument& doc, QDomElement& parentElem ) const;
62 
63  QList<int> usesBands() const;
64 
65  private:
66  int mRedBand;
67  int mGreenBand;
68  int mBlueBand;
69 
70  QgsContrastEnhancement* mRedContrastEnhancement;
71  QgsContrastEnhancement* mGreenContrastEnhancement;
72  QgsContrastEnhancement* mBlueContrastEnhancement;
73 };
74 
75 #endif // QGSMULTIBANDCOLORRENDERER_H
A rectangle specified with double values.
Definition: qgsrectangle.h:35
virtual QgsRasterBlock * block(int bandNo, const QgsRectangle &extent, int width, int height)=0
Read block of data using given extent and size.
virtual QList< int > usesBands() const
Returns a list of band numbers used by the renderer.
Definition: qgsrasterrenderer.h:89
const QgsContrastEnhancement * greenContrastEnhancement() const
Definition: qgsmultibandcolorrenderer.h:53
const QgsContrastEnhancement * redContrastEnhancement() const
Definition: qgsmultibandcolorrenderer.h:49
QgsRasterInterface * clone() const =0
Clone itself, create deep copy.
void setGreenBand(int band)
Definition: qgsmultibandcolorrenderer.h:45
void setRedBand(int band)
Definition: qgsmultibandcolorrenderer.h:43
Raster data container.
Definition: qgsrasterblock.h:32
virtual void writeXML(QDomDocument &doc, QDomElement &parentElem) const
Write base class members to xml.
Definition: qgsrasterinterface.h:211
int redBand() const
Definition: qgsmultibandcolorrenderer.h:42
Base class for processing filters like renderers, reprojector, resampler etc.
Definition: qgsrasterinterface.h:35
int blueBand() const
Definition: qgsmultibandcolorrenderer.h:46
void setBlueBand(int band)
Definition: qgsmultibandcolorrenderer.h:47
const QgsContrastEnhancement * blueContrastEnhancement() const
Definition: qgsmultibandcolorrenderer.h:57
Renderer for multiband images with the color components.
Definition: qgsmultibandcolorrenderer.h:29
Manipulates raster pixel values so that they enhanceContrast or clip into a specified numerical range...
Definition: qgscontrastenhancement.h:38
int greenBand() const
Definition: qgsmultibandcolorrenderer.h:44
Raster renderer pipe that applies colors to a raster.
Definition: qgsrasterrenderer.h:34