QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
qgselevationmap.h
Go to the documentation of this file.
1/***************************************************************************
2 qgselevationmap.h
3 --------------------------------------
4 Date : August 2022
5 Copyright : (C) 2022 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 QGSELEVATIONMAP_H
17#define QGSELEVATIONMAP_H
18
19#include "qgis.h"
20#include "qgis_sip.h"
21
22#include <QImage>
23#include <memory>
24
25class QgsRasterBlock;
26
42class CORE_EXPORT QgsElevationMap
43{
44 public:
46 explicit QgsElevationMap( const QSize &size );
47
63 void applyEyeDomeLighting( QImage &img, int distance, float strength, float rendererScale );
64
66 QImage rawElevationImage() const { return mElevationImage; }
67
69 QPainter *painter() const { return mPainter.get(); }
70
72 static QRgb encodeElevation( float z );
74 static float decodeElevation( QRgb colorRaw );
75
77 static std::unique_ptr<QgsElevationMap> fromRasterBlock( QgsRasterBlock *block ) SIP_SKIP;
78
79 private:
80
81#ifdef SIP_RUN
83#endif
84
85 Q_DISABLE_COPY( QgsElevationMap )
86
87 QImage mElevationImage;
88 std::unique_ptr<QPainter> mPainter;
89};
90
91#endif // QGSELEVATIONMAP_H
Stores digital elevation model in a raster image which may get updated as a part of map layer renderi...
QPainter * painter() const
Returns painter to the underlying QImage with elevations.
QImage rawElevationImage() const
Returns raw elevation image with elevations encoded as color values.
Raster data container.
#define SIP_SKIP
Definition: qgis_sip.h:126