Skip to content

Commit

Permalink
[BACKPORT] set default contrast enchacement algorithm to NoStretch
Browse files Browse the repository at this point in the history
(addresses #3867). Also set default standard deviations value to 2.0
because this is more appropriate value
  • Loading branch information
alexbruy committed Aug 2, 2011
1 parent 678549f commit 4d56f98
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/app/qgsrasterlayerproperties.cpp
Expand Up @@ -753,7 +753,7 @@ void QgsRasterLayerProperties::sync()
{
labelDefaultContrastEnhancementAlgorithm->setText( tr( "No Stretch" ) );
}
mDefaultStandardDeviation = myQSettings.value( "/Raster/defaultStandardDeviation", 1.0 ).toDouble();
mDefaultStandardDeviation = myQSettings.value( "/Raster/defaultStandardDeviation", 2.0 ).toDouble();
sboxThreeBandStdDev->setValue( mDefaultStandardDeviation );
}

Expand Down
6 changes: 3 additions & 3 deletions src/core/raster/qgsrasterlayer.cpp
Expand Up @@ -2459,7 +2459,7 @@ void QgsRasterLayer::setDataProvider( QString const & provider,
//Try to read the default contrast enhancement from the config file

QSettings myQSettings;
setContrastEnhancementAlgorithm( myQSettings.value( "/Raster/defaultContrastEnhancementAlgorithm", "StretchToMinimumMaximum" ).toString() );
setContrastEnhancementAlgorithm( myQSettings.value( "/Raster/defaultContrastEnhancementAlgorithm", "NoEnhancement" ).toString() );

//decide what type of layer this is...
//TODO Change this to look at the color interp and palette interp to decide which type of layer it is
Expand Down Expand Up @@ -2556,7 +2556,7 @@ void QgsRasterLayer::setDataProvider( QString const & provider,
// read standard deviations
if ( mContrastEnhancementAlgorithm == QgsContrastEnhancement::StretchToMinimumMaximum )
{
setStandardDeviations( myQSettings.value( "/Raster/defaultStandardDeviation", 1.0 ).toInt() );
setStandardDeviations( myQSettings.value( "/Raster/defaultStandardDeviation", 2.0 ).toInt() );
}
}
else //GrayOrUndefined
Expand All @@ -2571,7 +2571,7 @@ void QgsRasterLayer::setDataProvider( QString const & provider,
// read standard deviations
if ( mContrastEnhancementAlgorithm == QgsContrastEnhancement::StretchToMinimumMaximum )
{
setStandardDeviations( myQSettings.value( "/Raster/defaultStandardDeviation", 1.0 ).toInt() );
setStandardDeviations( myQSettings.value( "/Raster/defaultStandardDeviation", 2.0 ).toInt() );
}
}
// Debug
Expand Down

0 comments on commit 4d56f98

Please sign in to comment.