Skip to content
Permalink
Browse files

[BACKPORT] set default contrast enchacement algorithm to NoStretch

(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 a06590fa879ff27f999ca61ba34e275df9e27ce3
Showing with 4 additions and 4 deletions.
  1. +1 −1 src/app/qgsrasterlayerproperties.cpp
  2. +3 −3 src/core/raster/qgsrasterlayer.cpp
@@ -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 );
}

@@ -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
@@ -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
@@ -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

0 comments on commit a06590f

Please sign in to comment.
You can’t perform that action at this time.