Overview
FM4, S6E2DH/S6E2DF/S6E2D5/S6E2D3 Series, 32-Bit Microcontroller, Graphic Driver User Manual, Doc. No. 002-04387 Rev. *A
30
The Tutorial Utility Library contains a Utilities for the compression part providing sample code to create run-length-
coded and run-length-adaptive compressed buffers. Furthermore the 2D Core Driver package contains a windows
command line tool "ResourceGenerator.exe" that can be used to convert a png image into a compressed buffer and
store it in a c compliant header file. Afterwards this content can be used by the utSurfLoadBitmap() function to fill a
MML_GDC_SURFACE object that can be used for blit or display API functions.
4.10 Images With Color Index Table
To reduce the amount of required memory the HW supports images with indexed colors. In this case the image
requires 2 buffers:
One buffer contains all possible colors for this image: the color table or "color look up table".
The second buffer is the typical image buffer. But for each pixel in the image, it only stores an index pointing to
a color in the color table.
4.10.1 Alpha support
Index images can also include per pixel alpha values to control the transparency of the addressed color. The alpha
information can be stored either in the image buffer beside the index pointer or it can be part of the color table.
4.10.2 Image buffer
Like other image buffers also image buffer for indexed images can use different sizes. Depending on the bit width of
the index pointer the image can store a defined maximum of different colors. Beside the index pointer the image
buffer may also contain alpha bits. The sum of alpha and index bits must be 1, 2, 4, 16, 24 or 32. The index bits
must start at bit position 0.
The following table shows some possible pixel buffer color formats for indexed images. Only the size of red channel
in a surface defines the index width. The green and blue channel definition is not used for such images. Therefore a
short format RGB8 is equivalent to 8 bit index.
Short format
Bit per
pixel
Index
bits
Alpha bits
Maximum
of visible
colors
Use case
RGB8
8
8
0
256
Images without per pixel alpha and a maximum of
256 different colors.
RGB4
4
4
0
16
Images with 16 colors only (please note: the
palette may include an alpha bit too. That’s why it
is a possible use case to address 15 visible colors
and 1 transparent color).
A8RGB8
16
8
8
256
Images with per pixel alpha and a maximum of
256 different colors.
A3RGB5
8
5
3
32
Images with 8 levels of transparency (alpha) and
a maximum of 32 different colors.
RGB1
1
1
0
2
All images with only 2 different colors.
4.10.3 Color table
The color table can store up to 256 different colors. Each entry defines the RGB and optionally the alpha value. The
maximum number of bits to store these values are 24 bit per entry. Therefore supported color table formats are
R8G8B8 or R6G6B6A6 but R8G8B8A8 with 32 bit per color is not supported.
4.10.4 Surface properties for indexed images
Like other images also indexed images are described by surface objects. In this case the application must define the
format and address of the image buffer and color table buffer.