Module Documentation
FM4, S6E2DH/S6E2DF/S6E2D5/S6E2D3 Series, 32-Bit Microcontroller, Graphic Driver User Manual, Doc. No. 002-04387 Rev. *A
88
MML_GDC_SURF_FORMAT_A1B5G5R5
16 bpp ABGR format (5 bit for RGB, 1 bit alpha).
MML_GDC_SURF_FORMAT_B5G5R5A1
16 bpp BGRA format (5 bit for RGB, 1 bit alpha).
MML_GDC_SURF_FORMAT_R5G6B5
16 bpp BGR format (5 bit for RB, 6 bit for G).
MML_GDC_SURF_FORMAT_A8RGB8
16 bpp, A8RGB8 can be used for gray or indexed image buffers with additional alpha value. For the second use
case an indexed color lookup table must be defined in the surface.
MML_GDC_SURF_FORMAT_RGB8
8 bpp, RGB8 can be used for gray or indexed image buffers. For the second use case an indexed color lookup
table must be defined in the surface.
MML_GDC_SURF_FORMAT_A8
8 bpp alpha format, can be used (e.g., as text buffer or external alpha mask buffer).
MML_GDC_SURF_FORMAT_A4RGB4
8 bpp, A4RGB4 can be used for gray or indexed image buffers with additional alpha value. For the second use
case an indexed color lookup table must be defined in the surface.
MML_GDC_SURF_FORMAT_A4
4 bpp alpha format, can be used (e.g., as text buffer or external alpha mask buffer).
MML_GDC_SURF_FORMAT_A2
2 bpp alpha format, can be used (e.g., as text buffer or external alpha mask buffer).
MML_GDC_SURF_FORMAT_A1
1 bpp alpha format, can be used (e.g., as text buffer or external alpha mask buffer).
MML_GDC_SURF_FORMAT_RGB1
1 bpp back/white buffer (no alpha).
11.4.5 Function Documentation
11.4.5.1 MM_ERROR mmlGdcSmAssignBuffer(MML_GDC_SURFACE surf, MM_U32 uWidth,
MM_U32 uHeight, MML_GDC_SURF_FORMAT eFormat, void
∗
pBufferAddress, MM_U32
uRleWords)
Assign a memory address, width, height and color format representing an image to a surface object. The buffer is
owned by the calling function. It just describes how the image buffer must be used by a function. The application
must ensure that the memory is available as long as the surface is being used.
Note:
The mmlGdcSmAssignBuffer call is a fast way to assign an image to a surface object. Alternatively it is
also possible to assign the same properties with several calls of mmlGdcSmSetAttribute.
The eFormat value can be used to define the most useful color formats. Please note that not all
hardware units support all color formats. The MML_GDC_SURF_FORMAT description includes hints
which format can be used with which unit.
The PixEng HW can operate with many more color formats. Use mmlGdcSmSetAttribute in this case to
assign the correct format to the surface.
In some cases pBufferAddress can be zero. Such surfaces can be used as source surfaces in PixEng
operations. In this case the hardware will not access surface memory but the driver uses the geometry
settings of the surface.
Surfaces with run length encoded buffers (uRleWords != 0) are only supported for source surfaces in
PixEng operations. If uRleWords is different from zero MML_GDC_SURF_COMP_RLC will be set to
MML_GDC_SURF_ATTR_COMPRESSION_FORMAT, otherwiseMML_GDC_SURF_COMP_NON.