34 nuller->mNoData = mNoData;
35 nuller->mOutputNoData = mOutputNoData;
36 nuller->mHasOutputNoData = mHasOutputNoData;
42 if ( bandNo > mOutputNoData.
size() )
44 mOutputNoData.
resize( bandNo );
45 mHasOutputNoData.
resize( bandNo );
47 mOutputNoData[bandNo-1] =
noData;
48 mHasOutputNoData[bandNo-1] =
true;
53 if ( bandNo > mNoData.size() )
55 mNoData.resize( bandNo );
57 mNoData[bandNo-1] =
noData;
97 if ( mHasOutputNoData.
value( bandNo - 1 ) )
99 noDataValue = mOutputNoData.
value( bandNo - 1 );
112 for (
int i = 0; i < height; i++ )
114 for (
int j = 0; j < width; j++ )
116 double value = inputBlock->
value( i, j );
118 bool isNoData = inputBlock->
isNoData( i, j );
130 outputBlock->
setValue( i, j, value );
virtual int bandCount() const =0
Get number of bands.
A rectangle specified with double values.
static bool contains(double value, const QgsRasterRangeList &rangeList)
Test if value is within the list of ranges.
bool setValue(int row, int column, double value)
Set value on position.
Raster pipe that deals with null values.
double noDataValue() const
Return no data value.
QgsRasterBlock * block(int bandNo, const QgsRectangle &extent, int width, int height) override
Read block of data using given extent and size.
QGis::DataType dataType() const
Returns data type.
bool isNoData(int row, int column)
Check if value at position is no data.
bool setIsNoData(int row, int column)
Set no data on pixel.
double value(int row, int column) const
Read a single value if type of block is numeric.
static bool typeIsColor(QGis::DataType type)
Returns true if data type is color.
DataType
Raster data types.
virtual QGis::DataType dataType(int bandNo) const =0
Returns data type for the band specified by number.
Base class for processing filters like renderers, reprojector, resampler etc.
void setOutputNoDataValue(int bandNo, double noData)
Set output no data value.
void setNoData(int bandNo, const QgsRasterRangeList &noData)
bool hasNoDataValue() const
True if the block has no data value.
QgsRasterRangeList noData(int bandNo) const
Unknown or unspecified type.
virtual QgsRasterBlock * block(int bandNo, const QgsRectangle &extent, int width, int height)=0
Read block of data using given extent and size.
QgsRasterInterface * clone() const override
Clone itself, create deep copy.
QgsRasterNuller(QgsRasterInterface *input=0)
QGis::DataType dataType(int bandNo) const override
Returns data type for the band specified by number.
QgsRasterInterface * mInput
int bandCount() const override
Get number of bands.