QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
qgssinglebandgrayrenderer.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgssinglebandgrayrenderer.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 QGSSINGLEBANDGRAYRENDERER_H
19 #define QGSSINGLEBANDGRAYRENDERER_H
20 
21 #include "qgsrasterrenderer.h"
22 
24 class QDomElement;
25 
30 {
31  public:
32  enum Gradient
33  {
35  WhiteToBlack
36  };
37 
38  QgsSingleBandGrayRenderer( QgsRasterInterface* input, int grayBand );
40  QgsRasterInterface * clone() const;
41 
42  static QgsRasterRenderer* create( const QDomElement& elem, QgsRasterInterface* input );
43 
44  QgsRasterBlock *block( int bandNo, QgsRectangle const & extent, int width, int height );
45 
46  int grayBand() const { return mGrayBand; }
47  void setGrayBand( int band ) { mGrayBand = band; }
48  const QgsContrastEnhancement* contrastEnhancement() const { return mContrastEnhancement; }
50  void setContrastEnhancement( QgsContrastEnhancement* ce );
51 
52  void setGradient( Gradient theGradient ) { mGradient = theGradient; }
53  Gradient gradient() const { return mGradient; }
54 
55  void writeXML( QDomDocument& doc, QDomElement& parentElem ) const;
56 
57  void legendSymbologyItems( QList< QPair< QString, QColor > >& symbolItems ) const;
58 
59  QList<int> usesBands() const;
60 
61  private:
62  int mGrayBand;
63  Gradient mGradient;
64  QgsContrastEnhancement* mContrastEnhancement;
65 };
66 
67 #endif // QGSSINGLEBANDGRAYRENDERER_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
int grayBand() const
Definition: qgssinglebandgrayrenderer.h:46
const QgsContrastEnhancement * contrastEnhancement() const
Definition: qgssinglebandgrayrenderer.h:48
Gradient gradient() const
Definition: qgssinglebandgrayrenderer.h:53
QgsRasterInterface * clone() const =0
Clone itself, create deep copy.
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
Raster renderer pipe for single band gray.
Definition: qgssinglebandgrayrenderer.h:29
Definition: qgssinglebandgrayrenderer.h:34
Base class for processing filters like renderers, reprojector, resampler etc.
Definition: qgsrasterinterface.h:35
Gradient
Definition: qgssinglebandgrayrenderer.h:32
void setGradient(Gradient theGradient)
Definition: qgssinglebandgrayrenderer.h:52
virtual void legendSymbologyItems(QList< QPair< QString, QColor > > &symbolItems) const
Get symbology items if provided by renderer.
Definition: qgsrasterrenderer.h:83
void setGrayBand(int band)
Definition: qgssinglebandgrayrenderer.h:47
Manipulates raster pixel values so that they enhanceContrast or clip into a specified numerical range...
Definition: qgscontrastenhancement.h:38
Raster renderer pipe that applies colors to a raster.
Definition: qgsrasterrenderer.h:34