public interface MicroUIRawImageGeneratorExtension
The MicroUI Image RAW format accepts some optional characteristics: an optional header (most of hardware decoders are MicroUI Image RAW format compatible but can require a header to be able to recognize the image itself) and / or a row stride different than the image width in pixels.
When the image output format is "DISPLAY" and the LCD pixel format is
"CUSTOM" (that means not standard like ARGB8888 or RGB565 for instance),
image generator requires the extension to encode each pixel in LCD pixel
format (see convertARGBColorToDisplayColor(int)
).
Modifier and Type | Method and Description |
---|---|
boolean |
canRead(Image image)
Tells if the extension is able to read the given image.
|
default int |
convertARGBColorToDisplayColor(int color)
Called only when converting an image in same format than LCD format (image
output format is "DISPLAY") and when this LCD format is not standard (like
RGB565 or ARGB8888 for instance).
|
int |
get(int x,
int y)
Gets the ARGB8888 pixel color at given position.
|
int |
getHeight()
Gets the current source image height in pixels.
|
default byte[] |
getOptionalHeader()
Returns a header the image generator has to store just before the pixels
data.
|
default int |
getStride(int defaultStride)
Returns the preferred row stride in pixels to respect in output image.
|
int |
getWidth()
Gets the current source image width in pixels.
|
boolean canRead(Image image)
image
- the source image.default int convertARGBColorToDisplayColor(int color)
Converts the ARGB color into the LCD color format.
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.
Note: the alpha level may be ignored if the display pixel representation does not hold the alpha level information.
color
- the ARGB color to convertint get(int x, int y)
x
- the pixel X-coordinatey
- the pixel Y-coordinateint getHeight()
default byte[] getOptionalHeader()
No padding is added between this header and the pixels array. If some padding is required, the returned array must contain it.
Image generator ensures header address will be aligned on header size itself.
By default, no header is added.
default int getStride(int defaultStride)
defaultStride
- the stride calculated by the image generator (in pixels).int getWidth()