feat(vg_lite): add support for special format (#9464)
Signed-off-by: VIFEX <vifextech@foxmail.com>
@@ -69,6 +69,64 @@ Its purpose is to simplify the debugging of VG-Lite adaptation and reduce the ti
|
||||
For detailed instructions, see :ref:`vg_lite_tvg`.
|
||||
|
||||
|
||||
Image Decoder Color Format Conversion
|
||||
*************************************
|
||||
|
||||
The VG-Lite image decoder automatically converts certain color formats that are not natively
|
||||
supported by the GPU hardware into compatible formats. This conversion happens transparently
|
||||
during the image decoding process.
|
||||
|
||||
The following table shows the color format mapping:
|
||||
|
||||
.. list-table::
|
||||
:widths: 30 30 40
|
||||
:header-rows: 1
|
||||
|
||||
* - Source Format
|
||||
- Target Format
|
||||
- Description
|
||||
* - ``LV_COLOR_FORMAT_I1``
|
||||
- ``LV_COLOR_FORMAT_I8``
|
||||
- VG-Lite index formats require endian + bit flipping, converted to I8 for simplicity
|
||||
* - ``LV_COLOR_FORMAT_I2``
|
||||
- ``LV_COLOR_FORMAT_I8``
|
||||
- Same as above
|
||||
* - ``LV_COLOR_FORMAT_I4``
|
||||
- ``LV_COLOR_FORMAT_I8``
|
||||
- Same as above
|
||||
* - ``LV_COLOR_FORMAT_A1``
|
||||
- ``LV_COLOR_FORMAT_A8``
|
||||
- Alpha format expanded to 8-bit
|
||||
* - ``LV_COLOR_FORMAT_A2``
|
||||
- ``LV_COLOR_FORMAT_A8``
|
||||
- Alpha format expanded to 8-bit
|
||||
* - ``LV_COLOR_FORMAT_RGB888``
|
||||
- ``LV_COLOR_FORMAT_XRGB8888``
|
||||
- Converted when GPU doesn't support 24-bit format
|
||||
* - ``LV_COLOR_FORMAT_ARGB8565``
|
||||
- ``LV_COLOR_FORMAT_ARGB8888``
|
||||
- Converted when GPU doesn't support 24-bit format
|
||||
* - ``LV_COLOR_FORMAT_RGB565A8``
|
||||
- ``LV_COLOR_FORMAT_ARGB8888``
|
||||
- Separate RGB + Alpha planes merged into ARGB8888
|
||||
* - ``LV_COLOR_FORMAT_AL88``
|
||||
- ``LV_COLOR_FORMAT_ARGB8888``
|
||||
- Alpha + Luminance converted to ARGB8888
|
||||
* - ``LV_COLOR_FORMAT_RGB565_SWAPPED``
|
||||
- ``LV_COLOR_FORMAT_RGB565``
|
||||
- Byte order swapped
|
||||
|
||||
**Notes:**
|
||||
|
||||
- Formats not listed above will return ``LV_COLOR_FORMAT_UNKNOWN`` and be passed to other decoders in the chain.
|
||||
- The 24-bit format conversion (``RGB888``, ``ARGB8565``) depends on GPU capability, queried via ``vg_lite_query_feature(gcFEATURE_BIT_VG_24BIT)``.
|
||||
If the GPU supports 24-bit formats, the decoder will skip these formats and let the default binary decoder handle them.
|
||||
- Index formats (``I1``, ``I2``, ``I4``) maintain their palette but expand index values to 8-bit for GPU compatibility.
|
||||
- Alpha formats (``A1``, ``A2``) are linearly scaled to 8-bit (e.g., A1: 0→0, 1→255; A2: 0→0, 1→85, 2→170, 3→255).
|
||||
- **Compressed formats are not supported.** Images with ``LV_IMAGE_FLAGS_COMPRESSED`` flag will be rejected by this decoder
|
||||
and passed to other decoders that support decompression.
|
||||
|
||||
|
||||
API
|
||||
***
|
||||
|
||||
@@ -81,4 +139,3 @@ API
|
||||
.. API equals: vglite_create_rect_path_data
|
||||
|
||||
.. API equals: vglite_get_color
|
||||
|
||||
|
||||
@@ -585,9 +585,6 @@ vg_lite_buffer_format_t lv_vg_lite_vg_fmt(lv_color_format_t cf)
|
||||
case LV_COLOR_FORMAT_RGB565:
|
||||
return VG_LITE_BGR565;
|
||||
|
||||
case LV_COLOR_FORMAT_RGB565_SWAPPED:
|
||||
return VG_LITE_RGB565;
|
||||
|
||||
case LV_COLOR_FORMAT_ARGB8565:
|
||||
return VG_LITE_BGRA5658;
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 82 KiB |
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 82 KiB |
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 9.5 KiB |
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 7.9 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 42 KiB |