Skip to content
Permalink
Browse files

Merge pull request #2163 from carolinux/master

Added setBand capability to qgssinglebandpseudocolorrenderer API
  • Loading branch information
nyalldawson committed Jun 24, 2015
2 parents 8656b2d + 028c083 commit 7e8041cd98573e6e68951dde93b4176b84d9149f
@@ -29,6 +29,12 @@ class QgsSingleBandPseudoColorRenderer: QgsRasterRenderer
*/
int band() const;

/** Sets the band used by the renderer.
* @see band
* @note added in QGIS 2.10
*/
void setBand(int bandNo);

double classificationMin() const;
double classificationMax() const;
void setClassificationMin( double min );
@@ -38,6 +38,15 @@ QgsSingleBandPseudoColorRenderer::~QgsSingleBandPseudoColorRenderer()
delete mShader;
}

void QgsSingleBandPseudoColorRenderer::setBand(int bandNo)
{
if ( bandNo > mInput->bandCount() || bandNo <= 0 )
{
return;
}
mBand = bandNo;
}

QgsRasterInterface * QgsSingleBandPseudoColorRenderer::clone() const
{
QgsRasterShader *shader = 0;
@@ -54,6 +54,12 @@ class CORE_EXPORT QgsSingleBandPseudoColorRenderer: public QgsRasterRenderer
*/
int band() const { return mBand; }

/** Sets the band used by the renderer.
* @see band
* @note added in QGIS 2.10
*/
void setBand( int bandNo );

double classificationMin() const { return mClassificationMin; }
double classificationMax() const { return mClassificationMax; }
void setClassificationMin( double min ) { mClassificationMin = min; }

0 comments on commit 7e8041c

Please sign in to comment.
You can’t perform that action at this time.