Heightfield 1.0
HeightFieldShader Class Reference

Relief shading class. More...

#include <heightfieldshader.h>

Public Member Functions

 HeightFieldShader (const HeightField &)
 Create a shader.
 ~HeightFieldShader ()
 Empty.
QImage Relief (bool=false) const
 Diffuse lighting with enhanced curvature shaded relief.
QImage ReliefLighting () const
 Create a texture image representing the shaded terrain.
QImage Mitsuba () const
 Create a texture image representing the shaded terrain.
QImage ShadedRelief () const
 Diffuse lighting with enhanced curvature shaded relief.
QImage Eric () const
 Diffuse lighting with enhanced curvature shaded relief.
QImage ImageShadeRadianceScaling (const Color &=Color::White, const Color &=Color(142, 92, 31)) const
 Create a QImage representing the shaded terrain with an irradiance scaling effect with two colors.
ScalarField2 RadianceScaling (const double &, const double &) const
 Create a scalarfield representing the shaded terrain with an irradiance scaling effect.
QImage IsoLines (const QColor &=QColor(80, 60, 60), const QColor &=QColor(40, 20, 20), const double &=100.0, int=4) const
 Create a texture image representing the iso contours of the terrain.
QImage CartographicGreen () const
 Cartographic-like shading with green/yellow colors, using fractional laplacian to emphasize ridges.
QImage CartographicGreenYellow () const
 Cartographic-like shading with green/yellow colors.
QImage RiverWidth (const double &, int) const
 Compute an image representing a river of varying with by using the steepest drainage area.
QImage LaplacianShading (const Palette &, double=1.6, double=0.3) const
 Create a texture image representing the shaded terrain with a Laplacian shading effect.

Detailed Description

Relief shading class.

The texture image representing the shaded terrain for Hugo's 2024 paper:

return LaplacianShading(Palette::HugoShading, 1.6, 0.6);
QImage LaplacianShading(const Palette &, double=1.6, double=0.3) const
Create a texture image representing the shaded terrain with a Laplacian shading effect.
Definition heightfieldshader.cpp:294

Constructor & Destructor Documentation

◆ HeightFieldShader()

HeightFieldShader::HeightFieldShader ( const HeightField & field)
explicit

Create a shader.

Parameters
fieldReference to a heightfield.

Member Function Documentation

◆ CartographicGreen()

QImage HeightFieldShader::CartographicGreen ( ) const

Cartographic-like shading with green/yellow colors, using fractional laplacian to emphasize ridges.

Rivers are detected after a breaching and shaded in blue.

◆ Eric()

QImage HeightFieldShader::Eric ( ) const

Diffuse lighting with enhanced curvature shaded relief.

Create a texture representing the shaded terrain.

◆ IsoLines()

QImage HeightFieldShader::IsoLines ( const QColor & color = QColor(80, 60, 60),
const QColor & bold = QColor(40, 20, 20),
const double & height = 100.0,
int n = 4 ) const

Create a texture image representing the iso contours of the terrain.

Contours are created from the origin elevation.

Parameters
colorColor of the minor iso-lines.
boldColor of the major iso-lines.
heightHeight range between two major iso-lines.
nNumber of minor iso-lines between two major iso-lines.

◆ LaplacianShading()

QImage HeightFieldShader::LaplacianShading ( const Palette & palette,
double gamma = 1.6,
double lapamp = 0.3 ) const

Create a texture image representing the shaded terrain with a Laplacian shading effect.

Parameters
palettePalette used to color the terrain.
gammaGamma correction.
lapampLaplacian enhancement factor
Returns
QImage representing the shaded terrain.

◆ RadianceScaling()

ScalarField2 HeightFieldShader::RadianceScaling ( const double & pos,
const double & factor ) const

Create a scalarfield representing the shaded terrain with an irradiance scaling effect.

Parameters
posis the position of the lights typical range is [0.1-1.0] dir1 = [pos,pos,0.5] dir2 = [-2*pos,-2*pos,0.5]
factorfactor of radiance scaling typical values [0.5,4.0] Returns a normalized scalarfield that can be used to enhance high curvature crests

◆ Relief()

QImage HeightFieldShader::Relief ( bool enhanced = false) const

Diffuse lighting with enhanced curvature shaded relief.

Create a texture representing the shaded terrain.

◆ RiverWidth()

QImage HeightFieldShader::RiverWidth ( const double & t,
int size ) const

Compute an image representing a river of varying with by using the steepest drainage area.

Parameters
tStream area threshold: river will exist only for drainage area above this value.
sizeLargest rive size (in pixels).

◆ ShadedRelief()

QImage HeightFieldShader::ShadedRelief ( ) const

Diffuse lighting with enhanced curvature shaded relief.

Create a texture representing the shaded terrain.