QGIS API Documentation  2.17.0-Master (8784312)
qgsmultibandcolorrendererwidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmultibandcolorrendererwidget.h
3  ---------------------------------
4  begin : February 2012
5  copyright : (C) 2012 by Marco Hugentobler
6  email : marco at sourcepole dot ch
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSMULTIBANDCOLORRENDERERWIDGET_H
19 #define QGSMULTIBANDCOLORRENDERERWIDGET_H
20 
21 #include "qgsrasterminmaxwidget.h"
23 #include "ui_qgsmultibandcolorrendererwidgetbase.h"
24 
28 class QgsRasterLayer;
29 class QLineEdit;
30 
34 class GUI_EXPORT QgsMultiBandColorRendererWidget: public QgsRasterRendererWidget, private Ui::QgsMultiBandColorRendererWidgetBase
35 {
36  Q_OBJECT
37 
38  public:
40  static QgsRasterRendererWidget* create( QgsRasterLayer* layer, const QgsRectangle &theExtent ) { return new QgsMultiBandColorRendererWidget( layer, theExtent ); }
42 
43  QgsRasterRenderer* renderer() override;
44  void setMapCanvas( QgsMapCanvas* canvas ) override;
45 
46  void setFromRenderer( const QgsRasterRenderer* r );
47 
48  QString min( int index = 0 ) override;
49  QString max( int index = 0 ) override;
50  void setMin( const QString& value, int index = 0 ) override;
51  void setMax( const QString& value, int index = 0 ) override;
52  int selectedBand( int index = 0 ) override;
53 
54  public slots:
55  void loadMinMax( int theBandNo, double theMin, double theMax, int theOrigin );
56 
57  private slots:
58  //void on_mLoadPushButton_clicked();
59  void onBandChanged( int );
60 
61  private:
62  void createValidators();
63  void setCustomMinMaxValues( QgsMultiBandColorRenderer* r, const QgsRasterDataProvider* provider, int redBand, int GreenBand,
64  int blueBand );
66  void setMinMaxValue( const QgsContrastEnhancement* ce, QLineEdit* minEdit, QLineEdit* maxEdit );
67  QgsRasterMinMaxWidget * mMinMaxWidget;
68 };
69 
70 #endif // QGSMULTIBANDCOLORRENDERERWIDGET_H
static unsigned index
A rectangle specified with double values.
Definition: qgsrectangle.h:35
This class provides qgis with the ability to render raster datasets onto the mapcanvas.
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:109
virtual void setMapCanvas(QgsMapCanvas *canvas)
Sets the map canvas associated with the widget.
virtual void setMax(const QString &value, int index=0)
virtual QString min(int index=0)
virtual int selectedBand(int index=0)
static QgsRasterRendererWidget * create(QgsRasterLayer *layer, const QgsRectangle &theExtent)
Renderer for multiband images with the color components.
Manipulates raster pixel values so that they enhanceContrast or clip into a specified numerical range...
virtual QString max(int index=0)
virtual void setMin(const QString &value, int index=0)
virtual QgsRasterRenderer * renderer()=0
Raster renderer pipe that applies colors to a raster.
Base class for raster data providers.