1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-06-27 19:49:15 +02:00

Added hillshading settings

This commit is contained in:
2024-05-26 11:19:19 +02:00
parent feabd6668b
commit 11b9f842e5
9 changed files with 140 additions and 20 deletions

View File

@ -29,8 +29,6 @@ using namespace IMG;
#define ROAD 0
#define WATER 1
#define BLUR_RADIUS 3
static const QColor textColor(Qt::black);
static const QColor haloColor(Qt::white);
static const QColor shieldColor(Qt::white);
@ -498,9 +496,14 @@ MatrixD RasterTile::elevation(int extend) const
void RasterTile::drawHillShading(QPainter *painter) const
{
if (_hillShading && _zoom >= 18 && _zoom <= 24) {
MatrixD dem(Filter::blur(elevation(BLUR_RADIUS + 1), BLUR_RADIUS));
QImage img(HillShading::render(dem, BLUR_RADIUS + 1));
painter->drawImage(_rect.x(), _rect.y(), img);
if (HillShading::blur()) {
MatrixD dem(Filter::blur(elevation(HillShading::blur() + 1),
HillShading::blur()));
QImage img(HillShading::render(dem, HillShading::blur() + 1));
painter->drawImage(_rect.x(), _rect.y(), img);
} else
painter->drawImage(_rect.x(), _rect.y(),
HillShading::render(elevation(1), 1));
}
}