Skip to content

Commit d72935f

Browse files
author
ersts
committed
-some adjustments to the raster API as suggested by Timlinux
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9566 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 02fdc5e commit d72935f

File tree

8 files changed

+85
-85
lines changed

8 files changed

+85
-85
lines changed

python/core/qgscontrastenhancement.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public:
1414
StretchToMinimumMaximum, //linear histogram enhanceContrast
1515
StretchAndClipToMinimumMaximum,
1616
ClipToMinimumMaximum,
17-
UserDefined
17+
UserDefinedEnhancement
1818
};
1919

2020
/*! These are exactly the same as GDAL pixel data types */

python/core/qgsrasterlayer.sip

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ public:
5555
/** \brief This enumerator describes the types of shading that can be used */
5656
enum ColorShadingAlgorithm
5757
{
58-
UndefinedShadingAlgorithm,
59-
PseudoColor,
60-
FreakOut,
61-
ColorRamp,
62-
UserDefined
58+
UndefinedShader,
59+
PseudoColorShader,
60+
FreakOutShader,
61+
ColorRampShader,
62+
UserDefinedShader
6363
};
6464

6565
/** \brief This enumerator describes the different kinds of drawing we can do */
@@ -214,7 +214,7 @@ public:
214214
void setRGBMinimumMaximumEstimated( bool theBool );
215215

216216
/** \brief Mutator to alter the number of standard deviations that should be plotted */
217-
void setStandardDeviationsToPlot( double theStdDevsToPlot );
217+
void setStandardDeviations( double theStdDevsToPlot );
218218

219219
/** \brief Mutator for mUserDefinedGrayMinimumMaximum */
220220
void setUserDefinedGrayMinimumMaximum( bool theBool );
@@ -223,7 +223,7 @@ public:
223223
void setUserDefinedRGBMinimumMaximum( bool theBool );
224224

225225
/** \brief Accessor to find out how many standard deviations are being plotted */
226-
double standardDeviationsToPlot() const;
226+
double standardDeviations() const;
227227

228228
/** \brief Accessor for transparent band name mapping */
229229
QString transparentBandName() const;

src/app/qgsrasterlayerproperties.cpp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -588,19 +588,19 @@ void QgsRasterLayerProperties::sync()
588588
mRasterLayer->drawingStyle() == QgsRasterLayer::PalettedSingleBandPseudoColor ||
589589
mRasterLayer->drawingStyle() == QgsRasterLayer::MultiBandSingleBandPseudoColor )
590590
{
591-
if ( mRasterLayer->colorShadingAlgorithm() == QgsRasterLayer::PseudoColor )
591+
if ( mRasterLayer->colorShadingAlgorithm() == QgsRasterLayer::PseudoColorShader )
592592
{
593593
cboxColorMap->setCurrentIndex( cboxColorMap->findText( tr( "Pseudocolor" ) ) );
594594
}
595-
else if ( mRasterLayer->colorShadingAlgorithm() == QgsRasterLayer::FreakOut )
595+
else if ( mRasterLayer->colorShadingAlgorithm() == QgsRasterLayer::FreakOutShader )
596596
{
597597
cboxColorMap->setCurrentIndex( cboxColorMap->findText( tr( "Freak Out" ) ) );
598598
}
599-
else if ( mRasterLayer->colorShadingAlgorithm() == QgsRasterLayer::ColorRamp )
599+
else if ( mRasterLayer->colorShadingAlgorithm() == QgsRasterLayer::ColorRampShader )
600600
{
601601
cboxColorMap->setCurrentIndex( cboxColorMap->findText( tr( "Colormap" ) ) );
602602
}
603-
else if ( mRasterLayer->colorShadingAlgorithm() == QgsRasterLayer::UserDefined )
603+
else if ( mRasterLayer->colorShadingAlgorithm() == QgsRasterLayer::UserDefinedShader )
604604
{
605605
cboxColorMap->setCurrentIndex( cboxColorMap->findText( tr( "User Defined" ) ) );
606606
}
@@ -638,7 +638,7 @@ void QgsRasterLayerProperties::sync()
638638
}
639639
else
640640
{
641-
sboxThreeBandStdDev->setValue( mRasterLayer->standardDeviationsToPlot() );
641+
sboxThreeBandStdDev->setValue( mRasterLayer->standardDeviations() );
642642
rbtnThreeBandStdDev->setChecked( true );
643643
rbtnThreeBandMinMax->setChecked( false );
644644
}
@@ -677,7 +677,7 @@ void QgsRasterLayerProperties::sync()
677677
}
678678
else
679679
{
680-
sboxSingleBandStdDev->setValue( mRasterLayer->standardDeviationsToPlot() );
680+
sboxSingleBandStdDev->setValue( mRasterLayer->standardDeviations() );
681681
rbtnSingleBandStdDev->setChecked( true );
682682
rbtnSingleBandMinMax->setChecked( false );
683683
}
@@ -709,7 +709,7 @@ void QgsRasterLayerProperties::sync()
709709
{
710710
cboxContrastEnhancementAlgorithm->setCurrentIndex( cboxContrastEnhancementAlgorithm->findText( tr( "Clip To MinMax" ) ) );
711711
}
712-
else if ( QgsContrastEnhancement::UserDefined == mRasterLayer->contrastEnhancementAlgorithm() )
712+
else if ( QgsContrastEnhancement::UserDefinedEnhancement == mRasterLayer->contrastEnhancementAlgorithm() )
713713
{
714714
cboxContrastEnhancementAlgorithm->setCurrentIndex( cboxContrastEnhancementAlgorithm->findText( tr( "User Defined" ) ) );
715715
}
@@ -851,7 +851,7 @@ void QgsRasterLayerProperties::syncColormapTab()
851851
return;
852852
}
853853

854-
if ( QgsRasterLayer::ColorRamp != mRasterLayer->colorShadingAlgorithm() )
854+
if ( QgsRasterLayer::ColorRampShader != mRasterLayer->colorShadingAlgorithm() )
855855
{
856856
return;
857857
}
@@ -1059,15 +1059,15 @@ void QgsRasterLayerProperties::apply()
10591059
//If UserDefined do nothing, user defined can only be set programatically
10601060
if ( cboxColorMap->currentText() == tr( "Pseudocolor" ) )
10611061
{
1062-
mRasterLayer->setColorShadingAlgorithm( QgsRasterLayer::PseudoColor );
1062+
mRasterLayer->setColorShadingAlgorithm( QgsRasterLayer::PseudoColorShader );
10631063
}
10641064
else if ( cboxColorMap->currentText() == tr( "Freak Out" ) )
10651065
{
1066-
mRasterLayer->setColorShadingAlgorithm( QgsRasterLayer::FreakOut );
1066+
mRasterLayer->setColorShadingAlgorithm( QgsRasterLayer::FreakOutShader );
10671067
}
10681068
else if ( cboxColorMap->currentText() == tr( "Colormap" ) )
10691069
{
1070-
mRasterLayer->setColorShadingAlgorithm( QgsRasterLayer::ColorRamp );
1070+
mRasterLayer->setColorShadingAlgorithm( QgsRasterLayer::ColorRampShader );
10711071
}
10721072

10731073
//set the color scaling algorithm
@@ -1086,7 +1086,7 @@ void QgsRasterLayerProperties::apply()
10861086
{
10871087
mRasterLayer->setContrastEnhancementAlgorithm( QgsContrastEnhancement::ClipToMinimumMaximum, false );
10881088
}
1089-
else if ( QgsContrastEnhancement::UserDefined == mRasterLayer->contrastEnhancementAlgorithm() )
1089+
else if ( QgsContrastEnhancement::UserDefinedEnhancement == mRasterLayer->contrastEnhancementAlgorithm() )
10901090
{
10911091
//do nothing
10921092
}
@@ -1117,17 +1117,17 @@ void QgsRasterLayerProperties::apply()
11171117
mRasterLayer->setMinimumValue( cboBlue->currentText(), leBlueMin->text().toDouble(), false );
11181118
mRasterLayer->setMaximumValue( cboBlue->currentText(), leBlueMax->text().toDouble() );
11191119
}
1120-
mRasterLayer->setStandardDeviationsToPlot( 0.0 );
1120+
mRasterLayer->setStandardDeviations( 0.0 );
11211121
mRasterLayer->setUserDefinedRGBMinimumMaximum( true );
11221122
}
11231123
else if ( rbtnThreeBandStdDev->isEnabled() && rbtnThreeBandStdDev->isChecked() )
11241124
{
1125-
mRasterLayer->setStandardDeviationsToPlot( sboxThreeBandStdDev->value() );
1125+
mRasterLayer->setStandardDeviations( sboxThreeBandStdDev->value() );
11261126
mRasterLayer->setUserDefinedRGBMinimumMaximum( false );
11271127
}
11281128
else
11291129
{
1130-
mRasterLayer->setStandardDeviationsToPlot( 0.0 );
1130+
mRasterLayer->setStandardDeviations( 0.0 );
11311131
mRasterLayer->setUserDefinedRGBMinimumMaximum( false );
11321132
}
11331133
}
@@ -1142,17 +1142,17 @@ void QgsRasterLayerProperties::apply()
11421142
mRasterLayer->setMinimumValue( cboGray->currentText(), leGrayMin->text().toDouble(), false );
11431143
mRasterLayer->setMaximumValue( cboGray->currentText(), leGrayMax->text().toDouble() );
11441144
}
1145-
mRasterLayer->setStandardDeviationsToPlot( 0.0 );
1145+
mRasterLayer->setStandardDeviations( 0.0 );
11461146
mRasterLayer->setUserDefinedGrayMinimumMaximum( true );
11471147
}
11481148
else if ( rbtnSingleBandStdDev->isEnabled() && rbtnSingleBandStdDev->isChecked() )
11491149
{
1150-
mRasterLayer->setStandardDeviationsToPlot( sboxSingleBandStdDev->value() );
1150+
mRasterLayer->setStandardDeviations( sboxSingleBandStdDev->value() );
11511151
mRasterLayer->setUserDefinedGrayMinimumMaximum( false );
11521152
}
11531153
else
11541154
{
1155-
mRasterLayer->setStandardDeviationsToPlot( 0.0 );
1155+
mRasterLayer->setStandardDeviations( 0.0 );
11561156
mRasterLayer->setUserDefinedGrayMinimumMaximum( false );
11571157
}
11581158
}
@@ -1468,7 +1468,7 @@ void QgsRasterLayerProperties::apply()
14681468
{
14691469
if ( rbtnThreeBandStdDev->isEnabled() )
14701470
{
1471-
sboxThreeBandStdDev->setValue( mRasterLayer->standardDeviationsToPlot() );
1471+
sboxThreeBandStdDev->setValue( mRasterLayer->standardDeviations() );
14721472
}
14731473

14741474
if ( rbtnThreeBandMinMax->isEnabled() )
@@ -1496,7 +1496,7 @@ void QgsRasterLayerProperties::apply()
14961496
{
14971497
if ( rbtnSingleBandStdDev->isEnabled() )
14981498
{
1499-
sboxSingleBandStdDev->setValue( mRasterLayer->standardDeviationsToPlot() );
1499+
sboxSingleBandStdDev->setValue( mRasterLayer->standardDeviations() );
15001500
}
15011501

15021502
if ( rbtnSingleBandMinMax->isEnabled() )
@@ -2390,7 +2390,7 @@ void QgsRasterLayerProperties::on_rbtnSingleBand_toggled( bool theState )
23902390
}
23912391
else
23922392
{
2393-
sboxSingleBandStdDev->setValue( mRasterLayer->standardDeviationsToPlot() );
2393+
sboxSingleBandStdDev->setValue( mRasterLayer->standardDeviations() );
23942394
rbtnSingleBandStdDev->setChecked( true );
23952395
}
23962396

@@ -2471,7 +2471,7 @@ void QgsRasterLayerProperties::on_rbtnThreeBand_toggled( bool theState )
24712471
}
24722472
else
24732473
{
2474-
sboxThreeBandStdDev->setValue( mRasterLayer->standardDeviationsToPlot() );
2474+
sboxThreeBandStdDev->setValue( mRasterLayer->standardDeviations() );
24752475
rbtnThreeBandStdDev->setChecked( true );
24762476
}
24772477

src/core/raster/qgscontrastenhancement.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ void QgsContrastEnhancement::setContrastEnhancementAlgorithm( ContrastEnhancemen
251251
case ClipToMinimumMaximum :
252252
mContrastEnhancementFunction = new QgsClipToMinMaxEnhancement( mRasterDataType, mMinimumValue, mMaximumValue );
253253
break;
254-
case UserDefined :
254+
case UserDefinedEnhancement :
255255
//Do nothing
256256
break;
257257
default:
@@ -281,7 +281,7 @@ void QgsContrastEnhancement::setContrastEnhancementFunction( QgsContrastEnhancem
281281
if ( 0 != theFunction )
282282
{
283283
mContrastEnhancementFunction = theFunction;
284-
mContrastEnhancementAlgorithm = UserDefined;
284+
mContrastEnhancementAlgorithm = UserDefinedEnhancement;
285285
generateLookupTable();
286286
}
287287
}

src/core/raster/qgscontrastenhancement.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class CORE_EXPORT QgsContrastEnhancement
4242
StretchToMinimumMaximum, //linear histogram enhanceContrast
4343
StretchAndClipToMinimumMaximum,
4444
ClipToMinimumMaximum,
45-
UserDefined
45+
UserDefinedEnhancement
4646
};
4747

4848
/** These are exactly the same as GDAL pixel data types

0 commit comments

Comments
 (0)