18 #ifndef QGSRASTERRENDERER_H
19 #define QGSRASTERRENDERER_H
21 #include "qgis_core.h"
66 virtual QString
type()
const {
return mType; }
76 bool usesTransparency()
const;
83 void setOpacity(
double opacity ) { mOpacity = opacity; }
90 double opacity()
const {
return mOpacity; }
126 virtual QList< QPair< QString, QColor > > legendSymbologyItems()
const;
141 void readXml(
const QDomElement &rendererElem )
override;
148 void copyCommonProperties(
const QgsRasterRenderer *other,
bool copyMinMaxOrigin =
true );
151 virtual QList<int>
usesBands()
const {
return QList<int>(); }
163 virtual void toSld( QDomDocument &doc, QDomElement &element,
const QVariantMap &props = QVariantMap() )
const;
179 void _writeXml( QDomDocument &doc, QDomElement &rasterRendererElem )
const;
184 double mOpacity = 1.0;
205 QRgb renderColorForNodataPixel()
const;
DataType
Raster data types.
Layer tree node points to a map layer.
The QgsLegendRendererItem class is abstract interface for legend items returned from QgsMapLayerLegen...
Feedback object tailored for raster block reading.
Base class for processing filters like renderers, reprojector, resampler etc.
virtual Qgis::DataType dataType(int bandNo) const =0
Returns data type for the band specified by number.
virtual int bandCount() const =0
Gets number of bands.
virtual void readXml(const QDomElement &filterElem)
Sets base class members from xml. Usually called from create() methods of subclasses.
virtual bool setInput(QgsRasterInterface *input)
Set input.
This class describes the origin of min/max values.
Raster renderer pipe that applies colors to a raster.
QColor nodataColor() const
Returns the color to use for shading nodata pixels.
QgsRasterBlock * block(int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback=nullptr) override=0
Read block of data using given extent and size.
const QgsRasterTransparency * rasterTransparency() const
virtual QString type() const
void setMinMaxOrigin(const QgsRasterMinMaxOrigin &origin)
Sets origin of min/max values.
const QgsRasterRenderer & operator=(const QgsRasterRenderer &)=delete
QgsRasterRenderer cannot be copied. Use clone() instead.
QgsRasterRenderer * clone() const override=0
Clone itself, create deep copy.
double opacity() const
Returns the opacity for the renderer, where opacity is a value between 0 (totally transparent) and 1....
void setAlphaBand(int band)
void setOpacity(double opacity)
Sets the opacity for the renderer, where opacity is a value between 0 (totally transparent) and 1....
QgsRasterMinMaxOrigin mMinMaxOrigin
Origin of min/max values.
QgsRasterRenderer(const QgsRasterRenderer &)=delete
QgsRasterRenderer cannot be copied. Use clone() instead.
static const QRgb NODATA_COLOR
const QgsRasterMinMaxOrigin & minMaxOrigin() const
Returns const reference to origin of min/max values.
virtual QList< int > usesBands() const
Returns a list of band numbers used by the renderer.
void setNodataColor(const QColor &color)
Sets the color to use for shading nodata pixels.
Defines the list of pixel values to be considered as transparent or semi transparent when rendering r...
A rectangle specified with double values.
An interface for classes which can visit style entity (e.g.