Class TLspLayerStyle.Builder

java.lang.Object
com.luciad.view.lightspeed.layer.style.TLspLayerStyle.Builder
Enclosing class:
TLspLayerStyle

public static final class TLspLayerStyle.Builder extends Object
Builder for TLspLayerStyle.
Since:
2017.0
  • Method Details

    • all

      public TLspLayerStyle.Builder all(TLspLayerStyle aLayerStyle)
      Sets all parameters on the builder based on the given layer style.
      Parameters:
      aLayerStyle - aLayerStyle to copy
      Returns:
      this
    • opacity

      public TLspLayerStyle.Builder opacity(float aOpacity)
      Sets the opacity (alpha) for a layer in its whole. The alpha value must be contained in the interval [0, 1] interval (0 means fully transparent, 1 means fully opaque). If the value is outside the range, the value is clamped. By default, the opacity value is 1. Note that a call to modulationColor(Color) will override the opacity set to this builder.
      Parameters:
      aOpacity - the opacity
      Returns:
      this
    • modulationColor

      public TLspLayerStyle.Builder modulationColor(Color aColor)
      Sets the color that is modulated with the layer. For example using an layer with gray-scale colors and a red modulation color will result in a resulting painted layer with red hues.

      Color white leaves the layer intact. The parameter color alpha channel override the opacity set to this builder

      Parameters:
      aColor - the modulation color
      Returns:
      this
    • contrast

      public TLspLayerStyle.Builder contrast(float aContrast)
      Sets the contrast for a layer in its whole. The contrast value must be contained 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. If the value is outside the range, the value is clamped.
      Parameters:
      aContrast - the opacity
      Returns:
      this
    • brightness

      public TLspLayerStyle.Builder brightness(float aBrightness)
      Sets the brightness for a layer in its whole. The brightness value must be contained 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. If the value is outside the range, the value is clamped.
      Parameters:
      aBrightness - the opacity
      Returns:
      this
    • colorMatrix

      public TLspLayerStyle.Builder colorMatrix(float[] aColorMatrix)
      Sets the 4x5 matrix of the color transformation. The matrix is specified in row major order and can be seen as follows:
       [a, b, c, d, e, 
      f, g, h, i, j,
      k, l, m, n, o,
      p, q, r, s, t ].
      The matrix is used to transform the RGBA color channel of every pixel, the resulting color is computed as:
       R' = a*R + b*G + c*B + d*A + e;
      G' = f*R + g*G + h*B + i*A + j;
      B' = k*R + l*G + m*B + n*A + o;
      A' = p*R + q*G + r*B + s*A + t;
      in which the color components are represented as floating point numbers in [0,1].

      For example, transforming RGB color to grey-scale with the following formula : 0.21 R + 0.72 G + 0.07 B can be done with this matrix :

       [ 0.21, 0.72, 0.07, 0.0, 0.0, 
      0.21, 0.72, 0.07, 0.0, 0.0,
      0.21, 0.72, 0.07, 0.0, 0.0,
      0.00, 0.00, 0.00, 1.0, 0.0].

      By default, the matrix is null.

      Parameters:
      aColorMatrix - a float array of length 20
      Returns:
      this
    • colorLookupTable

      public TLspLayerStyle.Builder colorLookupTable(TLcdColorLookupTable aLookupTable)
      Set the color lookup table to perform color mapping. By default, the lookup table is null and there is no color mapping.
      Parameters:
      aLookupTable - the lookup table
      Returns:
      this
    • build

      public TLspLayerStyle build()
      Builds the layer style with the set parameters.
      Returns:
      the resulting layer style
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object