How to use the Color Look Up Table (CLUT) Functionality in GLCDC

How to use the Color Look Up Table (CLUT) Functionality in GLCDC

The Color Look Up Table enables the designer to compress the bits per pixel down to 8, 4, or 1 bit per pixel with the caveat of a limited number of available colors. The RA GLCDC hardware uses a table of 32-bit ARGB colors in an enumerated array. For example, if the 0th color in the array is 0xFF00FF00 (green), then the bits per a green pixel would be set to 0b0. The number of bits per pixel will reflect the size of the lookup table, rather than the color depth of the pixel. The number of colors available in one graphical layer is limited by the size of the look up table. An 8-bit CLUT is 256 color, 4-bit CLUT is 16 colors, and a 1-bit CLUT is 2 colors. The colors in the table are any arbitrary 32-bit ARGB color.

Since the CLUT works per layer, a designer can have the background be RGB565, with a foreground of 1-bit CLUT. This would be useful for having a highly compressed text layer in front of a high color depth background.

This example project shows how to set an 8-, 4-, or 1-bit CLUT on the foreground, with an RGB565 background. The foreground and background are rendered separately, so the user may set breakpoints to view the rendering process.

mipi_dsi_ek_ra8d1_CLUT_ep_final.zip

The critical settings to set up the CLUT are as follows:

In FSP, set the Color format to the appropriate CLUT pixel depth (the attached example project will accommodate CLUT8, 4, or 1, and is controlled by this setting.

The RTT allows the user to see debug output, which includes the project description as well as rendering times and frame buffer sizes. The following are examples:

 

CLUT8