Skip to content
Permalink
Browse files
fix #2457
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13750 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jun 19, 2010
1 parent c05f361 commit 2cf9351c200fdd9c07c705b6dabbdd7431dbea82
Showing with 9 additions and 6 deletions.
  1. +8 −5 src/core/raster/qgsrasterlayer.cpp
  2. +1 −1 src/core/raster/qgsrasterlayer.h
@@ -4507,7 +4507,9 @@ void QgsRasterLayer::drawPalettedSingleBandColor( QPainter * theQPainter, QgsRas
{
for ( int i = 0; i < theRasterViewPort->drawableAreaXDim; ++i )
{
myRedValue = 0; myGreenValue = 0; myBlueValue = 0;
myRedValue = 0;
myGreenValue = 0;
myBlueValue = 0;
myPixelValue = readValue( rasterScanLine, ( GDALDataType )myDataType, i );

if ( mValidNoDataValue && ( fabs( myPixelValue - mNoDataValue ) <= TINY_VALUE || myPixelValue != myPixelValue ) )
@@ -5404,7 +5406,8 @@ bool QgsRasterLayer::readFile( QString const &theFilename )
*/
double QgsRasterLayer::readValue( void *data, GDALDataType type, int index )
{
double val;
if ( !data )
return mValidNoDataValue ? mNoDataValue : 0.0;

switch ( type )
{
@@ -5427,13 +5430,13 @@ double QgsRasterLayer::readValue( void *data, GDALDataType type, int index )
return ( double )(( float * )data )[index];
break;
case GDT_Float64:
val = (( double * )data )[index];
return ( double )(( double * )data )[index];
break;
default:
QgsLogger::warning( "GDAL data type is not supported" );
}
return 0.0;

return mValidNoDataValue ? mNoDataValue : 0.0;
}

bool QgsRasterLayer::update()
@@ -5599,7 +5602,7 @@ bool QgsRasterImageBuffer::nextScanLine( QRgb** imageScanLine, void** rasterScan

++mCurrentPartImageRow;
++mCurrentRow;
return true;
return !mWritingEnabled || *imageScanLine;
}

bool QgsRasterImageBuffer::createNextPartImage()
@@ -6,7 +6,7 @@
email : tim@linfiniti.com
***************************************************************************/
/*
* Peter J. Ersts - contirbuted to the refactoring and maintenance of this class
* Peter J. Ersts - contributed to the refactoring and maintenance of this class
* B. Morley - added functions to convert this class to a data provider interface
* Frank Warmerdam - contributed bug fixes and migrated class to use all GDAL_C_API calls
*/

0 comments on commit 2cf9351

Please sign in to comment.