Overview
FM4, S6E2DH/S6E2DF/S6E2D5/S6E2D3 Series, 32-Bit Microcontroller, Graphic Driver User Manual, Doc. No. 002-04387 Rev. *A
27
4.8 Coordinate System Hints
Driver APIs for graphical operation use different coordinate systems. The following definitions are used inside the 2D
Graphics Driver:
4.8.1 Surface (Image) buffer
Images (described by a surface) are always line based from top to down, left to right. That means the first bits in a
surface memory buffer describe the upper left pixel, the next bits describe the pixel right of the first, and so on.
Figure 9. Zoomed image with pixel enumeration
4.8.2 Display coordinates
Analog to images the display coordinate system always starts at the top left pixel.
4.8.3 PixEng coordinates
For compatibility reasons the PixEng coordinate system starts per default with the bottom left pixel.
Note:
The very first pixel starts at 0.0, 0.0 and ends at 1.0, 1.0. That means the geometrical center of this pixel is 0.5, 0.5.
The following image is the result of a copy instruction of the 4
∗
3 pixel image above with offset 0, 0.
Figure 10. Zoomed blit and draw result with bottom left coordinate system setting
For some use cases it is much simpler to use the same coordinate system like the display. Besides this some
graphics formats (e.g., SVG) and APIs use the opposite coordinate system. That’s why the 2D Graphics Driver
supports the mirrored coordinate system too and the user can switch the coordinate handling to top left zero point.