Skip to content

Commit d72935f

Browse files
author
ersts
committedNov 6, 2008

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

‎src/core/raster/qgsrasterlayer.cpp

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,23 +1179,23 @@ QString QgsRasterLayer::colorShadingAlgorithmAsString() const
11791179
{
11801180
switch ( mColorShadingAlgorithm )
11811181
{
1182-
case PseudoColor:
1183-
return QString( "PseudoColor" );
1182+
case PseudoColorShader:
1183+
return QString( "PseudoColorShader" );
11841184
break;
1185-
case FreakOut:
1186-
return QString( "FreakOut" );
1185+
case FreakOutShader:
1186+
return QString( "FreakOutShader" );
11871187
break;
1188-
case ColorRamp:
1189-
return QString( "ColorRamp" );
1188+
case ColorRampShader:
1189+
return QString( "ColorRampShader" );
11901190
break;
1191-
case UserDefined:
1192-
return QString( "UserDefined" );
1191+
case UserDefinedShader:
1192+
return QString( "UserDefinedShader" );
11931193
break;
11941194
default:
11951195
break;
11961196
}
11971197

1198-
return QString( "UndefinedShadingAlgorithm" );
1198+
return QString( "UndefinedShader" );
11991199
}
12001200

12011201
/**
@@ -1252,7 +1252,7 @@ QString QgsRasterLayer::contrastEnhancementAlgorithmAsString() const
12521252
case QgsContrastEnhancement::ClipToMinimumMaximum:
12531253
return QString( "ClipToMinimumMaximum" );
12541254
break;
1255-
case QgsContrastEnhancement::UserDefined:
1255+
case QgsContrastEnhancement::UserDefinedEnhancement:
12561256
return QString( "UserDefined" );
12571257
break;
12581258
}
@@ -1980,7 +1980,7 @@ QPixmap QgsRasterLayer::legendAsPixmap( bool theWithNameFlag )
19801980
int myBlue = 255;
19811981
int myGreen = static_cast < int >((( 255 / myRangeSize ) * ( my - myClassBreakMin1 ) ) * 3 );
19821982
// testing this stuff still ...
1983-
if ( mColorShadingAlgorithm == FreakOut )
1983+
if ( mColorShadingAlgorithm == FreakOutShader )
19841984
{
19851985
myRed = 255 - myGreen;
19861986
}
@@ -1993,7 +1993,7 @@ QPixmap QgsRasterLayer::legendAsPixmap( bool theWithNameFlag )
19931993
int myBlue = static_cast < int >( 255 - ((( 255 / myRangeSize ) * (( my - myClassBreakMin2 ) / 1 ) ) * 3 ) );
19941994
int myGreen = 255;
19951995
// testing this stuff still ...
1996-
if ( mColorShadingAlgorithm == FreakOut )
1996+
if ( mColorShadingAlgorithm == FreakOutShader )
19971997
{
19981998
myGreen = myBlue;
19991999
}
@@ -2006,7 +2006,7 @@ QPixmap QgsRasterLayer::legendAsPixmap( bool theWithNameFlag )
20062006
int myBlue = 0;
20072007
int myGreen = static_cast < int >( 255 - ((( 255 / myRangeSize ) * (( my - myClassBreakMin3 ) / 1 ) * 3 ) ) );
20082008
// testing this stuff still ...
2009-
if ( mColorShadingAlgorithm == FreakOut )
2009+
if ( mColorShadingAlgorithm == FreakOutShader )
20102010
{
20112011
myRed = myGreen;
20122012
myGreen = 255 - myGreen;
@@ -2023,7 +2023,7 @@ QPixmap QgsRasterLayer::legendAsPixmap( bool theWithNameFlag )
20232023
int myBlue = 0;
20242024
int myGreen = static_cast < int >((( 255 / myRangeSize ) * (( my - myClassBreakMin1 ) / 1 ) * 3 ) );
20252025
// testing this stuff still ...
2026-
if ( mColorShadingAlgorithm == FreakOut )
2026+
if ( mColorShadingAlgorithm == FreakOutShader )
20272027
{
20282028
myRed = 255 - myGreen;
20292029
}
@@ -2036,7 +2036,7 @@ QPixmap QgsRasterLayer::legendAsPixmap( bool theWithNameFlag )
20362036
int myBlue = static_cast < int >((( 255 / myRangeSize ) * (( my - myClassBreakMin2 ) / 1 ) ) * 3 );
20372037
int myGreen = 255;
20382038
// testing this stuff still ...
2039-
if ( mColorShadingAlgorithm == FreakOut )
2039+
if ( mColorShadingAlgorithm == FreakOutShader )
20402040
{
20412041
myGreen = myBlue;
20422042
}
@@ -2049,7 +2049,7 @@ QPixmap QgsRasterLayer::legendAsPixmap( bool theWithNameFlag )
20492049
int myBlue = 255;
20502050
int myGreen = static_cast < int >( 255 - ((( 255 / myRangeSize ) * ( my - myClassBreakMin3 ) ) * 3 ) );
20512051
// testing this stuff still ...
2052-
if ( mColorShadingAlgorithm == FreakOut )
2052+
if ( mColorShadingAlgorithm == FreakOutShader )
20532053
{
20542054
myRed = 255 - myGreen;
20552055
}
@@ -2238,7 +2238,7 @@ QPixmap QgsRasterLayer::legendAsPixmap( int theLabelCount )
22382238
int myBlue = 255;
22392239
int myGreen = static_cast < int >((( 255 / myRangeSize ) * ( my - myClassBreakMin1 ) ) * 3 );
22402240
// testing this stuff still ...
2241-
if ( mColorShadingAlgorithm == FreakOut )
2241+
if ( mColorShadingAlgorithm == FreakOutShader )
22422242
{
22432243
myRed = 255 - myGreen;
22442244
}
@@ -2251,7 +2251,7 @@ QPixmap QgsRasterLayer::legendAsPixmap( int theLabelCount )
22512251
int myBlue = static_cast < int >( 255 - ((( 255 / myRangeSize ) * (( my - myClassBreakMin2 ) / 1 ) ) * 3 ) );
22522252
int myGreen = 255;
22532253
// testing this stuff still ...
2254-
if ( mColorShadingAlgorithm == FreakOut )
2254+
if ( mColorShadingAlgorithm == FreakOutShader )
22552255
{
22562256
myGreen = myBlue;
22572257
}
@@ -2264,7 +2264,7 @@ QPixmap QgsRasterLayer::legendAsPixmap( int theLabelCount )
22642264
int myBlue = 0;
22652265
int myGreen = static_cast < int >( 255 - ((( 255 / myRangeSize ) * (( my - myClassBreakMin3 ) / 1 ) * 3 ) ) );
22662266
// testing this stuff still ...
2267-
if ( mColorShadingAlgorithm == FreakOut )
2267+
if ( mColorShadingAlgorithm == FreakOutShader )
22682268
{
22692269
myRed = myGreen;
22702270
myGreen = 255 - myGreen;
@@ -2281,7 +2281,7 @@ QPixmap QgsRasterLayer::legendAsPixmap( int theLabelCount )
22812281
int myBlue = 0;
22822282
int myGreen = static_cast < int >((( 255 / myRangeSize ) * (( my - myClassBreakMin1 ) / 1 ) * 3 ) );
22832283
// testing this stuff still ...
2284-
if ( mColorShadingAlgorithm == FreakOut )
2284+
if ( mColorShadingAlgorithm == FreakOutShader )
22852285
{
22862286
myRed = 255 - myGreen;
22872287
}
@@ -2294,7 +2294,7 @@ QPixmap QgsRasterLayer::legendAsPixmap( int theLabelCount )
22942294
int myBlue = static_cast < int >((( 255 / myRangeSize ) * (( my - myClassBreakMin2 ) / 1 ) ) * 3 );
22952295
int myGreen = 255;
22962296
// testing this stuff still ...
2297-
if ( mColorShadingAlgorithm == FreakOut )
2297+
if ( mColorShadingAlgorithm == FreakOutShader )
22982298
{
22992299
myGreen = myBlue;
23002300
}
@@ -2307,7 +2307,7 @@ QPixmap QgsRasterLayer::legendAsPixmap( int theLabelCount )
23072307
int myBlue = 255;
23082308
int myGreen = static_cast < int >( 255 - ((( 255 / myRangeSize ) * ( my - myClassBreakMin3 ) ) * 3 ) );
23092309
// testing this stuff still ...
2310-
if ( mColorShadingAlgorithm == FreakOut )
2310+
if ( mColorShadingAlgorithm == FreakOutShader )
23112311
{
23122312
myRed = 255 - myGreen;
23132313
}
@@ -3150,16 +3150,16 @@ void QgsRasterLayer::setColorShadingAlgorithm( ColorShadingAlgorithm theShadingA
31503150

31513151
switch ( theShadingAlgorithm )
31523152
{
3153-
case PseudoColor:
3153+
case PseudoColorShader:
31543154
mRasterShader->setRasterShaderFunction( new QgsPseudoColorShader() );
31553155
break;
3156-
case FreakOut:
3157-
mRasterShader->setRasterShaderFunction( new QgsFreakOutShader() );
3156+
case FreakOutShader:
3157+
mRasterShader->setRasterShaderFunction( new QgsFreakOutShaderShader() );
31583158
break;
3159-
case ColorRamp:
3159+
case ColorRampShader:
31603160
mRasterShader->setRasterShaderFunction( new QgsColorRampShader() );
31613161
break;
3162-
case UserDefined:
3162+
case UserDefinedShader:
31633163
//do nothing
31643164
break;
31653165
default:
@@ -3174,16 +3174,16 @@ void QgsRasterLayer::setColorShadingAlgorithm( QString theShaderAlgorithm )
31743174
{
31753175
QgsDebugMsg( "called with [" + theShaderAlgorithm + "]" );
31763176

3177-
if ( theShaderAlgorithm == "PseudoColor" )
3178-
setColorShadingAlgorithm( PseudoColor );
3179-
else if ( theShaderAlgorithm == "FreakOut" )
3180-
setColorShadingAlgorithm( FreakOut );
3181-
else if ( theShaderAlgorithm == "ColorRamp" )
3182-
setColorShadingAlgorithm( ColorRamp );
3183-
else if ( theShaderAlgorithm == "UserDefined" )
3184-
setColorShadingAlgorithm( UserDefined );
3177+
if ( theShaderAlgorithm == "PseudoColorShader" )
3178+
setColorShadingAlgorithm( PseudoColorShader );
3179+
else if ( theShaderAlgorithm == "FreakOutShader" )
3180+
setColorShadingAlgorithm( FreakOutShader );
3181+
else if ( theShaderAlgorithm == "ColorRampShader" )
3182+
setColorShadingAlgorithm( ColorRampShader );
3183+
else if ( theShaderAlgorithm == "UserDefinedShader" )
3184+
setColorShadingAlgorithm( UserDefinedShader );
31853185
else
3186-
setColorShadingAlgorithm( UndefinedShadingAlgorithm );
3186+
setColorShadingAlgorithm( UndefinedShader );
31873187
}
31883188

31893189
void QgsRasterLayer::setContrastEnhancementAlgorithm( QgsContrastEnhancement::ContrastEnhancementAlgorithm theAlgorithm, bool theGenerateLookupTableFlag)
@@ -3219,7 +3219,7 @@ void QgsRasterLayer::setContrastEnhancementAlgorithm( QString theAlgorithm, bool
32193219
}
32203220
else if ( theAlgorithm == "UserDefined" )
32213221
{
3222-
setContrastEnhancementAlgorithm( QgsContrastEnhancement::UserDefined, theGenerateLookupTableFlag );
3222+
setContrastEnhancementAlgorithm( QgsContrastEnhancement::UserDefinedEnhancement, theGenerateLookupTableFlag );
32233223
}
32243224
else
32253225
{
@@ -3365,13 +3365,13 @@ void QgsRasterLayer::setRasterShaderFunction( QgsRasterShaderFunction* theFuncti
33653365
if ( theFunction )
33663366
{
33673367
mRasterShader->setRasterShaderFunction( theFunction );
3368-
mColorShadingAlgorithm = QgsRasterLayer::UserDefined;
3368+
mColorShadingAlgorithm = QgsRasterLayer::UserDefinedShader;
33693369
}
33703370
else
33713371
{
33723372
//If NULL as passed in, set a default shader function to prevent segfaults
33733373
mRasterShader->setRasterShaderFunction( new QgsRasterShaderFunction() );
3374-
mColorShadingAlgorithm = QgsRasterLayer::UserDefined;
3374+
mColorShadingAlgorithm = QgsRasterLayer::UserDefinedShader;
33753375
}
33763376
}
33773377

@@ -3518,7 +3518,7 @@ bool QgsRasterLayer::readSymbology( const QDomNode& layer_node, QString& errorMe
35183518

35193519
snode = mnl.namedItem( "mStandardDeviations" );
35203520
myElement = snode.toElement();
3521-
setStandardDeviationsToPlot( myElement.text().toDouble() );
3521+
setStandardDeviations( myElement.text().toDouble() );
35223522

35233523
snode = mnl.namedItem( "mUserDefinedRGBMinimumMaximum" );
35243524
myElement = snode.toElement();
@@ -3918,7 +3918,7 @@ bool QgsRasterLayer::writeSymbology( QDomNode & layer_node, QDomDocument & docum
39183918

39193919
// <mStandardDeviations>
39203920
QDomElement mStandardDeviationsElement = document.createElement( "mStandardDeviations" );
3921-
QDomText mStandardDeviationsText = document.createTextNode( QString::number( standardDeviationsToPlot() ) );
3921+
QDomText mStandardDeviationsText = document.createTextNode( QString::number( standardDeviations() ) );
39223922

39233923
mStandardDeviationsElement.appendChild( mStandardDeviationsText );
39243924

@@ -4074,7 +4074,7 @@ bool QgsRasterLayer::writeSymbology( QDomNode & layer_node, QDomDocument & docum
40744074
/*
40754075
* Color Ramp tab
40764076
*/
4077-
if ( QgsRasterLayer::ColorRamp == colorShadingAlgorithm() )
4077+
if ( QgsRasterLayer::ColorRampShader == colorShadingAlgorithm() )
40784078
{
40794079
QDomElement customColorRampElement = document.createElement( "customColorRamp" );
40804080

@@ -5157,7 +5157,7 @@ bool QgsRasterLayer::readFile( QString const &theFilename )
51575157
mDrawingStyle = PalettedColor; //sensible default
51585158

51595159
//Set up a new color ramp shader
5160-
setColorShadingAlgorithm( ColorRamp );
5160+
setColorShadingAlgorithm( ColorRampShader );
51615161
QgsColorRampShader* myColorRampShader = ( QgsColorRampShader* ) mRasterShader->rasterShaderFunction();
51625162
myColorRampShader->setColorRampType( QgsColorRampShader::INTERPOLATED );
51635163
myColorRampShader->setColorRampItemList( *colorTable( 1 ) );

‎src/core/raster/qgsrasterlayer.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ class QLibrary;
165165
* color palettes inverted using the setTransparency and setInvertHistogram methods.
166166
*
167167
* Pseudocolor images can have their output adjusted to a given number of standard
168-
* deviations using the setStandardDeviationsToPlot method.
168+
* deviations using the setStandardDeviations method.
169169
*
170170
* The final area of functionality you may be interested in is band mapping. Band mapping
171171
* allows you to choose arbitrary band -> color mappings and is applicable only to Palette
@@ -221,11 +221,11 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
221221
/** \brief This enumerator describes the types of shading that can be used */
222222
enum ColorShadingAlgorithm
223223
{
224-
UndefinedShadingAlgorithm,
225-
PseudoColor,
226-
FreakOut,
227-
ColorRamp,
228-
UserDefined
224+
UndefinedShader,
225+
PseudoColorShader,
226+
FreakOutShader,
227+
ColorRampShader,
228+
UserDefinedShader
229229
};
230230

231231
/** \brief This enumerator describes the different kinds of drawing we can do */
@@ -380,7 +380,7 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
380380
void setRGBMinimumMaximumEstimated( bool theBool ) { mRGBMinimumMaximumEstimated = theBool; }
381381

382382
/** \brief Mutator to alter the number of standard deviations that should be plotted */
383-
void setStandardDeviationsToPlot( double theStdDevsToPlot ) { mStandardDeviations = theStdDevsToPlot; }
383+
void setStandardDeviations( double theStandardDeviations ) { mStandardDeviations = theStandardDeviations; }
384384

385385
/** \brief Mutator for mUserDefinedGrayMinimumMaximum */
386386
void setUserDefinedGrayMinimumMaximum( bool theBool ) { mUserDefinedGrayMinimumMaximum = theBool; }
@@ -389,7 +389,7 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
389389
void setUserDefinedRGBMinimumMaximum( bool theBool ) { mUserDefinedRGBMinimumMaximum = theBool; }
390390

391391
/** \brief Accessor to find out how many standard deviations are being plotted */
392-
double standardDeviationsToPlot() const { return mStandardDeviations; }
392+
double standardDeviations() const { return mStandardDeviations; }
393393

394394
/** \brief Accessor for transparent band name mapping */
395395
QString transparentBandName() const { return mTransparencyBandName; }

‎tests/src/core/testqgsrasterlayer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ void TestQgsRasterLayer::isValid()
120120
void TestQgsRasterLayer::pseudoColor()
121121
{
122122
mpRasterLayer->setDrawingStyle( QgsRasterLayer::SingleBandPseudoColor );
123-
mpRasterLayer->setColorShadingAlgorithm( QgsRasterLayer::PseudoColor );
123+
mpRasterLayer->setColorShadingAlgorithm( QgsRasterLayer::PseudoColorShader );
124124
mpRasterLayer->setContrastEnhancementAlgorithm(
125125
QgsContrastEnhancement::StretchToMinimumMaximum, false );
126126
mpRasterLayer->setMinimumValue( mpRasterLayer->grayBandName(), 0.0, false );

0 commit comments

Comments
 (0)
Please sign in to comment.