|
Quantum GIS API Documentation
master-ce49b66
|
00001 /*************************************************************************** 00002 qgssinglebandpseudocolorrenderer.h 00003 ---------------------------------- 00004 begin : January 2012 00005 copyright : (C) 2012 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 QGSSINGLEBANDPSEUDOCOLORRENDERER_H 00019 #define QGSSINGLEBANDPSEUDOCOLORRENDERER_H 00020 00021 #include "qgsrasterrenderer.h" 00022 00023 class QDomElement; 00024 class QgsRasterShader; 00025 00029 class CORE_EXPORT QgsSingleBandPseudoColorRenderer: public QgsRasterRenderer 00030 { 00031 public: 00033 QgsSingleBandPseudoColorRenderer( QgsRasterInterface* input, int band, QgsRasterShader* shader ); 00034 ~QgsSingleBandPseudoColorRenderer(); 00035 QgsRasterInterface * clone() const; 00036 00037 static QgsRasterRenderer* create( const QDomElement& elem, QgsRasterInterface* input ); 00038 00039 QgsRasterBlock* block( int bandNo, const QgsRectangle & extent, int width, int height ); 00040 00042 void setShader( QgsRasterShader* shader ); 00043 QgsRasterShader* shader() { return mShader; } 00044 const QgsRasterShader* shader() const { return mShader; } 00045 00046 void writeXML( QDomDocument& doc, QDomElement& parentElem ) const; 00047 00048 void legendSymbologyItems( QList< QPair< QString, QColor > >& symbolItems ) const; 00049 00050 QList<int> usesBands() const; 00051 00052 double classificationMin() const { return mClassificationMin; } 00053 double classificationMax() const { return mClassificationMax; } 00054 void setClassificationMin( double min ) { mClassificationMin = min; } 00055 void setClassificationMax( double max ) { mClassificationMax = max; } 00056 int classificationMinMaxOrigin() const { return mClassificationMinMaxOrigin; } 00057 void setClassificationMinMaxOrigin( int origin ) { mClassificationMinMaxOrigin = origin; } 00058 00059 private: 00060 QgsRasterShader* mShader; 00061 int mBand; 00062 00063 // Minimum and maximum values used for automatic classification, these 00064 // values are not used by renderer in rendering process 00065 double mClassificationMin; 00066 double mClassificationMax; 00067 00068 int mClassificationMinMaxOrigin; 00069 }; 00070 00071 #endif // QGSSINGLEBANDPSEUDOCOLORRENDERER_H