Skip to content
Permalink
Browse files
Fill comboboxes in single band gray widget
  • Loading branch information
mhugent committed Mar 5, 2012
1 parent 8d415e5 commit 579ccb30aed58317bc27df6ec4f39c6b094c1864
Showing with 23 additions and 0 deletions.
  1. +23 −0 src/gui/raster/qgssinglebandgrayrendererwidget.cpp
@@ -16,10 +16,33 @@
***************************************************************************/

#include "qgssinglebandgrayrendererwidget.h"
#include "qgsrasterlayer.h"

QgsSingleBandGrayRendererWidget::QgsSingleBandGrayRendererWidget( QgsRasterLayer* layer ): QgsRasterRendererWidget( layer )
{
setupUi( this );

if ( mRasterLayer )
{
QgsRasterDataProvider* provider = mRasterLayer->dataProvider();
if ( !provider )
{
return;
}

//fill available bands into combo box
int nBands = provider->bandCount();
for ( int i = 1; i <= nBands; ++i ) //band numbering seem to start at 1
{
mGrayBandComboBox->addItem( provider->colorInterpretationName( i ), i );
}

//contrast enhancement algorithms
mContrastEnhancementComboBox->addItem( tr( "No enhancement" ), 0 );
mContrastEnhancementComboBox->addItem( tr( "Stretch to MinMax" ), 1 );
mContrastEnhancementComboBox->addItem( tr( "Stretch and clip to MinMax" ), 2 );
mContrastEnhancementComboBox->addItem( tr( "Clip to MinMax" ), 3 );
}
}

QgsSingleBandGrayRendererWidget::~QgsSingleBandGrayRendererWidget()

0 comments on commit 579ccb3

Please sign in to comment.