1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-27 21:24:47 +01:00

Code cleanup

This commit is contained in:
Martin Tůma 2024-02-21 18:39:21 +01:00
parent 54e185ed4a
commit ed11bbd730

View File

@ -81,18 +81,14 @@ QImage HillShading::render(const Matrix &m, quint8 alpha, double azimuth,
double L = (c.a1 - c.a2 * d.dzdx - c.a3 * d.dzdy)
/ sqrt(1.0 + d.dzdx * d.dzdx + d.dzdy * d.dzdy);
quint8 a, val;
if (std::isnan(L)) {
a = 0;
val = 0;
} else {
if (L < 0)
L = 0;
val = L * alpha;
a = alpha;
quint32 pixel;
if (std::isnan(L))
pixel = 0;
else {
quint8 val = (L < 0) ? 0 : L * alpha;
pixel = alpha<<24 | val<<16 | val<<8 | val;
}
quint32 pixel = a<<24 | val<<16 | val<<8 | val;
*(quint32*)(bits + (y - 1) * bpl + (x - 1) * 4) = pixel;
}
}