mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-24 03:35:53 +01:00
Compare commits
3 Commits
c4d07b5f12
...
6803ee0324
Author | SHA1 | Date | |
---|---|---|---|
6803ee0324 | |||
43271d9ff8 | |||
6bd83780cd |
@ -174,7 +174,7 @@ SETTING(markerInfo, "markerInfo", MarkerInfoItem::None );
|
|||||||
SETTING(useStyles, "styles", true );
|
SETTING(useStyles, "styles", true );
|
||||||
|
|
||||||
/* DEM */
|
/* DEM */
|
||||||
SETTING(drawHillShading, "hillshading", false );
|
SETTING(drawHillShading, "hillshading", true );
|
||||||
|
|
||||||
/* Position */
|
/* Position */
|
||||||
SETTING(showPosition, "show", false );
|
SETTING(showPosition, "show", false );
|
||||||
|
@ -129,16 +129,17 @@ bool JLS::readLine(BitStream &bs)
|
|||||||
quint8 k;
|
quint8 k;
|
||||||
uint MErrval;
|
uint MErrval;
|
||||||
int Errval;
|
int Errval;
|
||||||
int Rx = _last[1];
|
int Rx;
|
||||||
int last0 = _last[0];
|
int Ra = _last[1];
|
||||||
int last1 = _last[1];
|
int Rb = _last[1];
|
||||||
|
int Rc = _last[0];
|
||||||
uint col = 1;
|
uint col = 1;
|
||||||
|
|
||||||
*_current = _last[1];
|
*_current = _last[1];
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (abs(last1 - Rx) > _near) {
|
if (abs(Rb - Ra) > _near) {
|
||||||
int Px = Rx + last1 - last0;
|
int Px = Ra + Rb - Rc;
|
||||||
if (Px < 0)
|
if (Px < 0)
|
||||||
Px = 0;
|
Px = 0;
|
||||||
else if (Px > _maxval)
|
else if (Px > _maxval)
|
||||||
@ -166,7 +167,7 @@ bool JLS::readLine(BitStream &bs)
|
|||||||
} else
|
} else
|
||||||
mes = mes * (_near * 2 + 1);
|
mes = mes * (_near * 2 + 1);
|
||||||
|
|
||||||
Errval = (Rx < last1) ? mes : -mes;
|
Errval = (Ra < Rb) ? mes : -mes;
|
||||||
Rx = Px + Errval;
|
Rx = Px + Errval;
|
||||||
|
|
||||||
if (Rx < -_near)
|
if (Rx < -_near)
|
||||||
@ -196,8 +197,8 @@ bool JLS::readLine(BitStream &bs)
|
|||||||
} else if (_b[1] > 0)
|
} else if (_b[1] > 0)
|
||||||
_b[1] = ((_b[1] - _n[1]) >> 0xf) & (_b[1] - _n[1]);
|
_b[1] = ((_b[1] - _n[1]) >> 0xf) & (_b[1] - _n[1]);
|
||||||
|
|
||||||
last0 = last1;
|
Rc = Rb;
|
||||||
last1 = _last[col + 1];
|
Rb = _last[col + 1];
|
||||||
} else {
|
} else {
|
||||||
quint16 samples;
|
quint16 samples;
|
||||||
if (!processRunMode(bs, _w - col + 1, samples))
|
if (!processRunMode(bs, _w - col + 1, samples))
|
||||||
@ -207,21 +208,21 @@ bool JLS::readLine(BitStream &bs)
|
|||||||
for (int i = 0; i < samples; i++) {
|
for (int i = 0; i < samples; i++) {
|
||||||
if (col > _w)
|
if (col > _w)
|
||||||
return false;
|
return false;
|
||||||
_current[col] = Rx;
|
_current[col] = Ra;
|
||||||
col++;
|
col++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (col > _w)
|
if (col > _w)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
last0 = _last[col];
|
Rc = _last[col];
|
||||||
last1 = _last[col + 1];
|
Rb = _last[col + 1];
|
||||||
} else {
|
} else {
|
||||||
last0 = last1;
|
Rc = Rb;
|
||||||
last1 = _last[col + 1];
|
Rb = _last[col + 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
rctx = (abs(last0 - Rx) <= _near);
|
rctx = (abs(Rc - Ra) <= _near);
|
||||||
quint16 TEMP = _a[rctx + 2];
|
quint16 TEMP = _a[rctx + 2];
|
||||||
if (rctx)
|
if (rctx)
|
||||||
TEMP += _n[rctx + 2] >> 1;
|
TEMP += _n[rctx + 2] >> 1;
|
||||||
@ -249,15 +250,15 @@ bool JLS::readLine(BitStream &bs)
|
|||||||
|
|
||||||
Errval *= (_near * 2 + 1);
|
Errval *= (_near * 2 + 1);
|
||||||
if (!rctx) {
|
if (!rctx) {
|
||||||
if (Rx == last0)
|
if (Ra == Rc)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (Rx < last0)
|
if (Ra < Rc)
|
||||||
Rx = last0 + Errval;
|
Rx = Rc + Errval;
|
||||||
else
|
else
|
||||||
Rx = last0 - Errval;
|
Rx = Rc - Errval;
|
||||||
} else
|
} else
|
||||||
Rx = Rx + Errval;
|
Rx = Ra + Errval;
|
||||||
|
|
||||||
if (Rx < -_near)
|
if (Rx < -_near)
|
||||||
Rx += (_near * 2 + 1) * _range;
|
Rx += (_near * 2 + 1) * _range;
|
||||||
@ -279,6 +280,8 @@ bool JLS::readLine(BitStream &bs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
_current[col] = Rx;
|
_current[col] = Rx;
|
||||||
|
|
||||||
|
Ra = Rx;
|
||||||
col = col + 1;
|
col = col + 1;
|
||||||
} while (col <= _w);
|
} while (col <= _w);
|
||||||
|
|
||||||
|
@ -500,8 +500,8 @@ MatrixD RasterTile::elevation(int extend) const
|
|||||||
void RasterTile::drawHillShading(QPainter *painter) const
|
void RasterTile::drawHillShading(QPainter *painter) const
|
||||||
{
|
{
|
||||||
if (_hillShading && _zoom >= 18 && _zoom <= 24) {
|
if (_hillShading && _zoom >= 18 && _zoom <= 24) {
|
||||||
MatrixD dem(Filter::blur(elevation(BLUR_RADIUS), BLUR_RADIUS));
|
MatrixD dem(Filter::blur(elevation(BLUR_RADIUS + 1), BLUR_RADIUS));
|
||||||
QImage img(HillShading::render(dem, BLUR_RADIUS));
|
QImage img(HillShading::render(dem, BLUR_RADIUS + 1));
|
||||||
painter->drawImage(_rect.x(), _rect.y(), img);
|
painter->drawImage(_rect.x(), _rect.y(), img);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -442,8 +442,9 @@ void RasterTile::drawPaths(QPainter *painter, const QList<MapData::Path> &paths,
|
|||||||
painter->drawEllipse(ll2xy(point->coordinates), radius, radius);
|
painter->drawEllipse(ll2xy(point->coordinates), radius, radius);
|
||||||
} else {
|
} else {
|
||||||
if (_hillShading) {
|
if (_hillShading) {
|
||||||
MatrixD dem(Filter::blur(elevation(BLUR_RADIUS), BLUR_RADIUS));
|
MatrixD dem(Filter::blur(elevation(BLUR_RADIUS + 1),
|
||||||
QImage img(HillShading::render(dem, BLUR_RADIUS));
|
BLUR_RADIUS));
|
||||||
|
QImage img(HillShading::render(dem, BLUR_RADIUS + 1));
|
||||||
painter->drawImage(_rect.x(), _rect.y(), img);
|
painter->drawImage(_rect.x(), _rect.y(), img);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user