QGIS API Documentation 3.39.0-Master (bca3cdb6021)
Loading...
Searching...
No Matches
qgsrasterlayerrenderer.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsrasterlayerrenderer.h
3 --------------------------------------
4 Date : December 2013
5 Copyright : (C) 2013 by Martin Dobias
6 Email : wonder dot sk at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSRASTERLAYERRENDERER_H
17#define QGSRASTERLAYERRENDERER_H
18
19#define SIP_NO_FILE
20
21#include "qgsmaplayerrenderer.h"
23
24class QPainter;
25
26class QgsMapToPixel;
27class QgsRasterLayer;
28class QgsRasterPipe;
31
33
34#include "qgsrasterinterface.h"
35
37
43class CORE_EXPORT QgsRasterLayerRendererFeedback : public QgsRasterBlockFeedback
44{
45 Q_OBJECT
46
47 public:
49 explicit QgsRasterLayerRendererFeedback( QgsRasterLayerRenderer *r );
50
52 void onNewData() override;
53 private:
54 QgsRasterLayerRenderer *mR = nullptr;
55 int mMinimalPreviewInterval;
56 QTime mLastPreview;
57};
58
60
68{
69 public:
70 QgsRasterLayerRenderer( QgsRasterLayer *layer, QgsRenderContext &rendererContext );
71 ~QgsRasterLayerRenderer() override;
72
73 bool render() override;
74 QgsFeedback *feedback() const override;
75 bool forceRasterRender() const override;
76
77 private:
78
79 QString mLayerName;
80 QgsRasterViewPort *mRasterViewPort = nullptr;
81
82 double mLayerOpacity = 1.0;
83 std::unique_ptr<QgsRasterPipe> mPipe;
84
85 Qgis::RasterProviderCapabilities mProviderCapabilities;
86 Qgis::RasterInterfaceCapabilities mInterfaceCapabilities;
87
89 QgsRasterLayerRendererFeedback *mFeedback = nullptr;
90
91 QList< QgsMapClippingRegion > mClippingRegions;
92
93 double mElevationScale = 1.0;
94 double mElevationOffset = 0.0;
95 int mElevationBand = 0;
96 bool mDrawElevationMap = false;
97
98 bool mEnableProfile = false;
99 quint64 mPreparationTime = 0;
100
101 void drawElevationMap();
102
103 friend class QgsRasterLayerRendererFeedback;
104};
105
106
107#endif // QGSRASTERLAYERRENDERER_H
QFlags< RasterProviderCapability > RasterProviderCapabilities
Raster data provider capabilities.
Definition qgis.h:4542
QFlags< RasterInterfaceCapability > RasterInterfaceCapabilities
Raster interface capabilities.
Definition qgis.h:4509
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition qgsfeedback.h:44
Base class for utility classes that encapsulate information necessary for rendering of map layers.
Perform transforms between map coordinates and device coordinates.
Feedback object tailored for raster block reading.
virtual void onNewData()
May be emitted by raster data provider to indicate that some partial data are available and a new pre...
Implementation of threaded rendering for raster layers.
Represents a raster layer.
Contains a pipeline of raster interfaces for sequential raster processing.
Contains information about the context of a rendering operation.
This class provides details of the viewable area that a raster will be rendered into.