QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
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
22#include "ui_qgsmultibandcolorrendererwidgetbase.h"
23#include "qgis_gui.h"
24
28class QgsRasterLayer;
29class QLineEdit;
31
36class GUI_EXPORT QgsMultiBandColorRendererWidget : public QgsRasterRendererWidget, private Ui::QgsMultiBandColorRendererWidgetBase
37{
38 Q_OBJECT
39
40 public:
42 static QgsRasterRendererWidget *create( QgsRasterLayer *layer, const QgsRectangle &extent ) { return new QgsMultiBandColorRendererWidget( layer, extent ); }
43
45 void setMapCanvas( QgsMapCanvas *canvas ) override;
46
50 void setFromRenderer( const QgsRasterRenderer *r );
51
52 QString min( int index = 0 ) override;
53 QString max( int index = 0 ) override;
54 void setMin( const QString &value, int index = 0 ) override;
55 void setMax( const QString &value, int index = 0 ) override;
56 int selectedBand( int index = 0 ) override;
57
58 QgsContrastEnhancement::ContrastEnhancementAlgorithm contrastEnhancementAlgorithm() const override;
59 void setContrastEnhancementAlgorithm( QgsContrastEnhancement::ContrastEnhancementAlgorithm algorithm ) override;
60
61 void doComputations() override;
62 QgsRasterMinMaxWidget *minMaxWidget() override { return mMinMaxWidget; }
63
64 public slots:
66 void loadMinMax( int bandNo, double min, double max );
67
68 private slots:
69 void onBandChanged( int );
70 void mRedMinLineEdit_textChanged( const QString & );
71 void mRedMaxLineEdit_textChanged( const QString & );
72 void mGreenMinLineEdit_textChanged( const QString & );
73 void mGreenMaxLineEdit_textChanged( const QString & );
74 void mBlueMinLineEdit_textChanged( const QString & );
75 void mBlueMaxLineEdit_textChanged( const QString & );
76
77 private:
78 void createValidators();
79 void setCustomMinMaxValues( QgsMultiBandColorRenderer *r, const QgsRasterDataProvider *provider, int redBand, int GreenBand, int blueBand );
81 void setMinMaxValue( const QgsContrastEnhancement *ce, QLineEdit *minEdit, QLineEdit *maxEdit );
82 QgsRasterMinMaxWidget *mMinMaxWidget = nullptr;
83 bool mDisableMinMaxWidgetRefresh;
84
85 void minMaxModified();
86};
87
88#endif // QGSMULTIBANDCOLORRENDERERWIDGET_H
Manipulates raster or point cloud pixel values so that they enhanceContrast or clip into a specified ...
Map canvas is a class for displaying all GIS data types on a canvas.
static QgsRasterRendererWidget * create(QgsRasterLayer *layer, const QgsRectangle &extent)
Renderer for multiband images with the color components.
Base class for raster data providers.
Represents a raster layer.
Abstract base class for widgets which configure a QgsRasterRenderer.
virtual QgsRasterRenderer * renderer()=0
Creates a new renderer, using the properties defined in the widget.
Raster renderer pipe that applies colors to a raster.
A rectangle specified with double values.
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into allowing algorithms to be written in pure substantial changes are required in order to port existing x Processing algorithms for QGIS x The most significant changes are outlined not GeoAlgorithm For algorithms which operate on features one by consider subclassing the QgsProcessingFeatureBasedAlgorithm class This class allows much of the boilerplate code for looping over features from a vector layer to be bypassed and instead requires implementation of a processFeature method Ensure that your algorithm(or algorithm 's parent class) implements the new pure virtual createInstance(self) call
#define SIP_FACTORY
Definition qgis_sip.h:76