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