Microchip Graphics Library
|
Applications often require some transition effects while changing screens in order to enhance the look and feel which can be achieved by using Transition APIs provided with the Microchip Graphics Library. Refer to Appendix C of the application note AN1368: Developing Embedded Graphics Applications using PIC® Microcontrollers with Integrated Graphics Controller for a graphical illustration of how transitions can be achieved.
In order to translate a new screen, the new screen has to be developed in a separate buffer and has to be copied to the frame buffer (visible display buffer) part by part. The way the new screen data is copied into the frame buffer determines the transition effect. A number of transition effects can be achieved by using the API: GFXTransition(left, top, right, bottom, type, srcpageaddr, destpageaddr, delay_ms, param1, param2). This API copies the rectangular area defined by left, top, right and bottom from address defined by srcpageaddr to the destpageaddr as per the transition defined by type, param1 and param2. The srcpageaddr should contain the new screen data and the destpageaddr must be the frame buffer address. The speed of the transition can be configured by the parameter delay_ms which determines the delay between each copy operations. Note that this API must be called only at the end of GOLDrawCallback() function in order to ensure that the new screen is fully created in the RAM.
If double buffering is enabled, then using transitions is made easier by another API: GFXSetupTransition(left, top, right, bottom, type, delay_ms, param1, param2). This API can be called immediately after creating the new screen and the graphics library will store the request and initiate the transition after the new screen is fully created in the RAM. Note that this API doesn’t have address parameters as the address of draw-buffer is already known to the double buffering subsystem of the graphics engine.
Name |
Description |
Direction enumeration to determine the direction of the selected GFX_TRANSITION_TYPE. | |
Transition type enumeration to determine the type of the transition. Each type will require specific parameters when setting up the transition operation (GFXSetupTransition() or GFXTransition()). |
|
Name |
Description |
|
This immediately executes the transition effect using the GFX_TRANSITION_TYPE and the given parameters. | |
|
This sets up the transition effect using the GFX_TRANSITION_TYPE and the given parameters. The actual transition execution will occur when GFXExecutePendingTransition() is called. When DOUBLE_BUFFERING is enabled, GFXExecutePendingTransition() is executed after the current screen is fully rendered. | |
|
This function executes the transition that was set up by GFXSetupTransition(). Status of the transition is returned to indicate if the transition was executed or not. This function is used by the double buffering feature (USE_DOUBLE_BUFFERING) to perform transition operation after the current screen is fully rendered. This function assumes that the source page and destination page are already set up. | |
|
This function returns the status of a pending transition, set up by GFXSetupTransition(), waiting to be executed. |