2024-01-04 07:25:13 +01:00
|
|
|
.. _tjpgd:
|
2023-04-27 06:42:02 -06:00
|
|
|
|
2024-01-04 07:25:13 +01:00
|
|
|
================================
|
|
|
|
Tiny JPEG Decompressor (TJpgDec)
|
|
|
|
================================
|
|
|
|
|
2024-01-06 08:34:02 +01:00
|
|
|
Allow the use of JPEG (JPG) images in LVGL.
|
2023-04-27 06:42:02 -06:00
|
|
|
|
2024-01-04 07:25:13 +01:00
|
|
|
Detailed introduction: `TJpgDec <http://elm-chan.org/fsw/tjpgd/>`__
|
|
|
|
|
|
|
|
.. _tjpgd_overview:
|
|
|
|
|
2023-04-27 06:42:02 -06:00
|
|
|
Overview
|
|
|
|
--------
|
|
|
|
|
2024-01-06 08:34:02 +01:00
|
|
|
- JPEG is decoded in 8x8 tiles.
|
|
|
|
- Only baseline JPEG files are supported (no progressive JPEG support).
|
2023-12-08 22:12:03 +01:00
|
|
|
- Read from file and C array are implemented.
|
2024-01-06 08:34:02 +01:00
|
|
|
- Only the required portions of the JPEG images are decoded,
|
2023-04-27 11:47:13 -06:00
|
|
|
therefore they can't be zoomed or rotated.
|
2023-04-27 06:42:02 -06:00
|
|
|
|
2024-01-04 07:25:13 +01:00
|
|
|
.. _tjpgd_usage:
|
|
|
|
|
2023-04-27 06:42:02 -06:00
|
|
|
Usage
|
|
|
|
-----
|
|
|
|
|
2023-09-27 12:23:40 +02:00
|
|
|
If enabled in ``lv_conf.h`` by :c:macro:`LV_USE_TJPGD` LVGL will register a new
|
2024-01-06 08:34:02 +01:00
|
|
|
image decoder automatically so JPEG files can be used directly
|
|
|
|
as image sources.
|
|
|
|
|
|
|
|
For example:
|
2023-04-27 06:42:02 -06:00
|
|
|
|
|
|
|
.. code:: c
|
|
|
|
|
2023-09-27 12:23:40 +02:00
|
|
|
lv_image_set_src(my_img, "S:path/to/picture.jpg");
|
2023-04-27 06:42:02 -06:00
|
|
|
|
2024-01-06 08:34:02 +01:00
|
|
|
:Note: a file system driver needs to be registered to open images from
|
|
|
|
files. Read more about :ref:`overview_file_system` or just
|
|
|
|
enable one in ``lv_conf.h`` with ``LV_USE_FS_...`` config.
|
2023-04-27 06:42:02 -06:00
|
|
|
|
|
|
|
Converter
|
|
|
|
---------
|
|
|
|
|
2024-01-06 08:34:02 +01:00
|
|
|
Converting JPEG to C array
|
2023-04-27 06:42:02 -06:00
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
- Use lvgl online tool https://lvgl.io/tools/imageconverter
|
|
|
|
- Color format = RAW, output format = C Array
|
|
|
|
|
2024-01-04 07:25:13 +01:00
|
|
|
.. _tjpgd_example:
|
|
|
|
|
2023-04-27 06:42:02 -06:00
|
|
|
Example
|
|
|
|
-------
|
|
|
|
|
2023-09-20 16:38:47 +08:00
|
|
|
.. include:: ../examples/libs/tjpgd/index.rst
|
2023-04-27 06:42:02 -06:00
|
|
|
|
2024-01-04 07:25:13 +01:00
|
|
|
.. _tjpgd_api:
|
2023-04-27 06:42:02 -06:00
|
|
|
|
|
|
|
API
|
|
|
|
---
|
|
|
|
|
2023-09-20 16:38:47 +08:00
|
|
|
:ref:`lv_tjpgd`
|
2023-04-27 06:42:02 -06:00
|
|
|
|
|
|
|
:ref:`tjpgd`
|
|
|
|
|
|
|
|
:ref:`tjpgdcnf`
|