Class TLspLayerStyle

java.lang.Object
com.luciad.view.lightspeed.layer.style.TLspLayerStyle

public final class TLspLayerStyle extends Object
TLspLayerStyle is used to style a layer as a whole contrary to ALspStyle that styles domain objects. Layer styles modify the layer pixels while ALspStyle determine how domain objects are painted.

TLspLayerStyle can do the following post-processing effects on a layer :

  • Modify the opacity of the complete layer.
  • Adjust the brightness and the contrast of each layer pixel.
  • Modify the RGBA components of each layer pixel through a matrix operation, for example transform the color into grey-scale.
  • Map each color to a new one with a TLcdColorLookupTable.

If a instance of TLspLayerStyle has a TLcdColorLookupTable, the color mapping is performed before other effects like the opacity adjustment. The other effects are commutative and they are applied together.

Layer style is a post-processing effects that is applied for every TLspPaintPhase for every layer. Its performance impacts increases when used in 3D and with stereo devices.

TLspLayerStyle can be set to and retrieved from a layer with the methods ILspLayer.setLayerStyle(TLspLayerStyle) and ILspLayer.getLayerStyle().

Since:
2017.0
  • Method Details

    • getOpacity

      public float getOpacity()
      Get the opacity value in the interval [0, 1] (0 means fully transparent, 1 means fully opaque).
      Returns:
      the opacity
    • getModulationColor

      public Color getModulationColor()
      Get the modulation color. The alpha channel of the modulation color is the same as the value from getOpacity().
      Returns:
      the modulation color.
    • getBrightness

      public float getBrightness()
      Get the brightness value in the interval [0, 2]. A value of 1 (the default) leaves the brightness unchanged. A value larger than 1 makes the colors brighter, while a value smaller than 1 makes the colors darker.
      Returns:
      the brightness
    • getContrast

      public float getContrast()
      Get the contrast value in the interval [0, 2]. A value of 1 (the default) leaves the contrast unchanged. A value larger than 1 enhances the contrast of bright colors by making them brighter and dark colors darker.
      Returns:
      the contrast
    • getColorMatrix

      public float[] getColorMatrix()
      Gets the 4x5 color matrix or null if the style doesn't have one. The matrix is specified in row major order and is used to transform the RGBA color of every pixel.
      Returns:
      the color matrix
      See Also:
    • getColorLookupTable

      public TLcdColorLookupTable getColorLookupTable()
      Gets the color lookup table or null if the style doesn't have one. The color look up table is used to map a color to another.
      Returns:
      the color lookup table
      See Also:
    • newBuilder

      public static TLspLayerStyle.Builder newBuilder()
      Creates a new builder with the default values.
      Returns:
      the new builder.
    • asBuilder

      public TLspLayerStyle.Builder asBuilder()
      Creates a new builder initialized with all the properties of this layer style.
      Returns:
      the new builder.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object