QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
qgsrendererrasterpropertieswidget.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsrendererrasterpropertieswidget.cpp
3  ---------------------
4  begin : May 2016
5  copyright : (C) 2016 by Nathan Woodrow
6  email : woodrow dot nathan at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
16 
17 #include "qgis.h"
18 #include "qgsmapcanvas.h"
20 #include "qgshuesaturationfilter.h"
22 #include "qgsrasterlayer.h"
32 #include "qgsapplication.h"
33 
34 
35 #include "qgsmessagelog.h"
36 
37 static void _initRendererWidgetFunctions()
38 {
39  static bool sInitialized = false;
40  if ( sInitialized )
41  return;
42 
49 
50  sInitialized = true;
51 }
52 
53 
54 
56  : QgsMapLayerConfigWidget( layer, canvas, parent )
57  , mRasterLayer( qobject_cast<QgsRasterLayer *>( layer ) )
58 {
59  if ( !mRasterLayer )
60  return;
61 
62  setupUi( this );
63  connect( mResetColorRenderingBtn, &QToolButton::clicked, this, &QgsRendererRasterPropertiesWidget::mResetColorRenderingBtn_clicked );
64 
65  _initRendererWidgetFunctions();
66 
67  mResamplingUtils.initWidgets( mRasterLayer, mZoomedInResamplingComboBox, mZoomedOutResamplingComboBox, mMaximumOversamplingSpinBox, mCbEarlyResampling );
68 
69  connect( cboRenderers, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsRendererRasterPropertiesWidget::rendererChanged );
70 
71  connect( mSliderBrightness, &QAbstractSlider::valueChanged, mBrightnessSpinBox, &QSpinBox::setValue );
72  connect( mBrightnessSpinBox, static_cast < void ( QSpinBox::* )( int ) > ( &QSpinBox::valueChanged ), mSliderBrightness, &QAbstractSlider::setValue );
73  mBrightnessSpinBox->setClearValue( 0 );
74 
75  connect( mSliderContrast, &QAbstractSlider::valueChanged, mContrastSpinBox, &QSpinBox::setValue );
76  connect( mContrastSpinBox, static_cast < void ( QSpinBox::* )( int ) > ( &QSpinBox::valueChanged ), mSliderContrast, &QAbstractSlider::setValue );
77  mContrastSpinBox->setClearValue( 0 );
78 
79  connect( mSliderGamma, &QAbstractSlider::valueChanged, this, &QgsRendererRasterPropertiesWidget::updateGammaSpinBox );
80  connect( mGammaSpinBox, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsRendererRasterPropertiesWidget::updateGammaSlider );
81  mGammaSpinBox->setClearValue( 1.0 );
82 
83  // Connect saturation slider and spin box
84  connect( sliderSaturation, &QAbstractSlider::valueChanged, spinBoxSaturation, &QSpinBox::setValue );
85  connect( spinBoxSaturation, static_cast < void ( QSpinBox::* )( int ) > ( &QSpinBox::valueChanged ), sliderSaturation, &QAbstractSlider::setValue );
86  spinBoxSaturation->setClearValue( 0 );
87 
88  // Connect colorize strength slider and spin box
89  connect( sliderColorizeStrength, &QAbstractSlider::valueChanged, spinColorizeStrength, &QSpinBox::setValue );
90  connect( spinColorizeStrength, static_cast < void ( QSpinBox::* )( int ) > ( &QSpinBox::valueChanged ), sliderColorizeStrength, &QAbstractSlider::setValue );
91  spinColorizeStrength->setClearValue( 100 );
92 
93  // enable or disable saturation slider and spin box depending on grayscale combo choice
94  connect( comboGrayscale, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsRendererRasterPropertiesWidget::toggleSaturationControls );
95 
96  // enable or disable colorize colorbutton with colorize checkbox
97  connect( mColorizeCheck, &QAbstractButton::toggled, this, &QgsRendererRasterPropertiesWidget::toggleColorizeControls );
98 
99  // Just connect the spin boxes because the sliders update the spinners
100  connect( mBrightnessSpinBox, static_cast < void ( QSpinBox::* )( int ) > ( &QSpinBox::valueChanged ), this, &QgsPanelWidget::widgetChanged );
101  connect( mContrastSpinBox, static_cast < void ( QSpinBox::* )( int ) > ( &QSpinBox::valueChanged ), this, &QgsPanelWidget::widgetChanged );
102  connect( mGammaSpinBox, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsPanelWidget::widgetChanged );
103  connect( spinBoxSaturation, static_cast < void ( QSpinBox::* )( int ) > ( &QSpinBox::valueChanged ), this, &QgsPanelWidget::widgetChanged );
104  connect( spinColorizeStrength, static_cast < void ( QSpinBox::* )( int ) > ( &QSpinBox::valueChanged ), this, &QgsPanelWidget::widgetChanged );
105  connect( btnColorizeColor, &QgsColorButton::colorChanged, this, &QgsPanelWidget::widgetChanged );
106 
107  connect( mBlendModeComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsPanelWidget::widgetChanged );
108  connect( mZoomedInResamplingComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsPanelWidget::widgetChanged );
109  connect( mZoomedOutResamplingComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsPanelWidget::widgetChanged );
110  connect( mMaximumOversamplingSpinBox, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsPanelWidget::widgetChanged );
111  connect( mCbEarlyResampling, &QAbstractButton::toggled, this, &QgsPanelWidget::widgetChanged );
112 
113  // finally sync to the layer - even though some actions may emit widgetChanged signal,
114  // this is not a problem - nobody is listening to our signals yet
115  syncToLayer( mRasterLayer );
116 
117  connect( mRasterLayer, &QgsMapLayer::styleChanged, this, &QgsRendererRasterPropertiesWidget::refreshAfterStyleChanged );
118 }
119 
121 {
122  mMapCanvas = canvas;
123 }
124 
126 {
127  QString rendererName = cboRenderers->currentData().toString();
128  setRendererWidget( rendererName );
129  emit widgetChanged();
130 }
131 
133 {
134  if ( QgsBrightnessContrastFilter *brightnessFilter = mRasterLayer->brightnessFilter() )
135  {
136  brightnessFilter->setBrightness( mSliderBrightness->value() );
137  brightnessFilter->setContrast( mSliderContrast->value() );
138  brightnessFilter->setGamma( mGammaSpinBox->value() );
139  }
140 
141  if ( QgsRasterRendererWidget *rendererWidget = dynamic_cast<QgsRasterRendererWidget *>( stackedWidget->currentWidget() ) )
142  {
143  rendererWidget->doComputations();
144 
145  if ( QgsRasterRenderer *newRenderer = rendererWidget->renderer() )
146  {
147  // there are transparency related data stored in renderer instances, but they
148  // are not configured in the widget, so we need to copy them over from existing renderer
149  if ( QgsRasterRenderer *oldRenderer = mRasterLayer->renderer() )
150  newRenderer->copyCommonProperties( oldRenderer, false );
151  mRasterLayer->setRenderer( newRenderer );
152  }
153  }
154 
155  // Hue and saturation controls
156  if ( QgsHueSaturationFilter *hueSaturationFilter = mRasterLayer->hueSaturationFilter() )
157  {
158  hueSaturationFilter->setSaturation( sliderSaturation->value() );
159  hueSaturationFilter->setGrayscaleMode( ( QgsHueSaturationFilter::GrayscaleMode ) comboGrayscale->currentIndex() );
160  hueSaturationFilter->setColorizeOn( mColorizeCheck->checkState() );
161  hueSaturationFilter->setColorizeColor( btnColorizeColor->color() );
162  hueSaturationFilter->setColorizeStrength( sliderColorizeStrength->value() );
163  }
164 
165  mResamplingUtils.refreshLayerFromWidgets();
166 
167  mRasterLayer->setBlendMode( mBlendModeComboBox->blendMode() );
168 }
169 
171 {
172  mRasterLayer = layer;
173 
174  cboRenderers->blockSignals( true );
175  cboRenderers->clear();
177  const auto constRenderersList = QgsApplication::rasterRendererRegistry()->renderersList();
178  for ( const QString &name : constRenderersList )
179  {
180  if ( QgsApplication::rasterRendererRegistry()->rendererData( name, entry ) )
181  {
182  if ( ( mRasterLayer->rasterType() != QgsRasterLayer::ColorLayer && entry.name != QLatin1String( "singlebandcolordata" ) ) ||
183  ( mRasterLayer->rasterType() == QgsRasterLayer::ColorLayer && entry.name == QLatin1String( "singlebandcolordata" ) ) )
184  {
185  cboRenderers->addItem( entry.icon(), entry.visibleName, entry.name );
186  }
187  }
188  }
189  cboRenderers->setCurrentIndex( -1 );
190  cboRenderers->blockSignals( false );
191 
192  if ( QgsRasterRenderer *renderer = mRasterLayer->renderer() )
193  {
194  setRendererWidget( renderer->type() );
195  }
196 
197  if ( QgsBrightnessContrastFilter *brightnessFilter = mRasterLayer->brightnessFilter() )
198  {
199  mSliderBrightness->setValue( brightnessFilter->brightness() );
200  mSliderContrast->setValue( brightnessFilter->contrast() );
201  mGammaSpinBox->setValue( brightnessFilter->gamma() );
202  }
203 
204  btnColorizeColor->setColorDialogTitle( tr( "Select Color" ) );
205  btnColorizeColor->setContext( QStringLiteral( "symbology" ) );
206 
207  // Hue and saturation color control
208  //set hue and saturation controls to current values
209  if ( const QgsHueSaturationFilter *hueSaturationFilter = mRasterLayer->hueSaturationFilter() )
210  {
211  sliderSaturation->setValue( hueSaturationFilter->saturation() );
212  comboGrayscale->setCurrentIndex( ( int ) hueSaturationFilter->grayscaleMode() );
213 
214  // Set initial state of saturation controls based on grayscale mode choice
215  toggleSaturationControls( static_cast<int>( hueSaturationFilter->grayscaleMode() ) );
216 
217  // Set initial state of colorize controls
218  mColorizeCheck->setChecked( hueSaturationFilter->colorizeOn() );
219  btnColorizeColor->setColor( hueSaturationFilter->colorizeColor() );
220  toggleColorizeControls( hueSaturationFilter->colorizeOn() );
221  sliderColorizeStrength->setValue( hueSaturationFilter->colorizeStrength() );
222  }
223 
224  //blend mode
225  mBlendModeComboBox->setBlendMode( mRasterLayer->blendMode() );
226 
227  //set combo boxes to current resampling types
228  mResamplingUtils.refreshWidgetsFromLayer();
229 }
230 
231 void QgsRendererRasterPropertiesWidget::mResetColorRenderingBtn_clicked()
232 {
233  mBlendModeComboBox->setBlendMode( QPainter::CompositionMode_SourceOver );
234  mSliderBrightness->setValue( 0 );
235  mSliderContrast->setValue( 0 );
236  mGammaSpinBox->setValue( 1.0 );
237  sliderSaturation->setValue( 0 );
238  comboGrayscale->setCurrentIndex( ( int ) QgsHueSaturationFilter::GrayscaleOff );
239  mColorizeCheck->setChecked( false );
240  sliderColorizeStrength->setValue( 100 );
241 }
242 
243 void QgsRendererRasterPropertiesWidget::toggleSaturationControls( int grayscaleMode )
244 {
245  // Enable or disable saturation controls based on choice of grayscale mode
246  if ( grayscaleMode == 0 )
247  {
248  sliderSaturation->setEnabled( true );
249  spinBoxSaturation->setEnabled( true );
250  }
251  else
252  {
253  sliderSaturation->setEnabled( false );
254  spinBoxSaturation->setEnabled( false );
255  }
256  emit widgetChanged();
257 }
258 
259 void QgsRendererRasterPropertiesWidget::toggleColorizeControls( bool colorizeEnabled )
260 {
261  // Enable or disable colorize controls based on checkbox
262  btnColorizeColor->setEnabled( colorizeEnabled );
263  sliderColorizeStrength->setEnabled( colorizeEnabled );
264  spinColorizeStrength->setEnabled( colorizeEnabled );
265  emit widgetChanged();
266 }
267 
268 void QgsRendererRasterPropertiesWidget::setRendererWidget( const QString &rendererName )
269 {
270  QgsDebugMsgLevel( "rendererName = " + rendererName, 3 );
271  QgsRasterRendererWidget *oldWidget = mRendererWidget;
272 
273  int alphaBand = -1;
274  double opacity = 1;
275  QColor nodataColor;
276  if ( QgsRasterRenderer *oldRenderer = mRasterLayer->renderer() )
277  {
278  // Retain alpha band and opacity when switching renderer
279  alphaBand = oldRenderer->alphaBand();
280  opacity = oldRenderer->opacity();
281  nodataColor = oldRenderer->nodataColor();
282  }
283 
284  QgsRasterRendererRegistryEntry rendererEntry;
285  if ( QgsApplication::rasterRendererRegistry()->rendererData( rendererName, rendererEntry ) )
286  {
287  if ( rendererEntry.widgetCreateFunction ) // Single band color data renderer e.g. has no widget
288  {
289  QgsDebugMsgLevel( QStringLiteral( "renderer has widgetCreateFunction" ), 3 );
290  // Current canvas extent (used to calc min/max) in layer CRS
292  if ( oldWidget )
293  {
294  if ( rendererName == QLatin1String( "singlebandgray" ) )
295  {
296  whileBlocking( mRasterLayer )->setRenderer( QgsApplication::rasterRendererRegistry()->defaultRendererForDrawingStyle( QgsRaster::SingleBandGray, mRasterLayer->dataProvider() ) );
297  whileBlocking( mRasterLayer )->setDefaultContrastEnhancement();
298  }
299  else if ( rendererName == QLatin1String( "multibandcolor" ) )
300  {
301  whileBlocking( mRasterLayer )->setRenderer( QgsApplication::rasterRendererRegistry()->defaultRendererForDrawingStyle( QgsRaster::MultiBandColor, mRasterLayer->dataProvider() ) );
302  whileBlocking( mRasterLayer )->setDefaultContrastEnhancement();
303  }
304  }
305  mRasterLayer->renderer()->setAlphaBand( alphaBand );
306  mRasterLayer->renderer()->setOpacity( opacity );
307  mRasterLayer->renderer()->setNodataColor( nodataColor );
308  mRendererWidget = rendererEntry.widgetCreateFunction( mRasterLayer, myExtent );
309  mRendererWidget->setMapCanvas( mMapCanvas );
310  connect( mRendererWidget, &QgsRasterRendererWidget::widgetChanged, this, &QgsPanelWidget::widgetChanged );
311  stackedWidget->addWidget( mRendererWidget );
312  stackedWidget->setCurrentWidget( mRendererWidget );
313  if ( oldWidget )
314  {
315  // Compare used bands in new and old renderer and reset transparency dialog if different
316  QgsRasterRenderer *oldRenderer = oldWidget->renderer();
317  QgsRasterRenderer *newRenderer = mRendererWidget->renderer();
318 #if 0
319  QList<int> oldBands = oldRenderer->usesBands();
320  QList<int> newBands = newRenderer->usesBands();
321 
322  if ( oldBands != newBands )
323  {
324  populateTransparencyTable( newRenderer );
325  }
326 #endif
327 
328  delete oldRenderer;
329  delete newRenderer;
330  }
331  }
332  }
333 
334  if ( mRendererWidget != oldWidget )
335  delete oldWidget;
336 
337  int widgetIndex = cboRenderers->findData( rendererName );
338  if ( widgetIndex != -1 )
339  {
340  whileBlocking( cboRenderers )->setCurrentIndex( widgetIndex );
341  }
342 
343 }
344 
345 void QgsRendererRasterPropertiesWidget::refreshAfterStyleChanged()
346 {
347  if ( mRendererWidget )
348  {
349  QgsRasterRenderer *renderer = mRasterLayer->renderer();
350  if ( QgsMultiBandColorRenderer *mbcr = dynamic_cast<QgsMultiBandColorRenderer *>( renderer ) )
351  {
352  const QgsContrastEnhancement *redCe = mbcr->redContrastEnhancement();
353  if ( redCe )
354  {
355  mRendererWidget->setMin( QString::number( redCe->minimumValue() ), 0 );
356  mRendererWidget->setMax( QString::number( redCe->maximumValue() ), 0 );
357  }
358  const QgsContrastEnhancement *greenCe = mbcr->greenContrastEnhancement();
359  if ( greenCe )
360  {
361  mRendererWidget->setMin( QString::number( greenCe->minimumValue() ), 1 );
362  mRendererWidget->setMax( QString::number( greenCe->maximumValue() ), 1 );
363  }
364  const QgsContrastEnhancement *blueCe = mbcr->blueContrastEnhancement();
365  if ( blueCe )
366  {
367  mRendererWidget->setMin( QString::number( blueCe->minimumValue() ), 2 );
368  mRendererWidget->setMax( QString::number( blueCe->maximumValue() ), 2 );
369  }
370  }
371  else if ( QgsSingleBandGrayRenderer *sbgr = dynamic_cast<QgsSingleBandGrayRenderer *>( renderer ) )
372  {
373  const QgsContrastEnhancement *ce = sbgr->contrastEnhancement();
374  if ( ce )
375  {
376  mRendererWidget->setMin( QString::number( ce->minimumValue() ) );
377  mRendererWidget->setMax( QString::number( ce->maximumValue() ) );
378  }
379  }
380  }
381 }
382 
383 void QgsRendererRasterPropertiesWidget::updateGammaSpinBox( int value )
384 {
385  mGammaSpinBox->setValue( value / 100.0 );
386 }
387 
388 void QgsRendererRasterPropertiesWidget::updateGammaSlider( double value )
389 {
390  mSliderGamma->setValue( value * 100 );
391 }
QgsContrastEnhancement::maximumValue
double maximumValue() const
Returns the maximum value for the contrast enhancement range.
Definition: qgscontrastenhancement.h:152
QgsApplication::rasterRendererRegistry
static QgsRasterRendererRegistry * rasterRendererRegistry()
Returns the application's raster renderer registry, used for managing raster layer renderers.
Definition: qgsapplication.cpp:2153
QgsRasterContourRendererWidget::create
static QgsRasterRendererWidget * create(QgsRasterLayer *layer, const QgsRectangle &extent)
Widget creation function (mainly for the use by the renderer registry)
Definition: qgsrastercontourrendererwidget.h:37
qgspalettedrendererwidget.h
QgsMapCanvas::extent
QgsRectangle extent() const
Returns the current zoom extent of the map canvas.
Definition: qgsmapcanvas.cpp:1056
qgsrasterlayer.h
QgsContrastEnhancement::minimumValue
double minimumValue() const
Returns the minimum value for the contrast enhancement range.
Definition: qgscontrastenhancement.h:155
QgsPalettedRendererWidget::create
static QgsRasterRendererWidget * create(QgsRasterLayer *layer, const QgsRectangle &extent)
Definition: qgspalettedrendererwidget.h:161
qgsmapcanvas.h
QgsDebugMsgLevel
#define QgsDebugMsgLevel(str, level)
Definition: qgslogger.h:39
QgsMapLayer::blendMode
QPainter::CompositionMode blendMode() const
Returns the current blending mode for a layer.
Definition: qgsmaplayer.cpp:212
QgsMapCanvas::mapSettings
const QgsMapSettings & mapSettings() const
Gets access to properties used for map rendering.
Definition: qgsmapcanvas.cpp:391
QgsMapSettings::outputExtentToLayerExtent
QgsRectangle outputExtentToLayerExtent(const QgsMapLayer *layer, QgsRectangle extent) const
transform bounding box from output CRS to layer's CRS
Definition: qgsmapsettings.cpp:458
QgsRaster::SingleBandGray
@ SingleBandGray
Definition: qgsraster.h:92
QgsRasterLayer::ColorLayer
@ ColorLayer
Definition: qgsrasterlayer.h:184
QgsRasterRendererRegistryEntry::name
QString name
Definition: qgsrasterrendererregistry.h:53
QgsRasterRendererRegistryEntry
Registry for raster renderer entries.
Definition: qgsrasterrendererregistry.h:45
QgsHueSaturationFilter::GrayscaleMode
GrayscaleMode
Definition: qgshuesaturationfilter.h:37
QgsMapCanvas
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:85
QgsRendererRasterPropertiesWidget::QgsRendererRasterPropertiesWidget
QgsRendererRasterPropertiesWidget(QgsMapLayer *layer, QgsMapCanvas *canvas, QWidget *parent=nullptr)
A widget to hold the renderer properties for a raster layer.
Definition: qgsrendererrasterpropertieswidget.cpp:55
qgis.h
QgsSingleBandGrayRenderer
Raster renderer pipe for single band gray.
Definition: qgssinglebandgrayrenderer.h:34
QgsRasterRendererWidget::setMax
virtual void setMax(const QString &value, int index=0)
Definition: qgsrasterrendererwidget.h:72
QgsMapLayer::setBlendMode
void setBlendMode(QPainter::CompositionMode blendMode)
Set the blending mode used for rendering a layer.
Definition: qgsmaplayer.cpp:202
qgsrasterrendererregistry.h
QgsRasterRendererRegistry::insertWidgetFunction
void insertWidgetFunction(const QString &rendererName, QgsRasterRendererWidgetCreateFunc func)
Definition: qgsrasterrendererregistry.cpp:73
QgsRendererRasterPropertiesWidget::apply
void apply() override
Apply the changes from the dialog to the layer.
Definition: qgsrendererrasterpropertieswidget.cpp:132
QgsSingleBandPseudoColorRendererWidget::create
static QgsRasterRendererWidget * create(QgsRasterLayer *layer, const QgsRectangle &extent)
Creates new raster renderer widget.
Definition: qgssinglebandpseudocolorrendererwidget.h:49
QgsRasterRenderer::usesBands
virtual QList< int > usesBands() const
Returns a list of band numbers used by the renderer.
Definition: qgsrasterrenderer.h:133
qgsrasterrendererwidget.h
QgsRectangle
A rectangle specified with double values.
Definition: qgsrectangle.h:42
QgsRasterLayer::setRenderer
void setRenderer(QgsRasterRenderer *renderer)
Sets the raster's renderer.
Definition: qgsrasterlayer.cpp:1659
QgsRendererRasterPropertiesWidget::rendererChanged
void rendererChanged()
called when user changes renderer type
Definition: qgsrendererrasterpropertieswidget.cpp:125
qgsmultibandcolorrendererwidget.h
QgsSingleBandGrayRendererWidget::create
static QgsRasterRendererWidget * create(QgsRasterLayer *layer, const QgsRectangle &extent)
Definition: qgssinglebandgrayrendererwidget.h:38
QgsMapLayerConfigWidget
A panel widget that can be shown in the map style dock.
Definition: qgsmaplayerconfigwidget.h:34
QgsColorButton::colorChanged
void colorChanged(const QColor &color)
Emitted whenever a new color is set for the button.
qgsapplication.h
QgsRasterRendererWidget::setMapCanvas
virtual void setMapCanvas(QgsMapCanvas *canvas)
Sets the map canvas associated with the widget.
Definition: qgsrasterrendererwidget.cpp:23
qgssinglebandpseudocolorrendererwidget.h
whileBlocking
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
Definition: qgis.h:262
QgsRasterRenderer
Raster renderer pipe that applies colors to a raster.
Definition: qgsrasterrenderer.h:39
QgsRasterRendererRegistryEntry::icon
QIcon icon()
Definition: qgsrasterrendererregistry.cpp:44
QgsMapLayer::styleChanged
void styleChanged()
Signal emitted whenever a change affects the layer's style.
QgsRasterRenderer::setAlphaBand
void setAlphaBand(int band)
Definition: qgsrasterrenderer.h:116
QgsPanelWidget::widgetChanged
void widgetChanged()
Emitted when the widget state changes.
QgsRasterLayer::dataProvider
QgsRasterDataProvider * dataProvider() override
Returns the source data provider.
Definition: qgsrasterlayer.cpp:234
qgsrendererrasterpropertieswidget.h
QgsRasterRendererRegistryEntry::visibleName
QString visibleName
Definition: qgsrasterrendererregistry.h:54
QgsHueSaturationFilter
Color and saturation filter pipe for rasters.
Definition: qgshuesaturationfilter.h:32
QgsMultiBandColorRenderer
Renderer for multiband images with the color components.
Definition: qgsmultibandcolorrenderer.h:33
QgsRasterLayer
Represents a raster layer.
Definition: qgsrasterlayer.h:71
qgsrastercontourrendererwidget.h
qgsbrightnesscontrastfilter.h
QgsContrastEnhancement
Manipulates raster pixel values so that they enhanceContrast or clip into a specified numerical range...
Definition: qgscontrastenhancement.h:43
QgsMultiBandColorRendererWidget::create
static QgsRasterRendererWidget * create(QgsRasterLayer *layer, const QgsRectangle &extent)
Definition: qgsmultibandcolorrendererwidget.h:42
qgssinglebandgrayrenderer.h
QgsHillshadeRendererWidget::create
static QgsRasterRendererWidget * create(QgsRasterLayer *layer, const QgsRectangle &extent)
Factory method to create the renderer for this type.
Definition: qgshillshaderendererwidget.h:49
qgshuesaturationfilter.h
qgssinglebandgrayrendererwidget.h
QgsMapLayerConfigWidget::mMapCanvas
QgsMapCanvas * mMapCanvas
Definition: qgsmaplayerconfigwidget.h:72
QgsBrightnessContrastFilter
Brightness/contrast and gamma correction filter pipe for rasters.
Definition: qgsbrightnesscontrastfilter.h:32
qgshillshaderendererwidget.h
QgsMapLayer
Base class for all map layer types.
Definition: qgsmaplayer.h:83
QgsHueSaturationFilter::GrayscaleOff
@ GrayscaleOff
Definition: qgshuesaturationfilter.h:38
qgsmultibandcolorrenderer.h
QgsRasterLayer::hueSaturationFilter
QgsHueSaturationFilter * hueSaturationFilter() const
Returns the raster's hue/saturation filter.
Definition: qgsrasterlayer.h:270
QgsRasterLayer::brightnessFilter
QgsBrightnessContrastFilter * brightnessFilter() const
Returns the raster's brightness/contrast filter.
Definition: qgsrasterlayer.h:262
QgsRaster::MultiBandColor
@ MultiBandColor
Definition: qgsraster.h:100
QgsRasterRendererWidget::setMin
virtual void setMin(const QString &value, int index=0)
Definition: qgsrasterrendererwidget.h:71
QgsRendererRasterPropertiesWidget::syncToLayer
void syncToLayer(QgsRasterLayer *layer)
Sync the widget to the given layer.
Definition: qgsrendererrasterpropertieswidget.cpp:170
QgsRasterRenderer::setNodataColor
void setNodataColor(const QColor &color)
Sets the color to use for shading nodata pixels.
Definition: qgsrasterrenderer.h:111
QgsRasterLayer::renderer
QgsRasterRenderer * renderer() const
Returns the raster's renderer.
Definition: qgsrasterlayer.h:246
QgsRendererRasterPropertiesWidget::setMapCanvas
void setMapCanvas(QgsMapCanvas *canvas)
Sets the map canvas associated with the dialog.
Definition: qgsrendererrasterpropertieswidget.cpp:120
QgsRasterRendererWidget
Definition: qgsrasterrendererwidget.h:37
QgsRasterRendererWidget::widgetChanged
void widgetChanged()
Emitted when something on the widget has changed.
QgsRasterRendererWidget::renderer
virtual QgsRasterRenderer * renderer()=0
QgsRasterLayer::rasterType
LayerType rasterType()
Returns the raster layer type (which is a read only property).
Definition: qgsrasterlayer.h:233
QgsRasterRenderer::setOpacity
void setOpacity(double opacity)
Sets the opacity for the renderer, where opacity is a value between 0 (totally transparent) and 1....
Definition: qgsrasterrenderer.h:81
QgsRasterRendererRegistry::renderersList
QStringList renderersList() const
Definition: qgsrasterrendererregistry.cpp:93
qgsmessagelog.h
QgsRasterRendererRegistryEntry::widgetCreateFunction
QgsRasterRendererWidgetCreateFunc widgetCreateFunction
Definition: qgsrasterrendererregistry.h:57