QGIS API Documentation 3.41.0-Master (45a0abf3bec)
|
This class can render elevation shading on an image with different methods (eye dome lighting, hillshading, ...). More...
#include <qgselevationshadingrenderer.h>
Public Member Functions | |
QgsElevationShadingRenderer () | |
Qgis::ElevationMapCombineMethod | combinedElevationMethod () const |
Returns the method used when conbining different elevation sources. | |
double | eyeDomeLightingDistance () const |
Returns the distance of the eye dome lighting method, that is the distance where the effect is apply from the source elevation. | |
Qgis::RenderUnit | eyeDomeLightingDistanceUnit () const |
Returns the unit of the distance of the eye dome lighting method returned by eyeDomeLightingDistance(). | |
double | eyeDomeLightingStrength () const |
Returns the strength of the eye dome lighting method. | |
double | hillshadingZFactor () const |
Returns the z factor used by the hill shading method. | |
bool | isActive () const |
Returns whether this shading renderer is active. | |
bool | isActiveEyeDomeLighting () const |
Returns whether eye-dome lighting shading method is active. | |
bool | isActiveHillshading () const |
Returns whether the hillshading is active. | |
bool | isHillshadingMultidirectional () const |
Returns whether the hill shading method is multidirectional. | |
double | lightAltitude () const |
Returns the altitude of the light (degree) that can be used by some methods (e.g. | |
double | lightAzimuth () const |
Returns the azimuth of the light (degree) that can be used by some methods (e.g. | |
void | readXml (const QDomElement &element, const QgsReadWriteContext &context) |
Reads configuration from a DOM element. | |
void | renderShading (const QgsElevationMap &elevation, QImage &image, const QgsRenderContext &context) const |
Render shading on image condidering the elevation map elevation and the renderer context context If elevation map and the image don't have same sizes, nothing happens. | |
void | setActive (bool active) |
Sets whether this shading renderer is active. | |
void | setActiveEyeDomeLighting (bool active) |
Sets active the eye-dome lighting shading method. | |
void | setActiveHillshading (bool active) |
Sets active the hillshading. | |
void | setCombinedElevationMethod (Qgis::ElevationMapCombineMethod method) |
Sets the method used when conbining different elevation sources. | |
void | setEyeDomeLightingDistance (double distance) |
Sets the distance of the eye dome lighting method, that is the distance where the effect is apply from the source elevation. | |
void | setEyeDomeLightingDistanceUnit (Qgis::RenderUnit unit) |
Sets the unit of the distance of the eye dome lighting method set by setEyeDomeLightingDistance(). | |
void | setEyeDomeLightingStrength (double strength) |
Sets the strength of the eye dome lighting method. | |
void | setHillshadingMultidirectional (bool multiDirectional) |
Sets whether the hill shading method is multidirectional. | |
void | setHillshadingZFactor (double zFactor) |
Sets the z factor used by the hill shading method. | |
void | setLightAltitude (double lightAltitude) |
Sets the altitude of the light (degree) that can be used by some methods (e.g. | |
void | setLightAzimuth (double lightAzimuth) |
Sets the azimuth of the light (degree) that can be used by some methods (e.g. | |
void | writeXml (QDomElement &elem, const QgsReadWriteContext &context) const |
Writes configuration on a DOM element. | |
This class can render elevation shading on an image with different methods (eye dome lighting, hillshading, ...).
An instance of this class supports the following settings:
To render shading on image the caller call renderShading() with the image and an elevation map (see QgsElevationMap()) as parameters. The shading is applied on the image in place. Elevation map and image must have same sizes.
Definition at line 47 of file qgselevationshadingrenderer.h.
QgsElevationShadingRenderer::QgsElevationShadingRenderer | ( | ) |
Definition at line 24 of file qgselevationshadingrenderer.cpp.
Qgis::ElevationMapCombineMethod QgsElevationShadingRenderer::combinedElevationMethod | ( | ) | const |
Returns the method used when conbining different elevation sources.
Definition at line 165 of file qgselevationshadingrenderer.cpp.
double QgsElevationShadingRenderer::eyeDomeLightingDistance | ( | ) | const |
Returns the distance of the eye dome lighting method, that is the distance where the effect is apply from the source elevation.
Definition at line 185 of file qgselevationshadingrenderer.cpp.
Qgis::RenderUnit QgsElevationShadingRenderer::eyeDomeLightingDistanceUnit | ( | ) | const |
Returns the unit of the distance of the eye dome lighting method returned by eyeDomeLightingDistance().
Definition at line 175 of file qgselevationshadingrenderer.cpp.
double QgsElevationShadingRenderer::eyeDomeLightingStrength | ( | ) | const |
Returns the strength of the eye dome lighting method.
Definition at line 195 of file qgselevationshadingrenderer.cpp.
double QgsElevationShadingRenderer::hillshadingZFactor | ( | ) | const |
Returns the z factor used by the hill shading method.
Definition at line 70 of file qgselevationshadingrenderer.cpp.
bool QgsElevationShadingRenderer::isActive | ( | ) | const |
Returns whether this shading renderer is active.
Definition at line 45 of file qgselevationshadingrenderer.cpp.
bool QgsElevationShadingRenderer::isActiveEyeDomeLighting | ( | ) | const |
Returns whether eye-dome lighting shading method is active.
Definition at line 55 of file qgselevationshadingrenderer.cpp.
bool QgsElevationShadingRenderer::isActiveHillshading | ( | ) | const |
Returns whether the hillshading is active.
Definition at line 65 of file qgselevationshadingrenderer.cpp.
bool QgsElevationShadingRenderer::isHillshadingMultidirectional | ( | ) | const |
Returns whether the hill shading method is multidirectional.
Definition at line 80 of file qgselevationshadingrenderer.cpp.
double QgsElevationShadingRenderer::lightAltitude | ( | ) | const |
Returns the altitude of the light (degree) that can be used by some methods (e.g.
hill shading).
Definition at line 90 of file qgselevationshadingrenderer.cpp.
double QgsElevationShadingRenderer::lightAzimuth | ( | ) | const |
Returns the azimuth of the light (degree) that can be used by some methods (e.g.
hill shading).
Definition at line 100 of file qgselevationshadingrenderer.cpp.
void QgsElevationShadingRenderer::readXml | ( | const QDomElement & | element, |
const QgsReadWriteContext & | context | ||
) |
Reads configuration from a DOM element.
Definition at line 129 of file qgselevationshadingrenderer.cpp.
void QgsElevationShadingRenderer::renderShading | ( | const QgsElevationMap & | elevation, |
QImage & | image, | ||
const QgsRenderContext & | context | ||
) | const |
Render shading on image condidering the elevation map elevation and the renderer context context If elevation map and the image don't have same sizes, nothing happens.
Definition at line 28 of file qgselevationshadingrenderer.cpp.
void QgsElevationShadingRenderer::setActive | ( | bool | active | ) |
Sets whether this shading renderer is active.
Definition at line 40 of file qgselevationshadingrenderer.cpp.
void QgsElevationShadingRenderer::setActiveEyeDomeLighting | ( | bool | active | ) |
Sets active the eye-dome lighting shading method.
Definition at line 50 of file qgselevationshadingrenderer.cpp.
void QgsElevationShadingRenderer::setActiveHillshading | ( | bool | active | ) |
Sets active the hillshading.
Definition at line 60 of file qgselevationshadingrenderer.cpp.
void QgsElevationShadingRenderer::setCombinedElevationMethod | ( | Qgis::ElevationMapCombineMethod | method | ) |
Sets the method used when conbining different elevation sources.
Definition at line 170 of file qgselevationshadingrenderer.cpp.
void QgsElevationShadingRenderer::setEyeDomeLightingDistance | ( | double | distance | ) |
Sets the distance of the eye dome lighting method, that is the distance where the effect is apply from the source elevation.
Definition at line 190 of file qgselevationshadingrenderer.cpp.
void QgsElevationShadingRenderer::setEyeDomeLightingDistanceUnit | ( | Qgis::RenderUnit | unit | ) |
Sets the unit of the distance of the eye dome lighting method set by setEyeDomeLightingDistance().
Definition at line 180 of file qgselevationshadingrenderer.cpp.
void QgsElevationShadingRenderer::setEyeDomeLightingStrength | ( | double | strength | ) |
Sets the strength of the eye dome lighting method.
Definition at line 200 of file qgselevationshadingrenderer.cpp.
void QgsElevationShadingRenderer::setHillshadingMultidirectional | ( | bool | multiDirectional | ) |
Sets whether the hill shading method is multidirectional.
Definition at line 85 of file qgselevationshadingrenderer.cpp.
void QgsElevationShadingRenderer::setHillshadingZFactor | ( | double | zFactor | ) |
Sets the z factor used by the hill shading method.
Definition at line 75 of file qgselevationshadingrenderer.cpp.
void QgsElevationShadingRenderer::setLightAltitude | ( | double | lightAltitude | ) |
Sets the altitude of the light (degree) that can be used by some methods (e.g.
hill shading).
Definition at line 95 of file qgselevationshadingrenderer.cpp.
void QgsElevationShadingRenderer::setLightAzimuth | ( | double | lightAzimuth | ) |
Sets the azimuth of the light (degree) that can be used by some methods (e.g.
hill shading).
Definition at line 105 of file qgselevationshadingrenderer.cpp.
void QgsElevationShadingRenderer::writeXml | ( | QDomElement & | elem, |
const QgsReadWriteContext & | context | ||
) | const |
Writes configuration on a DOM element.
Definition at line 110 of file qgselevationshadingrenderer.cpp.