Class DiffuseLightShadingAlgorithm

  • All Implemented Interfaces:
    ShadingAlgorithm

    public class DiffuseLightShadingAlgorithm
    extends AbsShadingAlgorithmDefaults
    simulates diffuse lighting (without self-shadowing) except for scaling the light values below horizontal and above horizontal differently so that both make full use of the available dynamic range while maintinging horizontal neutral identical to SimpleShadingAlgorithm and to the standard neutral value that is filled in when there is no hillshading but the always-option is set to true in the theme.

    More accurate than SimpleShadingAlgorithm, but maybe not as useful for visualizing both softly rolling hills and dramatic mountain ranges at the same time.

    • Constructor Detail

      • DiffuseLightShadingAlgorithm

        public DiffuseLightShadingAlgorithm()
      • DiffuseLightShadingAlgorithm

        public DiffuseLightShadingAlgorithm​(float heightAngle)
        height angle of light source over ground (in degrees 0..90)
    • Method Detail

      • getLightHeight

        public double getLightHeight()
      • getAxisLenght

        public int getAxisLenght​(org.mapsforge.map.layer.hills.HgtCache.HgtFileInfo source)
      • convert

        protected byte[] convert​(java.nio.ByteBuffer din,
                                 int axisLength,
                                 int rowLen,
                                 int padding,
                                 org.mapsforge.map.layer.hills.HgtCache.HgtFileInfo fileInfo)
                          throws java.io.IOException
        Specified by:
        convert in class AbsShadingAlgorithmDefaults
        Throws:
        java.io.IOException
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object