Skip to content

Commit

Permalink
Fix for multiband raster display
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@12815 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Jan 22, 2010
1 parent 882e7e8 commit 467ee66
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/core/raster/qgsrasterlayer.cpp
Expand Up @@ -4406,7 +4406,7 @@ void QgsRasterLayer::drawMultiBandColor( QPainter * theQPainter, QgsRasterViewPo
QgsRasterImageBuffer greenImageBuffer( myGdalGreenBand, theQPainter, theRasterViewPort, theQgsMapToPixel, &mGeoTransform[0] );
greenImageBuffer.setWritingEnabled( false ); //only draw to redImageBuffer
greenImageBuffer.reset();
QgsRasterImageBuffer blueImageBuffer( myGdalGreenBand, theQPainter, theRasterViewPort, theQgsMapToPixel, &mGeoTransform[0] );
QgsRasterImageBuffer blueImageBuffer( myGdalBlueBand, theQPainter, theRasterViewPort, theQgsMapToPixel, &mGeoTransform[0] );
blueImageBuffer.setWritingEnabled( false ); //only draw to redImageBuffer
blueImageBuffer.reset();

Expand All @@ -4415,9 +4415,9 @@ void QgsRasterLayer::drawMultiBandColor( QPainter * theQPainter, QgsRasterViewPo
{
for ( int i = 0; i < theRasterViewPort->drawableAreaXDim; ++i )
{
myRedValue = readValue( redImageScanLine, ( GDALDataType )myRedType, i );
myGreenValue = readValue( greenImageScanLine, ( GDALDataType )myGreenType, i );
myBlueValue = readValue( blueImageScanLine, ( GDALDataType )myBlueType, i );
myRedValue = readValue( redRasterScanLine, ( GDALDataType )myRedType, i );
myGreenValue = readValue( greenRasterScanLine, ( GDALDataType )myGreenType, i );
myBlueValue = readValue( blueRasterScanLine, ( GDALDataType )myBlueType, i );

if ( mValidNoDataValue && (( fabs( myRedValue - mNoDataValue ) <= TINY_VALUE || myRedValue != myRedValue ) || ( fabs( myGreenValue - mNoDataValue ) <= TINY_VALUE || myGreenValue != myGreenValue ) || ( fabs( myBlueValue - mNoDataValue ) <= TINY_VALUE || myBlueValue != myBlueValue ) ) )
{
Expand Down Expand Up @@ -5582,7 +5582,7 @@ bool QgsRasterImageBuffer::nextScanLine( QRgb** imageScanLine, void** rasterScan
return false;
}

if ( !mCurrentGDALData || ! mCurrentImage )
if ( !mCurrentImage && !mCurrentGDALData )
{
return false;
}
Expand Down Expand Up @@ -5614,7 +5614,7 @@ bool QgsRasterImageBuffer::nextScanLine( QRgb** imageScanLine, void** rasterScan

bool QgsRasterImageBuffer::createNextPartImage()
{
//draw the last image if mCurrentImage if it exists
//draw the last image if mCurrentImage exists
if ( mCurrentImage )
{
if ( mWritingEnabled )
Expand Down

0 comments on commit 467ee66

Please sign in to comment.