File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 16
16
***************************************************************************/
17
17
18
18
#include " qgssinglebandgrayrendererwidget.h"
19
+ #include " qgsrasterlayer.h"
19
20
20
21
QgsSingleBandGrayRendererWidget::QgsSingleBandGrayRendererWidget ( QgsRasterLayer* layer ): QgsRasterRendererWidget( layer )
21
22
{
22
23
setupUi ( this );
24
+
25
+ if ( mRasterLayer )
26
+ {
27
+ QgsRasterDataProvider* provider = mRasterLayer ->dataProvider ();
28
+ if ( !provider )
29
+ {
30
+ return ;
31
+ }
32
+
33
+ // fill available bands into combo box
34
+ int nBands = provider->bandCount ();
35
+ for ( int i = 1 ; i <= nBands; ++i ) // band numbering seem to start at 1
36
+ {
37
+ mGrayBandComboBox ->addItem ( provider->colorInterpretationName ( i ), i );
38
+ }
39
+
40
+ // contrast enhancement algorithms
41
+ mContrastEnhancementComboBox ->addItem ( tr ( " No enhancement" ), 0 );
42
+ mContrastEnhancementComboBox ->addItem ( tr ( " Stretch to MinMax" ), 1 );
43
+ mContrastEnhancementComboBox ->addItem ( tr ( " Stretch and clip to MinMax" ), 2 );
44
+ mContrastEnhancementComboBox ->addItem ( tr ( " Clip to MinMax" ), 3 );
45
+ }
23
46
}
24
47
25
48
QgsSingleBandGrayRendererWidget::~QgsSingleBandGrayRendererWidget ()
You can’t perform that action at this time.
0 commit comments