21 #include <QDomDocument> 22 #include <QDomElement> 68 if ( !inputBlock || inputBlock->
isEmpty() )
76 if ( !hasTransparency )
93 QRgb* inputBits = ( QRgb* )inputBlock->
bits();
94 QRgb* outputBits = ( QRgb* )outputBlock->
bits();
97 QRgb c = inputBits[i];
107 if ( parentElem.
isNull() )
129 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
QgsSingleBandColorDataRenderer * clone() const override
Clone itself, create deep copy.
virtual QgsRasterInterface * input() const
Current input.
QgsSingleBandColorDataRenderer(QgsRasterInterface *input, int band)
void readXML(const QDomElement &rendererElem) override
Sets base class members from xml.
Raster renderer pipe for single band color.
bool usesTransparency() const
QgsRasterTransparency * mRasterTransparency
Raster transparency per color or value.
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
Color, alpha, red, green, blue, 4 bytes the same as QImage::Format_ARGB32.
int mAlphaBand
Read alpha value from band.
virtual QGis::DataType dataType(int bandNo) const =0
Returns data type for the band specified by number.
void setAlphaBand(int band)
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.
virtual QgsRasterBlock * block(int bandNo, const QgsRectangle &extent, int width, int height)=0
Read block of data using given extent and size.
double mOpacity
Global alpha value (0-1)
Defines the list of pixel values to be considered as transparent or semi transparent when rendering r...
void setOpacity(double opacity)
QDomElement createElement(const QString &tagName)
void _writeXML(QDomDocument &doc, QDomElement &rasterRendererElem) const
Write upper class info into rasterrenderer element (called by writeXML method of subclasses) ...
QgsRasterInterface * mInput
void setRasterTransparency(QgsRasterTransparency *t)
Raster renderer pipe that applies colors to a raster.
bool isEmpty() const
Returns true if block is empty, i.e.