QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
Go to the documentation of this file.
18 #ifndef QGSPALETTEDRASTERRENDERER_H
19 #define QGSPALETTEDRASTERRENDERER_H
21 #include "qgis_core.h"
43 Class(
int value,
const QColor &color = QColor(),
const QString &label = QString() )
59 typedef QList< QgsPalettedRasterRenderer::Class >
ClassData;
77 int nColors()
const {
return mClassData.size(); }
82 ClassData classes()
const;
87 QString label(
int idx )
const;
92 void setLabel(
int idx,
const QString &label );
98 int band()
const {
return mBand; }
100 void writeXml( QDomDocument &doc, QDomElement &parentElem )
const override;
164 ClassData mClassData;
167 std::unique_ptr<QgsColorRamp> mSourceColorRamp;
170 QMap< int, QRgb > mColors;
174 #endif // QGSPALETTEDRASTERRENDERER_H
QList< QgsPalettedRasterRenderer::Class > ClassData
Map of value to class properties.
Abstract base class for color ramps.
virtual void writeXml(QDomDocument &doc, QDomElement &parentElem) const
Write base class members to xml.
QColor color
Color to render value.
virtual bool accept(QgsStyleEntityVisitorInterface *visitor) const
Accepts the specified symbology visitor, causing it to visit all symbols associated with the renderer...
QString label
Label for value.
virtual void toSld(QDomDocument &doc, QDomElement &element, const QgsStringMap &props=QgsStringMap()) const
Used from subclasses to create SLD Rule elements following SLD v1.0 specs.
virtual QList< int > usesBands() const
Returns a list of band numbers used by the renderer.
int band() const
Returns the raster band used for rendering the raster.
Properties of a single value class.
QgsRasterRenderer * clone() const override=0
Clone itself, create deep copy.
QMap< QString, QString > QgsStringMap
virtual void legendSymbologyItems(QList< QPair< QString, QColor > > &symbolItems) const
Gets symbology items if provided by renderer.
Class(int value, const QColor &color=QColor(), const QString &label=QString())
Constructor for Class.
const QgsRasterRenderer & operator=(const QgsRasterRenderer &)=delete
QgsRasterRenderer cannot be copied. Use clone() instead.