Overview
FM4, S6E2DH/S6E2DF/S6E2D5/S6E2D3 Series, 32-Bit Microcontroller, Graphic Driver User Manual, Doc. No. 002-04387 Rev. *A
28
The same image rendered above will now show the following result:
Figure 11. Zoomed blit and draw result with top left coordinate system setting
4.8.4 Matrix helper functions
The 2D Graphics Driver comes with many tutorial samples and sample code. For geometrical operation the utility
part includes matrix calculation helpers. Different matrix formats are available
Mat3x2: This matrix format can be used for 2 dimensional operations like translation, scaling and rotation.
Mat3x3: This matrix format must be used for the API in the blit path for the source image if a "3D" operation is
required.
Mat4x4: The 4x4 matrix is just a helper format. The related functions are basically similar to other "3D" render
APIs like OpenGL. However, the depth information is not used, so the 2D Graphics Driver API does not support
this matrix format. An application can anyway use these helper functions for the view calculation, because the
matrix result can be converted into a 3x3 matrix by removing the depth (z) parts from the matrix.
The following example shows the required Mat3X2 operations to rotate the image above at the center of second
pixel in the second line and blend the result to a target. The rotation center of the source pixel will be located at the
center of pixel 4, 2 in the target.
//reset the matrix
utMat3x2LoadIdentity(mat);
//translate to target coordinates
utMat3x2Translate(mat, 4.5f, 2.5f);
//90 degrees rotation
utMat3x2Rot(mat, 90.0f);
//translate to center of pixel 1, 1 in source coordinate system
utMat3x2Translate(mat, -1.5f, -1.5f);
Figure 12. Zoomed blit result with matrix operation (bottom left coordinate center)
4.9 Image Compression