public static final class TLspLayerStyle.Builder extends Object
TLspLayerStyle
.Modifier and Type | Method and Description |
---|---|
TLspLayerStyle.Builder |
all(TLspLayerStyle aLayerStyle)
Sets all parameters on the builder based on the given layer style.
|
TLspLayerStyle.Builder |
brightness(float aBrightness)
Sets the brightness for a layer in its whole.
|
TLspLayerStyle |
build()
Builds the layer style with the set parameters.
|
TLspLayerStyle.Builder |
colorLookupTable(TLcdColorLookupTable aLookupTable)
Set the color lookup table to perform color mapping.
|
TLspLayerStyle.Builder |
colorMatrix(float[] aColorMatrix)
Sets the 4x5 matrix of the color transformation.
|
TLspLayerStyle.Builder |
contrast(float aContrast)
Sets the contrast for a layer in its whole.
|
boolean |
equals(Object obj) |
int |
hashCode() |
TLspLayerStyle.Builder |
modulationColor(Color aColor)
Sets the color that is modulated with the layer.
|
TLspLayerStyle.Builder |
opacity(float aOpacity)
Sets the opacity (alpha) for a layer in its whole.
|
public TLspLayerStyle.Builder all(TLspLayerStyle aLayerStyle)
aLayerStyle
- aLayerStyle to copythis
public TLspLayerStyle.Builder opacity(float aOpacity)
modulationColor(Color)
will override the opacity set to this builder.aOpacity
- the opacitythis
public TLspLayerStyle.Builder modulationColor(Color aColor)
Color white leaves the layer intact. The parameter color alpha channel override the opacity set to this builder
aColor
- the modulation colorthis
public TLspLayerStyle.Builder contrast(float aContrast)
aContrast
- the opacitythis
public TLspLayerStyle.Builder brightness(float aBrightness)
aBrightness
- the opacitythis
public TLspLayerStyle.Builder colorMatrix(float[] aColorMatrix)
[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
.
aColorMatrix
- a float array of length 20this
public TLspLayerStyle.Builder colorLookupTable(TLcdColorLookupTable aLookupTable)
null
and there is no color mapping.aLookupTable
- the lookup tablethis
public TLspLayerStyle build()