QGIS API Documentation  3.14.0-Pi (9f7028fd23)
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"
35 #include "qgsapplication.h"
36 
37 
38 #include "qgsmessagelog.h"
39 
40 static void _initRendererWidgetFunctions()
41 {
42  static bool sInitialized = false;
43  if ( sInitialized )
44  return;
45 
52 
53  sInitialized = true;
54 }
55 
56 
57 
59  : QgsMapLayerConfigWidget( layer, canvas, parent )
60 
61 {
62  mRasterLayer = qobject_cast<QgsRasterLayer *>( layer );
63 
64  if ( !mRasterLayer )
65  return;
66 
67  setupUi( this );
68  connect( mResetColorRenderingBtn, &QToolButton::clicked, this, &QgsRendererRasterPropertiesWidget::mResetColorRenderingBtn_clicked );
69 
70  _initRendererWidgetFunctions();
71 
72  mZoomedInResamplingComboBox->insertItem( 0, tr( "Nearest neighbour" ) );
73  mZoomedInResamplingComboBox->insertItem( 1, tr( "Bilinear" ) );
74  mZoomedInResamplingComboBox->insertItem( 2, tr( "Cubic" ) );
75  mZoomedOutResamplingComboBox->insertItem( 0, tr( "Nearest neighbour" ) );
76  mZoomedOutResamplingComboBox->insertItem( 1, tr( "Average" ) );
77 
78  connect( cboRenderers, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsRendererRasterPropertiesWidget::rendererChanged );
79 
80  connect( mSliderBrightness, &QAbstractSlider::valueChanged, mBrightnessSpinBox, &QSpinBox::setValue );
81  connect( mBrightnessSpinBox, static_cast < void ( QSpinBox::* )( int ) > ( &QSpinBox::valueChanged ), mSliderBrightness, &QAbstractSlider::setValue );
82 
83  connect( mSliderContrast, &QAbstractSlider::valueChanged, mContrastSpinBox, &QSpinBox::setValue );
84  connect( mContrastSpinBox, static_cast < void ( QSpinBox::* )( int ) > ( &QSpinBox::valueChanged ), mSliderContrast, &QAbstractSlider::setValue );
85 
86  // Connect saturation slider and spin box
87  connect( sliderSaturation, &QAbstractSlider::valueChanged, spinBoxSaturation, &QSpinBox::setValue );
88  connect( spinBoxSaturation, static_cast < void ( QSpinBox::* )( int ) > ( &QSpinBox::valueChanged ), sliderSaturation, &QAbstractSlider::setValue );
89 
90  // Connect colorize strength slider and spin box
91  connect( sliderColorizeStrength, &QAbstractSlider::valueChanged, spinColorizeStrength, &QSpinBox::setValue );
92  connect( spinColorizeStrength, static_cast < void ( QSpinBox::* )( int ) > ( &QSpinBox::valueChanged ), sliderColorizeStrength, &QAbstractSlider::setValue );
93 
94  // enable or disable saturation slider and spin box depending on grayscale combo choice
95  connect( comboGrayscale, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsRendererRasterPropertiesWidget::toggleSaturationControls );
96 
97  // enable or disable colorize colorbutton with colorize checkbox
98  connect( mColorizeCheck, &QAbstractButton::toggled, this, &QgsRendererRasterPropertiesWidget::toggleColorizeControls );
99 
100  // Just connect the spin boxes because the sliders update the spinners
101  connect( mBrightnessSpinBox, static_cast < void ( QSpinBox::* )( int ) > ( &QSpinBox::valueChanged ), this, &QgsPanelWidget::widgetChanged );
102  connect( mContrastSpinBox, static_cast < void ( QSpinBox::* )( int ) > ( &QSpinBox::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 
112  // finally sync to the layer - even though some actions may emit widgetChanged signal,
113  // this is not a problem - nobody is listening to our signals yet
114  syncToLayer( mRasterLayer );
115 
116  connect( mRasterLayer, &QgsMapLayer::styleChanged, this, &QgsRendererRasterPropertiesWidget::refreshAfterStyleChanged );
117 }
118 
120 {
121  mMapCanvas = canvas;
122 }
123 
125 {
126  QString rendererName = cboRenderers->currentData().toString();
127  setRendererWidget( rendererName );
128  emit widgetChanged();
129 }
130 
132 {
133  if ( QgsBrightnessContrastFilter *brightnessFilter = mRasterLayer->brightnessFilter() )
134  {
135  brightnessFilter->setBrightness( mSliderBrightness->value() );
136  brightnessFilter->setContrast( mSliderContrast->value() );
137  }
138 
139  if ( QgsRasterRendererWidget *rendererWidget = dynamic_cast<QgsRasterRendererWidget *>( stackedWidget->currentWidget() ) )
140  {
141  rendererWidget->doComputations();
142 
143  if ( QgsRasterRenderer *newRenderer = rendererWidget->renderer() )
144  {
145  // there are transparency related data stored in renderer instances, but they
146  // are not configured in the widget, so we need to copy them over from existing renderer
147  if ( QgsRasterRenderer *oldRenderer = mRasterLayer->renderer() )
148  newRenderer->copyCommonProperties( oldRenderer, false );
149  mRasterLayer->setRenderer( newRenderer );
150  }
151  }
152 
153  // Hue and saturation controls
154  if ( QgsHueSaturationFilter *hueSaturationFilter = mRasterLayer->hueSaturationFilter() )
155  {
156  hueSaturationFilter->setSaturation( sliderSaturation->value() );
157  hueSaturationFilter->setGrayscaleMode( ( QgsHueSaturationFilter::GrayscaleMode ) comboGrayscale->currentIndex() );
158  hueSaturationFilter->setColorizeOn( mColorizeCheck->checkState() );
159  hueSaturationFilter->setColorizeColor( btnColorizeColor->color() );
160  hueSaturationFilter->setColorizeStrength( sliderColorizeStrength->value() );
161  }
162 
163  if ( QgsRasterResampleFilter *resampleFilter = mRasterLayer->resampleFilter() )
164  {
165  QgsRasterResampler *zoomedInResampler = nullptr;
166  QString zoomedInResamplingMethod = mZoomedInResamplingComboBox->currentText();
167  if ( zoomedInResamplingMethod == tr( "Bilinear" ) )
168  {
169  zoomedInResampler = new QgsBilinearRasterResampler();
170  }
171  else if ( zoomedInResamplingMethod == tr( "Cubic" ) )
172  {
173  zoomedInResampler = new QgsCubicRasterResampler();
174  }
175 
176  resampleFilter->setZoomedInResampler( zoomedInResampler );
177 
178  //raster resampling
179  QgsRasterResampler *zoomedOutResampler = nullptr;
180  QString zoomedOutResamplingMethod = mZoomedOutResamplingComboBox->currentText();
181  if ( zoomedOutResamplingMethod == tr( "Average" ) )
182  {
183  zoomedOutResampler = new QgsBilinearRasterResampler();
184  }
185 
186  resampleFilter->setZoomedOutResampler( zoomedOutResampler );
187 
188  resampleFilter->setMaxOversampling( mMaximumOversamplingSpinBox->value() );
189  }
190 
191  mRasterLayer->setBlendMode( mBlendModeComboBox->blendMode() );
192 }
193 
195 {
196  mRasterLayer = layer;
197 
198  cboRenderers->blockSignals( true );
199  cboRenderers->clear();
201  const auto constRenderersList = QgsApplication::rasterRendererRegistry()->renderersList();
202  for ( const QString &name : constRenderersList )
203  {
204  if ( QgsApplication::rasterRendererRegistry()->rendererData( name, entry ) )
205  {
206  if ( ( mRasterLayer->rasterType() != QgsRasterLayer::ColorLayer && entry.name != QLatin1String( "singlebandcolordata" ) ) ||
207  ( mRasterLayer->rasterType() == QgsRasterLayer::ColorLayer && entry.name == QLatin1String( "singlebandcolordata" ) ) )
208  {
209  cboRenderers->addItem( entry.icon(), entry.visibleName, entry.name );
210  }
211  }
212  }
213  cboRenderers->setCurrentIndex( -1 );
214  cboRenderers->blockSignals( false );
215 
216  if ( QgsRasterRenderer *renderer = mRasterLayer->renderer() )
217  {
218  setRendererWidget( renderer->type() );
219  }
220 
221  if ( QgsBrightnessContrastFilter *brightnessFilter = mRasterLayer->brightnessFilter() )
222  {
223  mSliderBrightness->setValue( brightnessFilter->brightness() );
224  mSliderContrast->setValue( brightnessFilter->contrast() );
225  }
226 
227  btnColorizeColor->setColorDialogTitle( tr( "Select Color" ) );
228  btnColorizeColor->setContext( QStringLiteral( "symbology" ) );
229 
230  // Hue and saturation color control
231  //set hue and saturation controls to current values
232  if ( const QgsHueSaturationFilter *hueSaturationFilter = mRasterLayer->hueSaturationFilter() )
233  {
234  sliderSaturation->setValue( hueSaturationFilter->saturation() );
235  comboGrayscale->setCurrentIndex( ( int ) hueSaturationFilter->grayscaleMode() );
236 
237  // Set initial state of saturation controls based on grayscale mode choice
238  toggleSaturationControls( static_cast<int>( hueSaturationFilter->grayscaleMode() ) );
239 
240  // Set initial state of colorize controls
241  mColorizeCheck->setChecked( hueSaturationFilter->colorizeOn() );
242  btnColorizeColor->setColor( hueSaturationFilter->colorizeColor() );
243  toggleColorizeControls( hueSaturationFilter->colorizeOn() );
244  sliderColorizeStrength->setValue( hueSaturationFilter->colorizeStrength() );
245  }
246 
247  //blend mode
248  mBlendModeComboBox->setBlendMode( mRasterLayer->blendMode() );
249 
250  //set combo boxes to current resampling types
251  if ( const QgsRasterResampleFilter *resampleFilter = mRasterLayer->resampleFilter() )
252  {
253  const QgsRasterResampler *zoomedInResampler = resampleFilter->zoomedInResampler();
254  if ( zoomedInResampler )
255  {
256  if ( zoomedInResampler->type() == QLatin1String( "bilinear" ) )
257  {
258  mZoomedInResamplingComboBox->setCurrentIndex( 1 );
259  }
260  else if ( zoomedInResampler->type() == QLatin1String( "cubic" ) )
261  {
262  mZoomedInResamplingComboBox->setCurrentIndex( 2 );
263  }
264  }
265  else
266  {
267  mZoomedInResamplingComboBox->setCurrentIndex( 0 );
268  }
269 
270  const QgsRasterResampler *zoomedOutResampler = resampleFilter->zoomedOutResampler();
271  if ( zoomedOutResampler )
272  {
273  if ( zoomedOutResampler->type() == QLatin1String( "bilinear" ) ) //bilinear resampler does averaging when zooming out
274  {
275  mZoomedOutResamplingComboBox->setCurrentIndex( 1 );
276  }
277  }
278  else
279  {
280  mZoomedOutResamplingComboBox->setCurrentIndex( 0 );
281  }
282  mMaximumOversamplingSpinBox->setValue( resampleFilter->maxOversampling() );
283  }
284 }
285 
286 void QgsRendererRasterPropertiesWidget::mResetColorRenderingBtn_clicked()
287 {
288  mBlendModeComboBox->setBlendMode( QPainter::CompositionMode_SourceOver );
289  mSliderBrightness->setValue( 0 );
290  mSliderContrast->setValue( 0 );
291  sliderSaturation->setValue( 0 );
292  comboGrayscale->setCurrentIndex( ( int ) QgsHueSaturationFilter::GrayscaleOff );
293  mColorizeCheck->setChecked( false );
294  sliderColorizeStrength->setValue( 100 );
295 }
296 
297 void QgsRendererRasterPropertiesWidget::toggleSaturationControls( int grayscaleMode )
298 {
299  // Enable or disable saturation controls based on choice of grayscale mode
300  if ( grayscaleMode == 0 )
301  {
302  sliderSaturation->setEnabled( true );
303  spinBoxSaturation->setEnabled( true );
304  }
305  else
306  {
307  sliderSaturation->setEnabled( false );
308  spinBoxSaturation->setEnabled( false );
309  }
310  emit widgetChanged();
311 }
312 
313 void QgsRendererRasterPropertiesWidget::toggleColorizeControls( bool colorizeEnabled )
314 {
315  // Enable or disable colorize controls based on checkbox
316  btnColorizeColor->setEnabled( colorizeEnabled );
317  sliderColorizeStrength->setEnabled( colorizeEnabled );
318  spinColorizeStrength->setEnabled( colorizeEnabled );
319  emit widgetChanged();
320 }
321 
322 void QgsRendererRasterPropertiesWidget::setRendererWidget( const QString &rendererName )
323 {
324  QgsDebugMsgLevel( "rendererName = " + rendererName, 3 );
325  QgsRasterRendererWidget *oldWidget = mRendererWidget;
326 
327  int alphaBand = -1;
328  double opacity = 1;
329  QColor nodataColor;
330  if ( QgsRasterRenderer *oldRenderer = mRasterLayer->renderer() )
331  {
332  // Retain alpha band and opacity when switching renderer
333  alphaBand = oldRenderer->alphaBand();
334  opacity = oldRenderer->opacity();
335  nodataColor = oldRenderer->nodataColor();
336  }
337 
338  QgsRasterRendererRegistryEntry rendererEntry;
339  if ( QgsApplication::rasterRendererRegistry()->rendererData( rendererName, rendererEntry ) )
340  {
341  if ( rendererEntry.widgetCreateFunction ) // Single band color data renderer e.g. has no widget
342  {
343  QgsDebugMsgLevel( QStringLiteral( "renderer has widgetCreateFunction" ), 3 );
344  // Current canvas extent (used to calc min/max) in layer CRS
346  if ( oldWidget )
347  {
348  if ( rendererName == QLatin1String( "singlebandgray" ) )
349  {
350  whileBlocking( mRasterLayer )->setRenderer( QgsApplication::rasterRendererRegistry()->defaultRendererForDrawingStyle( QgsRaster::SingleBandGray, mRasterLayer->dataProvider() ) );
351  whileBlocking( mRasterLayer )->setDefaultContrastEnhancement();
352  }
353  else if ( rendererName == QLatin1String( "multibandcolor" ) )
354  {
355  whileBlocking( mRasterLayer )->setRenderer( QgsApplication::rasterRendererRegistry()->defaultRendererForDrawingStyle( QgsRaster::MultiBandColor, mRasterLayer->dataProvider() ) );
356  whileBlocking( mRasterLayer )->setDefaultContrastEnhancement();
357  }
358  }
359  mRasterLayer->renderer()->setAlphaBand( alphaBand );
360  mRasterLayer->renderer()->setOpacity( opacity );
361  mRasterLayer->renderer()->setNodataColor( nodataColor );
362  mRendererWidget = rendererEntry.widgetCreateFunction( mRasterLayer, myExtent );
363  mRendererWidget->setMapCanvas( mMapCanvas );
364  connect( mRendererWidget, &QgsRasterRendererWidget::widgetChanged, this, &QgsPanelWidget::widgetChanged );
365  stackedWidget->addWidget( mRendererWidget );
366  stackedWidget->setCurrentWidget( mRendererWidget );
367  if ( oldWidget )
368  {
369  // Compare used bands in new and old renderer and reset transparency dialog if different
370  QgsRasterRenderer *oldRenderer = oldWidget->renderer();
371  QgsRasterRenderer *newRenderer = mRendererWidget->renderer();
372 #if 0
373  QList<int> oldBands = oldRenderer->usesBands();
374  QList<int> newBands = newRenderer->usesBands();
375 
376  if ( oldBands != newBands )
377  {
378  populateTransparencyTable( newRenderer );
379  }
380 #endif
381 
382  delete oldRenderer;
383  delete newRenderer;
384  }
385  }
386  }
387 
388  if ( mRendererWidget != oldWidget )
389  delete oldWidget;
390 
391  int widgetIndex = cboRenderers->findData( rendererName );
392  if ( widgetIndex != -1 )
393  {
394  whileBlocking( cboRenderers )->setCurrentIndex( widgetIndex );
395  }
396 
397 }
398 
399 void QgsRendererRasterPropertiesWidget::refreshAfterStyleChanged()
400 {
401  if ( mRendererWidget )
402  {
403  QgsRasterRenderer *renderer = mRasterLayer->renderer();
404  if ( QgsMultiBandColorRenderer *mbcr = dynamic_cast<QgsMultiBandColorRenderer *>( renderer ) )
405  {
406  const QgsContrastEnhancement *redCe = mbcr->redContrastEnhancement();
407  if ( redCe )
408  {
409  mRendererWidget->setMin( QString::number( redCe->minimumValue() ), 0 );
410  mRendererWidget->setMax( QString::number( redCe->maximumValue() ), 0 );
411  }
412  const QgsContrastEnhancement *greenCe = mbcr->greenContrastEnhancement();
413  if ( greenCe )
414  {
415  mRendererWidget->setMin( QString::number( greenCe->minimumValue() ), 1 );
416  mRendererWidget->setMax( QString::number( greenCe->maximumValue() ), 1 );
417  }
418  const QgsContrastEnhancement *blueCe = mbcr->blueContrastEnhancement();
419  if ( blueCe )
420  {
421  mRendererWidget->setMin( QString::number( blueCe->minimumValue() ), 2 );
422  mRendererWidget->setMax( QString::number( blueCe->maximumValue() ), 2 );
423  }
424  }
425  else if ( QgsSingleBandGrayRenderer *sbgr = dynamic_cast<QgsSingleBandGrayRenderer *>( renderer ) )
426  {
427  const QgsContrastEnhancement *ce = sbgr->contrastEnhancement();
428  if ( ce )
429  {
430  mRendererWidget->setMin( QString::number( ce->minimumValue() ) );
431  mRendererWidget->setMax( QString::number( ce->maximumValue() ) );
432  }
433  }
434  }
435 }
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:2104
QgsRasterContourRendererWidget::create
static QgsRasterRendererWidget * create(QgsRasterLayer *layer, const QgsRectangle &extent)
Widget creation function (mainly for the use by the renderer registry)
Definition: qgsrastercontourrendererwidget.h:50
qgspalettedrendererwidget.h
QgsMapCanvas::extent
QgsRectangle extent() const
Returns the current zoom extent of the map canvas.
Definition: qgsmapcanvas.cpp:1049
qgsrasterlayer.h
qgsbilinearrasterresampler.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:390
QgsMapSettings::outputExtentToLayerExtent
QgsRectangle outputExtentToLayerExtent(const QgsMapLayer *layer, QgsRectangle extent) const
transform bounding box from output CRS to layer's CRS
Definition: qgsmapsettings.cpp:457
QgsRaster::SingleBandGray
@ SingleBandGray
Definition: qgsraster.h:105
QgsRasterLayer::ColorLayer
@ ColorLayer
Definition: qgsrasterlayer.h:186
QgsRasterRendererRegistryEntry::name
QString name
Definition: qgsrasterrendererregistry.h:53
QgsRasterRendererRegistryEntry
Definition: qgsrasterrendererregistry.h:44
QgsHueSaturationFilter::GrayscaleMode
GrayscaleMode
Definition: qgshuesaturationfilter.h:36
QgsRasterResampler
Definition: qgsrasterresampler.h:33
QgsMapCanvas
Definition: qgsmapcanvas.h:83
QgsRendererRasterPropertiesWidget::QgsRendererRasterPropertiesWidget
QgsRendererRasterPropertiesWidget(QgsMapLayer *layer, QgsMapCanvas *canvas, QWidget *parent=nullptr)
A widget to hold the renderer properties for a raster layer.
Definition: qgsrendererrasterpropertieswidget.cpp:58
qgis.h
QgsSingleBandGrayRenderer
Definition: qgssinglebandgrayrenderer.h:33
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:131
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:132
qgsrasterrendererwidget.h
QgsRectangle
Definition: qgsrectangle.h:41
qgscubicrasterresampler.h
QgsRasterLayer::setRenderer
void setRenderer(QgsRasterRenderer *renderer)
Sets the raster's renderer.
Definition: qgsrasterlayer.cpp:1616
QgsRendererRasterPropertiesWidget::rendererChanged
void rendererChanged()
called when user changes renderer type
Definition: qgsrendererrasterpropertieswidget.cpp:124
qgsmultibandcolorrendererwidget.h
QgsBilinearRasterResampler
Definition: qgsbilinearrasterresampler.h:33
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:33
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
Definition: qgsrasterrenderer.h:38
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.
QgsCubicRasterResampler
Definition: qgscubicrasterresampler.h:32
qgsrendererrasterpropertieswidget.h
QgsRasterRendererRegistryEntry::visibleName
QString visibleName
Definition: qgsrasterrendererregistry.h:54
QgsHueSaturationFilter
Definition: qgshuesaturationfilter.h:31
QgsMultiBandColorRenderer
Definition: qgsmultibandcolorrenderer.h:32
QgsRasterLayer
Definition: qgsrasterlayer.h:72
qgsrastercontourrendererwidget.h
qgsrasterresamplefilter.h
qgsbrightnesscontrastfilter.h
QgsContrastEnhancement
Definition: qgscontrastenhancement.h:42
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:62
QgsRasterLayer::resampleFilter
QgsRasterResampleFilter * resampleFilter() const
Returns the raster's resample filter.
Definition: qgsrasterlayer.h:255
qgshuesaturationfilter.h
QgsRasterResampler::type
virtual QString type() const =0
Gets a descriptive type identifier for this raster resampler.
qgssinglebandgrayrendererwidget.h
QgsMapLayerConfigWidget::mMapCanvas
QgsMapCanvas * mMapCanvas
Definition: qgsmaplayerconfigwidget.h:72
QgsBrightnessContrastFilter
Definition: qgsbrightnesscontrastfilter.h:31
qgshillshaderendererwidget.h
QgsMapLayer
Definition: qgsmaplayer.h:81
QgsHueSaturationFilter::GrayscaleOff
@ GrayscaleOff
Definition: qgshuesaturationfilter.h:38
QgsRasterResampleFilter
Definition: qgsrasterresamplefilter.h:32
qgsmultibandcolorrenderer.h
QgsRasterLayer::hueSaturationFilter
QgsHueSaturationFilter * hueSaturationFilter() const
Returns the raster's hue/saturation filter.
Definition: qgsrasterlayer.h:271
QgsRasterLayer::brightnessFilter
QgsBrightnessContrastFilter * brightnessFilter() const
Returns the raster's brightness/contrast filter.
Definition: qgsrasterlayer.h:263
QgsRaster::MultiBandColor
@ MultiBandColor
Definition: qgsraster.h:113
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:194
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:247
QgsRendererRasterPropertiesWidget::setMapCanvas
void setMapCanvas(QgsMapCanvas *canvas)
Sets the map canvas associated with the dialog.
Definition: qgsrendererrasterpropertieswidget.cpp:119
QgsRasterRendererWidget
Definition: qgsrasterrendererwidget.h:36
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:234
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
QgsRasterLayer::dataProvider
QgsRasterDataProvider * dataProvider() override
Returns the source data provider.
Definition: qgsrasterlayer.cpp:233
qgsmessagelog.h
QgsRasterRendererRegistryEntry::widgetCreateFunction
QgsRasterRendererWidgetCreateFunc widgetCreateFunction
Definition: qgsrasterrendererregistry.h:57