[QMS-902] Improve HiDPI Support#1134
Conversation
|
At least on old fashioned, normal screens everything is the same 😄 |
Rewrite CMapTMS::draw from scratch to be maintainable again and correctly handle tiles of different sizes other then 256px (like HiDPI tiles).
|
I now made VRT maps and DEMs load data at physical resolution, till now they used logical which would reduce quality for HiDPI screens.
Rendering of TMS tiles with size != 256px should look different for you as well! Confirmed with setting my screen to 1.0 scale. |
Take HiDPI scaling into account to read at the physical pixel resolution. Previously logical pixels were used resulting in a quality loss of DEM shadings on HiDPI screens.
Those changes have not been tested and were properly wrong.
The same information is available in IDrawContext::buffer_t::image using the devicePixelRatio method.
Same change as to CDemVRT which should behave identical in that regard.
|
Side note: Just noticed that some window sizes result in the VRT code choosing a buffer size 1 pixel smaller than the buffer from the drawing context which will possibly cause a scale at the end: |
Some HiDPI servers reuse a standard TileMatrixSet (e.g. TileWidth=256) while serving larger (e.g. 512px) tiles. Add layer_t::tileScale, learned from the first tile, and divide the candidate pixel span by it during selection so tiles land 1:1 on physical pixels.
|
WMTS should now be working as expected even with problematic servers. With that this PR is ready for review. |
|
Just to note. I notice some compiler warnings in my dev environment. Some already exists quite a while but some are new and seems related to this PR: |
|
@kkarsten62 all preexisting |
What is the linked issue for this pull request:
QMS-#902
What you have done:
Steps to perform a simple smoke test:
Open TMS and WMTS maps with various tile sizes.
Try a DEM and a VRT map.
Does the code comply to the coding rules and naming conventions Coding Guidelines:
Is every user facing string in a tr() macro?
Did you add the ticket number and title into the changelog? Keep the numeric order in each release block.