Tutorial
FM4, S6E2DH/S6E2DF/S6E2D5/S6E2D3 Series, 32-Bit Microcontroller, Graphic Driver User Manual, Doc. No. 002-04387 Rev. *A
36
6.5 Tutorial 1: Surfaces_Blit_Display Basic
6.5.1 Description
This is a very simple start-up application to show the usage of MML_GDC_SURFACE and
MML_GDC_PE_CONTEXT.
A surface is required to perform operations in the blit and display path.
Please note: Although all APIs use a MML_GDC_SURFACE parameter you need to declare
MML_GDC_SURFACE_CONTAINER objects and use the pointer to these objects for all APIs. It holds the following
information:
Buffer dimension
Memory address of the pixel data
Color format
and optionally:
Compression format and parameter
Color look-up table parameters
6.5.2 MML_GDC_SURFACE
6.5.2.1
Color format
The color format defines the color depth (bits per pixel) for each color channel (red, green, blue, alpha). A lot of
common color formats are pre-defined, for example
MML_GDC_SURF_FORMAT_R8G8B8A8 (32 bits per pixel, 8 bits for each channel)
MML_GDC_SURF_FORMAT_R5G6B5 (16 bits per pixel, 5 bits for red, 6 bits for green, 5 bits for blue)
MML_GDC_SURF_FORMAT_RGB8 (8 bit per pixel for red, green and blue, which means 256 gray scale
values)
MML_GDC_SURF_FORMAT_RGB1 (1 bit per pixel for red, green and blue, which means black-and-white)
...
6.5.2.2
Compression format and parameter
The 2D Graphics Core can use different kinds of pixel buffer compression: RLC, RLA, RLAD or RLAD_UNIFORM.
The surface holds information about compression format and related properties.
6.5.2.3
Color look-up table parameters
A color lookup table can be assigned to a surface by using the function mmlGdcSmAssignClut. Lookup tables can
be used for indexed images: the value for red in the image defines an index of the color lookup table. The color of
the table entry defines the pixel color at this point.