30 nuller->mNoData = mNoData;
31 nuller->mOutputNoData = mOutputNoData;
32 nuller->mHasOutputNoData = mHasOutputNoData;
38 if ( bandNo > mOutputNoData.size() )
40 mOutputNoData.resize( bandNo );
41 mHasOutputNoData.resize( bandNo );
43 mOutputNoData[bandNo - 1] =
noData;
44 mHasOutputNoData[bandNo - 1] =
true;
49 if ( bandNo > mNoData.size() )
51 mNoData.resize( bandNo );
53 mNoData[bandNo - 1] =
noData;
76 std::unique_ptr< QgsRasterBlock > inputBlock(
mInput->
block( bandNo,
extent, width, height, feedback ) );
85 return inputBlock.release();
88 std::unique_ptr< QgsRasterBlock > outputBlock(
new QgsRasterBlock( inputBlock->dataType(), width, height ) );
89 if ( mHasOutputNoData.value( bandNo - 1 ) || inputBlock->hasNoDataValue() )
92 if ( mHasOutputNoData.value( bandNo - 1 ) )
94 noDataValue = mOutputNoData.value( bandNo - 1 );
98 noDataValue = inputBlock->noDataValue();
100 outputBlock->setNoDataValue( noDataValue );
103 bool isNoData =
false;
104 for (
int i = 0; i < height; i++ )
106 for (
int j = 0; j < width; j++ )
108 const double value = inputBlock->valueAndNoData( i, j, isNoData );
114 outputBlock->setValue( i, j, inputBlock->value( i, j ) );
117 outputBlock->setIsNoData( i, j );
121 outputBlock->setValue( i, j, value );
125 return outputBlock.release();