21 #include <QDomDocument> 22 #include <QDomElement> 57 return block2( bandNo, extent, width, height );
71 if ( !inputBlock || inputBlock->
isEmpty() )
79 if ( !hasTransparency )
96 QRgb* inputBits = ( QRgb* )inputBlock->
bits();
97 QRgb* outputBits = ( QRgb* )outputBlock->
bits();
100 QRgb c = inputBits[i];
110 if ( parentElem.
isNull() )
132 if ( !input )
return false;
A rectangle specified with double values.
bool setInput(QgsRasterInterface *input) override
Set input.
bool convert(QGis::DataType destDataType)
Convert data to different type.
QgsRasterBlock * block(int bandNo, const QgsRectangle &extent, int width, int height) override
Read block of data using given extent and size.
QDomNode appendChild(const QDomNode &newChild)
~QgsSingleBandColorDataRenderer()
QString attribute(const QString &name, const QString &defValue) const
virtual QgsRasterInterface * input() const
Current input.
void copyCommonProperties(const QgsRasterRenderer *other)
Copies common properties like opacity / transparency data from other renderer.
QgsSingleBandColorDataRenderer * clone() const override
Clone itself, create deep copy.
QgsSingleBandColorDataRenderer(QgsRasterInterface *input, int band)
void readXML(const QDomElement &rendererElem) override
Sets base class members from xml.
virtual QgsRasterBlock * block2(int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback=nullptr)
Read block of data using given extent and size.
Raster renderer pipe for single band color.
Color, alpha, red, green, blue, 4 bytes the same as QImage::Format_ARGB32_Premultiplied.
void setAttribute(const QString &name, const QString &value)
int toInt(bool *ok, int base) const
bool usesTransparency() const
Color, alpha, red, green, blue, 4 bytes the same as QImage::Format_ARGB32.
bool isEmpty() const
Returns true if block is empty, i.e.
void _writeXML(QDomDocument &doc, QDomElement &rasterRendererElem) const
Write upper class info into rasterrenderer element (called by writeXML method of subclasses) ...
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.
unsigned long long qgssize
Qgssize is used instead of size_t, because size_t is stdlib type, unknown by SIP, and it would be har...
bool reset(QGis::DataType theDataType, int theWidth, int theHeight)
Reset block.
QList< int > usesBands() const override
Returns a list of band numbers used by the renderer.
virtual QgsRectangle extent()
Get the extent of the interface.
static QgsRasterRenderer * create(const QDomElement &elem, QgsRasterInterface *input)
char * bits(int row, int column)
Get pointer to data.
void writeXML(QDomDocument &doc, QDomElement &parentElem) const override
Write base class members to xml.
QgsRasterBlock * block2(int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback=nullptr) override
Read block of data using given extent and size.
double mOpacity
Global alpha value (0-1)
QDomElement createElement(const QString &tagName)
QgsRasterInterface * mInput
Feedback object tailored for raster block reading.
Raster renderer pipe that applies colors to a raster.