QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
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"
24
25class QPainter;
26
27class QgsMapToPixel;
28class QgsRasterLayer;
29class QgsRasterPipe;
32
34
35#include "qgsrasterinterface.h"
36
38
45class CORE_EXPORT QgsRasterLayerRendererFeedback : public QgsRasterBlockFeedback
46{
47 Q_OBJECT
48
49 public:
51 explicit QgsRasterLayerRendererFeedback( QgsRasterLayerRenderer *r );
52
54 void onNewData() override;
55 private:
56 QgsRasterLayerRenderer *mR = nullptr;
57 int mMinimalPreviewInterval;
58 QTime mLastPreview;
59};
60
62
71{
72 public:
73 QgsRasterLayerRenderer( QgsRasterLayer *layer, QgsRenderContext &rendererContext );
74 ~QgsRasterLayerRenderer() override;
75
76 bool render() override;
77 QgsFeedback *feedback() const override;
78 bool forceRasterRender() const override;
79
80 private:
81
82 QString mLayerName;
83 QgsRasterViewPort *mRasterViewPort = nullptr;
84
85 double mLayerOpacity = 1.0;
86 std::unique_ptr<QgsRasterPipe> mPipe;
87
88 QgsRasterDataProvider::Capability mProviderCapabilities;
89
91 QgsRasterLayerRendererFeedback *mFeedback = nullptr;
92
93 QList< QgsMapClippingRegion > mClippingRegions;
94
95 double mElevationScale = 1.0;
96 double mElevationOffset = 0.0;
97 int mElevationBand = 0;
98 bool mDrawElevationMap = false;
99
100 bool mEnableProfile = false;
101 quint64 mPreparationTime = 0;
102
103 void drawElevationMap();
104
105 friend class QgsRasterLayerRendererFeedback;
106};
107
108
109#endif // QGSRASTERLAYERRENDERER_H
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition qgsfeedback.h:45
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...
Capability
If you add to this, please also add to capabilitiesString()
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.