Package com.massifmaps.components
Class LightStop
java.lang.Object
com.massifmaps.components.LightStop
One point on a day-cycle light curve: the scene light at a given sun height.
A list of these IS the "formula" that turns an hour into a look. Everything downstream is
derived from the two lights it names - the colour every 2D surface is graded by, the sun and
ambient the 3D buildings and the terrain are lit with, and the brightness a style reads as
`view::brightness` - so replacing the list replaces the whole map's palette at every hour,
in 2D and in 3D, without a second theme and without a re-decode.
The default list is MapBox Standard's own four light setups, which is why a converted
Standard renders as its `day` preset at noon and its `dusk` preset at 19h.
A list of these IS the "formula" that turns an hour into a look. Everything downstream is
derived from the two lights it names - the colour every 2D surface is graded by, the sun and
ambient the 3D buildings and the terrain are lit with, and the brightness a style reads as
`view::brightness` - so replacing the list replaces the whole map's palette at every hour,
in 2D and in 3D, without a second theme and without a re-decode.
The default list is MapBox Standard's own four light setups, which is why a converted
Standard renders as its `day` preset at noon and its `dusk` preset at 19h.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if this object is equal to the specified object.Returns the ambient colour.floatReturns the ambient intensity.floatReturns the sun height this light belongs to.Returns the directional colour.floatReturns the directional intensity.inthashCode()Returns the hash value of this object.toString()Creates a string representation of this light stop, useful for logging.
-
Constructor Details
-
LightStop
public LightStop()Constructs an empty LightStop, a white light at the horizon. -
LightStop
public LightStop(float sunAltitude, Color ambientColor, float ambientIntensity, Color sunColor, float sunIntensity) Constructs a LightStop.- Parameters:
sunAltitude- The sun height this light belongs to, in degrees above the horizon.ambientColor- The ambient (sky) colour.ambientIntensity- The ambient intensity, 0-1.sunColor- The directional (sun) colour.sunIntensity- The directional intensity, 0-1.
-
-
Method Details
-
equals
Checks if this object is equal to the specified object. -
hashCode
public int hashCode()Returns the hash value of this object. -
getSunAltitude
public float getSunAltitude()Returns the sun height this light belongs to.- Returns:
- The sun height, in degrees above the horizon.
-
getAmbientColor
Returns the ambient colour.- Returns:
- The ambient colour.
-
getAmbientIntensity
public float getAmbientIntensity()Returns the ambient intensity.- Returns:
- The ambient intensity, 0-1.
-
getSunColor
Returns the directional colour.- Returns:
- The directional colour.
-
getSunIntensity
public float getSunIntensity()Returns the directional intensity.- Returns:
- The directional intensity, 0-1.
-
toString
Creates a string representation of this light stop, useful for logging.
-