QGIS API Documentation 3.37.0-Master (49cede7946b)
Loading...
Searching...
No Matches
qgsrasterrendererregistry.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsrasterrendererregistry.h
3 ---------------------------
4 begin : January 2012
5 copyright : (C) 2012 by Marco Hugentobler
6 email : marco at sourcepole 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 QGSRASTERRENDERERREGISTRY_H
19#define QGSRASTERRENDERERREGISTRY_H
20
21#include "qgis_core.h"
22#include "qgis.h"
23#include <QHash>
24#include <QString>
25
26class QDomElement;
28class QgsRasterLayer;
32class QgsRectangle;
33
34#ifndef SIP_RUN
35typedef QgsRasterRenderer *( *QgsRasterRendererCreateFunc )( const QDomElement &, QgsRasterInterface *input );
36typedef QgsRasterRendererWidget *( *QgsRasterRendererWidgetCreateFunc )( QgsRasterLayer *, const QgsRectangle &extent );
37
45{
46
52 QgsRasterRendererRegistryEntry( const QString &name, const QString &visibleName, QgsRasterRendererCreateFunc rendererFunction,
54
59 QString name;
60 QString visibleName; //visible (and translatable) name
61
68
69 QIcon icon();
70 QgsRasterRendererCreateFunc rendererCreateFunction = nullptr ; //pointer to create function
71 QgsRasterRendererWidgetCreateFunc widgetCreateFunction = nullptr ; //pointer to create function for renderer widget
72};
73
74#endif
75
86{
87 public:
88
98
104 void insert( const QgsRasterRendererRegistryEntry &entry ) SIP_SKIP;
105
111 void insertWidgetFunction( const QString &rendererName, QgsRasterRendererWidgetCreateFunc func ) SIP_SKIP;
112
118 bool rendererData( const QString &rendererName, QgsRasterRendererRegistryEntry &data ) const SIP_SKIP;
119
123 QStringList renderersList() const;
124
130 QList< QgsRasterRendererRegistryEntry > entries() const SIP_SKIP;
131
137 Qgis::RasterRendererCapabilities rendererCapabilities( const QString &rendererName ) const;
138
143 QgsRasterRenderer *defaultRendererForDrawingStyle( Qgis::RasterDrawingStyle drawingStyle, QgsRasterDataProvider *provider ) const SIP_FACTORY;
144
145 private:
146 QHash< QString, QgsRasterRendererRegistryEntry > mEntries;
147 QStringList mSortedEntries;
148
149 //read min/max values from
150 bool minMaxValuesForBand( int band, QgsRasterDataProvider *provider, double &minValue, double &maxValue ) const;
151};
152
153#endif // QGSRASTERRENDERERREGISTRY_H
RasterDrawingStyle
Raster drawing styles.
Definition qgis.h:4124
QFlags< RasterRendererCapability > RasterRendererCapabilities
Raster renderer capabilities.
Definition qgis.h:1245
Base class for raster data providers.
Base class for processing filters like renderers, reprojector, resampler etc.
Represents a raster layer.
Registry for raster renderers.
Abstract base class for widgets which configure a QgsRasterRenderer.
Raster renderer pipe that applies colors to a raster.
A rectangle specified with double values.
#define SIP_SKIP
Definition qgis_sip.h:126
#define SIP_FACTORY
Definition qgis_sip.h:76
QgsRasterRendererWidget *(* QgsRasterRendererWidgetCreateFunc)(QgsRasterLayer *, const QgsRectangle &extent)
QgsRasterRenderer *(* QgsRasterRendererCreateFunc)(const QDomElement &, QgsRasterInterface *input)
Registry for raster renderer entries.
QgsRasterRendererRegistryEntry()=default
Constructor for QgsRasterRendererRegistryEntry.
Qgis::RasterRendererCapabilities capabilities
Renderer capabilities.