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

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

0 comments on commit 4d56f98

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