|
Quantum GIS API Documentation
master-693a1fe
|
00001 /*************************************************************************** 00002 qgspalettedrasterrenderer.h 00003 --------------------------- 00004 begin : December 2011 00005 copyright : (C) 2011 by Marco Hugentobler 00006 email : marco at sourcepole dot ch 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef QGSPALETTEDRASTERRENDERER_H 00019 #define QGSPALETTEDRASTERRENDERER_H 00020 00021 #include "qgsrasterrenderer.h" 00022 00023 class QColor; 00024 class QDomElement; 00025 00029 class CORE_EXPORT QgsPalettedRasterRenderer: public QgsRasterRenderer 00030 { 00031 public: 00033 QgsPalettedRasterRenderer( QgsRasterInterface* input, int bandNumber, QColor* colorArray, int nColors ); 00034 QgsPalettedRasterRenderer( QgsRasterInterface* input, int bandNumber, QRgb* colorArray, int nColors ); 00035 ~QgsPalettedRasterRenderer(); 00036 QgsRasterInterface * clone() const; 00037 static QgsRasterRenderer* create( const QDomElement& elem, QgsRasterInterface* input ); 00038 00039 QgsRasterBlock *block( int bandNo, const QgsRectangle & extent, int width, int height ); 00040 00042 int nColors() const { return mNColors; } 00044 QColor* colors() const; 00045 00049 QRgb* rgbArray() const; 00050 00051 void writeXML( QDomDocument& doc, QDomElement& parentElem ) const; 00052 00053 void legendSymbologyItems( QList< QPair< QString, QColor > >& symbolItems ) const; 00054 00055 QList<int> usesBands() const; 00056 00057 private: 00058 int mBand; 00060 QRgb* mColors; 00062 int mNColors; 00063 }; 00064 00065 #endif // QGSPALETTEDRASTERRENDERER_H