29 mMinLineEdit->setValidator(
new QDoubleValidator( mMinLineEdit ) );
30 mMaxLineEdit->setValidator(
new QDoubleValidator( mMaxLineEdit ) );
43 QHBoxLayout *layout =
new QHBoxLayout();
44 layout->setContentsMargins( 0, 0, 0, 0 );
45 mMinMaxContainerWidget->setLayout( layout );
48 connect(
mMinMaxWidget, SIGNAL( load(
int,
double,
double,
int ) ),
49 this, SLOT(
loadMinMax(
int,
double,
double,
int ) ) );
53 for (
int i = 1; i <= nBands; ++i )
59 mContrastEnhancementComboBox->addItem(
tr(
"No enhancement" ), 0 );
60 mContrastEnhancementComboBox->addItem(
tr(
"Stretch to MinMax" ), 1 );
61 mContrastEnhancementComboBox->addItem(
tr(
"Stretch and clip to MinMax" ), 2 );
62 mContrastEnhancementComboBox->addItem(
tr(
"Clip to MinMax" ), 3 );
83 int band = mGrayBandComboBox->itemData( mGrayBandComboBox->currentIndex() ).toInt();
90 mContrastEnhancementComboBox->currentIndex() ).toInt() ) );
103 Q_UNUSED( theBandNo );
104 Q_UNUSED( theOrigin );
105 QgsDebugMsg( QString(
"theBandNo = %1 theMin = %2 theMax = %3" ).arg( theBandNo ).arg( theMin ).arg( theMax ) );
107 if ( qIsNaN( theMin ) )
109 mMinLineEdit->clear();
113 mMinLineEdit->setText( QString::number( theMin ) );
116 if ( qIsNaN( theMax ) )
118 mMaxLineEdit->clear();
122 mMaxLineEdit->setText( QString::number( theMax ) );
129 myBands.append( mGrayBandComboBox->itemData( index ).toInt() );
139 mGrayBandComboBox->setCurrentIndex( mGrayBandComboBox->findData( gr->
grayBand() ) );
142 mGradientComboBox->setCurrentIndex( mGradientComboBox->findData( gr->
gradient() ) );
144 mMinLineEdit->setText( QString::number( ce->
minimumValue() ) );
145 mMaxLineEdit->setText( QString::number( ce->
maximumValue() ) );
147 mContrastEnhancementComboBox->setCurrentIndex(
virtual int bandCount() const =0
Get number of bands.
void setContrastEnhancementAlgorithm(ContrastEnhancementAlgorithm, bool generateTable=true)
Set the contrast enhancement algorithm.
A rectangle specified with double values.
ContrastEnhancementAlgorithm contrastEnhancementAlgorithm() const
This class provides qgis with the ability to render raster datasets onto the mapcanvas.
const QgsContrastEnhancement * contrastEnhancement() const
Gradient gradient() const
QgsRasterRenderer * renderer() const
void setMinimumValue(double, bool generateTable=true)
Return the minimum value for the contrast enhancement range.
virtual QGis::DataType dataType(int bandNo) const =0
Returns data type for the band specified by number.
Raster renderer pipe for single band gray.
double minimumValue() const
Return the minimum value for the contrast enhancement range.
void setGradient(Gradient theGradient)
void setContrastEnhancement(QgsContrastEnhancement *ce)
Takes ownership.
ContrastEnhancementAlgorithm
This enumerator describes the types of contrast enhancement algorithms that can be used...
double maximumValue() const
Return the maximum value for the contrast enhancement range.
DataType
Raster data types.
Manipulates raster pixel values so that they enhanceContrast or clip into a specified numerical range...
QgsRasterDataProvider * dataProvider()
Returns the data provider.
Raster renderer pipe that applies colors to a raster.
void setMaximumValue(double, bool generateTable=true)
Set the maximum value for the contrast enhancement range.
Base class for raster data providers.