QGIS API Documentation 3.41.0-Master (d5b93354e9c)
Loading...
Searching...
No Matches
qgssinglebandgrayrendererwidget.h
Go to the documentation of this file.
1/***************************************************************************
2 qgssinglebandgrayrendererwidget.h
3 ---------------------------------
4 begin : March 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 QGSSINGLEBANDGRAYRENDERERWIDGET_H
19#define QGSSINGLEBANDGRAYRENDERERWIDGET_H
20
22#include "qgis_sip.h"
23#include "ui_qgssinglebandgrayrendererwidgetbase.h"
24#include "qgis_gui.h"
26
28
33class GUI_EXPORT QgsSingleBandGrayRendererWidget : public QgsRasterRendererWidget, private Ui::QgsSingleBandGrayRendererWidgetBase
34{
35 Q_OBJECT
36 public:
38
39 static QgsRasterRendererWidget *create( QgsRasterLayer *layer, const QgsRectangle &extent ) SIP_FACTORY { return new QgsSingleBandGrayRendererWidget( layer, extent ); }
40
42 void setMapCanvas( QgsMapCanvas *canvas ) override;
43
47 void setFromRenderer( const QgsRasterRenderer *r );
48
49 QString min( int index = 0 ) override
50 {
51 Q_UNUSED( index )
52 return mMinLineEdit->text();
53 }
54 QString max( int index = 0 ) override
55 {
56 Q_UNUSED( index )
57 return mMaxLineEdit->text();
58 }
59 void setMin( const QString &value, int index = 0 ) override;
60 void setMax( const QString &value, int index = 0 ) override;
61 int selectedBand( int index = 0 ) override
62 {
63 Q_UNUSED( index )
64 return mGrayBandComboBox->currentBand();
65 }
66
69
70 void doComputations() override;
71 QgsRasterMinMaxWidget *minMaxWidget() override { return mMinMaxWidget; }
72
73 public slots:
75 void loadMinMax( int bandNo, double min, double max );
76
77 private slots:
78 void bandChanged();
79 void mMinLineEdit_textChanged( const QString & );
80 void mMaxLineEdit_textChanged( const QString & );
81 void showLegendSettings();
82
83 private:
84 QgsRasterMinMaxWidget *mMinMaxWidget = nullptr;
85 bool mDisableMinMaxWidgetRefresh;
86 QgsColorRampLegendNodeSettings mLegendSettings;
87
88 void minMaxModified();
89};
90
91#endif // QGSSINGLEBANDGRAYRENDERERWIDGET_H
Settings for a color ramp legend node.
ContrastEnhancementAlgorithm
This enumerator describes the types of contrast enhancement algorithms that can be used.
Map canvas is a class for displaying all GIS data types on a canvas.
Represents a raster layer.
Abstract base class for widgets which configure a QgsRasterRenderer.
virtual void setMax(const QString &value, int index=0)
virtual void setContrastEnhancementAlgorithm(QgsContrastEnhancement::ContrastEnhancementAlgorithm algorithm)
Sets the contrast enhancement algorithm to be used by the raster renderer.
virtual void setMin(const QString &value, int index=0)
virtual QgsContrastEnhancement::ContrastEnhancementAlgorithm contrastEnhancementAlgorithm() const
Returns the contrast enhancement algorithm to be used by the raster renderer.
virtual void doComputations()
Load programmatically with current values.
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.
static QgsRasterRendererWidget * create(QgsRasterLayer *layer, const QgsRectangle &extent)
QgsRasterMinMaxWidget * minMaxWidget() override
Returns min/max widget when it exists.
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