public class SimpleShadingAlgorithm extends java.lang.Object implements ShadingAlgorithm
variations can be created by overriding exaggerate(double)
ShadingAlgorithm.RawHillTileSource, ShadingAlgorithm.RawShadingResult| Constructor and Description |
|---|
SimpleShadingAlgorithm() |
SimpleShadingAlgorithm(double linearity,
double scale)
customization constructor for controlling some parameters of the shading formula
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
protected double |
exaggerate(double in)
should calculate values from -128 to +127 using whatever range required (within reason)
|
int |
getAxisLenght(org.mapsforge.map.layer.hills.HgtCache.HgtFileInfo source) |
int |
hashCode() |
java.lang.String |
toString() |
ShadingAlgorithm.RawShadingResult |
transformToByteBuffer(org.mapsforge.map.layer.hills.HgtCache.HgtFileInfo source,
int padding) |
public SimpleShadingAlgorithm()
public SimpleShadingAlgorithm(double linearity,
double scale)
linearity - 1 or higher for linear grade, 0 or lower for a triple-applied
sine of grade that gives high emphasis on changes in slope in
near-flat areas, but reduces details within steep slopes
(default 0.1)scale - scales the input slopes, with lower values slopes will saturate later, but nuances closer to flat will suffer
(default: 0.666d)protected double exaggerate(double in)
in - a grade, ascent per projected distance (along coordinate axis)public int getAxisLenght(org.mapsforge.map.layer.hills.HgtCache.HgtFileInfo source)
getAxisLenght in interface ShadingAlgorithmpublic ShadingAlgorithm.RawShadingResult transformToByteBuffer(org.mapsforge.map.layer.hills.HgtCache.HgtFileInfo source, int padding)
transformToByteBuffer in interface ShadingAlgorithmpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object