18#ifndef QGSRASTERRENDERER_H
19#define QGSRASTERRENDERER_H
85 virtual bool canCreateRasterAttributeTable( )
const;
101 virtual int inputBand()
const;
115 virtual bool setInputBand(
int band );
173 virtual QList< QPair< QString, QColor > > legendSymbologyItems()
const;
188 void readXml(
const QDomElement &rendererElem )
override;
194 void copyCommonProperties(
const QgsRasterRenderer *other,
bool copyMinMaxOrigin =
true );
201 virtual QList<int>
usesBands()
const {
return QList<int>(); }
213 Q_DECL_DEPRECATED
virtual void toSld( QDomDocument &doc, QDomElement &element,
const QVariantMap &props = QVariantMap() ) const
SIP_DEPRECATED;
219 virtual
bool toSld( QDomDocument &doc, QDomElement &element,
QgsSldExportContext &context ) const;
248 virtual
bool refresh( const
QgsRectangle &extent, const QList<
double> &min, const QList<
double> &max,
bool forceRefresh = false )
SIP_SKIP;
253 void _writeXml( QDomDocument &doc, QDomElement &rasterRendererElem ) const;
QFlags< RasterRendererFlag > RasterRendererFlags
Flags which control behavior of raster renderers.
DataType
Raster data types.
Layer tree node points to a map layer.
An abstract interface for legend items returned from QgsMapLayerLegend implementation.
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.
QgsRasterInterface(QgsRasterInterface *input=nullptr)
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 QgsRectangle extent() const
Gets the extent of the interface.
virtual QgsRasterInterface * input() const
Current input.
virtual bool setInput(QgsRasterInterface *input)
Set input.
Describes the origin of minimum and maximum values in a raster.
Raster renderer pipe that applies colors to a raster.
QColor nodataColor() const
Returns the color to use for shading nodata pixels.
QgsRasterRenderer(QgsRasterInterface *input=nullptr, const QString &type=QString())
Constructor for QgsRasterRenderer.
virtual QString type() const
Returns a unique string representation of the renderer type.
double mOpacity
Global alpha value (0-1).
void setMinMaxOrigin(const QgsRasterMinMaxOrigin &origin)
Sets origin of min/max values.
int mAlphaBand
Read alpha value from band.
QgsRectangle mLastRectangleUsedByRefreshContrastEnhancementIfNeeded
To save computations and possible infinite cycle of notifications.
QRgb renderColorForNodataPixel() const
Returns the color for the renderer to use to represent nodata pixels.
const QgsRasterTransparency * rasterTransparency() const
std::unique_ptr< QgsRasterTransparency > mRasterTransparency
Raster transparency per color or value. Overwrites global alpha value.
const QgsRasterMinMaxOrigin & minMaxOrigin() const
Returns const reference to origin of min/max values.
double opacity() const
Returns the opacity for the renderer, where opacity is a value between 0 (totally transparent) and 1....
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.
virtual QList< int > usesBands() const
Returns a list of band numbers used by the renderer.
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.
bool usesTransparency() const
static const QRgb NODATA_COLOR
void setNodataColor(const QColor &color)
Sets the color to use for shading nodata pixels.
const QgsRasterRenderer & operator=(const QgsRasterRenderer &)=delete
QgsRasterRenderer cannot be copied. Use clone() instead.
QgsRasterRenderer * clone() const override=0
Clone itself, create deep copy.
Defines the list of pixel values to be considered as transparent or semi transparent when rendering r...
A rectangle specified with double values.
Holds SLD export options and other information related to SLD export of a QGIS layer style.
An interface for classes which can visit style entity (e.g.