QGIS API Documentation  2.0.1-Dufour
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgspalettedrasterrenderer.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgspalettedrasterrenderer.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 QGSPALETTEDRASTERRENDERER_H
19 #define QGSPALETTEDRASTERRENDERER_H
20 
21 #include "qgsrasterrenderer.h"
22 
23 class QColor;
24 class QDomElement;
25 
30 {
31  public:
33  QgsPalettedRasterRenderer( QgsRasterInterface* input, int bandNumber, QColor* colorArray, int nColors );
34  QgsPalettedRasterRenderer( QgsRasterInterface* input, int bandNumber, QRgb* colorArray, int nColors );
36  QgsRasterInterface * clone() const;
37  static QgsRasterRenderer* create( const QDomElement& elem, QgsRasterInterface* input );
38 
39  QgsRasterBlock *block( int bandNo, const QgsRectangle & extent, int width, int height );
40 
42  int nColors() const { return mNColors; }
44  QColor* colors() const;
45 
49  QRgb* rgbArray() const;
50 
51  void writeXML( QDomDocument& doc, QDomElement& parentElem ) const;
52 
53  void legendSymbologyItems( QList< QPair< QString, QColor > >& symbolItems ) const;
54 
55  QList<int> usesBands() const;
56 
57  private:
58  int mBand;
60  QRgb* mColors;
62  int mNColors;
63 };
64 
65 #endif // QGSPALETTEDRASTERRENDERER_H