Image Pre-Processing
Introduction
Image processing is a feature in Microchip Graphics Suite (MGS) Harmony that facilitates the efficient storage of compressed images in Flash memory, which are subsequently decompressed to Random Access Memory (RAM) upon system startup.
Benefits and Tradeoffs
Pre-processing allows for rapid rendering of the decompressed images from RAM to the frame buffer.
By employing preprocessing techniques, users can minimize the storage footprint of image assets in Flash memory while simultaneously taking advantage of the swift rendering capabilities associated with uncompressed images in RAM.
Configuring Image Assets for Pre-Processing
The steps to configure images for pre-processing can be summarized as follows:
- Create a user location using the MGS Harmony Composer Memory Manager.
- Enable pre-processing using the MGS Harmony Composer Image Asset Manager.
Details of these steps are described in the next subsections.
Create a User Location Using the Memory Manager in MGS Harmony Composer
Specify the User Location properties as shown.
- Set Name to a unique value. This name will be used to assign asset locations.
- Set Capacity (bytes) to the size of the memory location.
- Set Access Mode to Write.
- Set Address to start address in RAM to decompress images. Make sure that the start address + capacity are unused regions in RAM.
- Set Alignment so the images are decompressed to aligned start addresses. This is important if HW acceleration (like GPU) is used to read and write these images to the frame buffer.
Enable Preprocess in Image Assets Manager in MGS Harmony Composer
Set image format properties.
Check Preprocess to enable pre-processing.
In the Memory Locations Manager, the pre-processed images will be shown in the User Location where they are set.
At render time, the MGS Harmony Library will automatically use the decompressed image in the User Location (RAM) to draw the image to the frame buffer. If a GPU is available in the device, the library may use the GPU to very quickly copy (blit) the image to the frame buffer.