Skip to content

Commit

Permalink
Fix typo in raster enum for MultiBandsingleBandGray and kept old enum…
Browse files Browse the repository at this point in the history
… with identical value for backwards compatibility

git-svn-id: http://svn.osgeo.org/qgis/trunk@14042 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Aug 10, 2010
1 parent e8460ed commit 9625703
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 19 deletions.
2 changes: 1 addition & 1 deletion python/core/qgsrasterlayer.sip
Expand Up @@ -72,7 +72,7 @@ public:
PalettedSingleBandGray, // a "Palette" layer drawn in gray scale
PalettedSingleBandPseudoColor, // a "Palette" layerdrawn using a pseudocolor algorithm
PalettedMultiBandColor, // currently not supported
MultiBandSingleGandGray, // a layer containing 2 or more bands, but a single band drawn as a range of gray colors
MultiBandSingleBandGray, // a layer containing 2 or more bands, but a single band drawn as a range of gray colors
MultiBandSingleBandPseudoColor, //a layer containing 2 or more bands, but a single band drawn using a pseudocolor algorithm
MultiBandColor //a layer containing 2 or more bands, mapped to RGB color space.
//In the case of a multiband with only two bands, one band will be mapped to more than one color.
Expand Down
2 changes: 1 addition & 1 deletion src/app/legend/qgslegend.cpp
Expand Up @@ -1640,7 +1640,7 @@ void QgsLegend::legendLayerStretchUsingCurrentExtent()
}
else if ( layer->drawingStyle() == QgsRasterLayer::MultiBandSingleBandPseudoColor )
{
layer->setDrawingStyle( QgsRasterLayer::MultiBandSingleGandGray );
layer->setDrawingStyle( QgsRasterLayer::MultiBandSingleBandGray );
}

if ( layer->contrastEnhancementAlgorithmAsString() == "NoEnhancement" )
Expand Down
8 changes: 4 additions & 4 deletions src/app/qgsrasterlayerproperties.cpp
Expand Up @@ -532,7 +532,7 @@ void QgsRasterLayerProperties::sync()
cboxContrastEnhancementAlgorithm->setEnabled( false );
labelContrastEnhancement->setEnabled( false );
break;
case QgsRasterLayer::MultiBandSingleGandGray:
case QgsRasterLayer::MultiBandSingleBandGray:
rbtnThreeBand->setEnabled( true );
rbtnSingleBand->setEnabled( true );
rbtnSingleBand->setChecked( true );
Expand Down Expand Up @@ -1049,11 +1049,11 @@ void QgsRasterLayerProperties::apply()
}
else
{
QgsDebugMsg( "Setting Raster Drawing Style to :: MultiBandSingleGandGray" );
QgsDebugMsg( "Setting Raster Drawing Style to :: MultiBandSingleBandGray" );
QgsDebugMsg( QString( "Combo value : %1 GrayBand Mapping : %2" ).arg( cboGray->currentText() ).arg( mRasterLayer->
grayBandName() ) );

mRasterLayer->setDrawingStyle( QgsRasterLayer::MultiBandSingleGandGray );
mRasterLayer->setDrawingStyle( QgsRasterLayer::MultiBandSingleBandGray );

}
}
Expand Down Expand Up @@ -2886,7 +2886,7 @@ void QgsRasterLayerProperties::on_pbtnLoadColorMapFromFile_clicked()

void QgsRasterLayerProperties::on_pbtnLoadMinMax_clicked()
{
if ( mRasterLayerIsGdal && ( mRasterLayer->drawingStyle() == QgsRasterLayer::SingleBandGray || mRasterLayer->drawingStyle() == QgsRasterLayer::MultiBandSingleGandGray || mRasterLayer->drawingStyle() == QgsRasterLayer::MultiBandColor ) )
if ( mRasterLayerIsGdal && ( mRasterLayer->drawingStyle() == QgsRasterLayer::SingleBandGray || mRasterLayer->drawingStyle() == QgsRasterLayer::MultiBandSingleBandGray || mRasterLayer->drawingStyle() == QgsRasterLayer::MultiBandColor ) )
{
QgsRasterBandStats myRasterBandStats;
double myMinimumMaximum[2];
Expand Down
24 changes: 12 additions & 12 deletions src/core/raster/qgsrasterlayer.cpp
Expand Up @@ -1766,12 +1766,12 @@ void QgsRasterLayer::draw( QPainter * theQPainter,
theQgsMapToPixel, 1 );
break;
// a layer containing 2 or more bands, but using only one band to produce a grayscale image
case MultiBandSingleGandGray:
QgsDebugMsg( "MultiBandSingleGandGray drawing type detected..." );
case MultiBandSingleBandGray:
QgsDebugMsg( "MultiBandSingleBandGray drawing type detected..." );
//check the band is set!
if ( mGrayBandName == TRSTRING_NOT_SET )
{
QgsDebugMsg( "MultiBandSingleGandGray Not Set detected..." + mGrayBandName );
QgsDebugMsg( "MultiBandSingleBandGray Not Set detected..." + mGrayBandName );
break;
}
else
Expand Down Expand Up @@ -1842,8 +1842,8 @@ QString QgsRasterLayer::drawingStyleAsString() const
case PalettedMultiBandColor:
return QString( "PalettedMultiBandColor" );//no need to tr() this its not shown in ui
break;
case MultiBandSingleGandGray:
return QString( "MultiBandSingleGandGray" );//no need to tr() this its not shown in ui
case MultiBandSingleBandGray:
return QString( "MultiBandSingleBandGray" );//no need to tr() this its not shown in ui
break;
case MultiBandSingleBandPseudoColor:
return QString( "MultiBandSingleBandPseudoColor" );//no need to tr() this its not shown in ui
Expand Down Expand Up @@ -2078,7 +2078,7 @@ QPixmap QgsRasterLayer::legendAsPixmap( bool theWithNameFlag )
//
// Create the legend pixmap - note it is generated on the preadjusted stats
//
if ( mDrawingStyle == MultiBandSingleGandGray || mDrawingStyle == PalettedSingleBandGray || mDrawingStyle == SingleBandGray )
if ( mDrawingStyle == MultiBandSingleBandGray || mDrawingStyle == PalettedSingleBandGray || mDrawingStyle == SingleBandGray )
{

myLegendQPixmap = QPixmap( 100, 1 );
Expand Down Expand Up @@ -2284,7 +2284,7 @@ QPixmap QgsRasterLayer::legendAsPixmap( bool theWithNameFlag )
//
// Overlay the layer name
//
if ( mDrawingStyle == MultiBandSingleGandGray || mDrawingStyle == PalettedSingleBandGray || mDrawingStyle == SingleBandGray )
if ( mDrawingStyle == MultiBandSingleBandGray || mDrawingStyle == PalettedSingleBandGray || mDrawingStyle == SingleBandGray )
{
myQPainter.setPen( Qt::white );
}
Expand Down Expand Up @@ -2333,7 +2333,7 @@ QPixmap QgsRasterLayer::legendAsPixmap( int theLabelCount )
//
// Create the legend pixmap - note it is generated on the preadjusted stats
//
if ( mDrawingStyle == MultiBandSingleGandGray || mDrawingStyle == PalettedSingleBandGray || mDrawingStyle == SingleBandGray )
if ( mDrawingStyle == MultiBandSingleBandGray || mDrawingStyle == PalettedSingleBandGray || mDrawingStyle == SingleBandGray )
{

myLegendQPixmap = QPixmap( 1, myImageHeight );
Expand Down Expand Up @@ -2516,7 +2516,7 @@ QPixmap QgsRasterLayer::legendAsPixmap( int theLabelCount )
//
// Overlay the layer name
//
if ( mDrawingStyle == MultiBandSingleGandGray || mDrawingStyle == PalettedSingleBandGray || mDrawingStyle == SingleBandGray )
if ( mDrawingStyle == MultiBandSingleBandGray || mDrawingStyle == PalettedSingleBandGray || mDrawingStyle == SingleBandGray )
{
myQPainter2.setPen( Qt::white );
}
Expand Down Expand Up @@ -3434,9 +3434,9 @@ void QgsRasterLayer::setDrawingStyle( QString const & theDrawingStyleQString )
{
mDrawingStyle = PalettedMultiBandColor;
}
else if ( theDrawingStyleQString == "MultiBandSingleGandGray" )//no need to tr() this its not shown in ui
else if ( theDrawingStyleQString == "MultiBandSingleBandGray" )//no need to tr() this its not shown in ui
{
mDrawingStyle = MultiBandSingleGandGray;
mDrawingStyle = MultiBandSingleBandGray;
}
else if ( theDrawingStyleQString == "MultiBandSingleBandPseudoColor" )//no need to tr() this its not shown in ui
{
Expand Down Expand Up @@ -3493,7 +3493,7 @@ void QgsRasterLayer::setMaximumValue( QString theBand, double theValue, bool the
void QgsRasterLayer::setMinimumMaximumUsingLastExtent()
{
double myMinMax[2];
if ( rasterType() == QgsRasterLayer::GrayOrUndefined || drawingStyle() == QgsRasterLayer::SingleBandGray || drawingStyle() == QgsRasterLayer::MultiBandSingleGandGray )
if ( rasterType() == QgsRasterLayer::GrayOrUndefined || drawingStyle() == QgsRasterLayer::SingleBandGray || drawingStyle() == QgsRasterLayer::MultiBandSingleBandGray )
{
computeMinimumMaximumFromLastExtent( grayBandName(), myMinMax );
setMinimumValue( grayBandName(), myMinMax[0] );
Expand Down
4 changes: 3 additions & 1 deletion src/core/raster/qgsrasterlayer.h
Expand Up @@ -83,7 +83,7 @@ class QLibrary;
* PalettedSingleBandGray -> a PaletteD layer drawn in gray scale (using only one of the color components)
* PalettedSingleBandPseudoColor -> a PaletteD layer having only one of its color components rendered as psuedo color
* PalettedMultiBandColor -> a PaletteD image where the bands contains 24bit color info and 8 bits is pulled out per color
* MultiBandSingleGandGray -> a layer containing 2 or more bands, but using only one band to produce a grayscale image
* MultiBandSingleBandGray -> a layer containing 2 or more bands, but using only one band to produce a grayscale image
* MultiBandSingleBandPseudoColor -> a layer containing 2 or more bands, but using only one band to produce a pseudocolor image
* 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
*
Expand Down Expand Up @@ -239,6 +239,8 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
PalettedSingleBandPseudoColor, // a "Palette" layerdrawn using a pseudocolor algorithm
PalettedMultiBandColor, // currently not supported
MultiBandSingleGandGray, // a layer containing 2 or more bands, but a single band drawn as a range of gray colors
//added in 1.6 to fix naming glitch
MultiBandSingleBandGray=MultiBandSingleGandGray, // a layer containing 2 or more bands, but a single band drawn as a range of gray colors
MultiBandSingleBandPseudoColor, //a layer containing 2 or more bands, but a single band drawn using a pseudocolor algorithm
MultiBandColor //a layer containing 2 or more bands, mapped to RGB color space.
//In the case of a multiband with only two bands, one band will be mapped to more than one color.
Expand Down

0 comments on commit 9625703

Please sign in to comment.