Module Documentation
FM4, S6E2DH/S6E2DF/S6E2D5/S6E2D3 Series, 32-Bit Microcontroller, Graphic Driver User Manual, Doc. No. 002-04387 Rev. *A
126
Blend Mode
RGBA Components
MML_GDC_PE_BM_GL_FUNC_ADD
C = Cs
∗
Fs + Cd
∗
Fd
MML_GDC_PE_BM_GL_MIN
C = min(Cs, Cd)
MML_GDC_PE_BM_GL_MAX
C = max(Cs, Cd)
MML_GDC_PE_BM_GL_FUNC_SUBTRACT
C = Cs
∗
Fs - Cd
∗
Fd
MML_GDC_PE_BM_GL_FUNC_REVERSE_SUBTRACT
C = Cd
∗
Fd - Cs
∗
Fs
MML_GDC_PE_BM_VG_BLEND_SRC
C = Cs
MML_GDC_PE_BM_VG_BLEND_SRC_OVER
C = Cs + Cd
∗
(1 - As)
MML_GDC_PE_BM_VG_BLEND_DST_OVER
C = Cs
∗
(1 - Ad)+ Cd
MML_GDC_PE_BM_VG_BLEND_SRC_IN
C = Cs
∗
Ad
MML_GDC_PE_BM_VG_BLEND_DST_IN
C = Cd
∗
As
MML_GDC_PE_BM_VG_BLEND_MULTIPLY
C = Cs
∗
(1-Ad) + Cd
∗
(1-As) + Cs
∗
Cd
MML_GDC_PE_BM_VG_BLEND_SCREEN
C = Cs + Cd - Cs
∗
Cd
MML_GDC_PE_BM_VG_BLEND_DARKEN
C = min(Cs + Cd
∗
(1-As), Cd + Cs
∗
(1-Ad))
MML_GDC_PE_BM_VG_BLEND_LIGHTEN
C = max(Cs + Cd
∗
(1-As), Cd + Cs
∗
(1-Ad))
MML_GDC_PE_BM_VG_BLEND_ADDITIVE
C = Cs + Cd
Parameters
in,out
pectx
Pixel Engine context (!=NULL).
in
mode_red
Blend mode of red (default: MML_GDC_PE_BM_GL_FUNC_ADD).
in
mode_green
Blend mode of green (default: MML_GDC_PE_BM_GL_FUNC_ADD).
in
mode_blue
Blend mode of blue (default: MML_GDC_PE_BM_GL_FUNC_ADD).
in
mode_alpha
Blend mode of alpha (default: MML_GDC_PE_BM_GL_FUNC_ADD).
Return values
MML_OK
On success. Otherwise the related error code.
11.6.5.6 MML_GDC_PE_API MM_ERROR mmlGdcPeBlt ( MML_GDC_PE_CONTEXT pectx,
MM_FLOAT offsetx, MM_FLOAT offsety )
This API initiates an operation that reads pixel data from surfaces bound to SRC, DST and MASK and performs a
calculation using it. The resulting pixel data build a rectangle that is written to the bound STORE surface. The details
of the operation are defined by the context and surface attributes.
Note
The offsetx and offsety position parameters will be added to the current geometric matrix of the src and
mask surface. That means they are not really required because the matrix changes can handle the same.
However the most common use case is to blend a (modified) source bitmap to a defined x, y position and it
is much simpler to commit this position as parameter. The geometrical relation between pixels of the target
buffer and pixels of the source buffer are defined in the following way:
Moffs represent a matrix using the fX, fY offsets given from this function.
Ms (Xs, Ys) represent the surface matrix (pixel) of the related source: SRC or MASK.
�𝑋𝑋𝑥𝑥𝑥𝑥𝑥𝑥𝑋𝑋𝑥𝑥
𝑌𝑌𝑥𝑥𝑥𝑥𝑥𝑥𝑋𝑋𝑥𝑥�
=
𝑀𝑀𝑥𝑥𝑥𝑥𝑥𝑥𝑥𝑥
×
𝑀𝑀𝑥𝑥
×
�𝑋𝑋𝑥𝑥
𝑌𝑌𝑥𝑥�
The path for the DST calculation is a little bit different:
�𝑋𝑋𝑥𝑥𝑥𝑥𝑥𝑥𝑋𝑋𝑥𝑥
𝑌𝑌𝑥𝑥𝑥𝑥𝑥𝑥𝑋𝑋𝑥𝑥�
=
𝑀𝑀𝑑𝑑𝑥𝑥𝑥𝑥
×
�𝑋𝑋𝑥𝑥
𝑌𝑌𝑥𝑥�