Skip to content

Commit fe7d4fb

Browse files
committedDec 10, 2012
inline more raster block methods
1 parent eb79e21 commit fe7d4fb

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed
 

‎src/core/raster/qgsrasterblock.cpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -239,28 +239,6 @@ bool QgsRasterBlock::isNoDataValue( double value, double noDataValue )
239239
return false;
240240
}
241241

242-
bool QgsRasterBlock::isNoDataValue( double value ) const
243-
{
244-
// More precise would be qIsNaN(value) && qIsNaN(noDataValue(bandNo)), but probably
245-
// not important and slower
246-
if ( qIsNaN( value ) ||
247-
doubleNear( value, mNoDataValue ) )
248-
{
249-
return true;
250-
}
251-
return false;
252-
}
253-
254-
double QgsRasterBlock::value( size_t index ) const
255-
{
256-
if ( index >= ( size_t )mWidth*mHeight )
257-
{
258-
QgsDebugMsg( QString( "Index %1 out of range (%2 x %3)" ).arg( index ).arg( mWidth ).arg( mHeight ) );
259-
return mNoDataValue;
260-
}
261-
return readValue( mData, mDataType, index );
262-
}
263-
264242
double QgsRasterBlock::value( int row, int column ) const
265243
{
266244
return value(( size_t )row*mWidth + column );

‎src/core/raster/qgsrasterblock.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,28 @@ inline bool QgsRasterBlock::valueInRange( double value, const QList<QgsRasterBlo
430430
return false;
431431
}
432432

433+
inline double QgsRasterBlock::value( size_t index ) const
434+
{
435+
/*if ( index >= ( size_t )mWidth*mHeight )
436+
{
437+
QgsDebugMsg( QString( "Index %1 out of range (%2 x %3)" ).arg( index ).arg( mWidth ).arg( mHeight ) );
438+
return mNoDataValue;
439+
}*/
440+
return readValue( mData, mDataType, index );
441+
}
442+
443+
inline bool QgsRasterBlock::isNoDataValue( double value ) const
444+
{
445+
// More precise would be qIsNaN(value) && qIsNaN(noDataValue(bandNo)), but probably
446+
// not important and slower
447+
if ( qIsNaN( value ) ||
448+
doubleNear( value, mNoDataValue ) )
449+
{
450+
return true;
451+
}
452+
return false;
453+
}
454+
433455
#endif
434456

435457

0 commit comments

Comments
 (0)
Please sign in to comment.