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 5ff54ab commit a06590f
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 @@ -756,7 +756,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 @@ -2364,7 +2364,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 @@ -2461,7 +2461,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 @@ -2476,7 +2476,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 a06590f

Please sign in to comment.