16#include <QIntValidator>
21#include <QRegularExpression>
42 , TRSTRING_NOT_SET( tr(
"Not Set" ) )
43 , mRasterLayer( layer )
44 , mMapCanvas( canvas )
47 connect( pbnAddValuesFromDisplay, &QToolButton::clicked,
this, &QgsRasterTransparencyWidget::pbnAddValuesFromDisplay_clicked );
48 connect( pbnAddValuesManually, &QToolButton::clicked,
this, &QgsRasterTransparencyWidget::pbnAddValuesManually_clicked );
49 connect( pbnDefaultValues, &QToolButton::clicked,
this, &QgsRasterTransparencyWidget::pbnDefaultValues_clicked );
50 connect( pbnExportTransparentPixelValues, &QToolButton::clicked,
this, &QgsRasterTransparencyWidget::pbnExportTransparentPixelValues_clicked );
51 connect( pbnImportTransparentPixelValues, &QToolButton::clicked,
this, &QgsRasterTransparencyWidget::pbnImportTransparentPixelValues_clicked );
52 connect( pbnRemoveSelectedRow, &QToolButton::clicked,
this, &QgsRasterTransparencyWidget::pbnRemoveSelectedRow_clicked );
54 mNodataColorButton->setShowNoColor(
true );
55 mNodataColorButton->setColorDialogTitle( tr(
"Select No Data Color" ) );
62 leNoDataValue->setValidator(
new QgsDoubleValidator( std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max(),
this ) );
65 mPixelSelectorTool =
nullptr;
73 pbnAddValuesFromDisplay->setEnabled(
false );
97 expContext << generator->createExpressionContextScope();
127 gboxNoDataValue->setEnabled(
false );
128 gboxCustomTransparency->setEnabled(
false );
131 cboxTransparencyBand->setShowNotSetOption(
true, tr(
"None" ) );
132 cboxTransparencyBand->setLayer( mRasterLayer );
140 lblSrcNoDataValue->setText( tr(
"not defined" ) );
147 mSrcNoDataValueCheckBox->setEnabled( enableSrcNoData );
148 lblSrcNoDataValue->setEnabled( enableSrcNoData );
154 mNodataColorButton->setColor( renderer->
nodataColor() );
156 mNodataColorButton->setToNull();
158 mOpacityWidget->setOpacity( renderer->
opacity() );
160 cboxTransparencyBand->setBand( renderer->
alphaBand() );
166 QgsDebugMsg( QStringLiteral(
"noDataRangeList.size = %1" ).arg( noDataRangeList.size() ) );
167 if ( !noDataRangeList.isEmpty() )
170 leNoDataValue->setText( QLocale().toString( v ) );
174 leNoDataValue->setText( QString() );
179 leNoDataValue->setText( QString() );
185 populateTransparencyTable( mRasterLayer->
renderer() );
188void QgsRasterTransparencyWidget::transparencyCellTextEdited(
const QString &text )
191 QgsDebugMsg( QStringLiteral(
"text = %1" ).arg( text ) );
197 const int nBands = renderer->
usesBands().size();
200 QLineEdit *lineEdit = qobject_cast<QLineEdit *>( sender() );
201 if ( !lineEdit )
return;
204 for (
int r = 0; r < tableTransparency->rowCount(); r++ )
206 for (
int c = 0;
c < tableTransparency->columnCount();
c++ )
208 if ( tableTransparency->cellWidget( r,
c ) == sender() )
215 if ( row != -1 )
break;
217 QgsDebugMsg( QStringLiteral(
"row = %1 column =%2" ).arg( row ).arg( column ) );
221 QLineEdit *toLineEdit =
dynamic_cast<QLineEdit *
>( tableTransparency->cellWidget( row, 1 ) );
222 if ( !toLineEdit )
return;
223 const bool toChanged = mTransparencyToEdited.value( row );
224 QgsDebugMsg( QStringLiteral(
"toChanged = %1" ).arg( toChanged ) );
227 toLineEdit->setText( lineEdit->text() );
230 else if ( column == 1 )
232 setTransparencyToEdited( row );
238void QgsRasterTransparencyWidget::pbnAddValuesFromDisplay_clicked()
240 if ( mMapCanvas && mPixelSelectorTool )
246void QgsRasterTransparencyWidget::pbnAddValuesManually_clicked()
254 tableTransparency->insertRow( tableTransparency->rowCount() );
259 for (
int i = 0; i < n; i++ )
261 setTransparencyCell( tableTransparency->rowCount() - 1, i, std::numeric_limits<double>::quiet_NaN() );
264 setTransparencyCell( tableTransparency->rowCount() - 1, n, 100 );
270void QgsRasterTransparencyWidget::pbnDefaultValues_clicked()
278 const int nBands = r->
usesBands().size();
280 setupTransparencyTable( nBands );
287void QgsRasterTransparencyWidget::pbnExportTransparentPixelValues_clicked()
290 const QString myLastDir = myQSettings.
value( QStringLiteral(
"lastRasterFileFilterDir" ), QDir::homePath() ).toString();
291 QString myFileName = QFileDialog::getSaveFileName(
this, tr(
"Save Pixel Values as File" ), myLastDir, tr(
"Textfile" ) +
" (*.txt)" );
292 if ( !myFileName.isEmpty() )
294 if ( !myFileName.endsWith( QLatin1String(
".txt" ), Qt::CaseInsensitive ) )
296 myFileName = myFileName +
".txt";
299 QFile myOutputFile( myFileName );
300 if ( myOutputFile.open( QFile::WriteOnly | QIODevice::Truncate ) )
302 QTextStream myOutputStream( &myOutputFile );
303 myOutputStream <<
"# " << tr(
"QGIS Generated Transparent Pixel Value Export File" ) <<
'\n';
304 if ( rasterIsMultiBandColor() )
306 myOutputStream <<
"#\n#\n# " << tr(
"Red" ) <<
"\t" << tr(
"Green" ) <<
"\t" << tr(
"Blue" ) <<
"\t" << tr(
"Percent Transparent" );
307 for (
int myTableRunner = 0; myTableRunner < tableTransparency->rowCount(); myTableRunner++ )
309 myOutputStream <<
'\n' << QString::number( transparencyCellValue( myTableRunner, 0 ) ) <<
"\t"
310 << QString::number( transparencyCellValue( myTableRunner, 1 ) ) <<
"\t"
311 << QString::number( transparencyCellValue( myTableRunner, 2 ) ) <<
"\t"
312 << QString::number( transparencyCellValue( myTableRunner, 3 ) );
317 myOutputStream <<
"#\n#\n# " << tr(
"Value" ) <<
"\t" << tr(
"Percent Transparent" );
319 for (
int myTableRunner = 0; myTableRunner < tableTransparency->rowCount(); myTableRunner++ )
321 myOutputStream <<
'\n' << QString::number( transparencyCellValue( myTableRunner, 0 ) ) <<
"\t"
322 << QString::number( transparencyCellValue( myTableRunner, 1 ) ) <<
"\t"
323 << QString::number( transparencyCellValue( myTableRunner, 2 ) );
329 QMessageBox::warning(
this, tr(
"Save Pixel Values as File" ), tr(
"Write access denied. Adjust the file permissions and try again.\n\n" ) );
334void QgsRasterTransparencyWidget::pbnImportTransparentPixelValues_clicked()
336 int myLineCounter = 0;
337 bool myImportError =
false;
340 const QString myLastDir = myQSettings.
value( QStringLiteral(
"lastRasterFileFilterDir" ), QDir::homePath() ).toString();
341 const QString myFileName = QFileDialog::getOpenFileName(
this, tr(
"Load Pixel Values from File" ), myLastDir, tr(
"Textfile" ) +
" (*.txt)" );
342 QFile myInputFile( myFileName );
343 if ( myInputFile.open( QFile::ReadOnly ) )
345 QTextStream myInputStream( &myInputFile );
347 if ( rasterIsMultiBandColor() )
349 for (
int myTableRunner = tableTransparency->rowCount() - 1; myTableRunner >= 0; myTableRunner-- )
351 tableTransparency->removeRow( myTableRunner );
354 while ( !myInputStream.atEnd() )
357 myInputLine = myInputStream.readLine();
358 if ( !myInputLine.isEmpty() )
360 if ( !myInputLine.simplified().startsWith(
'#' ) )
362#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
363 QStringList myTokens = myInputLine.split( QRegExp(
"\\s+" ), QString::SkipEmptyParts );
365 QStringList myTokens = myInputLine.split( QRegularExpression(
"\\s+" ), Qt::SkipEmptyParts );
367 if ( myTokens.count() != 4 )
369 myImportError =
true;
370 myBadLines = myBadLines + QString::number( myLineCounter ) +
":\t[" + myInputLine +
"]\n";
374 tableTransparency->insertRow( tableTransparency->rowCount() );
375 for (
int col = 0; col < 4; col++ )
377 setTransparencyCell( tableTransparency->rowCount() - 1, col, myTokens[col].toDouble() );
386 for (
int myTableRunner = tableTransparency->rowCount() - 1; myTableRunner >= 0; myTableRunner-- )
388 tableTransparency->removeRow( myTableRunner );
391 while ( !myInputStream.atEnd() )
394 myInputLine = myInputStream.readLine();
395 if ( !myInputLine.isEmpty() )
397 if ( !myInputLine.simplified().startsWith(
'#' ) )
399#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
400 QStringList myTokens = myInputLine.split( QRegExp(
"\\s+" ), QString::SkipEmptyParts );
402 QStringList myTokens = myInputLine.split( QRegularExpression(
"\\s+" ), Qt::SkipEmptyParts );
404 if ( myTokens.count() != 3 && myTokens.count() != 2 )
406 myImportError =
true;
407 myBadLines = myBadLines + QString::number( myLineCounter ) +
":\t[" + myInputLine +
"]\n";
411 if ( myTokens.count() == 2 )
413 myTokens.insert( 1, myTokens[0] );
415 tableTransparency->insertRow( tableTransparency->rowCount() );
416 for (
int col = 0; col < 3; col++ )
418 setTransparencyCell( tableTransparency->rowCount() - 1, col, myTokens[col].toDouble() );
428 QMessageBox::warning(
this, tr(
"Load Pixel Values from File" ), tr(
"The following lines contained errors\n\n%1" ).arg( myBadLines ) );
431 else if ( !myFileName.isEmpty() )
433 QMessageBox::warning(
this, tr(
"Load Pixel Values from File" ), tr(
"Read access denied. Adjust the file permissions and try again.\n\n" ) );
440void QgsRasterTransparencyWidget::pbnRemoveSelectedRow_clicked()
442 if ( 0 < tableTransparency->rowCount() )
444 tableTransparency->removeRow( tableTransparency->currentRow() );
449bool QgsRasterTransparencyWidget::rasterIsMultiBandColor()
458 if (
"" != leNoDataValue->text() )
460 bool myDoubleOk =
false;
464 const QgsRasterRange myNoDataRange( myNoDataValue, myNoDataValue );
465 myNoDataRangeList << myNoDataRange;
470 for (
int bandNo = 1; bandNo <= provider->bandCount(); bandNo++ )
479 if ( rasterRenderer )
481 rasterRenderer->
setAlphaBand( cboxTransparencyBand->currentBand() );
486 if ( tableTransparency->columnCount() == 4 )
489 QList<QgsRasterTransparency::TransparentThreeValuePixel> myTransparentThreeValuePixelList;
490 myTransparentThreeValuePixelList.reserve( tableTransparency->rowCount() );
491 for (
int myListRunner = 0; myListRunner < tableTransparency->rowCount(); myListRunner++ )
493 myTransparentPixel.
red = transparencyCellValue( myListRunner, 0 );
494 myTransparentPixel.
green = transparencyCellValue( myListRunner, 1 );
495 myTransparentPixel.
blue = transparencyCellValue( myListRunner, 2 );
497 myTransparentThreeValuePixelList.append( myTransparentPixel );
501 else if ( tableTransparency->columnCount() == 3 )
504 QList<QgsRasterTransparency::TransparentSingleValuePixel> myTransparentSingleValuePixelList;
505 myTransparentSingleValuePixelList.reserve( tableTransparency->rowCount() );
506 for (
int myListRunner = 0; myListRunner < tableTransparency->rowCount(); myListRunner++ )
508 myTransparentPixel.
min = transparencyCellValue( myListRunner, 0 );
509 myTransparentPixel.
max = transparencyCellValue( myListRunner, 1 );
512 myTransparentSingleValuePixelList.append( myTransparentPixel );
520 rasterRenderer->
setOpacity( mOpacityWidget->opacity() );
528 button->blockSignals(
true );
532 button->blockSignals(
false );
537 const auto propertyOverrideButtons { findChildren< QgsPropertyOverrideButton * >() };
556void QgsRasterTransparencyWidget::updateProperty()
564void QgsRasterTransparencyWidget::pixelSelected(
const QgsPointXY &canvasPoint )
573 if ( mMapCanvas && mPixelSelectorTool && mRasterLayer->
dataProvider() )
582 const int myWidth = mMapCanvas->
extent().
width() / mapUnitsPerPixel;
583 const int myHeight = mMapCanvas->
extent().
height() / mapUnitsPerPixel;
587 const QList<int> bands = renderer->
usesBands();
589 QList<double> values;
590 for (
int i = 0; i < bands.size(); ++i )
592 const int bandNo = bands.value( i );
593 if ( myPixelMap.count( bandNo ) == 1 )
599 const double value = myPixelMap.value( bandNo ).toDouble();
600 QgsDebugMsg( QStringLiteral(
"value = %1" ).arg( value, 0,
'g', 17 ) );
601 values.append( value );
604 if ( bands.size() == 1 )
607 values.insert( 1, values.value( 0 ) );
609 tableTransparency->insertRow( tableTransparency->rowCount() );
610 for (
int i = 0; i < values.size(); i++ )
612 setTransparencyCell( tableTransparency->rowCount() - 1, i, values.value( i ) );
614 setTransparencyCell( tableTransparency->rowCount() - 1, tableTransparency->columnCount() - 1, 100 );
621void QgsRasterTransparencyWidget::populateTransparencyTable(
QgsRasterRenderer *renderer )
633 const int nBands = renderer->
usesBands().size();
634 setupTransparencyTable( nBands );
637 if ( !rasterTransparency )
645 for (
int i = 0; i < pixelList.size(); ++i )
647 tableTransparency->insertRow( i );
648 setTransparencyCell( i, 0, pixelList[i].min );
649 setTransparencyCell( i, 1, pixelList[i].max );
650 setTransparencyCell( i, 2, pixelList[i].percentTransparent );
652 if ( pixelList[i].min != pixelList[i].max )
654 setTransparencyToEdited( i );
658 else if ( nBands == 3 )
661 for (
int i = 0; i < pixelList.size(); ++i )
663 tableTransparency->insertRow( i );
664 setTransparencyCell( i, 0, pixelList[i].red );
665 setTransparencyCell( i, 1, pixelList[i].green );
666 setTransparencyCell( i, 2, pixelList[i].blue );
667 setTransparencyCell( i, 3, pixelList[i].percentTransparent );
671 tableTransparency->resizeColumnsToContents();
672 tableTransparency->resizeRowsToContents();
676void QgsRasterTransparencyWidget::setupTransparencyTable(
int nBands )
678 tableTransparency->clear();
679 tableTransparency->setColumnCount( 0 );
680 tableTransparency->setRowCount( 0 );
681 mTransparencyToEdited.clear();
685 tableTransparency->setColumnCount( 4 );
686 tableTransparency->setHorizontalHeaderItem( 0,
new QTableWidgetItem( tr(
"Red" ) ) );
687 tableTransparency->setHorizontalHeaderItem( 1,
new QTableWidgetItem( tr(
"Green" ) ) );
688 tableTransparency->setHorizontalHeaderItem( 2,
new QTableWidgetItem( tr(
"Blue" ) ) );
689 tableTransparency->setHorizontalHeaderItem( 3,
new QTableWidgetItem( tr(
"Percent Transparent" ) ) );
693 tableTransparency->setColumnCount( 3 );
696 if ( QgsRasterLayer::PalettedColor != mRasterLayer->drawingStyle() &&
697 QgsRasterLayer::PalettedSingleBandGray != mRasterLayer->drawingStyle() &&
698 QgsRasterLayer::PalettedSingleBandPseudoColor != mRasterLayer->drawingStyle() &&
699 QgsRasterLayer::PalettedMultiBandColor != mRasterLayer->drawingStyle() )
701 tableTransparency->setHorizontalHeaderItem( 0,
new QTableWidgetItem( tr(
"Gray" ) ) );
705 tableTransparency->setHorizontalHeaderItem( 0,
new QTableWidgetItem( tr(
"Indexed Value" ) ) );
708 tableTransparency->setHorizontalHeaderItem( 0,
new QTableWidgetItem( tr(
"From" ) ) );
709 tableTransparency->setHorizontalHeaderItem( 1,
new QTableWidgetItem( tr(
"To" ) ) );
710 tableTransparency->setHorizontalHeaderItem( 2,
new QTableWidgetItem( tr(
"Percent Transparent" ) ) );
714void QgsRasterTransparencyWidget::setTransparencyCell(
int row,
int column,
double value )
716 QgsDebugMsg( QStringLiteral(
"value = %1" ).arg( value, 0,
'g', 17 ) );
724 const int nBands = renderer->
usesBands().size();
726 QLineEdit *lineEdit =
new QLineEdit();
727 lineEdit->setFrame(
false );
729 lineEdit->setContentsMargins( 1, 1, 1, 1 );
731 if ( column == tableTransparency->columnCount() - 1 )
735 lineEdit->setValidator(
new QIntValidator(
nullptr ) );
736 lineEdit->setText( QString::number(
static_cast<int>( value ) ) );
747 if ( !std::isnan( value ) )
750 valueString = QLocale().toString( v );
754 lineEdit->setValidator(
new QIntValidator(
nullptr ) );
755 if ( !std::isnan( value ) )
757 valueString = QString::number(
static_cast<int>( value ) );
761 lineEdit->setText( valueString );
764 tableTransparency->setCellWidget( row, column, lineEdit );
765 adjustTransparencyCellWidth( row, column );
767 if ( nBands == 1 && ( column == 0 || column == 1 ) )
769 connect( lineEdit, &QLineEdit::textEdited,
this, &QgsRasterTransparencyWidget::transparencyCellTextEdited );
775void QgsRasterTransparencyWidget::adjustTransparencyCellWidth(
int row,
int column )
777 QLineEdit *lineEdit =
dynamic_cast<QLineEdit *
>( tableTransparency->cellWidget( row, column ) );
778 if ( !lineEdit )
return;
780 int width = std::max( lineEdit->fontMetrics().boundingRect( lineEdit->text() ).width() + 10, 100 );
781 width = std::max( width, tableTransparency->columnWidth( column ) );
783 lineEdit->setFixedWidth( width );
786void QgsRasterTransparencyWidget::setTransparencyToEdited(
int row )
788 if ( row >= mTransparencyToEdited.size() )
790 mTransparencyToEdited.resize( row + 1 );
792 mTransparencyToEdited[row] =
true;
795double QgsRasterTransparencyWidget::transparencyCellValue(
int row,
int column )
797 QLineEdit *lineEdit =
dynamic_cast<QLineEdit *
>( tableTransparency->cellWidget( row, column ) );
798 if ( !lineEdit || lineEdit->text().isEmpty() )
800 return std::numeric_limits<double>::quiet_NaN();
808 return mPixelSelectorTool;
@ Float32
Thirty two bit floating point (float)
@ ARGB32_Premultiplied
Color, alpha, red, green, blue, 4 bytes the same as QImage::Format_ARGB32_Premultiplied.
@ ARGB32
Color, alpha, red, green, blue, 4 bytes the same as QImage::Format_ARGB32.
@ Float64
Sixty four bit floating point (double)
QgsDoubleValidator is a QLineEdit Validator that combines QDoubleValidator and QRegularExpressionVali...
static double toDouble(const QString &input, bool *ok)
Converts input string to double value.
Abstract interface for generating an expression context scope.
Single scope for storing variables and functions for use within a QgsExpressionContext.
static QgsExpressionContextScope * projectScope(const QgsProject *project)
Creates a new scope which contains variables and functions relating to a QGIS project.
static QgsExpressionContextScope * atlasScope(const QgsLayoutAtlas *atlas)
Creates a new scope which contains variables and functions relating to a QgsLayoutAtlas.
static QgsExpressionContextScope * mapSettingsScope(const QgsMapSettings &mapSettings)
Creates a new scope which contains variables and functions relating to a QgsMapSettings object.
static QgsExpressionContextScope * layerScope(const QgsMapLayer *layer)
Creates a new scope which contains variables and functions relating to a QgsMapLayer.
static QgsExpressionContextScope * globalScope()
Creates a new scope which contains variables and functions relating to the global QGIS context.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
void appendScope(QgsExpressionContextScope *scope)
Appends a scope to the end of the context.
Map canvas is a class for displaying all GIS data types on a canvas.
void unsetMapTool(QgsMapTool *mapTool)
Unset the current map tool or last non zoom tool.
void setMapTool(QgsMapTool *mapTool, bool clean=false)
Sets the map tool currently being used on the canvas.
double mapUnitsPerPixel() const
Returns the mapUnitsPerPixel (map units per pixel) for the canvas.
const QgsMapSettings & mapSettings() const
Gets access to properties used for map rendering.
QgsRectangle extent() const
Returns the current zoom extent of the map canvas.
The QgsMapSettings class contains configuration for rendering of the map.
QgsPointXY mapToLayerCoordinates(const QgsMapLayer *layer, QgsPointXY point) const
transform point coordinates from output CRS to layer's CRS
Renderer for multiband images with the color components.
A class to represent a 2D point.
static QgsProject * instance()
Returns the QgsProject singleton instance.
QgsProperty property(int key) const override
Returns a matching property from the collection, if one exists.
void setProperty(int key, const QgsProperty &property)
Adds a property to the collection and takes ownership of it.
void bandChanged(int band)
Emitted when the currently selected band changes.
static QString printValue(double value)
Print double value with all necessary significant digits.
Base class for raster data providers.
virtual bool sourceHasNoDataValue(int bandNo) const
Returns true if source band has no data value.
virtual bool useSourceNoDataValue(int bandNo) const
Returns the source nodata value usage.
Qgis::DataType sourceDataType(int bandNo) const override=0
Returns source data type for the band specified by number, source data type may be shorter than dataT...
virtual void setUseSourceNoDataValue(int bandNo, bool use)
Sets the source nodata value usage.
virtual double sourceNoDataValue(int bandNo) const
Value representing no data value.
virtual QgsRasterIdentifyResult identify(const QgsPointXY &point, QgsRaster::IdentifyFormat format, const QgsRectangle &boundingBox=QgsRectangle(), int width=0, int height=0, int dpi=96)
Identify raster value(s) found on the point position.
Qgis::DataType dataType(int bandNo) const override=0
Returns data type for the band specified by number.
virtual QgsRasterRangeList userNoDataValues(int bandNo) const
Returns a list of user no data value ranges.
virtual void setUserNoDataValue(int bandNo, const QgsRasterRangeList &noData)
QMap< int, QVariant > results() const
Returns the identify results.
Represents a raster layer.
QgsRasterPipe * pipe()
Returns the raster pipe.
QgsRasterRenderer * renderer() const
Returns the raster's renderer.
QgsRasterDataProvider * dataProvider() override
Returns the source data provider.
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the pipe's property collection, used for data defined overrides.
static QgsPropertiesDefinition propertyDefinitions()
Returns the definitions for data defined properties available for use in raster pipes.
Property
Data definable properties.
@ RendererOpacity
Raster renderer global opacity.
void setDataDefinedProperties(const QgsPropertyCollection &collection)
Sets the pipe's property collection, used for data defined overrides.
Raster values range container.
Raster renderer pipe that applies colors to a raster.
QColor nodataColor() const
Returns the color to use for shading nodata pixels.
const QgsRasterTransparency * rasterTransparency() const
double opacity() const
Returns the opacity for the renderer, where opacity is a value between 0 (totally transparent) and 1....
virtual QList< int > usesBands() const
Returns a list of band numbers used by the renderer.
void setAlphaBand(int band)
void setOpacity(double opacity)
Sets the opacity for the renderer, where opacity is a value between 0 (totally transparent) and 1....
void setRasterTransparency(QgsRasterTransparency *t)
void setNodataColor(const QColor &color)
Sets the color to use for shading nodata pixels.
Defines the list of pixel values to be considered as transparent or semi transparent when rendering r...
void setTransparentSingleValuePixelList(const QList< QgsRasterTransparency::TransparentSingleValuePixel > &newList)
Sets the transparent single value pixel list, replacing the whole existing list.
QList< QgsRasterTransparency::TransparentThreeValuePixel > transparentThreeValuePixelList() const
Returns the transparent three value pixel list.
void setTransparentThreeValuePixelList(const QList< QgsRasterTransparency::TransparentThreeValuePixel > &newList)
Sets the transparent three value pixel list, replacing the whole existing list.
QList< QgsRasterTransparency::TransparentSingleValuePixel > transparentSingleValuePixelList() const
Returns the transparent single value pixel list.
A rectangle specified with double values.
double width() const
Returns the width of the rectangle.
double height() const
Returns the height of the rectangle.
This class is a composition of two QSettings instances:
QVariant value(const QString &key, const QVariant &defaultValue=QVariant(), Section section=NoSection) const
Returns the value for setting key.
Contains settings which reflect the context in which a symbol (or renderer) widget is shown,...
QList< QgsExpressionContextScope > additionalExpressionContextScopes() const
Returns the list of additional expression context scopes to show as available within the layer.
QgsMapCanvas * mapCanvas() const
Returns the map canvas associated with the widget.
static bool isNull(const QVariant &variant)
Returns true if the specified variant should be considered a NULL value.
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into c
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
QList< QgsRasterRange > QgsRasterRangeList
double percentTransparent
double percentTransparent