1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-02-20 09:40:49 +01:00

Compare commits

..

No commits in common. "6803ee0324275407e1b061791542c6b7d789ddd9" and "c4d07b5f126dc91673e7366424134826a5f51418" have entirely different histories.

4 changed files with 24 additions and 28 deletions

View File

@ -174,7 +174,7 @@ SETTING(markerInfo, "markerInfo", MarkerInfoItem::None );
SETTING(useStyles, "styles", true ); SETTING(useStyles, "styles", true );
/* DEM */ /* DEM */
SETTING(drawHillShading, "hillshading", true ); SETTING(drawHillShading, "hillshading", false );
/* Position */ /* Position */
SETTING(showPosition, "show", false ); SETTING(showPosition, "show", false );

View File

@ -129,17 +129,16 @@ bool JLS::readLine(BitStream &bs)
quint8 k; quint8 k;
uint MErrval; uint MErrval;
int Errval; int Errval;
int Rx; int Rx = _last[1];
int Ra = _last[1]; int last0 = _last[0];
int Rb = _last[1]; int last1 = _last[1];
int Rc = _last[0];
uint col = 1; uint col = 1;
*_current = _last[1]; *_current = _last[1];
do { do {
if (abs(Rb - Ra) > _near) { if (abs(last1 - Rx) > _near) {
int Px = Ra + Rb - Rc; int Px = Rx + last1 - last0;
if (Px < 0) if (Px < 0)
Px = 0; Px = 0;
else if (Px > _maxval) else if (Px > _maxval)
@ -167,7 +166,7 @@ bool JLS::readLine(BitStream &bs)
} else } else
mes = mes * (_near * 2 + 1); mes = mes * (_near * 2 + 1);
Errval = (Ra < Rb) ? mes : -mes; Errval = (Rx < last1) ? mes : -mes;
Rx = Px + Errval; Rx = Px + Errval;
if (Rx < -_near) if (Rx < -_near)
@ -197,8 +196,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]);
Rc = Rb; last0 = last1;
Rb = _last[col + 1]; last1 = _last[col + 1];
} else { } else {
quint16 samples; quint16 samples;
if (!processRunMode(bs, _w - col + 1, samples)) if (!processRunMode(bs, _w - col + 1, samples))
@ -208,21 +207,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] = Ra; _current[col] = Rx;
col++; col++;
} }
if (col > _w) if (col > _w)
break; break;
Rc = _last[col]; last0 = _last[col];
Rb = _last[col + 1]; last1 = _last[col + 1];
} else { } else {
Rc = Rb; last0 = last1;
Rb = _last[col + 1]; last1 = _last[col + 1];
} }
rctx = (abs(Rc - Ra) <= _near); rctx = (abs(last0 - Rx) <= _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;
@ -250,15 +249,15 @@ bool JLS::readLine(BitStream &bs)
Errval *= (_near * 2 + 1); Errval *= (_near * 2 + 1);
if (!rctx) { if (!rctx) {
if (Ra == Rc) if (Rx == last0)
return false; return false;
if (Ra < Rc) if (Rx < last0)
Rx = Rc + Errval; Rx = last0 + Errval;
else else
Rx = Rc - Errval; Rx = last0 - Errval;
} else } else
Rx = Ra + Errval; Rx = Rx + Errval;
if (Rx < -_near) if (Rx < -_near)
Rx += (_near * 2 + 1) * _range; Rx += (_near * 2 + 1) * _range;
@ -280,8 +279,6 @@ 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);

View File

@ -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 + 1), BLUR_RADIUS)); MatrixD dem(Filter::blur(elevation(BLUR_RADIUS), BLUR_RADIUS));
QImage img(HillShading::render(dem, BLUR_RADIUS + 1)); QImage img(HillShading::render(dem, BLUR_RADIUS));
painter->drawImage(_rect.x(), _rect.y(), img); painter->drawImage(_rect.x(), _rect.y(), img);
} }
} }

View File

@ -442,9 +442,8 @@ 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 + 1), MatrixD dem(Filter::blur(elevation(BLUR_RADIUS), BLUR_RADIUS));
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);
} }
} }