QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
qgsrastersinglecolorrenderer.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsrastersinglecolorrenderer.h
3 ---------------------------
4 begin : April 2024
5 copyright : (C) 2024 by Mathieu Pellerin
6 email : mathieu at opengis dot ch
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSRASTERSINGLECOLORRENDERER_H
19#define QGSRASTERSINGLECOLORRENDERER_H
20
21#include <memory>
22
23#include "qgis_core.h"
24#include "qgis_sip.h"
25#include "qgsrasterrenderer.h"
26
27class QDomElement;
28
35{
36 public:
37
40
45
47 Qgis::RasterRendererFlags flags() const override;
48
50 static QgsRasterRenderer *create( const QDomElement &elem, QgsRasterInterface *input ) SIP_FACTORY;
51
52 QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback = nullptr ) override SIP_FACTORY;
53
58 QColor color() const;
59
64 void setColor( const QColor &color );
65
66 void writeXml( QDomDocument &doc, QDomElement &parentElem ) const override;
67
68 int inputBand() const override;
69 bool setInputBand( int band ) override;
70 QList<int> usesBands() const override;
71
72 private:
73#ifdef SIP_RUN
76#endif
77
78 int mInputBand = -1;
79 QColor mColor;
80};
81
82#endif // QGSRASTERSINGLECOLORRENDERER_H
Provides global constants and enumerations for use throughout the application.
Definition qgis.h:56
Feedback object tailored for raster block reading.
Raster data container.
QgsRasterInterface(QgsRasterInterface *input=nullptr)
virtual QgsRectangle extent() const
Gets the extent of the interface.
virtual QgsRasterInterface * input() const
Current input.
QgsRasterRenderer(QgsRasterInterface *input=nullptr, const QString &type=QString())
Constructor for QgsRasterRenderer.
const QgsRasterRenderer & operator=(const QgsRasterRenderer &)=delete
QgsRasterRenderer cannot be copied. Use clone() instead.
QgsRasterRenderer * clone() const override=0
Clone itself, create deep copy.
int inputBand() const override
Returns the input band for the renderer, or -1 if no input band is available.
bool setInputBand(int band) override
Attempts to set the input band for the renderer.
void writeXml(QDomDocument &doc, QDomElement &parentElem) const override
Write base class members to xml.
Qgis::RasterRendererFlags flags() const override
Returns flags which dictate renderer behavior.
static QgsRasterRenderer * create(const QDomElement &elem, QgsRasterInterface *input)
Creates an instance of the renderer based on definition from XML (used by the renderer registry).
const QgsRasterSingleColorRenderer & operator=(const QgsRasterSingleColorRenderer &)=delete
QgsRasterSingleColorRenderer cannot be copied. Use clone() instead.
QgsRasterSingleColorRenderer(QgsRasterInterface *input, int band, const QColor &color)
Creates a single color renderer.
QColor color() const
Returns the single color used by the renderer.
QList< int > usesBands() const override
Returns a list of band numbers used by the renderer.
QgsRasterBlock * block(int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback=nullptr) override
Read block of data using given extent and size.
QgsRasterSingleColorRenderer(const QgsRasterSingleColorRenderer &)=delete
QgsRasterSingleColorRenderer cannot be copied. Use clone() instead.
void setColor(const QColor &color)
Sets the single color used by the renderer.
A rectangle specified with double values.
#define SIP_FACTORY
Definition qgis_sip.h:84