File: qgselevationmap.sip.in

package info (click to toggle)
qgis 3.40.11%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,183,800 kB
  • sloc: cpp: 1,595,841; python: 372,637; xml: 23,474; sh: 3,761; perl: 3,664; ansic: 2,257; sql: 2,137; yacc: 1,068; lex: 577; javascript: 540; lisp: 411; makefile: 154
file content (156 lines) | stat: -rw-r--r-- 5,196 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/qgselevationmap.h                                           *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/





class QgsElevationMap
{
%Docstring(signature="appended")
Stores digital elevation model in a raster image which may get updated
as a part of map layer rendering process.

Afterwards the elevations can be used for post-processing effects of the
rendered color map image.

Elevations are encoded as colors in QImage, thanks to this it is not
only possible to set elevation for each pixel, but also to use QPainter
for more complex updates of elevations. We encode elevations to 24 bits
in range of [-7900, 8877] with precision of three decimal digits, which
should give millimiter precision and enough range for elevation values
in meters.

.. versionadded:: 3.28
%End

%TypeHeaderCode
#include "qgselevationmap.h"
%End
  public:

    QgsElevationMap();

    explicit QgsElevationMap( const QSize &size, float devicePixelRatio = 1.0 );
%Docstring
Constructs an elevation map with the given width and height
%End

    explicit QgsElevationMap( const QImage &image );
%Docstring
Constructs an elevation map from an existing raw elevation ``image``.
The image must have ARGB32 format and obtained by the
:py:func:`~QgsElevationMap.rawElevationImage` method.

.. seealso:: :py:func:`rawElevationImage`

.. versionadded:: 3.30
%End

    QgsElevationMap( const QgsElevationMap &other );

    void applyEyeDomeLighting( QImage &image, int distance, float strength, float rendererScale ) const;
%Docstring
Applies eye dome lighting effect to the given ``image``. The effect
makes angled surfaces darker and adds silhouettes in case of larger
differences of elevations between neighboring pixels.

The ``distance`` parameter tells how many pixels away from the original
pixel to sample neighboring pixels. Normally distance of 2 pixels gives
good results.

The ``strength`` parameter adjusts how strong the added shading will be.
Good default for this value seems to be 1000.

The ``rendererScale`` parameter adjusts scale of elevation values. It is
recommended to set this to the map's scale denominator to get similarly
looking results at different map scales.
%End

    void applyHillshading( QImage &image, bool multiDirectional, double altitude, double azimuth, double zFactor, double cellSizeX, double cellSizeY ) const;
%Docstring
Applies hill shading effect to the given ``image``.

If the ``multidirectinal`` parameter is ``True``, the algorithm will
considered a multi horizontal directional light to apply the shading.

The parameter ``altitude`` (could also be named zenith) is the vertical
direction of the light.

The parameter ``azimuth`` is the horizontal direction of the light
considered if ``multidirectional`` is ``False``.

The parameter ``zFactor`` is the vertical exageration of the terrain.

The parameters ``cellSizeX`` and ``cellSizeY`` are the sizes of the
elevation map cells in unit consistent with the unit of the encoded
elevation in this elevation map.

.. versionadded:: 3.30
%End

    QImage rawElevationImage() const;
%Docstring
Returns raw elevation image with elevations encoded as color values
%End


    QPainter *painter() const;
%Docstring
Returns painter to the underlying QImage with elevations
%End

    void combine( const QgsElevationMap &otherElevationMap, Qgis::ElevationMapCombineMethod method );
%Docstring
Combines this elevation map with ``otherElevationMap``. This elevation
map keeps its size and takes elevation values of otherElevationMap that
is not null for same row and column following the combine ``method``.
The other elevation map can have a different size, only rows and columns
contained in this elevation map will be considered.

.. versionadded:: 3.30
%End


    bool isValid() const;
%Docstring
Returns whether the elevation map is valid.

.. versionadded:: 3.30
%End

    static QRgb encodeElevation( float z );
%Docstring
Converts elevation value to an actual color
%End
    static float decodeElevation( QRgb colorRaw );
%Docstring
Converts a color back to elevation value
%End


    bool isNoData( QRgb colorRaw ) const;
%Docstring
Returns whether the encoded value is a no data value
%End

    float noDataValue() const;
%Docstring
Returns the no data value for the elevation map
%End


};

/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/qgselevationmap.h                                           *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/