26 , mDisableMinMaxWidgetRefresh( false )
29 connect( mMinLineEdit, &QLineEdit::textChanged,
this, &QgsSingleBandGrayRendererWidget::mMinLineEdit_textChanged );
30 connect( mMaxLineEdit, &QLineEdit::textChanged,
this, &QgsSingleBandGrayRendererWidget::mMaxLineEdit_textChanged );
35 mMinLineEdit->setValidator(
new QDoubleValidator( mMinLineEdit ) );
36 mMaxLineEdit->setValidator(
new QDoubleValidator( mMaxLineEdit ) );
50 QHBoxLayout *layout =
new QHBoxLayout();
51 layout->setContentsMargins( 0, 0, 0, 0 );
52 mMinMaxContainerWidget->setLayout( layout );
53 layout->addWidget( mMinMaxWidget );
88 int band = mGrayBandComboBox->currentBand();
116 void QgsSingleBandGrayRendererWidget::mMinLineEdit_textChanged(
const QString & )
121 void QgsSingleBandGrayRendererWidget::mMaxLineEdit_textChanged(
const QString & )
126 void QgsSingleBandGrayRendererWidget::minMaxModified()
128 if ( !mDisableMinMaxWidgetRefresh )
132 mContrastEnhancementComboBox->setCurrentIndex(
145 QgsDebugMsg( QStringLiteral(
"theBandNo = %1 min = %2 max = %3" ).arg( bandNo ).arg( min ).arg( max ) );
147 mDisableMinMaxWidgetRefresh =
true;
148 if ( std::isnan( min ) )
150 mMinLineEdit->clear();
154 mMinLineEdit->setText( QString::number( min ) );
157 if ( std::isnan( max ) )
159 mMaxLineEdit->clear();
163 mMaxLineEdit->setText( QString::number( max ) );
165 mDisableMinMaxWidgetRefresh =
false;
168 void QgsSingleBandGrayRendererWidget::bandChanged()
171 myBands.append( mGrayBandComboBox->currentBand() );
182 mGrayBandComboBox->setBand( gr->
grayBand() );
184 mGradientComboBox->setCurrentIndex( mGradientComboBox->findData( gr->
gradient() ) );
190 mDisableMinMaxWidgetRefresh =
true;
191 mMinLineEdit->setText( QString::number( ce->
minimumValue() ) );
192 mMaxLineEdit->setText( QString::number( ce->
maximumValue() ) );
193 mDisableMinMaxWidgetRefresh =
false;
195 mContrastEnhancementComboBox->setCurrentIndex(
205 mDisableMinMaxWidgetRefresh =
true;
206 mMinLineEdit->setText( value );
207 mDisableMinMaxWidgetRefresh =
false;
212 mDisableMinMaxWidgetRefresh =
true;
213 mMaxLineEdit->setText( value );
214 mDisableMinMaxWidgetRefresh =
false;
double maximumValue() const
Returns the maximum value for the contrast enhancement range.
A rectangle specified with double values.
void setMinimumValue(double value, bool generateTable=true)
Sets the minimum value for the contrast enhancement range.
This class provides qgis with the ability to render raster datasets onto the mapcanvas.
DataType
Raster data types.
const QgsContrastEnhancement * contrastEnhancement() const
double minimumValue() const
Returns the minimum value for the contrast enhancement range.
const QgsRasterMinMaxOrigin & minMaxOrigin() const
Returns const reference to origin of min/max values.
QgsRasterRenderer * renderer() const
Map canvas is a class for displaying all GIS data types on a canvas.
QgsRasterDataProvider * dataProvider() override
Returns the layer's data provider, it may be nullptr.
void setMaximumValue(double value, bool generateTable=true)
Sets the maximum value for the contrast enhancement range.
void bandChanged(int band)
Emitted when the currently selected band changes.
Raster renderer pipe for single band gray.
void setGradient(Gradient gradient)
Gradient gradient() const
void setMinMaxOrigin(const QgsRasterMinMaxOrigin &origin)
Sets origin of min/max values.
void setContrastEnhancement(QgsContrastEnhancement *ce)
Takes ownership.
ContrastEnhancementAlgorithm
This enumerator describes the types of contrast enhancement algorithms that can be used...
ContrastEnhancementAlgorithm contrastEnhancementAlgorithm() const
Manipulates raster pixel values so that they enhanceContrast or clip into a specified numerical range...
Raster renderer pipe that applies colors to a raster.
void setContrastEnhancementAlgorithm(ContrastEnhancementAlgorithm algorithm, bool generateTable=true)
Sets the contrast enhancement algorithm.
Qgis::DataType dataType(int bandNo) const override=0
Returns data type for the band specified by number.
Base class for raster data providers.