public static class TLcdColorLookupTable.Builder<B extends TLcdColorLookupTable.Builder<B>> extends Object
2x2x2
pixels with 8-bit color
components, uses linear interpolation and multiplies the opacity from the input and lookup
table color for the final result. The actual filter must be specified as either a ColorFilter
or a pixel buffer
.
For example to create a grey-scale filter:
TLcdColorLookupTable table = TLcdColorLookupTable.newBuilder().
filter(
new ILcdColorFilter() {
public void apply( float[] aRGBColorSFCT ) {
float lum = 0.2126f * aRGBColorSFCT[ 0 ] + 0.7152f * aRGBColorSFCT[ 1 ] + 0.0722f * aRGBColorSFCT[ 2 ];
aRGBColorSFCT[ 0 ] = aRGBColorSFCT[ 1 ] = aRGBColorSFCT[ 2 ] = lum;
}
}
).
build();
Modifier and Type | Method and Description |
---|---|
B |
alphaMode(TLcdColorLookupTable.AlphaMode aAlphaMode)
Sets the mode use for the alpha channel.
|
TLcdColorLookupTable |
build()
Builds the color lookup table.
|
B |
componentType(TLcdLookupTable.ComponentType aComponentType)
Sets the type of the table's color components.
|
B |
filter(Buffer aPixelData)
Sets the table's entries directly from a buffer.
|
B |
filter(ILcdColorFilter aColorFilter)
Sets the table's entries from a color filter.
|
B |
interpolation(ELcdInterpolationType aInterpolationType)
Sets the interpolation type between table pixels.
|
B |
size(int aWidth,
int aHeight,
int aDepth)
Sets the size of the table.
|
public B size(int aWidth, int aHeight, int aDepth)
2x2x2
for a linear filter16x16x16
for a non-linear filter256x1x1
for a filter that only changes the red color channelaWidth
- the width of the tableaHeight
- the height of the tableaDepth
- the depth of the tablepublic B componentType(TLcdLookupTable.ComponentType aComponentType)
aComponentType
- the component typepublic B interpolation(ELcdInterpolationType aInterpolationType)
NONE
and LINEAR
are currently supported.aInterpolationType
- the interpolation typepublic B alphaMode(TLcdColorLookupTable.AlphaMode aAlphaMode)
aAlphaMode
- the alpha modepublic B filter(ILcdColorFilter aColorFilter)
aColorFilter
- the color filterpublic B filter(Buffer aPixelData)
size
and component type
.
Each table entry has 4 components. See TLcdColorLookupTable
and TLcdLookupTable
for details.aPixelData
- the pixel bufferpublic TLcdColorLookupTable build()