forked from LK8000/LK8000
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[LK8000#1142] Fix Terrain Drawing for Altitude lower than 0 and great…
…er than 4095m land surface elevation range of earth are [-428m , 8848m], range of color ramp are [0, 255] currently we clip surface elevation to [0 - 4096], so all elevation bellow 0 are draw like sea (if topology doesn't include coast_area shape) and all elevation higher than 4096 are draw like invalid terrain (LCD Green). for fix this problem : 1 - calculate span of visible elevation 2 - shift elevation by min of this range ( result range is [0 - 9276] ) 3 - scale result to range [0 - 255] for speed reason, scaling is made using bit shift, ( power of 2 scaling factor). of course same algorithm are used for build color ramp.
- Loading branch information
Showing
2 changed files
with
76 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters