Class TLspLayerStyle.Builder
java.lang.Object
com.luciad.view.lightspeed.layer.style.TLspLayerStyle.Builder
- Enclosing class:
TLspLayerStyle
Builder for
TLspLayerStyle
.- Since:
- 2017.0
-
Method Summary
Modifier and TypeMethodDescriptionall
(TLspLayerStyle aLayerStyle) Sets all parameters on the builder based on the given layer style.brightness
(float aBrightness) Sets the brightness for a layer in its whole.build()
Builds the layer style with the set parameters.colorLookupTable
(TLcdColorLookupTable aLookupTable) Set the color lookup table to perform color mapping.colorMatrix
(float[] aColorMatrix) Sets the 4x5 matrix of the color transformation.contrast
(float aContrast) Sets the contrast for a layer in its whole.boolean
int
hashCode()
modulationColor
(Color aColor) Sets the color that is modulated with the layer.opacity
(float aOpacity) Sets the opacity (alpha) for a layer in its whole.
-
Method Details
-
all
Sets all parameters on the builder based on the given layer style.- Parameters:
aLayerStyle
- aLayerStyle to copy- Returns:
this
-
opacity
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 tomodulationColor(Color)
will override the opacity set to this builder.- Parameters:
aOpacity
- the opacity- Returns:
this
-
modulationColor
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
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
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
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,
The matrix is used to transform the RGBA color channel of every pixel, the resulting color is computed as:
f, g, h, i, j,
k, l, m, n, o,
p, q, r, s, t ].
R' = a*R + b*G + c*B + d*A + e;
in which the color components are represented as floating point numbers in
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;
[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
Set the color lookup table to perform color mapping. By default, the lookup table isnull
and there is no color mapping.- Parameters:
aLookupTable
- the lookup table- Returns:
this
-
build
Builds the layer style with the set parameters.- Returns:
- the resulting layer style
-
equals
-
hashCode
public int hashCode()
-