Skip to content
Permalink
Browse files

Fix for multiband raster display

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12815 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Jan 22, 2010
1 parent 8091ca4 commit 9002f4e773755507e73b95f27f209280bd1ef2be
Showing with 6 additions and 6 deletions.
  1. +6 −6 src/core/raster/qgsrasterlayer.cpp
@@ -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();

@@ -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 ) ) )
{
@@ -5582,7 +5582,7 @@ bool QgsRasterImageBuffer::nextScanLine( QRgb** imageScanLine, void** rasterScan
return false;
}

if ( !mCurrentGDALData || ! mCurrentImage )
if ( !mCurrentImage && !mCurrentGDALData )
{
return false;
}
@@ -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 )

0 comments on commit 9002f4e

Please sign in to comment.
You can’t perform that action at this time.