public abstract static class MicroUIDisplay.AbstractDisplayExtension
extends java.lang.Object
DisplayExtension
specifies the configuration of the
simulated display.Constructor and Description |
---|
AbstractDisplayExtension()
Must have a no-arg constructor.
|
Modifier and Type | Method and Description |
---|---|
abstract int |
convertARGBColorToDisplayColor(int argbColor)
Converts a ARGB color into a display color format.
|
abstract int |
convertDisplayColorToARGBColor(int displayColor)
Converts a display color into an ARGB color format.
|
boolean |
isColor()
Returns whether the display provides color.
|
boolean |
isDoubleBuffered()
Returns whether the display uses an underlying double buffer (either hardware or software).
|
int |
numberOfColors()
Gets the number of colors that can be represented on the device.
|
boolean |
prepareBlendingOfIndexedColors(java.util.concurrent.atomic.AtomicInteger foreground,
java.util.concurrent.atomic.AtomicInteger background)
Prepare the blending of two ARGB colors.
|
public AbstractDisplayExtension()
public int numberOfColors()
Note that the number of colors for a black and white display is 2.
A null or negative value allows the widget finds the number of colors according the available number of bits
per pixels set during the MicroEJ platform build: 1 << BPP
. Override this function when the
number of colors does not follow this rule.
The default implementation returns 0
.
public boolean isColor()
The default implementation returns true
.
public boolean isDoubleBuffered()
The default implementation returns true
.
public abstract int convertDisplayColorToARGBColor(int displayColor)
ARGB value is interpreted as a 32-bit ARGB color, where the eight less significant bits matches the blue component, the next eight bits matches the green component, the next eight bits matches the red component and the next eight bits matches the alpha level.
displayColor
- the display color to convert.public abstract int convertARGBColorToDisplayColor(int argbColor)
ARGB value is interpreted as a 32-bit ARGB color, where the eight less significant bits matches the blue component, the next eight bits matches the green component, the next eight bits matches the red component and the next eight bits matches the alpha level.
argbColor
- the ARGB color to convert.public boolean prepareBlendingOfIndexedColors(java.util.concurrent.atomic.AtomicInteger foreground, java.util.concurrent.atomic.AtomicInteger background)
When the ARGB colors are not available in the CLUT or when the range specified by the two ARGB colors is not
expected by the CLUT, the implementation should return false
. In this way the blending will be
done in software and the result color will be converted later thanks a call to
convertARGBColorToDisplayColor(int)
.
The default implementation returns false
.
foreground
- the foreground ARGB color to convert.background
- the background ARGB color to convert.true
when the indexes have been found.