Skip to content

Commit 8f45a08

Browse files
author
timlinux
committedAug 10, 2010
Fix typo in raster enum for MultiBandsingleBandGray and kept old enum with identical value for backwards compatibility
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14042 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

5 files changed

+21
-19
lines changed

5 files changed

+21
-19
lines changed
 

‎python/core/qgsrasterlayer.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public:
7272
PalettedSingleBandGray, // a "Palette" layer drawn in gray scale
7373
PalettedSingleBandPseudoColor, // a "Palette" layerdrawn using a pseudocolor algorithm
7474
PalettedMultiBandColor, // currently not supported
75-
MultiBandSingleGandGray, // a layer containing 2 or more bands, but a single band drawn as a range of gray colors
75+
MultiBandSingleBandGray, // a layer containing 2 or more bands, but a single band drawn as a range of gray colors
7676
MultiBandSingleBandPseudoColor, //a layer containing 2 or more bands, but a single band drawn using a pseudocolor algorithm
7777
MultiBandColor //a layer containing 2 or more bands, mapped to RGB color space.
7878
//In the case of a multiband with only two bands, one band will be mapped to more than one color.

‎src/app/legend/qgslegend.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1640,7 +1640,7 @@ void QgsLegend::legendLayerStretchUsingCurrentExtent()
16401640
}
16411641
else if ( layer->drawingStyle() == QgsRasterLayer::MultiBandSingleBandPseudoColor )
16421642
{
1643-
layer->setDrawingStyle( QgsRasterLayer::MultiBandSingleGandGray );
1643+
layer->setDrawingStyle( QgsRasterLayer::MultiBandSingleBandGray );
16441644
}
16451645

16461646
if ( layer->contrastEnhancementAlgorithmAsString() == "NoEnhancement" )

‎src/app/qgsrasterlayerproperties.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ void QgsRasterLayerProperties::sync()
532532
cboxContrastEnhancementAlgorithm->setEnabled( false );
533533
labelContrastEnhancement->setEnabled( false );
534534
break;
535-
case QgsRasterLayer::MultiBandSingleGandGray:
535+
case QgsRasterLayer::MultiBandSingleBandGray:
536536
rbtnThreeBand->setEnabled( true );
537537
rbtnSingleBand->setEnabled( true );
538538
rbtnSingleBand->setChecked( true );
@@ -1049,11 +1049,11 @@ void QgsRasterLayerProperties::apply()
10491049
}
10501050
else
10511051
{
1052-
QgsDebugMsg( "Setting Raster Drawing Style to :: MultiBandSingleGandGray" );
1052+
QgsDebugMsg( "Setting Raster Drawing Style to :: MultiBandSingleBandGray" );
10531053
QgsDebugMsg( QString( "Combo value : %1 GrayBand Mapping : %2" ).arg( cboGray->currentText() ).arg( mRasterLayer->
10541054
grayBandName() ) );
10551055

1056-
mRasterLayer->setDrawingStyle( QgsRasterLayer::MultiBandSingleGandGray );
1056+
mRasterLayer->setDrawingStyle( QgsRasterLayer::MultiBandSingleBandGray );
10571057

10581058
}
10591059
}
@@ -2886,7 +2886,7 @@ void QgsRasterLayerProperties::on_pbtnLoadColorMapFromFile_clicked()
28862886

28872887
void QgsRasterLayerProperties::on_pbtnLoadMinMax_clicked()
28882888
{
2889-
if ( mRasterLayerIsGdal && ( mRasterLayer->drawingStyle() == QgsRasterLayer::SingleBandGray || mRasterLayer->drawingStyle() == QgsRasterLayer::MultiBandSingleGandGray || mRasterLayer->drawingStyle() == QgsRasterLayer::MultiBandColor ) )
2889+
if ( mRasterLayerIsGdal && ( mRasterLayer->drawingStyle() == QgsRasterLayer::SingleBandGray || mRasterLayer->drawingStyle() == QgsRasterLayer::MultiBandSingleBandGray || mRasterLayer->drawingStyle() == QgsRasterLayer::MultiBandColor ) )
28902890
{
28912891
QgsRasterBandStats myRasterBandStats;
28922892
double myMinimumMaximum[2];

‎src/core/raster/qgsrasterlayer.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1766,12 +1766,12 @@ void QgsRasterLayer::draw( QPainter * theQPainter,
17661766
theQgsMapToPixel, 1 );
17671767
break;
17681768
// a layer containing 2 or more bands, but using only one band to produce a grayscale image
1769-
case MultiBandSingleGandGray:
1770-
QgsDebugMsg( "MultiBandSingleGandGray drawing type detected..." );
1769+
case MultiBandSingleBandGray:
1770+
QgsDebugMsg( "MultiBandSingleBandGray drawing type detected..." );
17711771
//check the band is set!
17721772
if ( mGrayBandName == TRSTRING_NOT_SET )
17731773
{
1774-
QgsDebugMsg( "MultiBandSingleGandGray Not Set detected..." + mGrayBandName );
1774+
QgsDebugMsg( "MultiBandSingleBandGray Not Set detected..." + mGrayBandName );
17751775
break;
17761776
}
17771777
else
@@ -1842,8 +1842,8 @@ QString QgsRasterLayer::drawingStyleAsString() const
18421842
case PalettedMultiBandColor:
18431843
return QString( "PalettedMultiBandColor" );//no need to tr() this its not shown in ui
18441844
break;
1845-
case MultiBandSingleGandGray:
1846-
return QString( "MultiBandSingleGandGray" );//no need to tr() this its not shown in ui
1845+
case MultiBandSingleBandGray:
1846+
return QString( "MultiBandSingleBandGray" );//no need to tr() this its not shown in ui
18471847
break;
18481848
case MultiBandSingleBandPseudoColor:
18491849
return QString( "MultiBandSingleBandPseudoColor" );//no need to tr() this its not shown in ui
@@ -2078,7 +2078,7 @@ QPixmap QgsRasterLayer::legendAsPixmap( bool theWithNameFlag )
20782078
//
20792079
// Create the legend pixmap - note it is generated on the preadjusted stats
20802080
//
2081-
if ( mDrawingStyle == MultiBandSingleGandGray || mDrawingStyle == PalettedSingleBandGray || mDrawingStyle == SingleBandGray )
2081+
if ( mDrawingStyle == MultiBandSingleBandGray || mDrawingStyle == PalettedSingleBandGray || mDrawingStyle == SingleBandGray )
20822082
{
20832083

20842084
myLegendQPixmap = QPixmap( 100, 1 );
@@ -2284,7 +2284,7 @@ QPixmap QgsRasterLayer::legendAsPixmap( bool theWithNameFlag )
22842284
//
22852285
// Overlay the layer name
22862286
//
2287-
if ( mDrawingStyle == MultiBandSingleGandGray || mDrawingStyle == PalettedSingleBandGray || mDrawingStyle == SingleBandGray )
2287+
if ( mDrawingStyle == MultiBandSingleBandGray || mDrawingStyle == PalettedSingleBandGray || mDrawingStyle == SingleBandGray )
22882288
{
22892289
myQPainter.setPen( Qt::white );
22902290
}
@@ -2333,7 +2333,7 @@ QPixmap QgsRasterLayer::legendAsPixmap( int theLabelCount )
23332333
//
23342334
// Create the legend pixmap - note it is generated on the preadjusted stats
23352335
//
2336-
if ( mDrawingStyle == MultiBandSingleGandGray || mDrawingStyle == PalettedSingleBandGray || mDrawingStyle == SingleBandGray )
2336+
if ( mDrawingStyle == MultiBandSingleBandGray || mDrawingStyle == PalettedSingleBandGray || mDrawingStyle == SingleBandGray )
23372337
{
23382338

23392339
myLegendQPixmap = QPixmap( 1, myImageHeight );
@@ -2516,7 +2516,7 @@ QPixmap QgsRasterLayer::legendAsPixmap( int theLabelCount )
25162516
//
25172517
// Overlay the layer name
25182518
//
2519-
if ( mDrawingStyle == MultiBandSingleGandGray || mDrawingStyle == PalettedSingleBandGray || mDrawingStyle == SingleBandGray )
2519+
if ( mDrawingStyle == MultiBandSingleBandGray || mDrawingStyle == PalettedSingleBandGray || mDrawingStyle == SingleBandGray )
25202520
{
25212521
myQPainter2.setPen( Qt::white );
25222522
}
@@ -3434,9 +3434,9 @@ void QgsRasterLayer::setDrawingStyle( QString const & theDrawingStyleQString )
34343434
{
34353435
mDrawingStyle = PalettedMultiBandColor;
34363436
}
3437-
else if ( theDrawingStyleQString == "MultiBandSingleGandGray" )//no need to tr() this its not shown in ui
3437+
else if ( theDrawingStyleQString == "MultiBandSingleBandGray" )//no need to tr() this its not shown in ui
34383438
{
3439-
mDrawingStyle = MultiBandSingleGandGray;
3439+
mDrawingStyle = MultiBandSingleBandGray;
34403440
}
34413441
else if ( theDrawingStyleQString == "MultiBandSingleBandPseudoColor" )//no need to tr() this its not shown in ui
34423442
{
@@ -3493,7 +3493,7 @@ void QgsRasterLayer::setMaximumValue( QString theBand, double theValue, bool the
34933493
void QgsRasterLayer::setMinimumMaximumUsingLastExtent()
34943494
{
34953495
double myMinMax[2];
3496-
if ( rasterType() == QgsRasterLayer::GrayOrUndefined || drawingStyle() == QgsRasterLayer::SingleBandGray || drawingStyle() == QgsRasterLayer::MultiBandSingleGandGray )
3496+
if ( rasterType() == QgsRasterLayer::GrayOrUndefined || drawingStyle() == QgsRasterLayer::SingleBandGray || drawingStyle() == QgsRasterLayer::MultiBandSingleBandGray )
34973497
{
34983498
computeMinimumMaximumFromLastExtent( grayBandName(), myMinMax );
34993499
setMinimumValue( grayBandName(), myMinMax[0] );

‎src/core/raster/qgsrasterlayer.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class QLibrary;
8383
* PalettedSingleBandGray -> a PaletteD layer drawn in gray scale (using only one of the color components)
8484
* PalettedSingleBandPseudoColor -> a PaletteD layer having only one of its color components rendered as psuedo color
8585
* PalettedMultiBandColor -> a PaletteD image where the bands contains 24bit color info and 8 bits is pulled out per color
86-
* MultiBandSingleGandGray -> a layer containing 2 or more bands, but using only one band to produce a grayscale image
86+
* MultiBandSingleBandGray -> a layer containing 2 or more bands, but using only one band to produce a grayscale image
8787
* MultiBandSingleBandPseudoColor -> a layer containing 2 or more bands, but using only one band to produce a pseudocolor image
8888
* MultiBandColor -> a layer containing 2 or more bands, mapped to the three RGBcolors. In the case of a multiband with only two bands, one band will have to be mapped to more than one color
8989
*
@@ -239,6 +239,8 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
239239
PalettedSingleBandPseudoColor, // a "Palette" layerdrawn using a pseudocolor algorithm
240240
PalettedMultiBandColor, // currently not supported
241241
MultiBandSingleGandGray, // a layer containing 2 or more bands, but a single band drawn as a range of gray colors
242+
//added in 1.6 to fix naming glitch
243+
MultiBandSingleBandGray=MultiBandSingleGandGray, // a layer containing 2 or more bands, but a single band drawn as a range of gray colors
242244
MultiBandSingleBandPseudoColor, //a layer containing 2 or more bands, but a single band drawn using a pseudocolor algorithm
243245
MultiBandColor //a layer containing 2 or more bands, mapped to RGB color space.
244246
//In the case of a multiband with only two bands, one band will be mapped to more than one color.

0 commit comments

Comments
 (0)
Please sign in to comment.