QGIS API Documentation  3.6.0-Noosa (5873452)
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"
21 #include "qgsrasterlayer.h"
34 #include "qgsapplication.h"
35 
36 
37 #include "qgsmessagelog.h"
38 
39 static void _initRendererWidgetFunctions()
40 {
41  static bool sInitialized = false;
42  if ( sInitialized )
43  return;
44 
50 
51  sInitialized = true;
52 }
53 
54 
55 
57  : QgsMapLayerConfigWidget( layer, canvas, parent )
58 
59 {
60  mRasterLayer = qobject_cast<QgsRasterLayer *>( layer );
61 
62  if ( !( mRasterLayer && mRasterLayer->isValid() ) )
63  return;
64 
65  setupUi( this );
66  connect( mResetColorRenderingBtn, &QToolButton::clicked, this, &QgsRendererRasterPropertiesWidget::mResetColorRenderingBtn_clicked );
67 
68  _initRendererWidgetFunctions();
69 
70  mZoomedInResamplingComboBox->insertItem( 0, tr( "Nearest neighbour" ) );
71  mZoomedInResamplingComboBox->insertItem( 1, tr( "Bilinear" ) );
72  mZoomedInResamplingComboBox->insertItem( 2, tr( "Cubic" ) );
73  mZoomedOutResamplingComboBox->insertItem( 0, tr( "Nearest neighbour" ) );
74  mZoomedOutResamplingComboBox->insertItem( 1, tr( "Average" ) );
75 
76  connect( cboRenderers, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsRendererRasterPropertiesWidget::rendererChanged );
77 
78  connect( mSliderBrightness, &QAbstractSlider::valueChanged, mBrightnessSpinBox, &QSpinBox::setValue );
79  connect( mBrightnessSpinBox, static_cast < void ( QSpinBox::* )( int ) > ( &QSpinBox::valueChanged ), mSliderBrightness, &QAbstractSlider::setValue );
80 
81  connect( mSliderContrast, &QAbstractSlider::valueChanged, mContrastSpinBox, &QSpinBox::setValue );
82  connect( mContrastSpinBox, static_cast < void ( QSpinBox::* )( int ) > ( &QSpinBox::valueChanged ), mSliderContrast, &QAbstractSlider::setValue );
83 
84  // Connect saturation slider and spin box
85  connect( sliderSaturation, &QAbstractSlider::valueChanged, spinBoxSaturation, &QSpinBox::setValue );
86  connect( spinBoxSaturation, static_cast < void ( QSpinBox::* )( int ) > ( &QSpinBox::valueChanged ), sliderSaturation, &QAbstractSlider::setValue );
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 
92  // enable or disable saturation slider and spin box depending on grayscale combo choice
93  connect( comboGrayscale, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsRendererRasterPropertiesWidget::toggleSaturationControls );
94 
95  // enable or disable colorize colorbutton with colorize checkbox
96  connect( mColorizeCheck, &QAbstractButton::toggled, this, &QgsRendererRasterPropertiesWidget::toggleColorizeControls );
97 
98  // Just connect the spin boxes because the sliders update the spinners
99  connect( mBrightnessSpinBox, static_cast < void ( QSpinBox::* )( int ) > ( &QSpinBox::valueChanged ), this, &QgsPanelWidget::widgetChanged );
100  connect( mContrastSpinBox, static_cast < void ( QSpinBox::* )( int ) > ( &QSpinBox::valueChanged ), this, &QgsPanelWidget::widgetChanged );
101  connect( spinBoxSaturation, static_cast < void ( QSpinBox::* )( int ) > ( &QSpinBox::valueChanged ), this, &QgsPanelWidget::widgetChanged );
102  connect( spinColorizeStrength, static_cast < void ( QSpinBox::* )( int ) > ( &QSpinBox::valueChanged ), this, &QgsPanelWidget::widgetChanged );
103  connect( btnColorizeColor, &QgsColorButton::colorChanged, this, &QgsPanelWidget::widgetChanged );
104 
105  connect( mBlendModeComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsPanelWidget::widgetChanged );
106  connect( mZoomedInResamplingComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsPanelWidget::widgetChanged );
107  connect( mZoomedOutResamplingComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsPanelWidget::widgetChanged );
108  connect( mMaximumOversamplingSpinBox, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsPanelWidget::widgetChanged );
109 
110  // finally sync to the layer - even though some actions may emit widgetChanged signal,
111  // this is not a problem - nobody is listening to our signals yet
112  syncToLayer( mRasterLayer );
113 
114  connect( mRasterLayer, &QgsMapLayer::styleChanged, this, &QgsRendererRasterPropertiesWidget::refreshAfterStyleChanged );
115 }
116 
118 {
119  mMapCanvas = canvas;
120 }
121 
123 {
124  QString rendererName = cboRenderers->currentData().toString();
125  setRendererWidget( rendererName );
126  emit widgetChanged();
127 }
128 
130 {
131 
132  if ( ! mRasterLayer->isValid() )
133  return;
134 
135  mRasterLayer->brightnessFilter()->setBrightness( mSliderBrightness->value() );
136  mRasterLayer->brightnessFilter()->setContrast( mSliderContrast->value() );
137 
138  QgsRasterRendererWidget *rendererWidget = dynamic_cast<QgsRasterRendererWidget *>( stackedWidget->currentWidget() );
139  if ( rendererWidget )
140  {
141  rendererWidget->doComputations();
142 
143  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  QgsRasterRenderer *oldRenderer = mRasterLayer->renderer();
148  if ( oldRenderer )
149  newRenderer->copyCommonProperties( oldRenderer, false );
150  mRasterLayer->setRenderer( newRenderer );
151  }
152 
153  // Hue and saturation controls
154  QgsHueSaturationFilter *hueSaturationFilter = mRasterLayer->hueSaturationFilter();
155  if ( hueSaturationFilter )
156  {
157  hueSaturationFilter->setSaturation( sliderSaturation->value() );
158  hueSaturationFilter->setGrayscaleMode( ( QgsHueSaturationFilter::GrayscaleMode ) comboGrayscale->currentIndex() );
159  hueSaturationFilter->setColorizeOn( mColorizeCheck->checkState() );
160  hueSaturationFilter->setColorizeColor( btnColorizeColor->color() );
161  hueSaturationFilter->setColorizeStrength( sliderColorizeStrength->value() );
162  }
163 
164  QgsRasterResampleFilter *resampleFilter = mRasterLayer->resampleFilter();
165  if ( resampleFilter )
166  {
167  QgsRasterResampler *zoomedInResampler = nullptr;
168  QString zoomedInResamplingMethod = mZoomedInResamplingComboBox->currentText();
169  if ( zoomedInResamplingMethod == tr( "Bilinear" ) )
170  {
171  zoomedInResampler = new QgsBilinearRasterResampler();
172  }
173  else if ( zoomedInResamplingMethod == tr( "Cubic" ) )
174  {
175  zoomedInResampler = new QgsCubicRasterResampler();
176  }
177 
178  resampleFilter->setZoomedInResampler( zoomedInResampler );
179 
180  //raster resampling
181  QgsRasterResampler *zoomedOutResampler = nullptr;
182  QString zoomedOutResamplingMethod = mZoomedOutResamplingComboBox->currentText();
183  if ( zoomedOutResamplingMethod == tr( "Average" ) )
184  {
185  zoomedOutResampler = new QgsBilinearRasterResampler();
186  }
187 
188  resampleFilter->setZoomedOutResampler( zoomedOutResampler );
189 
190  resampleFilter->setMaxOversampling( mMaximumOversamplingSpinBox->value() );
191  }
192 
193  mRasterLayer->setBlendMode( mBlendModeComboBox->blendMode() );
194 }
195 
197 {
198  mRasterLayer = layer;
199 
200  cboRenderers->blockSignals( true );
201  cboRenderers->clear();
203  Q_FOREACH ( const QString &name, QgsApplication::rasterRendererRegistry()->renderersList() )
204  {
205  if ( QgsApplication::rasterRendererRegistry()->rendererData( name, entry ) )
206  {
207  if ( ( mRasterLayer->rasterType() != QgsRasterLayer::ColorLayer && entry.name != QLatin1String( "singlebandcolordata" ) ) ||
208  ( mRasterLayer->rasterType() == QgsRasterLayer::ColorLayer && entry.name == QLatin1String( "singlebandcolordata" ) ) )
209  {
210  cboRenderers->addItem( entry.icon(), entry.visibleName, entry.name );
211  }
212  }
213  }
214  cboRenderers->setCurrentIndex( -1 );
215  cboRenderers->blockSignals( false );
216 
217  QgsRasterRenderer *renderer = mRasterLayer->renderer();
218  if ( renderer )
219  {
220  setRendererWidget( renderer->type() );
221  }
222 
223  QgsBrightnessContrastFilter *brightnessFilter = mRasterLayer->brightnessFilter();
224  if ( brightnessFilter )
225  {
226  mSliderBrightness->setValue( brightnessFilter->brightness() );
227  mSliderContrast->setValue( brightnessFilter->contrast() );
228  }
229 
230  btnColorizeColor->setColorDialogTitle( tr( "Select Color" ) );
231  btnColorizeColor->setContext( QStringLiteral( "symbology" ) );
232 
233  // Hue and saturation color control
234  const QgsHueSaturationFilter *hueSaturationFilter = mRasterLayer->hueSaturationFilter();
235  //set hue and saturation controls to current values
236  if ( hueSaturationFilter )
237  {
238  sliderSaturation->setValue( hueSaturationFilter->saturation() );
239  comboGrayscale->setCurrentIndex( ( int ) hueSaturationFilter->grayscaleMode() );
240 
241  // Set initial state of saturation controls based on grayscale mode choice
242  toggleSaturationControls( static_cast<int>( hueSaturationFilter->grayscaleMode() ) );
243 
244  // Set initial state of colorize controls
245  mColorizeCheck->setChecked( hueSaturationFilter->colorizeOn() );
246  btnColorizeColor->setColor( hueSaturationFilter->colorizeColor() );
247  toggleColorizeControls( hueSaturationFilter->colorizeOn() );
248  sliderColorizeStrength->setValue( hueSaturationFilter->colorizeStrength() );
249  }
250 
251  //blend mode
252  mBlendModeComboBox->setBlendMode( mRasterLayer->blendMode() );
253 
254  const QgsRasterResampleFilter *resampleFilter = mRasterLayer->resampleFilter();
255  //set combo boxes to current resampling types
256  if ( resampleFilter )
257  {
258  const QgsRasterResampler *zoomedInResampler = resampleFilter->zoomedInResampler();
259  if ( zoomedInResampler )
260  {
261  if ( zoomedInResampler->type() == QLatin1String( "bilinear" ) )
262  {
263  mZoomedInResamplingComboBox->setCurrentIndex( 1 );
264  }
265  else if ( zoomedInResampler->type() == QLatin1String( "cubic" ) )
266  {
267  mZoomedInResamplingComboBox->setCurrentIndex( 2 );
268  }
269  }
270  else
271  {
272  mZoomedInResamplingComboBox->setCurrentIndex( 0 );
273  }
274 
275  const QgsRasterResampler *zoomedOutResampler = resampleFilter->zoomedOutResampler();
276  if ( zoomedOutResampler )
277  {
278  if ( zoomedOutResampler->type() == QLatin1String( "bilinear" ) ) //bilinear resampler does averaging when zooming out
279  {
280  mZoomedOutResamplingComboBox->setCurrentIndex( 1 );
281  }
282  }
283  else
284  {
285  mZoomedOutResamplingComboBox->setCurrentIndex( 0 );
286  }
287  mMaximumOversamplingSpinBox->setValue( resampleFilter->maxOversampling() );
288  }
289 }
290 
291 void QgsRendererRasterPropertiesWidget::mResetColorRenderingBtn_clicked()
292 {
293  mBlendModeComboBox->setBlendMode( QPainter::CompositionMode_SourceOver );
294  mSliderBrightness->setValue( 0 );
295  mSliderContrast->setValue( 0 );
296  sliderSaturation->setValue( 0 );
297  comboGrayscale->setCurrentIndex( ( int ) QgsHueSaturationFilter::GrayscaleOff );
298  mColorizeCheck->setChecked( false );
299  sliderColorizeStrength->setValue( 100 );
300 }
301 
302 void QgsRendererRasterPropertiesWidget::toggleSaturationControls( int grayscaleMode )
303 {
304  // Enable or disable saturation controls based on choice of grayscale mode
305  if ( grayscaleMode == 0 )
306  {
307  sliderSaturation->setEnabled( true );
308  spinBoxSaturation->setEnabled( true );
309  }
310  else
311  {
312  sliderSaturation->setEnabled( false );
313  spinBoxSaturation->setEnabled( false );
314  }
315  emit widgetChanged();
316 }
317 
318 void QgsRendererRasterPropertiesWidget::toggleColorizeControls( bool colorizeEnabled )
319 {
320  // Enable or disable colorize controls based on checkbox
321  btnColorizeColor->setEnabled( colorizeEnabled );
322  sliderColorizeStrength->setEnabled( colorizeEnabled );
323  spinColorizeStrength->setEnabled( colorizeEnabled );
324  emit widgetChanged();
325 }
326 
327 void QgsRendererRasterPropertiesWidget::setRendererWidget( const QString &rendererName )
328 {
329  QgsDebugMsg( "rendererName = " + rendererName );
330  QgsRasterRendererWidget *oldWidget = mRendererWidget;
331  QgsRasterRenderer *oldRenderer = mRasterLayer->renderer();
332 
333  int alphaBand = -1;
334  double opacity = 1;
335  if ( oldRenderer )
336  {
337  // Retain alpha band and opacity when switching renderer
338  alphaBand = oldRenderer->alphaBand();
339  opacity = oldRenderer->opacity();
340  }
341 
342  QgsRasterRendererRegistryEntry rendererEntry;
343  if ( QgsApplication::rasterRendererRegistry()->rendererData( rendererName, rendererEntry ) )
344  {
345  if ( rendererEntry.widgetCreateFunction ) // Single band color data renderer e.g. has no widget
346  {
347  QgsDebugMsg( QStringLiteral( "renderer has widgetCreateFunction" ) );
348  // Current canvas extent (used to calc min/max) in layer CRS
350  if ( oldWidget )
351  {
352  if ( rendererName == QLatin1String( "singlebandgray" ) )
353  {
354  whileBlocking( mRasterLayer )->setRenderer( QgsApplication::rasterRendererRegistry()->defaultRendererForDrawingStyle( QgsRaster::SingleBandGray, mRasterLayer->dataProvider() ) );
355  whileBlocking( mRasterLayer )->setDefaultContrastEnhancement();
356  }
357  else if ( rendererName == QLatin1String( "multibandcolor" ) )
358  {
359  whileBlocking( mRasterLayer )->setRenderer( QgsApplication::rasterRendererRegistry()->defaultRendererForDrawingStyle( QgsRaster::MultiBandColor, mRasterLayer->dataProvider() ) );
360  whileBlocking( mRasterLayer )->setDefaultContrastEnhancement();
361  }
362  }
363  mRasterLayer->renderer()->setAlphaBand( alphaBand );
364  mRasterLayer->renderer()->setOpacity( opacity );
365  mRendererWidget = rendererEntry.widgetCreateFunction( mRasterLayer, myExtent );
366  mRendererWidget->setMapCanvas( mMapCanvas );
367  connect( mRendererWidget, &QgsRasterRendererWidget::widgetChanged, this, &QgsPanelWidget::widgetChanged );
368  stackedWidget->addWidget( mRendererWidget );
369  stackedWidget->setCurrentWidget( mRendererWidget );
370  if ( oldWidget )
371  {
372  // Compare used bands in new and old renderer and reset transparency dialog if different
373  QgsRasterRenderer *oldRenderer = oldWidget->renderer();
374  QgsRasterRenderer *newRenderer = mRendererWidget->renderer();
375 #if 0
376  QList<int> oldBands = oldRenderer->usesBands();
377  QList<int> newBands = newRenderer->usesBands();
378 
379  if ( oldBands != newBands )
380  {
381  populateTransparencyTable( newRenderer );
382  }
383 #endif
384 
385  delete oldRenderer;
386  delete newRenderer;
387  }
388  }
389  }
390 
391  if ( mRendererWidget != oldWidget )
392  delete oldWidget;
393 
394  int widgetIndex = cboRenderers->findData( rendererName );
395  if ( widgetIndex != -1 )
396  {
397  whileBlocking( cboRenderers )->setCurrentIndex( widgetIndex );
398  }
399 
400 }
401 
402 void QgsRendererRasterPropertiesWidget::refreshAfterStyleChanged()
403 {
404  if ( mRendererWidget )
405  {
406  QgsRasterRenderer *renderer = mRasterLayer->renderer();
407  if ( QgsMultiBandColorRenderer *mbcr = dynamic_cast<QgsMultiBandColorRenderer *>( renderer ) )
408  {
409  const QgsContrastEnhancement *redCe = mbcr->redContrastEnhancement();
410  if ( redCe )
411  {
412  mRendererWidget->setMin( QString::number( redCe->minimumValue() ), 0 );
413  mRendererWidget->setMax( QString::number( redCe->maximumValue() ), 0 );
414  }
415  const QgsContrastEnhancement *greenCe = mbcr->greenContrastEnhancement();
416  if ( greenCe )
417  {
418  mRendererWidget->setMin( QString::number( greenCe->minimumValue() ), 1 );
419  mRendererWidget->setMax( QString::number( greenCe->maximumValue() ), 1 );
420  }
421  const QgsContrastEnhancement *blueCe = mbcr->blueContrastEnhancement();
422  if ( blueCe )
423  {
424  mRendererWidget->setMin( QString::number( blueCe->minimumValue() ), 2 );
425  mRendererWidget->setMax( QString::number( blueCe->maximumValue() ), 2 );
426  }
427  }
428  else if ( QgsSingleBandGrayRenderer *sbgr = dynamic_cast<QgsSingleBandGrayRenderer *>( renderer ) )
429  {
430  const QgsContrastEnhancement *ce = sbgr->contrastEnhancement();
431  if ( ce )
432  {
433  mRendererWidget->setMin( QString::number( ce->minimumValue() ) );
434  mRendererWidget->setMax( QString::number( ce->maximumValue() ) );
435  }
436  }
437  }
438 }
A panel widget that can be shown in the map style dock.
double maximumValue() const
Returns the maximum value for the contrast enhancement range.
A rectangle specified with double values.
Definition: qgsrectangle.h:41
Base class for all map layer types.
Definition: qgsmaplayer.h:64
Cubic Raster Resampler.
Interface for resampling rasters (e.g.
QgsHueSaturationFilter * hueSaturationFilter() const
virtual QList< int > usesBands() const
Returns a list of band numbers used by the renderer.
double opacity() const
Returns the opacity for the renderer, where opacity is a value between 0 (totally transparent) and 1...
QgsRasterRendererWidgetCreateFunc widgetCreateFunction
void setColorizeColor(const QColor &colorizeColor)
void setRenderer(QgsRasterRenderer *renderer)
Sets raster renderer. Takes ownership of the renderer object.
#define QgsDebugMsg(str)
Definition: qgslogger.h:38
This class provides qgis with the ability to render raster datasets onto the mapcanvas.
QgsRectangle outputExtentToLayerExtent(const QgsMapLayer *layer, QgsRectangle extent) const
transform bounding box from output CRS to layer&#39;s CRS
virtual QString type() const
double minimumValue() const
Returns the minimum value for the contrast enhancement range.
Resample filter pipe for rasters.
void syncToLayer(QgsRasterLayer *layer)
Sync the widget to the given layer.
QgsRasterRenderer * renderer() const
bool isValid() const
Returns the status of the layer.
void setBlendMode(QPainter::CompositionMode blendMode)
Set the blending mode used for rendering a layer.
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:73
void styleChanged()
Signal emitted whenever a change affects the layer&#39;s style.
virtual void setMapCanvas(QgsMapCanvas *canvas)
Sets the map canvas associated with the widget.
QgsBrightnessContrastFilter * brightnessFilter() const
static QgsRasterRendererWidget * create(QgsRasterLayer *layer, const QgsRectangle &extent)
virtual void setMax(const QString &value, int index=0)
QgsRasterDataProvider * dataProvider() override
Returns the layer&#39;s data provider, it may be null.
static QgsRasterRendererWidget * create(QgsRasterLayer *layer, const QgsRectangle &extent)
Creates new raster renderer widget.
QgsRendererRasterPropertiesWidget(QgsMapLayer *layer, QgsMapCanvas *canvas, QWidget *parent=nullptr)
A widget to hold the renderer properties for a raster layer.
virtual QString type() const =0
Gets a descriptive type identifier for this raster resampler.
void copyCommonProperties(const QgsRasterRenderer *other, bool copyMinMaxOrigin=true)
Copies common properties like opacity / transparency data from other renderer.
QgsRectangle extent() const
Returns the current zoom extent of the map canvas.
Raster renderer pipe for single band gray.
LayerType rasterType()
Returns the raster layer type (which is a read only property).
void setAlphaBand(int band)
void setColorizeOn(bool colorizeOn)
static QgsRasterRendererWidget * create(QgsRasterLayer *layer, const QgsRectangle &extent)
void widgetChanged()
Emitted when the widget state changes.
void apply() override
Apply the changes from the dialog to the layer.
const QgsMapSettings & mapSettings() const
Gets access to properties used for map rendering.
Registry for raster renderer entries.
void setMapCanvas(QgsMapCanvas *canvas)
Sets the map canvas associated with the dialog.
void colorChanged(const QColor &color)
Is emitted whenever a new color is set for the button.
void rendererChanged()
called when user changes renderer type
virtual void doComputations()
Load programmatically with current values.
QgsHueSaturationFilter::GrayscaleMode grayscaleMode() const
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
Definition: qgis.h:212
void setZoomedInResampler(QgsRasterResampler *r)
Sets resampler for zoomed in scales. Takes ownership of the object.
QgsRasterResampleFilter * resampleFilter() const
Sets raster resample filter. Takes ownership of the resample filter object.
static QgsRasterRendererWidget * create(QgsRasterLayer *layer, const QgsRectangle &extent)
Factory method to create the renderer for this type.
Brightness/contrast filter pipe for rasters.
Bilinear Raster Resampler.
const QgsRasterResampler * zoomedOutResampler() const
Color and saturation filter pipe for rasters.
void setZoomedOutResampler(QgsRasterResampler *r)
Sets resampler for zoomed out scales. Takes ownership of the object.
Renderer for multiband images with the color components.
Manipulates raster pixel values so that they enhanceContrast or clip into a specified numerical range...
virtual void setMin(const QString &value, int index=0)
void setColorizeStrength(int colorizeStrength)
void setOpacity(double opacity)
Sets the opacity for the renderer, where opacity is a value between 0 (totally transparent) and 1...
void widgetChanged()
Emitted when something on the widget has changed.
virtual QgsRasterRenderer * renderer()=0
void insertWidgetFunction(const QString &rendererName, QgsRasterRendererWidgetCreateFunc func)
static QgsRasterRendererRegistry * rasterRendererRegistry()
Returns the application&#39;s raster renderer registry, used for managing raster layer renderers...
Raster renderer pipe that applies colors to a raster.
static QgsRasterRendererWidget * create(QgsRasterLayer *layer, const QgsRectangle &extent)
QPainter::CompositionMode blendMode() const
Returns the current blending mode for a layer.
void setGrayscaleMode(QgsHueSaturationFilter::GrayscaleMode grayscaleMode)
void setSaturation(int saturation)
const QgsRasterResampler * zoomedInResampler() const