From f3bb7ada9a633f48c7bdeb913e672627ea70588c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Mon, 26 Feb 2024 09:10:38 +0100 Subject: [PATCH] Split the alpha and z values --- src/map/hillshading.cpp | 5 ++--- src/map/hillshading.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/map/hillshading.cpp b/src/map/hillshading.cpp index 3e96db72..514417e2 100644 --- a/src/map/hillshading.cpp +++ b/src/map/hillshading.cpp @@ -59,8 +59,8 @@ static void getSubmatrix(int x, int y, const Matrix &m, SubMatrix &sm) sm.z9 = m.m(bottom, right); } -QImage HillShading::render(const Matrix &m, quint8 alpha, double azimuth, - double elevation) +QImage HillShading::render(const Matrix &m, quint8 alpha, double z, + double azimuth, double elevation) { QImage img(m.w() - 2, m.h() - 2, QImage::Format_ARGB32_Premultiplied); uchar *bits = img.bits(); @@ -69,7 +69,6 @@ QImage HillShading::render(const Matrix &m, quint8 alpha, double azimuth, Constants c; SubMatrix sm; Derivatives d; - double z = (double)alpha / 0xFF; getConstants(azimuth, elevation, c); diff --git a/src/map/hillshading.h b/src/map/hillshading.h index 9d84d703..7accd380 100644 --- a/src/map/hillshading.h +++ b/src/map/hillshading.h @@ -7,7 +7,7 @@ class HillShading { public: - static QImage render(const Matrix &m, quint8 alpha = 64, + static QImage render(const Matrix &m, quint8 alpha = 64, double z = 0.3, double azimuth = 315, double elevation = 25); };