「App:Library:LVGL:docs:Overview:Images」の版間の差分

提供: robot-jp wiki
ナビゲーションに移動検索に移動
2行目: 2行目:
 
__NOTOC__
 
__NOTOC__
 
= Images =
 
= Images =
 +
{| class="wikitable"
 +
!英文
 +
!自動翻訳
 +
|-
 +
|
 
An image can be a file or a variable which stores the bitmap itself and some metadata.
 
An image can be a file or a variable which stores the bitmap itself and some metadata.
 +
|
 +
|}
 +
:[[App:Library:LVGL:docs:Overview|戻る : Previous]]
 +
  
 
== Store images ==
 
== Store images ==
 +
{| class="wikitable"
 +
!英文
 +
!自動翻訳
 +
|-
 +
|
 
You can store images in two places
 
You can store images in two places
  
 
* as a variable in internal memory (RAM or ROM)
 
* as a variable in internal memory (RAM or ROM)
 
* as a file
 
* as a file
 +
|
 +
|}
 +
:[[App:Library:LVGL:docs:Overview|戻る : Previous]]
 +
  
 
=== Variables ===
 
=== Variables ===
Images stored internally in a variable are composed mainly of an <code>lv_img_dsc_t</code> structure with the following fields:
+
{| class="wikitable"
 +
!英文
 +
!自動翻訳
 +
|-
 +
|
 +
Images stored internally in a variable are composed mainly of an <code style="color: #bb0000;">lv_img_dsc_t</code> structure with the following fields:
  
 
* header
 
* header
20行目: 43行目:
 
** ''reserved'' reserved for future use
 
** ''reserved'' reserved for future use
 
* data pointer to an array where the image itself is stored
 
* data pointer to an array where the image itself is stored
* data_size length of <code>data</code> in bytes
+
* data_size length of <code style="color: #bb0000;">data</code> in bytes
  
 
These are usually stored within a project as C files. They are linked into the resulting executable like any other constant data.
 
These are usually stored within a project as C files. They are linked into the resulting executable like any other constant data.
 +
|
 +
|}
 +
:[[App:Library:LVGL:docs:Overview|戻る : Previous]]
 +
  
 
=== Files ===
 
=== Files ===
 +
{| class="wikitable"
 +
!英文
 +
!自動翻訳
 +
|-
 +
|
 
To deal with files you need to add a storage ''Drive'' to LVGL. In short, a ''Drive'' is a collection of functions (''open'', ''read'', ''close'', etc.) registered in LVGL to make file operations. You can add an interface to a standard file system (FAT32 on SD card) or you create your simple file system to read data from an SPI Flash memory. In every case, a ''Drive'' is just an abstraction to read and/or write data to memory. See the File system section to learn more.
 
To deal with files you need to add a storage ''Drive'' to LVGL. In short, a ''Drive'' is a collection of functions (''open'', ''read'', ''close'', etc.) registered in LVGL to make file operations. You can add an interface to a standard file system (FAT32 on SD card) or you create your simple file system to read data from an SPI Flash memory. In every case, a ''Drive'' is just an abstraction to read and/or write data to memory. See the File system section to learn more.
  
 
Images stored as files are not linked into the resulting executable, and must be read into RAM before being drawn. As a result, they are not as resource-friendly as images linked at compile time. However, they are easier to replace without needing to rebuild the main program.
 
Images stored as files are not linked into the resulting executable, and must be read into RAM before being drawn. As a result, they are not as resource-friendly as images linked at compile time. However, they are easier to replace without needing to rebuild the main program.
 +
|
 +
|}
 +
:[[App:Library:LVGL:docs:Overview|戻る : Previous]]
 +
  
 
== Color formats ==
 
== Color formats ==
 +
{| class="wikitable"
 +
!英文
 +
!自動翻訳
 +
|-
 +
|
 
Various built-in color formats are supported:
 
Various built-in color formats are supported:
  
 
* LV_IMG_CF_TRUE_COLOR Simply stores the RGB colors (in whatever color depth LVGL is configured for).
 
* LV_IMG_CF_TRUE_COLOR Simply stores the RGB colors (in whatever color depth LVGL is configured for).
* LV_IMG_CF_TRUE_COLOR_ALPHA Like <code>LV_IMG_CF_TRUE_COLOR</code> but it also adds an alpha (transparency) byte for every pixel.
+
* LV_IMG_CF_TRUE_COLOR_ALPHA Like <code style="color: #bb0000;">LV_IMG_CF_TRUE_COLOR</code> but it also adds an alpha (transparency) byte for every pixel.
* LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED Like <code>LV_IMG_CF_TRUE_COLOR</code> but if a pixel has the <code>LV_COLOR_TRANSP</code> color (set in ''lv_conf.h'') it will be transparent.
+
* LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED Like <code style="color: #bb0000;">LV_IMG_CF_TRUE_COLOR</code> but if a pixel has the <code style="color: #bb0000;">LV_COLOR_TRANSP</code> color (set in ''lv_conf.h'') it will be transparent.
 
* LV_IMG_CF_INDEXED_1/2/4/8BIT Uses a palette with 2, 4, 16 or 256 colors and stores each pixel in 1, 2, 4 or 8 bits.
 
* LV_IMG_CF_INDEXED_1/2/4/8BIT Uses a palette with 2, 4, 16 or 256 colors and stores each pixel in 1, 2, 4 or 8 bits.
* LV_IMG_CF_ALPHA_1/2/4/8BIT Only stores the Alpha value with 1, 2, 4 or 8 bits. The pixels take the color of <code>style.img_recolor</code> and the set opacity. The source image has to be an alpha channel. This is ideal for bitmaps similar to fonts where the whole image is one color that can be altered.
+
* LV_IMG_CF_ALPHA_1/2/4/8BIT Only stores the Alpha value with 1, 2, 4 or 8 bits. The pixels take the color of <code style="color: #bb0000;">style.img_recolor</code> and the set opacity. The source image has to be an alpha channel. This is ideal for bitmaps similar to fonts where the whole image is one color that can be altered.
  
The bytes of <code>LV_IMG_CF_TRUE_COLOR</code> images are stored in the following order.
+
The bytes of <code style="color: #bb0000;">LV_IMG_CF_TRUE_COLOR</code> images are stored in the following order.
  
 
For 32-bit color depth:
 
For 32-bit color depth:
62行目: 103行目:
 
* LV_IMG_CF_RAW Indicates a basic raw image (e.g. a PNG or JPG image).
 
* LV_IMG_CF_RAW Indicates a basic raw image (e.g. a PNG or JPG image).
 
* LV_IMG_CF_RAW_ALPHA Indicates that an image has alpha and an alpha byte is added for every pixel.
 
* LV_IMG_CF_RAW_ALPHA Indicates that an image has alpha and an alpha byte is added for every pixel.
* LV_IMG_CF_RAW_CHROMA_KEYED Indicates that an image is chroma-keyed as described in <code>LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED</code> above.
+
* LV_IMG_CF_RAW_CHROMA_KEYED Indicates that an image is chroma-keyed as described in <code style="color: #bb0000;">LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED</code> above.
 +
|
 +
|}
 +
:[[App:Library:LVGL:docs:Overview|戻る : Previous]]
 +
 
  
 
== Add and use images ==
 
== Add and use images ==
 +
{| class="wikitable"
 +
!英文
 +
!自動翻訳
 +
|-
 +
|
 
You can add images to LVGL in two ways:
 
You can add images to LVGL in two ways:
  
 
* using the online converter
 
* using the online converter
 
* manually create images
 
* manually create images
 +
|
 +
|}
 +
:[[App:Library:LVGL:docs:Overview|戻る : Previous]]
 +
  
 
=== Online converter ===
 
=== Online converter ===
 +
{| class="wikitable"
 +
!英文
 +
!自動翻訳
 +
|-
 +
|
 
The online Image converter is available here: <nowiki>https://lvgl.io/tools/imageconverter</nowiki>
 
The online Image converter is available here: <nowiki>https://lvgl.io/tools/imageconverter</nowiki>
  
78行目: 137行目:
 
# Give the image a name that will be used within LVGL.
 
# Give the image a name that will be used within LVGL.
 
# Select the Color format.
 
# Select the Color format.
# Select the type of image you want. Choosing a binary will generate a <code>.bin</code> file that must be stored separately and read using the file support. Choosing a variable will generate a standard C file that can be linked into your project.
+
# Select the type of image you want. Choosing a binary will generate a <code style="color: #bb0000;">.bin</code> file that must be stored separately and read using the file support. Choosing a variable will generate a standard C file that can be linked into your project.
 
# Hit the ''Convert'' button. Once the conversion is finished, your browser will automatically download the resulting file.
 
# Hit the ''Convert'' button. Once the conversion is finished, your browser will automatically download the resulting file.
  
In the generated C arrays (variables), bitmaps for all the color depths (1, 8, 16 or 32) are included in the C file, but only the color depth that matches <code>LV_COLOR_DEPTH</code> in ''lv_conf.h'' will actually be linked into the resulting executable.
+
In the generated C arrays (variables), bitmaps for all the color depths (1, 8, 16 or 32) are included in the C file, but only the color depth that matches <code style="color: #bb0000;">LV_COLOR_DEPTH</code> in ''lv_conf.h'' will actually be linked into the resulting executable.
  
 
In the case of binary files, you need to specify the color format you want:
 
In the case of binary files, you need to specify the color format you want:
89行目: 148行目:
 
* RGB565 Swap for 16-bit color depth (two bytes are swapped)
 
* RGB565 Swap for 16-bit color depth (two bytes are swapped)
 
* RGB888 for 32-bit color depth
 
* RGB888 for 32-bit color depth
 +
|
 +
|}
 +
:[[App:Library:LVGL:docs:Overview|戻る : Previous]]
 +
  
 
=== Manually create an image ===
 
=== Manually create an image ===
 +
{| class="wikitable"
 +
!英文
 +
!自動翻訳
 +
|-
 +
|
 
If you are generating an image at run-time, you can craft an image variable to display it using LVGL. For example:
 
If you are generating an image at run-time, you can craft an image variable to display it using LVGL. For example:
 
  uint8_t my_img_data[] = {0x00, 0x01, 0x02, ...};
 
  uint8_t my_img_data[] = {0x00, 0x01, 0x02, ...};
102行目: 170行目:
 
     .data = my_img_data,
 
     .data = my_img_data,
 
  };
 
  };
If the color format is <code>LV_IMG_CF_TRUE_COLOR_ALPHA</code> you can set <code>data_size</code> like <code>80 * 60 * LV_IMG_PX_SIZE_ALPHA_BYTE</code>.
+
If the color format is <code style="color: #bb0000;">LV_IMG_CF_TRUE_COLOR_ALPHA</code> you can set <code style="color: #bb0000;">data_size</code> like <code style="color: #bb0000;">80 * 60 * LV_IMG_PX_SIZE_ALPHA_BYTE</code>.
  
 
Another (possibly simpler) option to create and display an image at run-time is to use the Canvas object.
 
Another (possibly simpler) option to create and display an image at run-time is to use the Canvas object.
 +
|
 +
|}
 +
:[[App:Library:LVGL:docs:Overview|戻る : Previous]]
 +
  
 
=== Use images ===
 
=== Use images ===
 +
{| class="wikitable"
 +
!英文
 +
!自動翻訳
 +
|-
 +
|
 
The simplest way to use an image in LVGL is to display it with an lv_img object:
 
The simplest way to use an image in LVGL is to display it with an lv_img object:
 
  lv_obj_t * icon = lv_img_create(lv_scr_act(), NULL);
 
  lv_obj_t * icon = lv_img_create(lv_scr_act(), NULL);
115行目: 192行目:
 
  /*From file*/
 
  /*From file*/
 
  lv_img_set_src(icon, "S:my_icon.bin");
 
  lv_img_set_src(icon, "S:my_icon.bin");
If the image was converted with the online converter, you should use <code>LV_IMG_DECLARE(my_icon_dsc)</code> to declare the image in the file where you want to use it.
+
If the image was converted with the online converter, you should use <code style="color: #bb0000;">LV_IMG_DECLARE(my_icon_dsc)</code> to declare the image in the file where you want to use it.
 +
|
 +
|}
 +
:[[App:Library:LVGL:docs:Overview|戻る : Previous]]
 +
 
  
 
== Image decoder ==
 
== Image decoder ==
 
+
{| class="wikitable"
 +
!英文
 +
!自動翻訳
 +
|-
 +
|
 
As you can see in the Color formats section, LVGL supports several built-in image formats. In many cases, these will be all you need. LVGL doesn't directly support, however, generic image formats like PNG or JPG.
 
As you can see in the Color formats section, LVGL supports several built-in image formats. In many cases, these will be all you need. LVGL doesn't directly support, however, generic image formats like PNG or JPG.
  
126行目: 211行目:
  
 
* info get some basic info about the image (width, height and color format).
 
* info get some basic info about the image (width, height and color format).
* open open an image: either store a decoded image or set it to <code>NULL</code> to indicate the image can be read line-by-line.
+
* open open an image: either store a decoded image or set it to <code style="color: #bb0000;">NULL</code> to indicate the image can be read line-by-line.
 
* read if ''open'' didn't fully open an image this function should give some decoded data (max 1 line) from a given position.
 
* read if ''open'' didn't fully open an image this function should give some decoded data (max 1 line) from a given position.
 
* close close an opened image, free the allocated resources.
 
* close close an opened image, free the allocated resources.
132行目: 217行目:
 
You can add any number of image decoders. When an image needs to be drawn, the library will try all the registered image decoders until it finds one which can open the image, i.e. one which knows that format.
 
You can add any number of image decoders. When an image needs to be drawn, the library will try all the registered image decoders until it finds one which can open the image, i.e. one which knows that format.
  
The <code>LV_IMG_CF_TRUE_COLOR_...</code>, <code>LV_IMG_INDEXED_...</code> and <code>LV_IMG_ALPHA_...</code> formats (essentially, all non-<code>RAW</code> formats) are understood by the built-in decoder.
+
The <code style="color: #bb0000;">LV_IMG_CF_TRUE_COLOR_...</code>, <code style="color: #bb0000;">LV_IMG_INDEXED_...</code> and <code style="color: #bb0000;">LV_IMG_ALPHA_...</code> formats (essentially, all non-<code style="color: #bb0000;">RAW</code> formats) are understood by the built-in decoder.
  
 
=== Custom image formats ===
 
=== Custom image formats ===
The easiest way to create a custom image is to use the online image converter and select <code>Raw</code>, <code>Raw with alpha</code> or <code>Raw with chroma-keyed</code> format. It will just take every byte of the binary file you uploaded and write it as an image "bitmap". You then need to attach an image decoder that will parse that bitmap and generate the real, renderable bitmap.
+
The easiest way to create a custom image is to use the online image converter and select <code style="color: #bb0000;">Raw</code>, <code style="color: #bb0000;">Raw with alpha</code> or <code style="color: #bb0000;">Raw with chroma-keyed</code> format. It will just take every byte of the binary file you uploaded and write it as an image "bitmap". You then need to attach an image decoder that will parse that bitmap and generate the real, renderable bitmap.
  
<code>header.cf</code> will be <code>LV_IMG_CF_RAW</code>, <code>LV_IMG_CF_RAW_ALPHA</code> or <code>LV_IMG_CF_RAW_CHROMA_KEYED</code> accordingly. You should choose the correct format according to your needs: a fully opaque image, using an alpha channel or using a chroma key.
+
<code style="color: #bb0000;">header.cf</code> will be <code style="color: #bb0000;">LV_IMG_CF_RAW</code>, <code style="color: #bb0000;">LV_IMG_CF_RAW_ALPHA</code> or <code style="color: #bb0000;">LV_IMG_CF_RAW_CHROMA_KEYED</code> accordingly. You should choose the correct format according to your needs: a fully opaque image, using an alpha channel or using a chroma key.
  
 
After decoding, the ''raw'' formats are considered ''True color'' by the library. In other words, the image decoder must decode the ''Raw'' images to ''True color'' according to the format described in the Color formats section.
 
After decoding, the ''raw'' formats are considered ''True color'' by the library. In other words, the image decoder must decode the ''Raw'' images to ''True color'' according to the format described in the Color formats section.
  
If you want to create a custom image, you should use <code>LV_IMG_CF_USER_ENCODED_0..7</code> color formats. However, the library can draw images only in ''True color'' format (or ''Raw'' but ultimately it will be in ''True color'' format). The <code>LV_IMG_CF_USER_ENCODED_...</code> formats are not known by the library and therefore they should be decoded to one of the known formats from the Color formats section. It's possible to decode an image to a non-true color format first (for example: <code>LV_IMG_INDEXED_4BITS</code>) and then call the built-in decoder functions to convert it to ''True color''.
+
If you want to create a custom image, you should use <code style="color: #bb0000;">LV_IMG_CF_USER_ENCODED_0..7</code> color formats. However, the library can draw images only in ''True color'' format (or ''Raw'' but ultimately it will be in ''True color'' format). The <code style="color: #bb0000;">LV_IMG_CF_USER_ENCODED_...</code> formats are not known by the library and therefore they should be decoded to one of the known formats from the Color formats section. It's possible to decode an image to a non-true color format first (for example: <code style="color: #bb0000;">LV_IMG_INDEXED_4BITS</code>) and then call the built-in decoder functions to convert it to ''True color''.
 +
 
 +
With ''User encoded'' formats, the color format in the open function (<code style="color: #bb0000;">dsc->header.cf</code>) should be changed according to the new format.
 +
|
 +
|}
 +
:[[App:Library:LVGL:docs:Overview|戻る : Previous]]
  
With ''User encoded'' formats, the color format in the open function (<code>dsc->header.cf</code>) should be changed according to the new format.
 
  
 
=== Register an image decoder ===
 
=== Register an image decoder ===
 +
{| class="wikitable"
 +
!英文
 +
!自動翻訳
 +
|-
 +
|
 
Here's an example of getting LVGL to work with PNG images.
 
Here's an example of getting LVGL to work with PNG images.
  
235行目: 329行目:
 
So in summary:
 
So in summary:
  
* In <code>decoder_info</code>, you should collect some basic information about the image and store it in <code>header</code>.
+
* In <code style="color: #bb0000;">decoder_info</code>, you should collect some basic information about the image and store it in <code style="color: #bb0000;">header</code>.
* In <code>decoder_open</code>, you should try to open the image source pointed by <code>dsc->src</code>. Its type is already in <code>dsc->src_type == LV_IMG_SRC_FILE/VARIABLE</code>. If this format/type is not supported by the decoder, return <code>LV_RES_INV</code>. However, if you can open the image, a pointer to the decoded ''True color'' image should be set in <code>dsc->img_data</code>. If the format is known, but you don't want to decode the entire image (e.g. no memory for it), set <code>dsc->img_data = NULL</code> and use <code>read_line</code> to get the pixel data.
+
* In <code style="color: #bb0000;">decoder_open</code>, you should try to open the image source pointed by <code style="color: #bb0000;">dsc->src</code>. Its type is already in <code style="color: #bb0000;">dsc->src_type == LV_IMG_SRC_FILE/VARIABLE</code>. If this format/type is not supported by the decoder, return <code style="color: #bb0000;">LV_RES_INV</code>. However, if you can open the image, a pointer to the decoded ''True color'' image should be set in <code style="color: #bb0000;">dsc->img_data</code>. If the format is known, but you don't want to decode the entire image (e.g. no memory for it), set <code style="color: #bb0000;">dsc->img_data = NULL</code> and use <code style="color: #bb0000;">read_line</code> to get the pixel data.
* In <code>decoder_close</code> you should free all allocated resources.
+
* In <code style="color: #bb0000;">decoder_close</code> you should free all allocated resources.
* <code>decoder_read</code> is optional. Decoding the whole image requires extra memory and some computational overhead. However, it can decode one line of the image without decoding the whole image, you can save memory and time. To indicate that the ''line read'' function should be used, set <code>dsc->img_data = NULL</code> in the open function.
+
* <code style="color: #bb0000;">decoder_read</code> is optional. Decoding the whole image requires extra memory and some computational overhead. However, it can decode one line of the image without decoding the whole image, you can save memory and time. To indicate that the ''line read'' function should be used, set <code style="color: #bb0000;">dsc->img_data = NULL</code> in the open function.
 +
|
 +
|}
 +
:[[App:Library:LVGL:docs:Overview|戻る : Previous]]
 +
 
  
 
=== Manually use an image decoder ===
 
=== Manually use an image decoder ===
LVGL will use registered image decoders automatically if you try and draw a raw image (i.e. using the <code>lv_img</code> object) but you can use them manually too. Create an <code>lv_img_decoder_dsc_t</code> variable to describe the decoding session and call <code>lv_img_decoder_open()</code>.
+
{| class="wikitable"
 +
!英文
 +
!自動翻訳
 +
|-
 +
|
 +
LVGL will use registered image decoders automatically if you try and draw a raw image (i.e. using the <code style="color: #bb0000;">lv_img</code> object) but you can use them manually too. Create an <code style="color: #bb0000;">lv_img_decoder_dsc_t</code> variable to describe the decoding session and call <code style="color: #bb0000;">lv_img_decoder_open()</code>.
  
The <code>color</code> parameter is used only with <code>LV_IMG_CF_ALPHA_1/2/4/8BIT</code> images to tell color of the image. <code>frame_id</code> can be used if the image to open is an animation.
+
The <code style="color: #bb0000;">color</code> parameter is used only with <code style="color: #bb0000;">LV_IMG_CF_ALPHA_1/2/4/8BIT</code> images to tell color of the image. <code style="color: #bb0000;">frame_id</code> can be used if the image to open is an animation.
 
   
 
   
 
  lv_res_t res;
 
  lv_res_t res;
253行目: 356行目:
 
   lv_img_decoder_close(&dsc);
 
   lv_img_decoder_close(&dsc);
 
  }
 
  }
 +
|
 +
|}
 +
:[[App:Library:LVGL:docs:Overview|戻る : Previous]]
 +
  
 
== Image caching ==
 
== Image caching ==
 +
{| class="wikitable"
 +
!英文
 +
!自動翻訳
 +
|-
 +
|
 
Sometimes it takes a lot of time to open an image. Continuously decoding a PNG image or loading images from a slow external memory would be inefficient and detrimental to the user experience.
 
Sometimes it takes a lot of time to open an image. Continuously decoding a PNG image or loading images from a slow external memory would be inefficient and detrimental to the user experience.
  
Therefore, LVGL caches a given number of images. Caching means some images will be left open, hence LVGL can quickly access them from <code>dsc->img_data</code> instead of needing to decode them again.
+
Therefore, LVGL caches a given number of images. Caching means some images will be left open, hence LVGL can quickly access them from <code style="color: #bb0000;">dsc->img_data</code> instead of needing to decode them again.
  
 
Of course, caching images is resource intensive as it uses more RAM to store the decoded image. LVGL tries to optimize the process as much as possible (see below), but you will still need to evaluate if this would be beneficial for your platform or not. Image caching may not be worth it if you have a deeply embedded target which decodes small images from a relatively fast storage medium.
 
Of course, caching images is resource intensive as it uses more RAM to store the decoded image. LVGL tries to optimize the process as much as possible (see below), but you will still need to evaluate if this would be beneficial for your platform or not. Image caching may not be worth it if you have a deeply embedded target which decodes small images from a relatively fast storage medium.
 +
|
 +
|}
 +
:[[App:Library:LVGL:docs:Overview|戻る : Previous]]
 +
  
 
=== Cache size ===
 
=== Cache size ===
The number of cache entries can be defined with <code>LV_IMG_CACHE_DEF_SIZE</code> in ''lv_conf.h''. The default value is 1 so only the most recently used image will be left open.
+
{| class="wikitable"
 +
!英文
 +
!自動翻訳
 +
|-
 +
|
 +
The number of cache entries can be defined with <code style="color: #bb0000;">LV_IMG_CACHE_DEF_SIZE</code> in ''lv_conf.h''. The default value is 1 so only the most recently used image will be left open.
 +
 
 +
The size of the cache can be changed at run-time with <code style="color: #bb0000;">lv_img_cache_set_size(entry_num)</code>.
 +
|
 +
|}
 +
:[[App:Library:LVGL:docs:Overview|戻る : Previous]]
  
The size of the cache can be changed at run-time with <code>lv_img_cache_set_size(entry_num)</code>.
 
  
 
=== Value of images ===
 
=== Value of images ===
 +
{| class="wikitable"
 +
!英文
 +
!自動翻訳
 +
|-
 +
|
 
When you use more images than cache entries, LVGL can't cache all the images. Instead, the library will close one of the cached images to free space.
 
When you use more images than cache entries, LVGL can't cache all the images. Instead, the library will close one of the cached images to free space.
  
 
To decide which image to close, LVGL uses a measurement it previously made of how long it took to open the image. Cache entries that hold slower-to-open images are considered more valuable and are kept in the cache as long as possible.
 
To decide which image to close, LVGL uses a measurement it previously made of how long it took to open the image. Cache entries that hold slower-to-open images are considered more valuable and are kept in the cache as long as possible.
  
If you want or need to override LVGL's measurement, you can manually set the ''time to open'' value in the decoder open function in <code>dsc->time_to_open = time_ms</code> to give a higher or lower value. (Leave it unchanged to let LVGL control it.)
+
If you want or need to override LVGL's measurement, you can manually set the ''time to open'' value in the decoder open function in <code style="color: #bb0000;">dsc->time_to_open = time_ms</code> to give a higher or lower value. (Leave it unchanged to let LVGL control it.)
  
 
Every cache entry has a ''"life"'' value. Every time an image is opened through the cache, the ''life'' value of all entries is decreased to make them older. When a cached image is used, its ''life'' value is increased by the ''time to open'' value to make it more alive.
 
Every cache entry has a ''"life"'' value. Every time an image is opened through the cache, the ''life'' value of all entries is decreased to make them older. When a cached image is used, its ''life'' value is increased by the ''time to open'' value to make it more alive.
  
 
If there is no more space in the cache, the entry with the lowest life value will be closed.
 
If there is no more space in the cache, the entry with the lowest life value will be closed.
 +
|
 +
|}
 +
:[[App:Library:LVGL:docs:Overview|戻る : Previous]]
 +
  
 
=== Memory usage ===
 
=== Memory usage ===
 +
{| class="wikitable"
 +
!英文
 +
!自動翻訳
 +
|-
 +
|
 
Note that a cached image might continuously consume memory. For example, if three PNG images are cached, they will consume memory while they are open.
 
Note that a cached image might continuously consume memory. For example, if three PNG images are cached, they will consume memory while they are open.
  
 
Therefore, it's the user's responsibility to be sure there is enough RAM to cache even the largest images at the same time.
 
Therefore, it's the user's responsibility to be sure there is enough RAM to cache even the largest images at the same time.
 +
|
 +
|}
 +
:[[App:Library:LVGL:docs:Overview|戻る : Previous]]
 +
  
 
=== Clean the cache ===
 
=== Clean the cache ===
Let's say you have loaded a PNG image into a <code>lv_img_dsc_t my_png</code> variable and use it in an <code>lv_img</code> object. If the image is already cached and you then change the underlying PNG file, you need to notify LVGL to cache the image again. Otherwise, there is no easy way of detecting that the underlying file changed and LVGL will still draw the old image from cache.
+
{| class="wikitable"
 +
!英文
 +
!自動翻訳
 +
|-
 +
|
 +
Let's say you have loaded a PNG image into a <code style="color: #bb0000;">lv_img_dsc_t my_png</code> variable and use it in an <code style="color: #bb0000;">lv_img</code> object. If the image is already cached and you then change the underlying PNG file, you need to notify LVGL to cache the image again. Otherwise, there is no easy way of detecting that the underlying file changed and LVGL will still draw the old image from cache.
 +
 
 +
To do this, use <code style="color: #bb0000;">lv_img_cache_invalidate_src(&my_png)</code>. If <code style="color: #bb0000;">NULL</code> is passed as a parameter, the whole cache will be cleaned.
 +
|
 +
|}
 +
:[[App:Library:LVGL:docs:Overview|戻る : Previous]]
  
To do this, use <code>lv_img_cache_invalidate_src(&my_png)</code>. If <code>NULL</code> is passed as a parameter, the whole cache will be cleaned.
 
  
 
== API ==
 
== API ==
 
 
=== Image buffer ===
 
=== Image buffer ===
 +
{| class="wikitable"
 +
!英文
 +
!自動翻訳
 +
|-
 +
|
 
Typedefs
 
Typedefs
  
; <span id="_CPPv311lv_img_cf_t"></span><span id="_CPPv211lv_img_cf_t"></span><span id="lv_img_cf_t"></span><span id="lv__img__buf_8h_1a3cd0b0d2269a76ecf35c65d5abc8fa2c" class="target"></span>typedef uint8_t lv_img_cf_t[https://docs.lvgl.io/8.2/overview/image.html#_CPPv411lv_img_cf_t] <span id="_CPPv311lv_img_cf_t"></span><span id="_CPPv211lv_img_cf_t"></span><span id="lv_img_cf_t"></span><span id="lv__img__buf_8h_1a3cd0b0d2269a76ecf35c65d5abc8fa2c" class="target"></span>
+
<span style="background-color:#e7f2fa;color:#2980b9;">typedef uint8_t lv_img_cf_t </span>
 
:
 
:
  
 
Enums
 
Enums
  
; <span id="_CPPv3Ut2_17"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52caba" class="target"></span>enum [anon[https://docs.lvgl.io/8.2/overview/image.html#_CPPv411lv_img_cf_t]ymous][https://docs.lvgl.io/8.2/overview/image.html#_CPPv4Ut2_17] <span id="_CPPv3Ut2_17"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52caba" class="target"></span>
+
<span style="background-color:#e7f2fa;color:#2980b9;">enum [anonymous] </span>
 
: ''Values:''
 
: ''Values:''
:; <span id="_CPPv3NUt2_1717LV_IMG_CF_UNKNOWNE"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaaec9725b572a51d9e6f65e325c9c17f31" class="target"></span>e[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4Ut2_17]numerator LV_IMG_CF_UNKNOWN[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1717LV_IMG_CF_UNKNOWNE] <span id="_CPPv3NUt2_1717LV_IMG_CF_UNKNOWNE"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaaec9725b572a51d9e6f65e325c9c17f31" class="target"></span>
+
: <span style="background-color: #eeeeee;">enumerator LV_IMG_CF_UNKNOWN </span>
 
::
 
::
:; <span id="_CPPv3NUt2_1713LV_IMG_CF_RAWE"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaae79779c0a260d69563dfa30e9b11d265" class="target"></span>enumerator LV_IMG_[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1717LV_IMG_CF_UNKNOWNE]CF_RAW[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1713LV_IMG_CF_RAWE] <span id="_CPPv3NUt2_1713LV_IMG_CF_RAWE"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaae79779c0a260d69563dfa30e9b11d265" class="target"></span>
+
: <span style="background-color: #eeeeee;">enumerator LV_IMG_CF_RAW </span>
:: Contains the file as[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1713LV_IMG_CF_RAWE] it is. Needs custom decoder function
+
:: Contains the file as it is. Needs custom decoder function
:; <span id="_CPPv3NUt2_1719LV_IMG_CF_RAW_ALPHAE"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaac32f641d0c92f307ce2b93766239bd56" class="target"></span>enumerator LV_IMG_CF_RAW_ALPHA[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1719LV_IMG_CF_RAW_ALPHAE] <span id="_CPPv3NUt2_1719LV_IMG_CF_RAW_ALPHAE"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaac32f641d0c92f307ce2b93766239bd56" class="target"></span>
+
: <span style="background-color: #eeeeee;">enumerator LV_IMG_CF_RAW_ALPHA </span>
:: Contains the file as it is[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1719LV_IMG_CF_RAW_ALPHAE]. The image has alpha. Needs custom decoder function
+
:: Contains the file as it is. The image has alpha. Needs custom decoder function
:; <span id="_CPPv3NUt2_1726LV_IMG_CF_RAW_CHROMA_KEYEDE"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaa07e2f7713a6d4574d34f9548b5949d13" class="target"></span>enumerator LV_IMG_CF_RAW_CHROMA_KEYED[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1726LV_IMG_CF_RAW_CHROMA_KEYEDE] <span id="_CPPv3NUt2_1726LV_IMG_CF_RAW_CHROMA_KEYEDE"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaa07e2f7713a6d4574d34f9548b5949d13" class="target"></span>
+
: <span style="background-color: #eeeeee;">enumerator LV_IMG_CF_RAW_CHROMA_KEYED </span>
:: Contains the file as it is. The i[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1726LV_IMG_CF_RAW_CHROMA_KEYEDE]mage is chroma keyed. Needs custom decoder function
+
:: Contains the file as it is. The image is chroma keyed. Needs custom decoder function
:; <span id="_CPPv3NUt2_1720LV_IMG_CF_TRUE_COLORE"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaacc00dbb56f9207133c12cca0f94c4f8d" class="target"></span>enumerator LV_IMG_CF_TRUE_COLOR[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1720LV_IMG_CF_TRUE_COLORE] <span id="_CPPv3NUt2_1720LV_IMG_CF_TRUE_COLORE"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaacc00dbb56f9207133c12cca0f94c4f8d" class="target"></span>
+
: <span style="background-color: #eeeeee;">enumerator LV_IMG_CF_TRUE_COLOR </span>
:: Color format and depth shou[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1720LV_IMG_CF_TRUE_COLORE]ld match with LV_COLOR settings
+
:: Color format and depth should match with LV_COLOR settings
:; <span id="_CPPv3NUt2_1726LV_IMG_CF_TRUE_COLOR_ALPHAE"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaa77b153c97241ea0312b96a3bd5d4f185" class="target"></span>enumerator LV_IMG_CF_TRUE_COLOR_ALPHA[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1726LV_IMG_CF_TRUE_COLOR_ALPHAE] <span id="_CPPv3NUt2_1726LV_IMG_CF_TRUE_COLOR_ALPHAE"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaa77b153c97241ea0312b96a3bd5d4f185" class="target"></span>
+
: <span style="background-color: #eeeeee;">enumerator LV_IMG_CF_TRUE_COLOR_ALPHA </span>
:: Same as <code>LV_IMG_CF_TRUE_COLOR</code> but [https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1726LV_IMG_CF_TRUE_COLOR_ALPHAE]every pixel has an alpha byte
+
:: Same as <code style="color: #bb0000;">LV_IMG_CF_TRUE_COLOR</code> but every pixel has an alpha byte
:; <span id="_CPPv3NUt2_1733LV_IMG_CF_TRUE_COLOR_CHROMA_KEYEDE"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaa4afaa8f28d1b38d91a4579a7fe5cd746" class="target"></span>enumerator LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1733LV_IMG_CF_TRUE_COLOR_CHROMA_KEYEDE] <span id="_CPPv3NUt2_1733LV_IMG_CF_TRUE_COLOR_CHROMA_KEYEDE"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaa4afaa8f28d1b38d91a4579a7fe5cd746" class="target"></span>
+
: <span style="background-color: #eeeeee;">enumerator LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED </span>
:: Same as <code>LV_IMG_CF_TRUE_COLOR</code> but LV_COLO[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1733LV_IMG_CF_TRUE_COLOR_CHROMA_KEYEDE]R_TRANSP pixels will be transparent
+
:: Same as <code style="color: #bb0000;">LV_IMG_CF_TRUE_COLOR</code> but LV_COLOR_TRANSP pixels will be transparent
:; <span id="_CPPv3NUt2_1722LV_IMG_CF_INDEXED_1BITE"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaace7d7c0dc2a98e0d1989f1c102b5ea3b" class="target"></span>enumerator LV_IMG_CF_INDEXED_1BIT[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1722LV_IMG_CF_INDEXED_1BITE] <span id="_CPPv3NUt2_1722LV_IMG_CF_INDEXED_1BITE"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaace7d7c0dc2a98e0d1989f1c102b5ea3b" class="target"></span>
+
: <span style="background-color: #eeeeee;">enumerator LV_IMG_CF_INDEXED_1BIT </span>
:: Can have 2 different colors i[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1722LV_IMG_CF_INDEXED_1BITE]n a palette (always chroma keyed)
+
:: Can have 2 different colors in a palette (always chroma keyed)
:; <span id="_CPPv3NUt2_1722LV_IMG_CF_INDEXED_2BITE"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaaa6c3c2fdc1a2c273f50d3638ee62d775" class="target"></span>enumerator LV_IMG_CF_INDEXED_2BIT[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1722LV_IMG_CF_INDEXED_2BITE] <span id="_CPPv3NUt2_1722LV_IMG_CF_INDEXED_2BITE"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaaa6c3c2fdc1a2c273f50d3638ee62d775" class="target"></span>
+
: <span style="background-color: #eeeeee;">enumerator LV_IMG_CF_INDEXED_2BIT </span>
:: Can have 4 different colors i[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1722LV_IMG_CF_INDEXED_2BITE]n a palette (always chroma keyed)
+
:: Can have 4 different colors in a palette (always chroma keyed)
:; <span id="_CPPv3NUt2_1722LV_IMG_CF_INDEXED_4BITE"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaac541e5ff700cbab1422972b2124fa857" class="target"></span>enumerator LV_IMG_CF_INDEXED_4BIT[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1722LV_IMG_CF_INDEXED_4BITE] <span id="_CPPv3NUt2_1722LV_IMG_CF_INDEXED_4BITE"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaac541e5ff700cbab1422972b2124fa857" class="target"></span>
+
: <span style="background-color: #eeeeee;">enumerator LV_IMG_CF_INDEXED_4BIT </span>
:: Can have 16 different colors [https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1722LV_IMG_CF_INDEXED_4BITE]in a palette (always chroma keyed)
+
:: Can have 16 different colors in a palette (always chroma keyed)
:; <span id="_CPPv3NUt2_1722LV_IMG_CF_INDEXED_8BITE"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaa05da196150be23ccba0bee4d64b0e13f" class="target"></span>enumerator LV_IMG_CF_INDEXED_8BIT[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1722LV_IMG_CF_INDEXED_8BITE] <span id="_CPPv3NUt2_1722LV_IMG_CF_INDEXED_8BITE"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaa05da196150be23ccba0bee4d64b0e13f" class="target"></span>
+
: <span style="background-color: #eeeeee;">enumerator LV_IMG_CF_INDEXED_8BIT </span>
:: Can have 256 different colors[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1722LV_IMG_CF_INDEXED_8BITE] in a palette (always chroma keyed)
+
:: Can have 256 different colors in a palette (always chroma keyed)
:; <span id="_CPPv3NUt2_1720LV_IMG_CF_ALPHA_1BITE"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaa0704ce366200825b155639eabb098f72" class="target"></span>enumerator LV_IMG_CF_ALPHA_1BIT[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1720LV_IMG_CF_ALPHA_1BITE] <span id="_CPPv3NUt2_1720LV_IMG_CF_ALPHA_1BITE"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaa0704ce366200825b155639eabb098f72" class="target"></span>
+
: <span style="background-color: #eeeeee;">enumerator LV_IMG_CF_ALPHA_1BIT </span>
:: Can have one color and it c[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1720LV_IMG_CF_ALPHA_1BITE]an be drawn or not
+
:: Can have one color and it can be drawn or not
:; <span id="_CPPv3NUt2_1720LV_IMG_CF_ALPHA_2BITE"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaa384013e83c460e879851d57bb335c561" class="target"></span>enumerator LV_IMG_CF_ALPHA_2BIT[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1720LV_IMG_CF_ALPHA_2BITE] <span id="_CPPv3NUt2_1720LV_IMG_CF_ALPHA_2BITE"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaa384013e83c460e879851d57bb335c561" class="target"></span>
+
: <span style="background-color: #eeeeee;">enumerator LV_IMG_CF_ALPHA_2BIT </span>
:: Can have one color but 4 di[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1720LV_IMG_CF_ALPHA_2BITE]fferent alpha value
+
:: Can have one color but 4 different alpha value
:; <span id="_CPPv3NUt2_1720LV_IMG_CF_ALPHA_4BITE"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaa87a787a99d25627728738686b0ce3ef6" class="target"></span>enumerator LV_IMG_CF_ALPHA_4BIT[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1720LV_IMG_CF_ALPHA_4BITE] <span id="_CPPv3NUt2_1720LV_IMG_CF_ALPHA_4BITE"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaa87a787a99d25627728738686b0ce3ef6" class="target"></span>
+
: <span style="background-color: #eeeeee;">enumerator LV_IMG_CF_ALPHA_4BIT </span>
:: Can have one color but 16 d[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1720LV_IMG_CF_ALPHA_4BITE]ifferent alpha value
+
:: Can have one color but 16 different alpha value
:; <span id="_CPPv3NUt2_1720LV_IMG_CF_ALPHA_8BITE"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaaa886fdd8e02ff433765a3ac3ee3f3103" class="target"></span>enumerator LV_IMG_CF_ALPHA_8BIT[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1720LV_IMG_CF_ALPHA_8BITE] <span id="_CPPv3NUt2_1720LV_IMG_CF_ALPHA_8BITE"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaaa886fdd8e02ff433765a3ac3ee3f3103" class="target"></span>
+
: <span style="background-color: #eeeeee;">enumerator LV_IMG_CF_ALPHA_8BIT </span>
:: Can have one color but 256 [https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1720LV_IMG_CF_ALPHA_8BITE]different alpha value
+
:: Can have one color but 256 different alpha value
:; <span id="_CPPv3NUt2_1721LV_IMG_CF_RESERVED_15E"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaac6006bf886cf67fbdcba2fc35420dde1" class="target"></span>enumerator LV_IMG_CF_RESERVED_15[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1721LV_IMG_CF_RESERVED_15E] <span id="_CPPv3NUt2_1721LV_IMG_CF_RESERVED_15E"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaac6006bf886cf67fbdcba2fc35420dde1" class="target"></span>
+
: <span style="background-color: #eeeeee;">enumerator LV_IMG_CF_RESERVED_15 </span>
:: Reserved for further use. [https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1721LV_IMG_CF_RESERVED_15E]
+
:: Reserved for further use.  
:; <span id="_CPPv3NUt2_1721LV_IMG_CF_RESERVED_16E"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaac41001bc99874f888699ee66c95e4a60" class="target"></span>enumerator LV_IMG_CF_RESERVED_16[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1721LV_IMG_CF_RESERVED_16E] <span id="_CPPv3NUt2_1721LV_IMG_CF_RESERVED_16E"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaac41001bc99874f888699ee66c95e4a60" class="target"></span>
+
: <span style="background-color: #eeeeee;">enumerator LV_IMG_CF_RESERVED_16 </span>
:: Reserved for further use. [https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1721LV_IMG_CF_RESERVED_16E]
+
:: Reserved for further use.
:; <span id="_CPPv3NUt2_1721LV_IMG_CF_RESERVED_17E"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaa43ab253b62444e42d42f13aa095cf403" class="target"></span>enumerator LV_IMG_CF_RESERVED_17[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1721LV_IMG_CF_RESERVED_17E] <span id="_CPPv3NUt2_1721LV_IMG_CF_RESERVED_17E"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaa43ab253b62444e42d42f13aa095cf403" class="target"></span>
+
: <span style="background-color: #eeeeee;">enumerator LV_IMG_CF_RESERVED_17 </span>
:: Reserved for further use. [https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1721LV_IMG_CF_RESERVED_17E]
+
:: Reserved for further use.  
:; <span id="_CPPv3NUt2_1721LV_IMG_CF_RESERVED_18E"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaa8218597f402ec4f232086733989c7bdd" class="target"></span>enumerator LV_IMG_CF_RESERVED_18[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1721LV_IMG_CF_RESERVED_18E] <span id="_CPPv3NUt2_1721LV_IMG_CF_RESERVED_18E"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaa8218597f402ec4f232086733989c7bdd" class="target"></span>
+
: <span style="background-color: #eeeeee;">enumerator LV_IMG_CF_RESERVED_18 </span>
:: Reserved for further use. [https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1721LV_IMG_CF_RESERVED_18E]
+
:: Reserved for further use.
:; <span id="_CPPv3NUt2_1721LV_IMG_CF_RESERVED_19E"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaa8772a961b79a708937a85ec355ee7bf2" class="target"></span>enumerator LV_IMG_CF_RESERVED_19[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1721LV_IMG_CF_RESERVED_19E] <span id="_CPPv3NUt2_1721LV_IMG_CF_RESERVED_19E"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaa8772a961b79a708937a85ec355ee7bf2" class="target"></span>
+
: <span style="background-color: #eeeeee;">enumerator LV_IMG_CF_RESERVED_19 </span>
:: Reserved for further use. [https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1721LV_IMG_CF_RESERVED_19E]
+
:: Reserved for further use.
:; <span id="_CPPv3NUt2_1721LV_IMG_CF_RESERVED_20E"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaa5f19c0882596b10e127b1a644d49d839" class="target"></span>enumerator LV_IMG_CF_RESERVED_20[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1721LV_IMG_CF_RESERVED_20E] <span id="_CPPv3NUt2_1721LV_IMG_CF_RESERVED_20E"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaa5f19c0882596b10e127b1a644d49d839" class="target"></span>
+
: <span style="background-color: #eeeeee;">enumerator LV_IMG_CF_RESERVED_20 </span>
:: Reserved for further use. [https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1721LV_IMG_CF_RESERVED_20E]
+
:: Reserved for further use.  
:; <span id="_CPPv3NUt2_1721LV_IMG_CF_RESERVED_21E"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaa97912596b301ed725dd471c109e7d22e" class="target"></span>enumerator LV_IMG_CF_RESERVED_21[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1721LV_IMG_CF_RESERVED_21E] <span id="_CPPv3NUt2_1721LV_IMG_CF_RESERVED_21E"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaa97912596b301ed725dd471c109e7d22e" class="target"></span>
+
: <span style="background-color: #eeeeee;">enumerator LV_IMG_CF_RESERVED_21 </span>
:: Reserved for further use. [https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1721LV_IMG_CF_RESERVED_21E]
+
:: Reserved for further use.
:; <span id="_CPPv3NUt2_1721LV_IMG_CF_RESERVED_22E"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaaf6daa2d7b441229c118cae568f7be0e2" class="target"></span>enumerator LV_IMG_CF_RESERVED_22[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1721LV_IMG_CF_RESERVED_22E] <span id="_CPPv3NUt2_1721LV_IMG_CF_RESERVED_22E"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaaf6daa2d7b441229c118cae568f7be0e2" class="target"></span>
+
: <span style="background-color: #eeeeee;">enumerator LV_IMG_CF_RESERVED_22 </span>
:: Reserved for further use. [https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1721LV_IMG_CF_RESERVED_22E]
+
:: Reserved for further use.  
:; <span id="_CPPv3NUt2_1721LV_IMG_CF_RESERVED_23E"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaaab39036176cb11aad4434ae226d2b701" class="target"></span>enumerator LV_IMG_CF_RESERVED_23[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1721LV_IMG_CF_RESERVED_23E] <span id="_CPPv3NUt2_1721LV_IMG_CF_RESERVED_23E"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaaab39036176cb11aad4434ae226d2b701" class="target"></span>
+
: <span style="background-color: #eeeeee;">enumerator LV_IMG_CF_RESERVED_23 </span>
:: Reserved for further use. [https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1721LV_IMG_CF_RESERVED_23E]
+
:: Reserved for further use.
:; <span id="_CPPv3NUt2_1724LV_IMG_CF_USER_ENCODED_0E"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaa13acddabcd2b3d47fd6f77f1aa014788" class="target"></span>enumerator LV_IMG_CF_USER_ENCODED_0[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1724LV_IMG_CF_USER_ENCODED_0E] <span id="_CPPv3NUt2_1724LV_IMG_CF_USER_ENCODED_0E"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaa13acddabcd2b3d47fd6f77f1aa014788" class="target"></span>
+
: <span style="background-color: #eeeeee;">enumerator LV_IMG_CF_USER_ENCODED_0 </span>
:: User holder encoding format. [https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1724LV_IMG_CF_USER_ENCODED_0E]
+
:: User holder encoding format.
:; <span id="_CPPv3NUt2_1724LV_IMG_CF_USER_ENCODED_1E"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaa7a5e55bc05ae9d4fafa3670ce8fcdf07" class="target"></span>enumerator LV_IMG_CF_USER_ENCODED_1[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1724LV_IMG_CF_USER_ENCODED_1E] <span id="_CPPv3NUt2_1724LV_IMG_CF_USER_ENCODED_1E"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaa7a5e55bc05ae9d4fafa3670ce8fcdf07" class="target"></span>
+
: <span style="background-color: #eeeeee;">enumerator LV_IMG_CF_USER_ENCODED_1 </span>
:: User holder encoding format. [https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1724LV_IMG_CF_USER_ENCODED_1E]
+
:: User holder encoding format.
:; <span id="_CPPv3NUt2_1724LV_IMG_CF_USER_ENCODED_2E"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaabd5c306386fd2f5c061b8b1c1bcaf512" class="target"></span>enumerator LV_IMG_CF_USER_ENCODED_2[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1724LV_IMG_CF_USER_ENCODED_2E] <span id="_CPPv3NUt2_1724LV_IMG_CF_USER_ENCODED_2E"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaabd5c306386fd2f5c061b8b1c1bcaf512" class="target"></span>
+
: <span style="background-color: #eeeeee;">enumerator LV_IMG_CF_USER_ENCODED_2 </span>
:: User holder encoding format. [https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1724LV_IMG_CF_USER_ENCODED_2E]
+
:: User holder encoding format.  
:; <span id="_CPPv3NUt2_1724LV_IMG_CF_USER_ENCODED_3E"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaa5498735a659fb327623b221baa39d8a2" class="target"></span>enumerator LV_IMG_CF_USER_ENCODED_3[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1724LV_IMG_CF_USER_ENCODED_3E] <span id="_CPPv3NUt2_1724LV_IMG_CF_USER_ENCODED_3E"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaa5498735a659fb327623b221baa39d8a2" class="target"></span>
+
: <span style="background-color: #eeeeee;">enumerator LV_IMG_CF_USER_ENCODED_3 </span>
:: User holder encoding format. [https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1724LV_IMG_CF_USER_ENCODED_3E]
+
:: User holder encoding format.
:; <span id="_CPPv3NUt2_1724LV_IMG_CF_USER_ENCODED_4E"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaaed7b220bc523d7e71e118d663e93de95" class="target"></span>enumerator LV_IMG_CF_USER_ENCODED_4[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1724LV_IMG_CF_USER_ENCODED_4E] <span id="_CPPv3NUt2_1724LV_IMG_CF_USER_ENCODED_4E"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaaed7b220bc523d7e71e118d663e93de95" class="target"></span>
+
: <span style="background-color: #eeeeee;">enumerator LV_IMG_CF_USER_ENCODED_4 </span>
:: User holder encoding format. [https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1724LV_IMG_CF_USER_ENCODED_4E]
+
:: User holder encoding format.  
:; <span id="_CPPv3NUt2_1724LV_IMG_CF_USER_ENCODED_5E"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaa86489e0f698809d9de29da439f62df97" class="target"></span>enumerator LV_IMG_CF_USER_ENCODED_5[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1724LV_IMG_CF_USER_ENCODED_5E] <span id="_CPPv3NUt2_1724LV_IMG_CF_USER_ENCODED_5E"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaa86489e0f698809d9de29da439f62df97" class="target"></span>
+
: <span style="background-color: #eeeeee;">enumerator LV_IMG_CF_USER_ENCODED_5 </span>
:: User holder encoding format. [https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1724LV_IMG_CF_USER_ENCODED_5E]
+
:: User holder encoding format.
:; <span id="_CPPv3NUt2_1724LV_IMG_CF_USER_ENCODED_6E"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaaa8a98ec44b8871abe5dc1b2e59cead26" class="target"></span>enumerator LV_IMG_CF_USER_ENCODED_6[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1724LV_IMG_CF_USER_ENCODED_6E] <span id="_CPPv3NUt2_1724LV_IMG_CF_USER_ENCODED_6E"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaaa8a98ec44b8871abe5dc1b2e59cead26" class="target"></span>
+
: <span style="background-color: #eeeeee;">enumerator LV_IMG_CF_USER_ENCODED_6 </span>
:: User holder encoding format. [https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1724LV_IMG_CF_USER_ENCODED_6E]
+
:: User holder encoding format.
:; <span id="_CPPv3NUt2_1724LV_IMG_CF_USER_ENCODED_7E"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaa8d3c364964cd71c5cdde6c27b1fb48f4" class="target"></span>enumerator LV_IMG_CF_USER_ENCODED_7[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1724LV_IMG_CF_USER_ENCODED_7E] <span id="_CPPv3NUt2_1724LV_IMG_CF_USER_ENCODED_7E"></span><span id="lv__img__buf_8h_1a80155586fa275b28773c9b203f52cabaa8d3c364964cd71c5cdde6c27b1fb48f4" class="target"></span>
+
: <span style="background-color: #eeeeee;">enumerator LV_IMG_CF_USER_ENCODED_7 </span>
:: User holder encoding format. [https://docs.lvgl.io/8.2/overview/image.html#_CPPv4NUt2_1724LV_IMG_CF_USER_ENCODED_7E]
+
:: User holder encoding format.  
  
 
Functions
 
Functions
  
; <span id="_CPPv316lv_img_buf_alloc10lv_coord_t10lv_coord_t11lv_img_cf_t"></span><span id="_CPPv216lv_img_buf_alloc10lv_coord_t10lv_coord_t11lv_img_cf_t"></span><span id="lv_img_buf_alloc__lv_coord_t.lv_coord_t.lv_img_cf_t"></span><span id="lv__img__buf_8h_1a0119ae731cc4db78cb1ac5d57f1cea4c" class="target"></span>lv_img_dsc_t *lv_img_buf_alloc(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf)[https://docs.lvgl.io/8.2/overview/image.html#_CPPv416lv_img_buf_alloc10lv_coord_t10lv_coord_t11lv_img_cf_t] <span id="_CPPv316lv_img_buf_alloc10lv_coord_t10lv_coord_t11lv_img_cf_t"></span><span id="_CPPv216lv_img_buf_alloc10lv_coord_t10lv_coord_t11lv_img_cf_t"></span><span id="lv_img_buf_alloc__lv_coord_t.lv_coord_t.lv_img_cf_t"></span><span id="lv__img__buf_8h_1a0119ae731cc4db78cb1ac5d57f1cea4c" class="target"></span>
+
<span style="background-color:#e7f2fa;color:#2980b9;">lv_img_dsc_t *lv_img_buf_alloc(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf) </span>
 
: Allocate an image buffer in RAM
 
: Allocate an image buffer in RAM
:; Parameters
+
: Parameters
::* w -- width of image[https://docs.lvgl.io/8.2/overview/image.html#_CPPv416lv_img_buf_alloc10lv_coord_t10lv_coord_t11lv_img_cf_t]
+
::* w -- width of image
 
::* h -- height of image
 
::* h -- height of image
::* cf -- a color format (<code>LV_IMG_CF_...</code>)
+
::* cf -- a color format (<code style="color: #bb0000;">LV_IMG_CF_...</code>)
:; Returns
+
: Returns
 
:: an allocated image, or NULL on failure
 
:: an allocated image, or NULL on failure
  
; <span id="_CPPv323lv_img_buf_get_px_colorP12lv_img_dsc_t10lv_coord_t10lv_coord_t10lv_color_t"></span><span id="_CPPv223lv_img_buf_get_px_colorP12lv_img_dsc_t10lv_coord_t10lv_coord_t10lv_color_t"></span><span id="lv_img_buf_get_px_color__lv_img_dsc_tP.lv_coord_t.lv_coord_t.lv_color_t"></span><span id="lv__img__buf_8h_1acb536b0da91461b0070bb46f2e3d5d02" class="target"></span>lv_color_t lv_img_buf_get_px_color(lv_img_dsc_t *dsc, lv_coord_t x, lv_coord_t y, lv_color_t color)[https://docs.lvgl.io/8.2/overview/image.html#_CPPv423lv_img_buf_get_px_colorP12lv_img_dsc_t10lv_coord_t10lv_coord_t10lv_color_t] <span id="_CPPv323lv_img_buf_get_px_colorP12lv_img_dsc_t10lv_coord_t10lv_coord_t10lv_color_t"></span><span id="_CPPv223lv_img_buf_get_px_colorP12lv_img_dsc_t10lv_coord_t10lv_coord_t10lv_color_t"></span><span id="lv_img_buf_get_px_color__lv_img_dsc_tP.lv_coord_t.lv_coord_t.lv_color_t"></span><span id="lv__img__buf_8h_1acb536b0da91461b0070bb46f2e3d5d02" class="target"></span>
+
<span style="background-color:#e7f2fa;color:#2980b9;">lv_color_t lv_img_buf_get_px_color(lv_img_dsc_t *dsc, lv_coord_t x, lv_coord_t y, lv_color_t color) </span>
 
: Get the color of an image's pixel
 
: Get the color of an image's pixel
:; Parameters
+
: Parameters
 
::* dsc -- an image descriptor
 
::* dsc -- an image descriptor
::* x -- x coord[https://docs.lvgl.io/8.2/overview/image.html#_CPPv423lv_img_buf_get_px_colorP12lv_img_dsc_t10lv_coord_t10lv_coord_t10lv_color_t]inate of the point to get
+
::* x -- x coordinate of the point to get
 
::* y -- x coordinate of the point to get
 
::* y -- x coordinate of the point to get
::* color -- the color of the image. In case of <code>LV_IMG_CF_ALPHA_1/2/4/8</code> this color is used. Not used in other cases.
+
::* color -- the color of the image. In case of <code style="color: #bb0000;">LV_IMG_CF_ALPHA_1/2/4/8</code> this color is used. Not used in other cases.
 
::* safe -- true: check out of bounds
 
::* safe -- true: check out of bounds
:; Returns
+
: Returns
 
:: color of the point
 
:: color of the point
  
; <span id="_CPPv323lv_img_buf_get_px_alphaP12lv_img_dsc_t10lv_coord_t10lv_coord_t"></span><span id="_CPPv223lv_img_buf_get_px_alphaP12lv_img_dsc_t10lv_coord_t10lv_coord_t"></span><span id="lv_img_buf_get_px_alpha__lv_img_dsc_tP.lv_coord_t.lv_coord_t"></span><span id="lv__img__buf_8h_1ada8e08538d9c79d72c3b75681abf0c59" class="target"></span>lv_opa_t lv_img_buf_get_px_alpha(lv_img_dsc_t *dsc, lv_coord_t x, lv_coord_t y)[https://docs.lvgl.io/8.2/overview/image.html#_CPPv423lv_img_buf_get_px_alphaP12lv_img_dsc_t10lv_coord_t10lv_coord_t] <span id="_CPPv323lv_img_buf_get_px_alphaP12lv_img_dsc_t10lv_coord_t10lv_coord_t"></span><span id="_CPPv223lv_img_buf_get_px_alphaP12lv_img_dsc_t10lv_coord_t10lv_coord_t"></span><span id="lv_img_buf_get_px_alpha__lv_img_dsc_tP.lv_coord_t.lv_coord_t"></span><span id="lv__img__buf_8h_1ada8e08538d9c79d72c3b75681abf0c59" class="target"></span>
+
<span style="background-color:#e7f2fa;color:#2980b9;">lv_opa_t lv_img_buf_get_px_alpha(lv_img_dsc_t *dsc, lv_coord_t x, lv_coord_t y) </span>
 
: Get the alpha value of an image's pixel
 
: Get the alpha value of an image's pixel
:; Parameters
+
: Parameters
::* dsc -- pointer t[https://docs.lvgl.io/8.2/overview/image.html#_CPPv423lv_img_buf_get_px_alphaP12lv_img_dsc_t10lv_coord_t10lv_coord_t]o an image descriptor
+
::* dsc -- pointer to an image descriptor
 
::* x -- x coordinate of the point to set
 
::* x -- x coordinate of the point to set
 
::* y -- x coordinate of the point to set
 
::* y -- x coordinate of the point to set
 
::* safe -- true: check out of bounds
 
::* safe -- true: check out of bounds
:; Returns
+
: Returns
 
:: alpha value of the point
 
:: alpha value of the point
  
; <span id="_CPPv323lv_img_buf_set_px_colorP12lv_img_dsc_t10lv_coord_t10lv_coord_t10lv_color_t"></span><span id="_CPPv223lv_img_buf_set_px_colorP12lv_img_dsc_t10lv_coord_t10lv_coord_t10lv_color_t"></span><span id="lv_img_buf_set_px_color__lv_img_dsc_tP.lv_coord_t.lv_coord_t.lv_color_t"></span><span id="lv__img__buf_8h_1aa137b85163313565d31aa47e71032c00" class="target"></span>void lv_img_buf_set_px_color(lv_img_dsc_t *dsc, lv_coord_t x, lv_coord_t y, lv_color_t c)[https://docs.lvgl.io/8.2/overview/image.html#_CPPv423lv_img_buf_set_px_colorP12lv_img_dsc_t10lv_coord_t10lv_coord_t10lv_color_t] <span id="_CPPv323lv_img_buf_set_px_colorP12lv_img_dsc_t10lv_coord_t10lv_coord_t10lv_color_t"></span><span id="_CPPv223lv_img_buf_set_px_colorP12lv_img_dsc_t10lv_coord_t10lv_coord_t10lv_color_t"></span><span id="lv_img_buf_set_px_color__lv_img_dsc_tP.lv_coord_t.lv_coord_t.lv_color_t"></span><span id="lv__img__buf_8h_1aa137b85163313565d31aa47e71032c00" class="target"></span>
+
<span style="background-color:#e7f2fa;color:#2980b9;">void lv_img_buf_set_px_color(lv_img_dsc_t *dsc, lv_coord_t x, lv_coord_t y, lv_color_t c) </span>
 
: Set the color of a pixel of an image. The alpha channel won't be affected.
 
: Set the color of a pixel of an image. The alpha channel won't be affected.
:; Paramet[https://docs.lvgl.io/8.2/overview/image.html#_CPPv423lv_img_buf_set_px_colorP12lv_img_dsc_t10lv_coord_t10lv_coord_t10lv_color_t]ers
+
: Parameters
 
::* dsc -- pointer to an image descriptor
 
::* dsc -- pointer to an image descriptor
 
::* x -- x coordinate of the point to set
 
::* x -- x coordinate of the point to set
405行目: 561行目:
 
::* safe -- true: check out of bounds
 
::* safe -- true: check out of bounds
  
; <span id="_CPPv323lv_img_buf_set_px_alphaP12lv_img_dsc_t10lv_coord_t10lv_coord_t8lv_opa_t"></span><span id="_CPPv223lv_img_buf_set_px_alphaP12lv_img_dsc_t10lv_coord_t10lv_coord_t8lv_opa_t"></span><span id="lv_img_buf_set_px_alpha__lv_img_dsc_tP.lv_coord_t.lv_coord_t.lv_opa_t"></span><span id="lv__img__buf_8h_1a00e3395e129e36a06f0743355056c641" class="target"></span>void lv_img_buf_set_px_alpha(lv_img_dsc_t *dsc, lv_coord_t x, lv_coord_t y, lv_opa_t opa)[https://docs.lvgl.io/8.2/overview/image.html#_CPPv423lv_img_buf_set_px_alphaP12lv_img_dsc_t10lv_coord_t10lv_coord_t8lv_opa_t] <span id="_CPPv323lv_img_buf_set_px_alphaP12lv_img_dsc_t10lv_coord_t10lv_coord_t8lv_opa_t"></span><span id="_CPPv223lv_img_buf_set_px_alphaP12lv_img_dsc_t10lv_coord_t10lv_coord_t8lv_opa_t"></span><span id="lv_img_buf_set_px_alpha__lv_img_dsc_tP.lv_coord_t.lv_coord_t.lv_opa_t"></span><span id="lv__img__buf_8h_1a00e3395e129e36a06f0743355056c641" class="target"></span>
+
<span style="background-color:#e7f2fa;color:#2980b9;">void lv_img_buf_set_px_alpha(lv_img_dsc_t *dsc, lv_coord_t x, lv_coord_t y, lv_opa_t opa) </span>
 
: Set the alpha value of a pixel of an image. The color won't be affected
 
: Set the alpha value of a pixel of an image. The color won't be affected
:; Parameters[https://docs.lvgl.io/8.2/overview/image.html#_CPPv423lv_img_buf_set_px_alphaP12lv_img_dsc_t10lv_coord_t10lv_coord_t8lv_opa_t]
+
: Parameters
 
::* dsc -- pointer to an image descriptor
 
::* dsc -- pointer to an image descriptor
 
::* x -- x coordinate of the point to set
 
::* x -- x coordinate of the point to set
414行目: 570行目:
 
::* safe -- true: check out of bounds
 
::* safe -- true: check out of bounds
  
; <span id="_CPPv322lv_img_buf_set_paletteP12lv_img_dsc_t7uint8_t10lv_color_t"></span><span id="_CPPv222lv_img_buf_set_paletteP12lv_img_dsc_t7uint8_t10lv_color_t"></span><span id="lv_img_buf_set_palette__lv_img_dsc_tP.uint8_t.lv_color_t"></span><span id="lv__img__buf_8h_1af52fa01e288c05056908e06365c9a1e6" class="target"></span>void lv_img_buf_set_palette(lv_img_dsc_t *dsc, uint8_t id, lv_color_t c)[https://docs.lvgl.io/8.2/overview/image.html#_CPPv422lv_img_buf_set_paletteP12lv_img_dsc_t7uint8_t10lv_color_t] <span id="_CPPv322lv_img_buf_set_paletteP12lv_img_dsc_t7uint8_t10lv_color_t"></span><span id="_CPPv222lv_img_buf_set_paletteP12lv_img_dsc_t7uint8_t10lv_color_t"></span><span id="lv_img_buf_set_palette__lv_img_dsc_tP.uint8_t.lv_color_t"></span><span id="lv__img__buf_8h_1af52fa01e288c05056908e06365c9a1e6" class="target"></span>
+
<span style="background-color:#e7f2fa;color:#2980b9;">void lv_img_buf_set_palette(lv_img_dsc_t *dsc, uint8_t id, lv_color_t c) </span>
: Set the palette color of an indexed image. Valid only for <code>LV_IMG_CF_</code>[https://docs.lvgl.io/8.2/overview/image.html#_CPPv422lv_img_buf_set_paletteP12lv_img_dsc_t7uint8_t10lv_color_t]<code>INDEXED1/2/4/8</code>
+
: Set the palette color of an indexed image. Valid only for <code style="color: #bb0000;">LV_IMG_CF_</code><code style="color: #bb0000;">INDEXED1/2/4/8</code>
:; Parameters
+
: Parameters
 
::* dsc -- pointer to an image descriptor
 
::* dsc -- pointer to an image descriptor
 
::* id -- the palette color to set:
 
::* id -- the palette color to set:
::** for <code>LV_IMG_CF_INDEXED1</code>: 0..1
+
::** for <code style="color: #bb0000;">LV_IMG_CF_INDEXED1</code>: 0..1
::** for <code>LV_IMG_CF_INDEXED2</code>: 0..3
+
::** for <code style="color: #bb0000;">LV_IMG_CF_INDEXED2</code>: 0..3
::** for <code>LV_IMG_CF_INDEXED4</code>: 0..15
+
::** for <code style="color: #bb0000;">LV_IMG_CF_INDEXED4</code>: 0..15
::** for <code>LV_IMG_CF_INDEXED8</code>: 0..255
+
::** for <code style="color: #bb0000;">LV_IMG_CF_INDEXED8</code>: 0..255
 
::* c -- the color to set
 
::* c -- the color to set
  
; <span id="_CPPv315lv_img_buf_freeP12lv_img_dsc_t"></span><span id="_CPPv215lv_img_buf_freeP12lv_img_dsc_t"></span><span id="lv_img_buf_free__lv_img_dsc_tP"></span><span id="lv__img__buf_8h_1afda14850c7da203239ded571831a776e" class="target"></span>void lv_img_buf_free(lv_img_dsc_t *dsc)[https://docs.lvgl.io/8.2/overview/image.html#_CPPv415lv_img_buf_freeP12lv_img_dsc_t] <span id="_CPPv315lv_img_buf_freeP12lv_img_dsc_t"></span><span id="_CPPv215lv_img_buf_freeP12lv_img_dsc_t"></span><span id="lv_img_buf_free__lv_img_dsc_tP"></span><span id="lv__img__buf_8h_1afda14850c7da203239ded571831a776e" class="target"></span>
+
<span style="background-color:#e7f2fa;color:#2980b9;">void lv_img_buf_free(lv_img_dsc_t *dsc) </span>
 
: Free an allocated image buffer
 
: Free an allocated image buffer
:; P[https://docs.lvgl.io/8.2/overview/image.html#_CPPv415lv_img_buf_freeP12lv_img_dsc_t]arameters
+
: Parameters
 
:: dsc -- image buffer to free
 
:: dsc -- image buffer to free
  
; <span id="_CPPv323lv_img_buf_get_img_size10lv_coord_t10lv_coord_t11lv_img_cf_t"></span><span id="_CPPv223lv_img_buf_get_img_size10lv_coord_t10lv_coord_t11lv_img_cf_t"></span><span id="lv_img_buf_get_img_size__lv_coord_t.lv_coord_t.lv_img_cf_t"></span><span id="lv__img__buf_8h_1a5da34d625c83610b49ee8eb11d55a8cf" class="target"></span>uint32_t lv_img_buf_get_img_size(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf)[https://docs.lvgl.io/8.2/overview/image.html#_CPPv423lv_img_buf_get_img_size10lv_coord_t10lv_coord_t11lv_img_cf_t] <span id="_CPPv323lv_img_buf_get_img_size10lv_coord_t10lv_coord_t11lv_img_cf_t"></span><span id="_CPPv223lv_img_buf_get_img_size10lv_coord_t10lv_coord_t11lv_img_cf_t"></span><span id="lv_img_buf_get_img_size__lv_coord_t.lv_coord_t.lv_img_cf_t"></span><span id="lv__img__buf_8h_1a5da34d625c83610b49ee8eb11d55a8cf" class="target"></span>
+
<span style="background-color:#e7f2fa;color:#2980b9;">uint32_t lv_img_buf_get_img_size(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf) </span>
: Get the memory consumption of a raw bitmap, given color format and dimen[https://docs.lvgl.io/8.2/overview/image.html#_CPPv423lv_img_buf_get_img_size10lv_coord_t10lv_coord_t11lv_img_cf_t]sions.
+
: Get the memory consumption of a raw bitmap, given color format and dimensions.
:; Parameters
+
: Parameters
 
::* w -- width
 
::* w -- width
 
::* h -- height
 
::* h -- height
 
::* cf -- color format
 
::* cf -- color format
:; Returns
+
: Returns
 
:: size in bytes
 
:: size in bytes
  
; <span id="_CPPv326_lv_img_buf_transform_initP22lv_img_transform_dsc_t"></span><span id="_CPPv226_lv_img_buf_transform_initP22lv_img_transform_dsc_t"></span><span id="_lv_img_buf_transform_init__lv_img_transform_dsc_tP"></span><span id="lv__img__buf_8h_1ab063d41648b7f89d9638916673bb015c" class="target"></span>void _lv_img_buf_transform_init(lv_img_transform_dsc_t *dsc)[https://docs.lvgl.io/8.2/overview/image.html#_CPPv426_lv_img_buf_transform_initP22lv_img_transform_dsc_t] <span id="_CPPv326_lv_img_buf_transform_initP22lv_img_transform_dsc_t"></span><span id="_CPPv226_lv_img_buf_transform_initP22lv_img_transform_dsc_t"></span><span id="_lv_img_buf_transform_init__lv_img_transform_dsc_tP"></span><span id="lv__img__buf_8h_1ab063d41648b7f89d9638916673bb015c" class="target"></span>
+
<span style="background-color:#e7f2fa;color:#2980b9;">void _lv_img_buf_transform_init(lv_img_transform_dsc_t *dsc) </span>
 
: Initialize a descriptor to rotate an image
 
: Initialize a descriptor to rotate an image
:; Parameters[https://docs.lvgl.io/8.2/overview/image.html#_CPPv426_lv_img_buf_transform_initP22lv_img_transform_dsc_t]
+
: Parameters
:: dsc -- pointer to an <code>lv_img_transform_dsc_t</code> variable whose <code>cfg</code> field is initialized
+
:: dsc -- pointer to an <code style="color: #bb0000;">lv_img_transform_dsc_t</code> variable whose <code style="color: #bb0000;">cfg</code> field is initialized
  
; <span id="_CPPv332_lv_img_buf_transform_anti_aliasP22lv_img_transform_dsc_t"></span><span id="_CPPv232_lv_img_buf_transform_anti_aliasP22lv_img_transform_dsc_t"></span><span id="_lv_img_buf_transform_anti_alias__lv_img_transform_dsc_tP"></span><span id="lv__img__buf_8h_1a8cd4d03b10a75fefdf8ff1b26e74fde9" class="target"></span>bool _lv_img_buf_transform_anti_alias(lv_img_transform_dsc_t *dsc)[https://docs.lvgl.io/8.2/overview/image.html#_CPPv432_lv_img_buf_transform_anti_aliasP22lv_img_transform_dsc_t] <span id="_CPPv332_lv_img_buf_transform_anti_aliasP22lv_img_transform_dsc_t"></span><span id="_CPPv232_lv_img_buf_transform_anti_aliasP22lv_img_transform_dsc_t"></span><span id="_lv_img_buf_transform_anti_alias__lv_img_transform_dsc_tP"></span><span id="lv__img__buf_8h_1a8cd4d03b10a75fefdf8ff1b26e74fde9" class="target"></span>
+
<span style="background-color:#e7f2fa;color:#2980b9;">bool _lv_img_buf_transform_anti_alias(lv_img_transform_dsc_t *dsc) </span>
 
: Continue transformation by taking the neighbors into account
 
: Continue transformation by taking the neighbors into account
: [https://docs.lvgl.io/8.2/overview/image.html#_CPPv432_lv_img_buf_transform_anti_aliasP22lv_img_transform_dsc_t]
+
:  
:; Parameters
+
: Parameters
 
:: dsc -- pointer to the transformation descriptor
 
:: dsc -- pointer to the transformation descriptor
  
; <span id="_CPPv321_lv_img_buf_transformP22lv_img_transform_dsc_t10lv_coord_t10lv_coord_t"></span><span id="_CPPv221_lv_img_buf_transformP22lv_img_transform_dsc_t10lv_coord_t10lv_coord_t"></span><span id="_lv_img_buf_transform__lv_img_transform_dsc_tP.lv_coord_t.lv_coord_t"></span><span id="lv__img__buf_8h_1a4cccd33e54542d23518538f8eef7c8f9" class="target"></span>bool _lv_img_buf_transform(lv_img_transform_dsc_t *dsc, lv_coord_t x, lv_coord_t y)[https://docs.lvgl.io/8.2/overview/image.html#_CPPv421_lv_img_buf_transformP22lv_img_transform_dsc_t10lv_coord_t10lv_coord_t] <span id="_CPPv321_lv_img_buf_transformP22lv_img_transform_dsc_t10lv_coord_t10lv_coord_t"></span><span id="_CPPv221_lv_img_buf_transformP22lv_img_transform_dsc_t10lv_coord_t10lv_coord_t"></span><span id="_lv_img_buf_transform__lv_img_transform_dsc_tP.lv_coord_t.lv_coord_t"></span><span id="lv__img__buf_8h_1a4cccd33e54542d23518538f8eef7c8f9" class="target"></span>
+
<span style="background-color:#e7f2fa;color:#2980b9;">bool _lv_img_buf_transform(lv_img_transform_dsc_t *dsc, lv_coord_t x, lv_coord_t y) </span>
: Get which color and opa would come to a pixel if it were rotated  Note  the res[https://docs.lvgl.io/8.2/overview/image.html#_CPPv421_lv_img_buf_transformP22lv_img_transform_dsc_t10lv_coord_t10lv_coord_t]ult is written back to <code>dsc->res_color</code> and <code>dsc->res_opa</code>
+
: Get which color and opa would come to a pixel if it were rotated  Note  the result is written back to <code style="color: #bb0000;">dsc->res_color</code> and <code style="color: #bb0000;">dsc->res_opa</code>
:; Parameters
+
: Parameters
::* dsc -- a descriptor initialized by <code>lv_img_buf_rotate_init</code>
+
::* dsc -- a descriptor initialized by <code style="color: #bb0000;">lv_img_buf_rotate_init</code>
 
::* x -- the coordinate which color and opa should be get
 
::* x -- the coordinate which color and opa should be get
 
::* y -- the coordinate which color and opa should be get
 
::* y -- the coordinate which color and opa should be get
:; Returns
+
: Returns
 
:: true: there is valid pixel on these x/y coordinates; false: the rotated pixel was out of the image
 
:: true: there is valid pixel on these x/y coordinates; false: the rotated pixel was out of the image
  
; <span id="_CPPv332_lv_img_buf_get_transformed_areaP9lv_area_t10lv_coord_t10lv_coord_t7int16_t8uint16_tPK10lv_point_t"></span><span id="_CPPv232_lv_img_buf_get_transformed_areaP9lv_area_t10lv_coord_t10lv_coord_t7int16_t8uint16_tPK10lv_point_t"></span><span id="_lv_img_buf_get_transformed_area__lv_area_tP.lv_coord_t.lv_coord_t.int16_t.uint16_t.lv_point_tCP"></span><span id="lv__img__buf_8h_1a54f200e9ed40bbf1384696a4058feb69" class="target"></span>void _lv_img_buf_get_transformed_area(lv_area_t *res, lv_coord_t w, lv_coord_t h, int16_t angle, uint16_t zoom, const lv_point_t *pivot)[https://docs.lvgl.io/8.2/overview/image.html#_CPPv432_lv_img_buf_get_transformed_areaP9lv_area_t10lv_coord_t10lv_coord_t7int16_t8uint16_tPK10lv_point_t] <span id="_CPPv332_lv_img_buf_get_transformed_areaP9lv_area_t10lv_coord_t10lv_coord_t7int16_t8uint16_tPK10lv_point_t"></span><span id="_CPPv232_lv_img_buf_get_transformed_areaP9lv_area_t10lv_coord_t10lv_coord_t7int16_t8uint16_tPK10lv_point_t"></span><span id="_lv_img_buf_get_transformed_area__lv_area_tP.lv_coord_t.lv_coord_t.int16_t.uint16_t.lv_point_tCP"></span><span id="lv__img__buf_8h_1a54f200e9ed40bbf1384696a4058feb69" class="target"></span>
+
<span style="background-color:#e7f2fa;color:#2980b9;">void _lv_img_buf_get_transformed_area(lv_area_t *res, lv_coord_t w, lv_coord_t h, int16_t angle, uint16_t zoom, const lv_point_t *pivot) </span>
 
: Get the area of a rectangle if its rotated and scaled
 
: Get the area of a rectangle if its rotated and scaled
:; Parameters
+
: Parameters
 
::* res -- store the coordinates here
 
::* res -- store the coordinates here
::* w -- width of the rect[https://docs.lvgl.io/8.2/overview/image.html#_CPPv432_lv_img_buf_get_transformed_areaP9lv_area_t10lv_coord_t10lv_coord_t7int16_t8uint16_tPK10lv_point_t]angle to transform
+
::* w -- width of the rectangle to transform
 
::* h -- height of the rectangle to transform
 
::* h -- height of the rectangle to transform
 
::* angle -- angle of rotation
 
::* angle -- angle of rotation
469行目: 625行目:
 
::* pivot -- x,y pivot coordinates of rotation
 
::* pivot -- x,y pivot coordinates of rotation
  
; <span id="_CPPv315lv_img_header_t"></span><span id="_CPPv215lv_img_header_t"></span><span id="lv_img_header_t"></span><span id="structlv__img__header__t" class="target"></span>struct lv_img_header_t[https://docs.lvgl.io/8.2/overview/image.html#_CPPv415lv_img_header_t] <span id="_CPPv315lv_img_header_t"></span><span id="_CPPv215lv_img_header_t"></span><span id="lv_img_header_t"></span><span id="structlv__img__header__t" class="target"></span>
+
<span style="background-color:#e7f2fa;color:#2980b9;">struct lv_img_header_t </span>
: ''#include <lv_img_b''[https://docs.lvgl.io/8.2/overview/image.html#_CPPv415lv_img_header_t]''uf.h>'' The first 8 bit is very important to distinguish the different source types. For more info see <code>lv_img_get_src_type()</code> in lv_img.c On big endian systems the order is reversed so cf and always_zero must be at the end of the struct.  Public Members
+
: ''#include <lv_img_b''''uf.h>'' The first 8 bit is very important to distinguish the different source types. For more info see <code style="color: #bb0000;">lv_img_get_src_type()</code> in lv_img.c On big endian systems the order is reversed so cf and always_zero must be at the end of the struct.  Public Members
:; <span id="_CPPv3N15lv_img_header_t1hE"></span><span id="_CPPv2N15lv_img_header_t1hE"></span><span id="lv_img_header_t::h__uint32_t"></span><span id="structlv__img__header__t_1a7e3391cd72119d417766378f18aaae2c" class="target"></span>uint32_t h[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N15lv_img_header_t1hE] <span id="_CPPv3N15lv_img_header_t1hE"></span><span id="_CPPv2N15lv_img_header_t1hE"></span><span id="lv_img_header_t::h__uint32_t"></span><span id="structlv__img__header__t_1a7e3391cd72119d417766378f18aaae2c" class="target"></span>
+
: <span style="background-color: #eeeeee;">uint32_t h </span>
 
::
 
::
:; [https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N15lv_img_header_t1hE]<span id="_CPPv3N15lv_img_header_t1wE"></span><span id="_CPPv2N15lv_img_header_t1wE"></span><span id="lv_img_header_t::w__uint32_t"></span><span id="structlv__img__header__t_1a6553f8a9dc1a0f8c50dc51dda3aab537" class="target"></span>uint32_t w[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N15lv_img_header_t1wE] <span id="_CPPv3N15lv_img_header_t1wE"></span><span id="_CPPv2N15lv_img_header_t1wE"></span><span id="lv_img_header_t::w__uint32_t"></span><span id="structlv__img__header__t_1a6553f8a9dc1a0f8c50dc51dda3aab537" class="target"></span>
+
: <span style="background-color: #eeeeee;">uint32_t w </span>
 
::
 
::
:; [https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N15lv_img_header_t1wE]<span id="_CPPv3N15lv_img_header_t8reservedE"></span><span id="_CPPv2N15lv_img_header_t8reservedE"></span><span id="lv_img_header_t::reserved__uint32_t"></span><span id="structlv__img__header__t_1a7cf6525f2cb39346f5438973c489bf89" class="target"></span>uint32_t reserved[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N15lv_img_header_t8reservedE] <span id="_CPPv3N15lv_img_header_t8reservedE"></span><span id="_CPPv2N15lv_img_header_t8reservedE"></span><span id="lv_img_header_t::reserved__uint32_t"></span><span id="structlv__img__header__t_1a7cf6525f2cb39346f5438973c489bf89" class="target"></span>
+
: <span style="background-color: #eeeeee;">uint32_t reserved </span>
 
::
 
::
:; <span id="_CPPv3N15lv_img_header_t11always_zeroE"></span><span id="_CPPv2N15lv_img_header_t11always_zeroE"></span><span id="lv_img_header_t::always_zero__uint32_t"></span><span id="structlv__img__header__t_1a2500e38eea0424cf5639521e4cd36f74" class="target"></span>uint32_[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N15lv_img_header_t8reservedE]t always_zero[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N15lv_img_header_t11always_zeroE] <span id="_CPPv3N15lv_img_header_t11always_zeroE"></span><span id="_CPPv2N15lv_img_header_t11always_zeroE"></span><span id="lv_img_header_t::always_zero__uint32_t"></span><span id="structlv__img__header__t_1a2500e38eea0424cf5639521e4cd36f74" class="target"></span>
+
: <span style="background-color: #eeeeee;">uint32_t always_zero </span>
 
::
 
::
:; <span id="_CPPv3N15lv_img_header_t2cfE"></span><span id="_CPPv2N15lv_img_header_t2cfE"></span><span id="lv_img_header_t::cf__uint32_t"></span><span id="structlv__img__header__t_1a28513641737b777e0c546bd098eb58af" class="target"></span>uint32_t c[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N15lv_img_header_t11always_zeroE]f[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N15lv_img_header_t2cfE] <span id="_CPPv3N15lv_img_header_t2cfE"></span><span id="_CPPv2N15lv_img_header_t2cfE"></span><span id="lv_img_header_t::cf__uint32_t"></span><span id="structlv__img__header__t_1a28513641737b777e0c546bd098eb58af" class="target"></span>
+
: <span style="background-color: #eeeeee;">uint32_t cf </span>
 
::
 
::
  
; [https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N15lv_img_header_t2cfE]<span id="structlv__img__header__t" class="target"></span>struct lv_img_header_t <span id="structlv__img__header__t" class="target"></span>
+
<span style="background-color:#e7f2fa;color:#2980b9;">struct lv_img_header_t </span>
: ''#include <lv_img_buf.h>'' The first 8 bit is very important to distinguish the different source types. For more info see <code>lv_img_get_src_type()</code> in lv_img.c On big endian systems the order is reversed so cf and always_zero must be at the end of the struct.  Public Members
+
: ''#include <lv_img_buf.h>'' The first 8 bit is very important to distinguish the different source types. For more info see <code style="color: #bb0000;">lv_img_get_src_type()</code> in lv_img.c On big endian systems the order is reversed so cf and always_zero must be at the end of the struct.  Public Members
:; <span id="structlv__img__header__t_1a7e3391cd72119d417766378f18aaae2c" class="target"></span>uint32_t h <span id="structlv__img__header__t_1a7e3391cd72119d417766378f18aaae2c" class="target"></span>
+
: <span style="background-color: #eeeeee;">uint32_t h </span>
 
::
 
::
:; <span id="structlv__img__header__t_1a6553f8a9dc1a0f8c50dc51dda3aab537" class="target"></span>uint32_t w <span id="structlv__img__header__t_1a6553f8a9dc1a0f8c50dc51dda3aab537" class="target"></span>
+
: <span style="background-color: #eeeeee;">uint32_t w </span>
 
::
 
::
:; <span id="structlv__img__header__t_1a7cf6525f2cb39346f5438973c489bf89" class="target"></span>uint32_t reserved <span id="structlv__img__header__t_1a7cf6525f2cb39346f5438973c489bf89" class="target"></span>
+
: <span style="background-color: #eeeeee;">uint32_t reserved </span>
 
::
 
::
:; <span id="structlv__img__header__t_1a2500e38eea0424cf5639521e4cd36f74" class="target"></span>uint32_t always_zero <span id="structlv__img__header__t_1a2500e38eea0424cf5639521e4cd36f74" class="target"></span>
+
: <span style="background-color: #eeeeee;">uint32_t always_zero </span>
 
::
 
::
:; <span id="structlv__img__header__t_1a28513641737b777e0c546bd098eb58af" class="target"></span>uint32_t cf <span id="structlv__img__header__t_1a28513641737b777e0c546bd098eb58af" class="target"></span>
+
: <span style="background-color: #eeeeee;">uint32_t cf </span>
 
::
 
::
  
; <span id="_CPPv312lv_img_dsc_t"></span><span id="_CPPv212lv_img_dsc_t"></span><span id="lv_img_dsc_t"></span><span id="structlv__img__dsc__t" class="target"></span>struct lv_img_dsc_t[https://docs.lvgl.io/8.2/overview/image.html#_CPPv412lv_img_dsc_t] <span id="_CPPv312lv_img_dsc_t"></span><span id="_CPPv212lv_img_dsc_t"></span><span id="lv_img_dsc_t"></span><span id="structlv__img__dsc__t" class="target"></span>
+
<span style="background-color:#e7f2fa;color:#2980b9;">struct lv_img_dsc_t </span>
: ''#include <lv_im''[https://docs.lvgl.io/8.2/overview/image.html#_CPPv412lv_img_dsc_t]''g_buf.h>'' Image header it is compatible with the result from image converter utility  Public Members
+
: ''#include <lv_im''''g_buf.h>'' Image header it is compatible with the result from image converter utility  Public Members
:; <span id="_CPPv3N12lv_img_dsc_t6headerE"></span><span id="_CPPv2N12lv_img_dsc_t6headerE"></span><span id="lv_img_dsc_t::header__lv_img_header_t"></span><span id="structlv__img__dsc__t_1a552a5487bb4457d4b565dfa00381a846" class="target"></span>lv_img_header_t header[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N12lv_img_dsc_t6headerE] <span id="_CPPv3N12lv_img_dsc_t6headerE"></span><span id="_CPPv2N12lv_img_dsc_t6headerE"></span><span id="lv_img_dsc_t::header__lv_img_header_t"></span><span id="structlv__img__dsc__t_1a552a5487bb4457d4b565dfa00381a846" class="target"></span>
+
: <span style="background-color: #eeeeee;">lv_img_header_t header </span>
:: A header describin[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N12lv_img_dsc_t6headerE]g the basics of the image
+
:: A header describing the basics of the image
:; <span id="_CPPv3N12lv_img_dsc_t9data_sizeE"></span><span id="_CPPv2N12lv_img_dsc_t9data_sizeE"></span><span id="lv_img_dsc_t::data_size__uint32_t"></span><span id="structlv__img__dsc__t_1aef7de962a5e45e270151bec6bd4cdc80" class="target"></span>uint32_t data_size[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N12lv_img_dsc_t9data_sizeE] <span id="_CPPv3N12lv_img_dsc_t9data_sizeE"></span><span id="_CPPv2N12lv_img_dsc_t9data_sizeE"></span><span id="lv_img_dsc_t::data_size__uint32_t"></span><span id="structlv__img__dsc__t_1aef7de962a5e45e270151bec6bd4cdc80" class="target"></span>
+
: <span style="background-color: #eeeeee;">uint32_t data_size </span>
:: Size of the im[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N12lv_img_dsc_t9data_sizeE]age in bytes
+
:: Size of the image in bytes
:; <span id="_CPPv3N12lv_img_dsc_t4dataE"></span><span id="_CPPv2N12lv_img_dsc_t4dataE"></span><span id="lv_img_dsc_t::data__uint8_tCP"></span><span id="structlv__img__dsc__t_1a09900b90ae9c9888e341616b611df3a0" class="target"></span>const uint8_t *data[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N12lv_img_dsc_t4dataE] <span id="_CPPv3N12lv_img_dsc_t4dataE"></span><span id="_CPPv2N12lv_img_dsc_t4dataE"></span><span id="lv_img_dsc_t::data__uint8_tCP"></span><span id="structlv__img__dsc__t_1a09900b90ae9c9888e341616b611df3a0" class="target"></span>
+
: <span style="background-color: #eeeeee;">const uint8_t *data </span>
:: Pointer to the [https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N12lv_img_dsc_t4dataE]data of the image
+
:: Pointer to the data of the image
  
; <span id="_CPPv322lv_img_transform_dsc_t"></span><span id="_CPPv222lv_img_transform_dsc_t"></span><span id="lv_img_transform_dsc_t"></span><span id="structlv__img__transform__dsc__t" class="target"></span>struct lv_img_transform_dsc_t[https://docs.lvgl.io/8.2/overview/image.html#_CPPv422lv_img_transform_dsc_t] <span id="_CPPv322lv_img_transform_dsc_t"></span><span id="_CPPv222lv_img_transform_dsc_t"></span><span id="lv_img_transform_dsc_t"></span><span id="structlv__img__transform__dsc__t" class="target"></span>
+
<span style="background-color:#e7f2fa;color:#2980b9;">struct lv_img_transform_dsc_t </span>
 
: Public Members
 
: Public Members
:; <span id="_CPPv3N22lv_img_transform_dsc_t3srcE"></span><span id="_CPPv2N22lv_img_transform_dsc_t3srcE"></span><span id="lv_img_transform_dsc_t::src__voidCP"></span><span id="structlv__img__transform__dsc__t_1abe9e3f5ba59aac0033129fde382df60f" class="target"></span>const v[https://docs.lvgl.io/8.2/overview/image.html#_CPPv422lv_img_transform_dsc_t]oid *src[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t3srcE] <span id="_CPPv3N22lv_img_transform_dsc_t3srcE"></span><span id="_CPPv2N22lv_img_transform_dsc_t3srcE"></span><span id="lv_img_transform_dsc_t::src__voidCP"></span><span id="structlv__img__transform__dsc__t_1abe9e3f5ba59aac0033129fde382df60f" class="target"></span>
+
: <span style="background-color: #eeeeee;">const void *src </span>
 
::
 
::
:; <span id="_CPPv3N22lv_img_transform_dsc_t5src_wE"></span><span id="_CPPv2N22lv_img_transform_dsc_t5src_wE"></span><span id="lv_img_transform_dsc_t::src_w__lv_coord_t"></span><span id="structlv__img__transform__dsc__t_1a7d93f132c399eb20aec3906e0d0ce537" class="target"></span>lv_co[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t3srcE]ord_t src_w[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t5src_wE] <span id="_CPPv3N22lv_img_transform_dsc_t5src_wE"></span><span id="_CPPv2N22lv_img_transform_dsc_t5src_wE"></span><span id="lv_img_transform_dsc_t::src_w__lv_coord_t"></span><span id="structlv__img__transform__dsc__t_1a7d93f132c399eb20aec3906e0d0ce537" class="target"></span>
+
: <span style="background-color: #eeeeee;">lv_coord_t src_w </span>
 
::
 
::
:; <span id="_CPPv3N22lv_img_transform_dsc_t5src_hE"></span><span id="_CPPv2N22lv_img_transform_dsc_t5src_hE"></span><span id="lv_img_transform_dsc_t::src_h__lv_coord_t"></span><span id="structlv__img__transform__dsc__t_1a2a20c3fa8900db35f86f996cfd1b820f" class="target"></span>lv_coo[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t5src_wE]rd_t src_h[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t5src_hE] <span id="_CPPv3N22lv_img_transform_dsc_t5src_hE"></span><span id="_CPPv2N22lv_img_transform_dsc_t5src_hE"></span><span id="lv_img_transform_dsc_t::src_h__lv_coord_t"></span><span id="structlv__img__transform__dsc__t_1a2a20c3fa8900db35f86f996cfd1b820f" class="target"></span>
+
: <span style="background-color: #eeeeee;">lv_coord_t src_h </span>
 
::
 
::
:; <span id="_CPPv3N22lv_img_transform_dsc_t7pivot_xE"></span><span id="_CPPv2N22lv_img_transform_dsc_t7pivot_xE"></span><span id="lv_img_transform_dsc_t::pivot_x__lv_coord_t"></span><span id="structlv__img__transform__dsc__t_1a3b8dac07658b0c836577d4b53aab8af0" class="target"></span>lv_coo[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t5src_hE]rd_t pivot_x[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t7pivot_xE] <span id="_CPPv3N22lv_img_transform_dsc_t7pivot_xE"></span><span id="_CPPv2N22lv_img_transform_dsc_t7pivot_xE"></span><span id="lv_img_transform_dsc_t::pivot_x__lv_coord_t"></span><span id="structlv__img__transform__dsc__t_1a3b8dac07658b0c836577d4b53aab8af0" class="target"></span>
+
: <span style="background-color: #eeeeee;">lv_coord_t pivot_x </span>
 
::
 
::
:; <span id="_CPPv3N22lv_img_transform_dsc_t7pivot_yE"></span><span id="_CPPv2N22lv_img_transform_dsc_t7pivot_yE"></span><span id="lv_img_transform_dsc_t::pivot_y__lv_coord_t"></span><span id="structlv__img__transform__dsc__t_1afc39e547f190579cccad22fd6e8fd367" class="target"></span>lv_coord[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t7pivot_xE]_t pivot_y[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t7pivot_yE] <span id="_CPPv3N22lv_img_transform_dsc_t7pivot_yE"></span><span id="_CPPv2N22lv_img_transform_dsc_t7pivot_yE"></span><span id="lv_img_transform_dsc_t::pivot_y__lv_coord_t"></span><span id="structlv__img__transform__dsc__t_1afc39e547f190579cccad22fd6e8fd367" class="target"></span>
+
: <span style="background-color: #eeeeee;">lv_coord_t pivot_y </span>
 
::
 
::
:; <span id="_CPPv3N22lv_img_transform_dsc_t5angleE"></span><span id="_CPPv2N22lv_img_transform_dsc_t5angleE"></span><span id="lv_img_transform_dsc_t::angle__int16_t"></span><span id="structlv__img__transform__dsc__t_1a632e14fdf637f8cb7bb21df83410a2f7" class="target"></span>int16_t [https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t7pivot_yE]angle[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t5angleE] <span id="_CPPv3N22lv_img_transform_dsc_t5angleE"></span><span id="_CPPv2N22lv_img_transform_dsc_t5angleE"></span><span id="lv_img_transform_dsc_t::angle__int16_t"></span><span id="structlv__img__transform__dsc__t_1a632e14fdf637f8cb7bb21df83410a2f7" class="target"></span>
+
: <span style="background-color: #eeeeee;">int16_t angle </span>
 
::
 
::
:; <span id="_CPPv3N22lv_img_transform_dsc_t4zoomE"></span><span id="_CPPv2N22lv_img_transform_dsc_t4zoomE"></span><span id="lv_img_transform_dsc_t::zoom__uint16_t"></span><span id="structlv__img__transform__dsc__t_1af4de9a82c020c94dd9ccd69789444e25" class="target"></span>uin[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t5angleE]t16_t zoom[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t4zoomE] <span id="_CPPv3N22lv_img_transform_dsc_t4zoomE"></span><span id="_CPPv2N22lv_img_transform_dsc_t4zoomE"></span><span id="lv_img_transform_dsc_t::zoom__uint16_t"></span><span id="structlv__img__transform__dsc__t_1af4de9a82c020c94dd9ccd69789444e25" class="target"></span>
+
: <span style="background-color: #eeeeee;">uint16_t zoom </span>
 
::
 
::
:; <span id="_CPPv3N22lv_img_transform_dsc_t5colorE"></span><span id="_CPPv2N22lv_img_transform_dsc_t5colorE"></span><span id="lv_img_transform_dsc_t::color__lv_color_t"></span><span id="structlv__img__transform__dsc__t_1ab042ad890c709c0c62a895878c294493" class="target"></span>lv_[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t4zoomE]color_t color[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t5colorE] <span id="_CPPv3N22lv_img_transform_dsc_t5colorE"></span><span id="_CPPv2N22lv_img_transform_dsc_t5colorE"></span><span id="lv_img_transform_dsc_t::color__lv_color_t"></span><span id="structlv__img__transform__dsc__t_1ab042ad890c709c0c62a895878c294493" class="target"></span>
+
: <span style="background-color: #eeeeee;">lv_color_t color </span>
 
::
 
::
:; <span id="_CPPv3N22lv_img_transform_dsc_t2cfE"></span><span id="_CPPv2N22lv_img_transform_dsc_t2cfE"></span><span id="lv_img_transform_dsc_t::cf__lv_img_cf_t"></span><span id="structlv__img__transform__dsc__t_1ad13f927d37014934ad7469d54fc0df0f" class="target"></span>lv_img[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t5colorE]_cf_t cf[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t2cfE] <span id="_CPPv3N22lv_img_transform_dsc_t2cfE"></span><span id="_CPPv2N22lv_img_transform_dsc_t2cfE"></span><span id="lv_img_transform_dsc_t::cf__lv_img_cf_t"></span><span id="structlv__img__transform__dsc__t_1ad13f927d37014934ad7469d54fc0df0f" class="target"></span>
+
: <span style="background-color: #eeeeee;">lv_img_cf_t cf </span>
 
::
 
::
:; <span id="_CPPv3N22lv_img_transform_dsc_t9antialiasE"></span><span id="_CPPv2N22lv_img_transform_dsc_t9antialiasE"></span><span id="lv_img_transform_dsc_t::antialias__b"></span><span id="structlv__img__transform__dsc__t_1a9453d1086afc187063d2fff925600d29" class="target"></span>bool[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t2cfE] antialias[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t9antialiasE] <span id="_CPPv3N22lv_img_transform_dsc_t9antialiasE"></span><span id="_CPPv2N22lv_img_transform_dsc_t9antialiasE"></span><span id="lv_img_transform_dsc_t::antialias__b"></span><span id="structlv__img__transform__dsc__t_1a9453d1086afc187063d2fff925600d29" class="target"></span>
+
: <span style="background-color: #eeeeee;">bool antialias </span>
 
::
 
::
:; <span id="_CPPv3N22lv_img_transform_dsc_t3cfgE"></span><span id="_CPPv2N22lv_img_transform_dsc_t3cfgE"></span><span id="structlv__img__transform__dsc__t_1aac23703027acdd02bf964142c23d0bec" class="target"></span>stru[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t9antialiasE]<nowiki>ct lv_img_transform_dsc_t::[anonymous] cfg</nowiki>[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t3cfgE] <span id="_CPPv3N22lv_img_transform_dsc_t3cfgE"></span><span id="_CPPv2N22lv_img_transform_dsc_t3cfgE"></span><span id="structlv__img__transform__dsc__t_1aac23703027acdd02bf964142c23d0bec" class="target"></span>
+
: <span style="background-color: #eeeeee;">stru<nowiki>ct lv_img_transform_dsc_t::[anonymous] cfg</nowiki> </span>
 
::
 
::
:; <span id="_CPPv3N22lv_img_transform_dsc_t3opaE"></span><span id="_CPPv2N22lv_img_transform_dsc_t3opaE"></span><span id="lv_img_transform_dsc_t::opa__lv_opa_t"></span><span id="structlv__img__transform__dsc__t_1aadaf1aff28f438b03d286d3f87ca2302" class="target"></span>lv_opa_t opa[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t3opaE] <span id="_CPPv3N22lv_img_transform_dsc_t3opaE"></span><span id="_CPPv2N22lv_img_transform_dsc_t3opaE"></span><span id="lv_img_transform_dsc_t::opa__lv_opa_t"></span><span id="structlv__img__transform__dsc__t_1aadaf1aff28f438b03d286d3f87ca2302" class="target"></span>
+
: <span style="background-color: #eeeeee;">lv_opa_t opa </span>
 
::
 
::
:; <span id="_CPPv3N22lv_img_transform_dsc_t3resE"></span><span id="_CPPv2N22lv_img_transform_dsc_t3resE"></span><span id="structlv__img__transform__dsc__t_1a02feba1d039b8721efa1fdeec842ab74" class="target"></span>st[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t3opaE]ruct lv_im[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t3cfgE]<nowiki>g_transform_dsc_t::[anonymous] res</nowiki>[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t3resE] <span id="_CPPv3N22lv_img_transform_dsc_t3resE"></span><span id="_CPPv2N22lv_img_transform_dsc_t3resE"></span><span id="structlv__img__transform__dsc__t_1a02feba1d039b8721efa1fdeec842ab74" class="target"></span>
+
: <span style="background-color: #eeeeee;">struct lv_im<nowiki>g_transform_dsc_t::[anonymous] res</nowiki> </span>
 
::
 
::
:; <span id="_CPPv3N22lv_img_transform_dsc_t7img_dscE"></span><span id="_CPPv2N22lv_img_transform_dsc_t7img_dscE"></span><span id="lv_img_transform_dsc_t::img_dsc__lv_img_dsc_t"></span><span id="structlv__img__transform__dsc__t_1ada066ea7ffd711ab571c2c0bd470df46" class="target"></span>lv_img_dsc_t img_dsc[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t7img_dscE] <span id="_CPPv3N22lv_img_transform_dsc_t7img_dscE"></span><span id="_CPPv2N22lv_img_transform_dsc_t7img_dscE"></span><span id="lv_img_transform_dsc_t::img_dsc__lv_img_dsc_t"></span><span id="structlv__img__transform__dsc__t_1ada066ea7ffd711ab571c2c0bd470df46" class="target"></span>
+
: <span style="background-color: #eeeeee;">lv_img_dsc_t img_dsc </span>
 
::
 
::
:; <span id="_CPPv3N22lv_img_transform_dsc_t11pivot_x_256E"></span><span id="_CPPv2N22lv_img_transform_dsc_t11pivot_x_256E"></span><span id="lv_img_transform_dsc_t::pivot_x_256__int32_t"></span><span id="structlv__img__transform__dsc__t_1ad1f577db6b70eddb30f67d953db9bd1e" class="target"></span>int3[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t3resE]2_t pi[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t7img_dscE]vot_x_256[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t11pivot_x_256E] <span id="_CPPv3N22lv_img_transform_dsc_t11pivot_x_256E"></span><span id="_CPPv2N22lv_img_transform_dsc_t11pivot_x_256E"></span><span id="lv_img_transform_dsc_t::pivot_x_256__int32_t"></span><span id="structlv__img__transform__dsc__t_1ad1f577db6b70eddb30f67d953db9bd1e" class="target"></span>
+
: <span style="background-color: #eeeeee;">int32_t pivot_x_256 </span>
 
::
 
::
:; <span id="_CPPv3N22lv_img_transform_dsc_t11pivot_y_256E"></span><span id="_CPPv2N22lv_img_transform_dsc_t11pivot_y_256E"></span><span id="lv_img_transform_dsc_t::pivot_y_256__int32_t"></span><span id="structlv__img__transform__dsc__t_1ade400897e2d3c6bf314ece8f43b40432" class="target"></span>int32_t p[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t11pivot_x_256E]ivot_y_256[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t11pivot_y_256E] <span id="_CPPv3N22lv_img_transform_dsc_t11pivot_y_256E"></span><span id="_CPPv2N22lv_img_transform_dsc_t11pivot_y_256E"></span><span id="lv_img_transform_dsc_t::pivot_y_256__int32_t"></span><span id="structlv__img__transform__dsc__t_1ade400897e2d3c6bf314ece8f43b40432" class="target"></span>
+
: <span style="background-color: #eeeeee;">int32_t pivot_y_256 </span>
 
::
 
::
:; <span id="_CPPv3N22lv_img_transform_dsc_t5sinmaE"></span><span id="_CPPv2N22lv_img_transform_dsc_t5sinmaE"></span><span id="lv_img_transform_dsc_t::sinma__int32_t"></span><span id="structlv__img__transform__dsc__t_1ab9e2567e1e14cd684ddd35eb56c112d0" class="target"></span>int32_t s[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t11pivot_y_256E]inma[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t5sinmaE] <span id="_CPPv3N22lv_img_transform_dsc_t5sinmaE"></span><span id="_CPPv2N22lv_img_transform_dsc_t5sinmaE"></span><span id="lv_img_transform_dsc_t::sinma__int32_t"></span><span id="structlv__img__transform__dsc__t_1ab9e2567e1e14cd684ddd35eb56c112d0" class="target"></span>
+
: <span style="background-color: #eeeeee;">int32_t sinma </span>
 
::
 
::
:; <span id="_CPPv3N22lv_img_transform_dsc_t5cosmaE"></span><span id="_CPPv2N22lv_img_transform_dsc_t5cosmaE"></span><span id="lv_img_transform_dsc_t::cosma__int32_t"></span><span id="structlv__img__transform__dsc__t_1a35e685fda27515645370b34d507b7085" class="target"></span>int[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t5sinmaE]32_t cosma[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t5cosmaE] <span id="_CPPv3N22lv_img_transform_dsc_t5cosmaE"></span><span id="_CPPv2N22lv_img_transform_dsc_t5cosmaE"></span><span id="lv_img_transform_dsc_t::cosma__int32_t"></span><span id="structlv__img__transform__dsc__t_1a35e685fda27515645370b34d507b7085" class="target"></span>
+
: <span style="background-color: #eeeeee;">int32_t cosma </span>
 
::
 
::
:; <span id="_CPPv3N22lv_img_transform_dsc_t12chroma_keyedE"></span><span id="_CPPv2N22lv_img_transform_dsc_t12chroma_keyedE"></span><span id="lv_img_transform_dsc_t::chroma_keyed__uint8_t"></span><span id="structlv__img__transform__dsc__t_1a35060cf56c63be25ce159f7d6cd92ef1" class="target"></span>uin[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t5cosmaE]t8_t chroma_keyed[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t12chroma_keyedE] <span id="_CPPv3N22lv_img_transform_dsc_t12chroma_keyedE"></span><span id="_CPPv2N22lv_img_transform_dsc_t12chroma_keyedE"></span><span id="lv_img_transform_dsc_t::chroma_keyed__uint8_t"></span><span id="structlv__img__transform__dsc__t_1a35060cf56c63be25ce159f7d6cd92ef1" class="target"></span>
+
: <span style="background-color: #eeeeee;">uint8_t chroma_keyed </span>
 
::
 
::
:; <span id="_CPPv3N22lv_img_transform_dsc_t9has_alphaE"></span><span id="_CPPv2N22lv_img_transform_dsc_t9has_alphaE"></span><span id="lv_img_transform_dsc_t::has_alpha__uint8_t"></span><span id="structlv__img__transform__dsc__t_1a7ca558d3f9ebae256bc594efa1b7772c" class="target"></span>uint8_t ha[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t12chroma_keyedE]s_alpha[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t9has_alphaE] <span id="_CPPv3N22lv_img_transform_dsc_t9has_alphaE"></span><span id="_CPPv2N22lv_img_transform_dsc_t9has_alphaE"></span><span id="lv_img_transform_dsc_t::has_alpha__uint8_t"></span><span id="structlv__img__transform__dsc__t_1a7ca558d3f9ebae256bc594efa1b7772c" class="target"></span>
+
: <span style="background-color: #eeeeee;">uint8_t has_alpha </span>
 
::
 
::
:; <span id="_CPPv3N22lv_img_transform_dsc_t12native_colorE"></span><span id="_CPPv2N22lv_img_transform_dsc_t12native_colorE"></span><span id="lv_img_transform_dsc_t::native_color__uint8_t"></span><span id="structlv__img__transform__dsc__t_1a9fd36f237e745bade1eb7c34f1a63d0a" class="target"></span>uint8_t[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t9has_alphaE] native_color[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t12native_colorE] <span id="_CPPv3N22lv_img_transform_dsc_t12native_colorE"></span><span id="_CPPv2N22lv_img_transform_dsc_t12native_colorE"></span><span id="lv_img_transform_dsc_t::native_color__uint8_t"></span><span id="structlv__img__transform__dsc__t_1a9fd36f237e745bade1eb7c34f1a63d0a" class="target"></span>
+
: <span style="background-color: #eeeeee;">uint8_t native_color </span>
 
::
 
::
:; <span id="_CPPv3N22lv_img_transform_dsc_t8zoom_invE"></span><span id="_CPPv2N22lv_img_transform_dsc_t8zoom_invE"></span><span id="lv_img_transform_dsc_t::zoom_inv__uint32_t"></span><span id="structlv__img__transform__dsc__t_1ae64aa61ae01b93a2762ed5d8843db027" class="target"></span>uint32_t z[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t12native_colorE]oom_inv[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t8zoom_invE] <span id="_CPPv3N22lv_img_transform_dsc_t8zoom_invE"></span><span id="_CPPv2N22lv_img_transform_dsc_t8zoom_invE"></span><span id="lv_img_transform_dsc_t::zoom_inv__uint32_t"></span><span id="structlv__img__transform__dsc__t_1ae64aa61ae01b93a2762ed5d8843db027" class="target"></span>
+
: <span style="background-color: #eeeeee;">uint32_t zoom_inv </span>
 
::
 
::
:; <span id="_CPPv3N22lv_img_transform_dsc_t2xsE"></span><span id="_CPPv2N22lv_img_transform_dsc_t2xsE"></span><span id="lv_img_transform_dsc_t::xs__lv_coord_t"></span><span id="structlv__img__transform__dsc__t_1a60c6356a67602a7f60f0eba0eb24ddfe" class="target"></span>lv_coor[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t8zoom_invE]d_t xs[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t2xsE] <span id="_CPPv3N22lv_img_transform_dsc_t2xsE"></span><span id="_CPPv2N22lv_img_transform_dsc_t2xsE"></span><span id="lv_img_transform_dsc_t::xs__lv_coord_t"></span><span id="structlv__img__transform__dsc__t_1a60c6356a67602a7f60f0eba0eb24ddfe" class="target"></span>
+
: <span style="background-color: #eeeeee;">lv_coord_t xs </span>
 
::
 
::
:; <span id="_CPPv3N22lv_img_transform_dsc_t2ysE"></span><span id="_CPPv2N22lv_img_transform_dsc_t2ysE"></span><span id="lv_img_transform_dsc_t::ys__lv_coord_t"></span><span id="structlv__img__transform__dsc__t_1a259d1ad99ab3b20e05a380f2a22e3bab" class="target"></span>lv_[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t2xsE]coord_t ys[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t2ysE] <span id="_CPPv3N22lv_img_transform_dsc_t2ysE"></span><span id="_CPPv2N22lv_img_transform_dsc_t2ysE"></span><span id="lv_img_transform_dsc_t::ys__lv_coord_t"></span><span id="structlv__img__transform__dsc__t_1a259d1ad99ab3b20e05a380f2a22e3bab" class="target"></span>
+
: <span style="background-color: #eeeeee;">lv_coord_t ys </span>
 
::
 
::
:; <span id="_CPPv3N22lv_img_transform_dsc_t6xs_intE"></span><span id="_CPPv2N22lv_img_transform_dsc_t6xs_intE"></span><span id="lv_img_transform_dsc_t::xs_int__lv_coord_t"></span><span id="structlv__img__transform__dsc__t_1aad4f0a2dd7d2522713cb7bb04f21d87c" class="target"></span>lv_[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t2ysE]coord_t xs_int[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t6xs_intE] <span id="_CPPv3N22lv_img_transform_dsc_t6xs_intE"></span><span id="_CPPv2N22lv_img_transform_dsc_t6xs_intE"></span><span id="lv_img_transform_dsc_t::xs_int__lv_coord_t"></span><span id="structlv__img__transform__dsc__t_1aad4f0a2dd7d2522713cb7bb04f21d87c" class="target"></span>
+
: <span style="background-color: #eeeeee;">lv_coord_t xs_int </span>
 
::
 
::
:; <span id="_CPPv3N22lv_img_transform_dsc_t6ys_intE"></span><span id="_CPPv2N22lv_img_transform_dsc_t6ys_intE"></span><span id="lv_img_transform_dsc_t::ys_int__lv_coord_t"></span><span id="structlv__img__transform__dsc__t_1a2f4ad8835a1210611dc4ea7abedc040a" class="target"></span>lv_coor[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t6xs_intE]d_t ys_int[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t6ys_intE] <span id="_CPPv3N22lv_img_transform_dsc_t6ys_intE"></span><span id="_CPPv2N22lv_img_transform_dsc_t6ys_intE"></span><span id="lv_img_transform_dsc_t::ys_int__lv_coord_t"></span><span id="structlv__img__transform__dsc__t_1a2f4ad8835a1210611dc4ea7abedc040a" class="target"></span>
+
: <span style="background-color: #eeeeee;">lv_coord_t ys_int </span>
 
::
 
::
:; <span id="_CPPv3N22lv_img_transform_dsc_t3pxiE"></span><span id="_CPPv2N22lv_img_transform_dsc_t3pxiE"></span><span id="lv_img_transform_dsc_t::pxi__uint32_t"></span><span id="structlv__img__transform__dsc__t_1a4c14e9b4f5603203903eb788971c0796" class="target"></span>uint32_[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t6ys_intE]t pxi[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t3pxiE] <span id="_CPPv3N22lv_img_transform_dsc_t3pxiE"></span><span id="_CPPv2N22lv_img_transform_dsc_t3pxiE"></span><span id="lv_img_transform_dsc_t::pxi__uint32_t"></span><span id="structlv__img__transform__dsc__t_1a4c14e9b4f5603203903eb788971c0796" class="target"></span>
+
: <span style="background-color: #eeeeee;">uint32_t pxi </span>
 
::
 
::
:; <span id="_CPPv3N22lv_img_transform_dsc_t7px_sizeE"></span><span id="_CPPv2N22lv_img_transform_dsc_t7px_sizeE"></span><span id="lv_img_transform_dsc_t::px_size__uint8_t"></span><span id="structlv__img__transform__dsc__t_1a9f1c046e5e7a2d0b7ea93e4678245a12" class="target"></span>ui[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t3pxiE]nt8_t px_size[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t7px_sizeE] <span id="_CPPv3N22lv_img_transform_dsc_t7px_sizeE"></span><span id="_CPPv2N22lv_img_transform_dsc_t7px_sizeE"></span><span id="lv_img_transform_dsc_t::px_size__uint8_t"></span><span id="structlv__img__transform__dsc__t_1a9f1c046e5e7a2d0b7ea93e4678245a12" class="target"></span>
+
: <span style="background-color: #eeeeee;">uint8_t px_size </span>
 
::
 
::
:; <span id="_CPPv3N22lv_img_transform_dsc_t3tmpE"></span><span id="_CPPv2N22lv_img_transform_dsc_t3tmpE"></span><span id="structlv__img__transform__dsc__t_1a2fa66731b882c3b761fbba43075a49de" class="target"></span>struc[https://docs.lvgl.io/8.2/overview/image.html#_CPPv4N22lv_img_transform_dsc_t7px_sizeE]<nowiki>t lv_img_transform_dsc_t::[anonymous] tmp</nowiki>
+
: <span style="background-color: #eeeeee;">struc<nowiki>t lv_img_transform_dsc_t::[anonymous] tmp</nowiki></span>
 
+
|
 
+
|}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
  
  
 
:[[App:Library:LVGL#Overview|戻る : Previous]]
 
:[[App:Library:LVGL#Overview|戻る : Previous]]

2022年7月2日 (土) 08:59時点における版

https://docs.lvgl.io/8.2/overview/image.html

Images

英文 自動翻訳

An image can be a file or a variable which stores the bitmap itself and some metadata.

戻る : Previous


Store images

英文 自動翻訳

You can store images in two places

  • as a variable in internal memory (RAM or ROM)
  • as a file
戻る : Previous


Variables

英文 自動翻訳

Images stored internally in a variable are composed mainly of an lv_img_dsc_t structure with the following fields:

  • header
    • cf Color format. See below
    • w width in pixels (<= 2048)
    • h height in pixels (<= 2048)
    • always zero 3 bits which need to be always zero
    • reserved reserved for future use
  • data pointer to an array where the image itself is stored
  • data_size length of data in bytes

These are usually stored within a project as C files. They are linked into the resulting executable like any other constant data.

戻る : Previous


Files

英文 自動翻訳

To deal with files you need to add a storage Drive to LVGL. In short, a Drive is a collection of functions (open, read, close, etc.) registered in LVGL to make file operations. You can add an interface to a standard file system (FAT32 on SD card) or you create your simple file system to read data from an SPI Flash memory. In every case, a Drive is just an abstraction to read and/or write data to memory. See the File system section to learn more.

Images stored as files are not linked into the resulting executable, and must be read into RAM before being drawn. As a result, they are not as resource-friendly as images linked at compile time. However, they are easier to replace without needing to rebuild the main program.

戻る : Previous


Color formats

英文 自動翻訳

Various built-in color formats are supported:

  • LV_IMG_CF_TRUE_COLOR Simply stores the RGB colors (in whatever color depth LVGL is configured for).
  • LV_IMG_CF_TRUE_COLOR_ALPHA Like LV_IMG_CF_TRUE_COLOR but it also adds an alpha (transparency) byte for every pixel.
  • LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED Like LV_IMG_CF_TRUE_COLOR but if a pixel has the LV_COLOR_TRANSP color (set in lv_conf.h) it will be transparent.
  • LV_IMG_CF_INDEXED_1/2/4/8BIT Uses a palette with 2, 4, 16 or 256 colors and stores each pixel in 1, 2, 4 or 8 bits.
  • LV_IMG_CF_ALPHA_1/2/4/8BIT Only stores the Alpha value with 1, 2, 4 or 8 bits. The pixels take the color of style.img_recolor and the set opacity. The source image has to be an alpha channel. This is ideal for bitmaps similar to fonts where the whole image is one color that can be altered.

The bytes of LV_IMG_CF_TRUE_COLOR images are stored in the following order.

For 32-bit color depth:

  • Byte 0: Blue
  • Byte 1: Green
  • Byte 2: Red
  • Byte 3: Alpha

For 16-bit color depth:

  • Byte 0: Green 3 lower bit, Blue 5 bit
  • Byte 1: Red 5 bit, Green 3 higher bit
  • Byte 2: Alpha byte (only with LV_IMG_CF_TRUE_COLOR_ALPHA)

For 8-bit color depth:

  • Byte 0: Red 3 bit, Green 3 bit, Blue 2 bit
  • Byte 2: Alpha byte (only with LV_IMG_CF_TRUE_COLOR_ALPHA)

You can store images in a Raw format to indicate that it's not encoded with one of the built-in color formats and an external Image decoder needs to be used to decode the image.

  • LV_IMG_CF_RAW Indicates a basic raw image (e.g. a PNG or JPG image).
  • LV_IMG_CF_RAW_ALPHA Indicates that an image has alpha and an alpha byte is added for every pixel.
  • LV_IMG_CF_RAW_CHROMA_KEYED Indicates that an image is chroma-keyed as described in LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED above.
戻る : Previous


Add and use images

英文 自動翻訳

You can add images to LVGL in two ways:

  • using the online converter
  • manually create images
戻る : Previous


Online converter

英文 自動翻訳

The online Image converter is available here: https://lvgl.io/tools/imageconverter

Adding an image to LVGL via the online converter is easy.

  1. You need to select a BMP, PNG or JPG image first.
  2. Give the image a name that will be used within LVGL.
  3. Select the Color format.
  4. Select the type of image you want. Choosing a binary will generate a .bin file that must be stored separately and read using the file support. Choosing a variable will generate a standard C file that can be linked into your project.
  5. Hit the Convert button. Once the conversion is finished, your browser will automatically download the resulting file.

In the generated C arrays (variables), bitmaps for all the color depths (1, 8, 16 or 32) are included in the C file, but only the color depth that matches LV_COLOR_DEPTH in lv_conf.h will actually be linked into the resulting executable.

In the case of binary files, you need to specify the color format you want:

  • RGB332 for 8-bit color depth
  • RGB565 for 16-bit color depth
  • RGB565 Swap for 16-bit color depth (two bytes are swapped)
  • RGB888 for 32-bit color depth
戻る : Previous


Manually create an image

英文 自動翻訳

If you are generating an image at run-time, you can craft an image variable to display it using LVGL. For example:

uint8_t my_img_data[] = {0x00, 0x01, 0x02, ...};

static lv_img_dsc_t my_img_dsc = {
    .header.always_zero = 0,
    .header.w = 80,
    .header.h = 60,
    .data_size = 80 * 60 * LV_COLOR_DEPTH / 8,
    .header.cf = LV_IMG_CF_TRUE_COLOR,          /*Set the color format*/
    .data = my_img_data,
};

If the color format is LV_IMG_CF_TRUE_COLOR_ALPHA you can set data_size like 80 * 60 * LV_IMG_PX_SIZE_ALPHA_BYTE.

Another (possibly simpler) option to create and display an image at run-time is to use the Canvas object.

戻る : Previous


Use images

英文 自動翻訳

The simplest way to use an image in LVGL is to display it with an lv_img object:

lv_obj_t * icon = lv_img_create(lv_scr_act(), NULL);

/*From variable*/
lv_img_set_src(icon, &my_icon_dsc);

/*From file*/
lv_img_set_src(icon, "S:my_icon.bin");

If the image was converted with the online converter, you should use LV_IMG_DECLARE(my_icon_dsc) to declare the image in the file where you want to use it.

戻る : Previous


Image decoder

英文 自動翻訳

As you can see in the Color formats section, LVGL supports several built-in image formats. In many cases, these will be all you need. LVGL doesn't directly support, however, generic image formats like PNG or JPG.

To handle non-built-in image formats, you need to use external libraries and attach them to LVGL via the Image decoder interface.

An image decoder consists of 4 callbacks:

  • info get some basic info about the image (width, height and color format).
  • open open an image: either store a decoded image or set it to NULL to indicate the image can be read line-by-line.
  • read if open didn't fully open an image this function should give some decoded data (max 1 line) from a given position.
  • close close an opened image, free the allocated resources.

You can add any number of image decoders. When an image needs to be drawn, the library will try all the registered image decoders until it finds one which can open the image, i.e. one which knows that format.

The LV_IMG_CF_TRUE_COLOR_..., LV_IMG_INDEXED_... and LV_IMG_ALPHA_... formats (essentially, all non-RAW formats) are understood by the built-in decoder.

Custom image formats

The easiest way to create a custom image is to use the online image converter and select Raw, Raw with alpha or Raw with chroma-keyed format. It will just take every byte of the binary file you uploaded and write it as an image "bitmap". You then need to attach an image decoder that will parse that bitmap and generate the real, renderable bitmap.

header.cf will be LV_IMG_CF_RAW, LV_IMG_CF_RAW_ALPHA or LV_IMG_CF_RAW_CHROMA_KEYED accordingly. You should choose the correct format according to your needs: a fully opaque image, using an alpha channel or using a chroma key.

After decoding, the raw formats are considered True color by the library. In other words, the image decoder must decode the Raw images to True color according to the format described in the Color formats section.

If you want to create a custom image, you should use LV_IMG_CF_USER_ENCODED_0..7 color formats. However, the library can draw images only in True color format (or Raw but ultimately it will be in True color format). The LV_IMG_CF_USER_ENCODED_... formats are not known by the library and therefore they should be decoded to one of the known formats from the Color formats section. It's possible to decode an image to a non-true color format first (for example: LV_IMG_INDEXED_4BITS) and then call the built-in decoder functions to convert it to True color.

With User encoded formats, the color format in the open function (dsc->header.cf) should be changed according to the new format.

戻る : Previous


Register an image decoder

英文 自動翻訳

Here's an example of getting LVGL to work with PNG images.

First, you need to create a new image decoder and set some functions to open/close the PNG files. It should look like this:

/*Create a new decoder and register functions */
lv_img_decoder_t * dec = lv_img_decoder_create();
lv_img_decoder_set_info_cb(dec, decoder_info);
lv_img_decoder_set_open_cb(dec, decoder_open);
lv_img_decoder_set_close_cb(dec, decoder_close);


/**
 * Get info about a PNG image
 * @param decoder pointer to the decoder where this function belongs
 * @param src can be file name or pointer to a C array
 * @param header store the info here
 * @return LV_RES_OK: no error; LV_RES_INV: can't get the info
 */
static lv_res_t decoder_info(lv_img_decoder_t * decoder, const void * src, lv_img_header_t * header)
{
  /*Check whether the type `src` is known by the decoder*/
  if(is_png(src) == false) return LV_RES_INV;

  /* Read the PNG header and find `width` and `height` */
  ...

  header->cf = LV_IMG_CF_RAW_ALPHA;
  header->w = width;
  header->h = height;
}

/**
 * Open a PNG image and return the decided image
 * @param decoder pointer to the decoder where this function belongs
 * @param dsc pointer to a descriptor which describes this decoding session
 * @return LV_RES_OK: no error; LV_RES_INV: can't get the info
 */
static lv_res_t decoder_open(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc)
{

  /*Check whether the type `src` is known by the decoder*/
  if(is_png(src) == false) return LV_RES_INV;

  /*Decode and store the image. If `dsc->img_data` is `NULL`, the `read_line` function will be called to get the image data line-by-line*/
  dsc->img_data = my_png_decoder(src);

  /*Change the color format if required. For PNG usually 'Raw' is fine*/
  dsc->header.cf = LV_IMG_CF_...

  /*Call a built in decoder function if required. It's not required if`my_png_decoder` opened the image in true color format.*/
  lv_res_t res = lv_img_decoder_built_in_open(decoder, dsc);

  return res;
}

/**
 * Decode `len` pixels starting from the given `x`, `y` coordinates and store them in `buf`.
 * Required only if the "open" function can't open the whole decoded pixel array. (dsc->img_data == NULL)
 * @param decoder pointer to the decoder the function associated with
 * @param dsc pointer to decoder descriptor
 * @param x start x coordinate
 * @param y start y coordinate
 * @param len number of pixels to decode
 * @param buf a buffer to store the decoded pixels
 * @return LV_RES_OK: ok; LV_RES_INV: failed
 */
lv_res_t decoder_built_in_read_line(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc, lv_coord_t x,
                                                  lv_coord_t y, lv_coord_t len, uint8_t * buf)
{
   /*With PNG it's usually not required*/

   /*Copy `len` pixels from `x` and `y` coordinates in True color format to `buf` */

}

/**
 * Free the allocated resources
 * @param decoder pointer to the decoder where this function belongs
 * @param dsc pointer to a descriptor which describes this decoding session
 */
static void decoder_close(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc)
{
  /*Free all allocated data*/

  /*Call the built-in close function if the built-in open/read_line was used*/
  lv_img_decoder_built_in_close(decoder, dsc);

}

So in summary:

  • In decoder_info, you should collect some basic information about the image and store it in header.
  • In decoder_open, you should try to open the image source pointed by dsc->src. Its type is already in dsc->src_type == LV_IMG_SRC_FILE/VARIABLE. If this format/type is not supported by the decoder, return LV_RES_INV. However, if you can open the image, a pointer to the decoded True color image should be set in dsc->img_data. If the format is known, but you don't want to decode the entire image (e.g. no memory for it), set dsc->img_data = NULL and use read_line to get the pixel data.
  • In decoder_close you should free all allocated resources.
  • decoder_read is optional. Decoding the whole image requires extra memory and some computational overhead. However, it can decode one line of the image without decoding the whole image, you can save memory and time. To indicate that the line read function should be used, set dsc->img_data = NULL in the open function.
戻る : Previous


Manually use an image decoder

英文 自動翻訳

LVGL will use registered image decoders automatically if you try and draw a raw image (i.e. using the lv_img object) but you can use them manually too. Create an lv_img_decoder_dsc_t variable to describe the decoding session and call lv_img_decoder_open().

The color parameter is used only with LV_IMG_CF_ALPHA_1/2/4/8BIT images to tell color of the image. frame_id can be used if the image to open is an animation.

lv_res_t res;
lv_img_decoder_dsc_t dsc;
res = lv_img_decoder_open(&dsc, &my_img_dsc, color, frame_id);

if(res == LV_RES_OK) {
  /*Do something with `dsc->img_data`*/
  lv_img_decoder_close(&dsc);
}
戻る : Previous


Image caching

英文 自動翻訳

Sometimes it takes a lot of time to open an image. Continuously decoding a PNG image or loading images from a slow external memory would be inefficient and detrimental to the user experience.

Therefore, LVGL caches a given number of images. Caching means some images will be left open, hence LVGL can quickly access them from dsc->img_data instead of needing to decode them again.

Of course, caching images is resource intensive as it uses more RAM to store the decoded image. LVGL tries to optimize the process as much as possible (see below), but you will still need to evaluate if this would be beneficial for your platform or not. Image caching may not be worth it if you have a deeply embedded target which decodes small images from a relatively fast storage medium.

戻る : Previous


Cache size

英文 自動翻訳

The number of cache entries can be defined with LV_IMG_CACHE_DEF_SIZE in lv_conf.h. The default value is 1 so only the most recently used image will be left open.

The size of the cache can be changed at run-time with lv_img_cache_set_size(entry_num).

戻る : Previous


Value of images

英文 自動翻訳

When you use more images than cache entries, LVGL can't cache all the images. Instead, the library will close one of the cached images to free space.

To decide which image to close, LVGL uses a measurement it previously made of how long it took to open the image. Cache entries that hold slower-to-open images are considered more valuable and are kept in the cache as long as possible.

If you want or need to override LVGL's measurement, you can manually set the time to open value in the decoder open function in dsc->time_to_open = time_ms to give a higher or lower value. (Leave it unchanged to let LVGL control it.)

Every cache entry has a "life" value. Every time an image is opened through the cache, the life value of all entries is decreased to make them older. When a cached image is used, its life value is increased by the time to open value to make it more alive.

If there is no more space in the cache, the entry with the lowest life value will be closed.

戻る : Previous


Memory usage

英文 自動翻訳

Note that a cached image might continuously consume memory. For example, if three PNG images are cached, they will consume memory while they are open.

Therefore, it's the user's responsibility to be sure there is enough RAM to cache even the largest images at the same time.

戻る : Previous


Clean the cache

英文 自動翻訳

Let's say you have loaded a PNG image into a lv_img_dsc_t my_png variable and use it in an lv_img object. If the image is already cached and you then change the underlying PNG file, you need to notify LVGL to cache the image again. Otherwise, there is no easy way of detecting that the underlying file changed and LVGL will still draw the old image from cache.

To do this, use lv_img_cache_invalidate_src(&my_png). If NULL is passed as a parameter, the whole cache will be cleaned.

戻る : Previous


API

Image buffer

英文 自動翻訳

Typedefs

typedef uint8_t lv_img_cf_t

Enums

enum [anonymous]

Values:
enumerator LV_IMG_CF_UNKNOWN
enumerator LV_IMG_CF_RAW
Contains the file as it is. Needs custom decoder function
enumerator LV_IMG_CF_RAW_ALPHA
Contains the file as it is. The image has alpha. Needs custom decoder function
enumerator LV_IMG_CF_RAW_CHROMA_KEYED
Contains the file as it is. The image is chroma keyed. Needs custom decoder function
enumerator LV_IMG_CF_TRUE_COLOR
Color format and depth should match with LV_COLOR settings
enumerator LV_IMG_CF_TRUE_COLOR_ALPHA
Same as LV_IMG_CF_TRUE_COLOR but every pixel has an alpha byte
enumerator LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED
Same as LV_IMG_CF_TRUE_COLOR but LV_COLOR_TRANSP pixels will be transparent
enumerator LV_IMG_CF_INDEXED_1BIT
Can have 2 different colors in a palette (always chroma keyed)
enumerator LV_IMG_CF_INDEXED_2BIT
Can have 4 different colors in a palette (always chroma keyed)
enumerator LV_IMG_CF_INDEXED_4BIT
Can have 16 different colors in a palette (always chroma keyed)
enumerator LV_IMG_CF_INDEXED_8BIT
Can have 256 different colors in a palette (always chroma keyed)
enumerator LV_IMG_CF_ALPHA_1BIT
Can have one color and it can be drawn or not
enumerator LV_IMG_CF_ALPHA_2BIT
Can have one color but 4 different alpha value
enumerator LV_IMG_CF_ALPHA_4BIT
Can have one color but 16 different alpha value
enumerator LV_IMG_CF_ALPHA_8BIT
Can have one color but 256 different alpha value
enumerator LV_IMG_CF_RESERVED_15
Reserved for further use.
enumerator LV_IMG_CF_RESERVED_16
Reserved for further use.
enumerator LV_IMG_CF_RESERVED_17
Reserved for further use.
enumerator LV_IMG_CF_RESERVED_18
Reserved for further use.
enumerator LV_IMG_CF_RESERVED_19
Reserved for further use.
enumerator LV_IMG_CF_RESERVED_20
Reserved for further use.
enumerator LV_IMG_CF_RESERVED_21
Reserved for further use.
enumerator LV_IMG_CF_RESERVED_22
Reserved for further use.
enumerator LV_IMG_CF_RESERVED_23
Reserved for further use.
enumerator LV_IMG_CF_USER_ENCODED_0
User holder encoding format.
enumerator LV_IMG_CF_USER_ENCODED_1
User holder encoding format.
enumerator LV_IMG_CF_USER_ENCODED_2
User holder encoding format.
enumerator LV_IMG_CF_USER_ENCODED_3
User holder encoding format.
enumerator LV_IMG_CF_USER_ENCODED_4
User holder encoding format.
enumerator LV_IMG_CF_USER_ENCODED_5
User holder encoding format.
enumerator LV_IMG_CF_USER_ENCODED_6
User holder encoding format.
enumerator LV_IMG_CF_USER_ENCODED_7
User holder encoding format.

Functions

lv_img_dsc_t *lv_img_buf_alloc(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf)

Allocate an image buffer in RAM
Parameters
  • w -- width of image
  • h -- height of image
  • cf -- a color format (LV_IMG_CF_...)
Returns
an allocated image, or NULL on failure

lv_color_t lv_img_buf_get_px_color(lv_img_dsc_t *dsc, lv_coord_t x, lv_coord_t y, lv_color_t color)

Get the color of an image's pixel
Parameters
  • dsc -- an image descriptor
  • x -- x coordinate of the point to get
  • y -- x coordinate of the point to get
  • color -- the color of the image. In case of LV_IMG_CF_ALPHA_1/2/4/8 this color is used. Not used in other cases.
  • safe -- true: check out of bounds
Returns
color of the point

lv_opa_t lv_img_buf_get_px_alpha(lv_img_dsc_t *dsc, lv_coord_t x, lv_coord_t y)

Get the alpha value of an image's pixel
Parameters
  • dsc -- pointer to an image descriptor
  • x -- x coordinate of the point to set
  • y -- x coordinate of the point to set
  • safe -- true: check out of bounds
Returns
alpha value of the point

void lv_img_buf_set_px_color(lv_img_dsc_t *dsc, lv_coord_t x, lv_coord_t y, lv_color_t c)

Set the color of a pixel of an image. The alpha channel won't be affected.
Parameters
  • dsc -- pointer to an image descriptor
  • x -- x coordinate of the point to set
  • y -- x coordinate of the point to set
  • c -- color of the point
  • safe -- true: check out of bounds

void lv_img_buf_set_px_alpha(lv_img_dsc_t *dsc, lv_coord_t x, lv_coord_t y, lv_opa_t opa)

Set the alpha value of a pixel of an image. The color won't be affected
Parameters
  • dsc -- pointer to an image descriptor
  • x -- x coordinate of the point to set
  • y -- x coordinate of the point to set
  • opa -- the desired opacity
  • safe -- true: check out of bounds

void lv_img_buf_set_palette(lv_img_dsc_t *dsc, uint8_t id, lv_color_t c)

Set the palette color of an indexed image. Valid only for LV_IMG_CF_INDEXED1/2/4/8
Parameters
  • dsc -- pointer to an image descriptor
  • id -- the palette color to set:
    • for LV_IMG_CF_INDEXED1: 0..1
    • for LV_IMG_CF_INDEXED2: 0..3
    • for LV_IMG_CF_INDEXED4: 0..15
    • for LV_IMG_CF_INDEXED8: 0..255
  • c -- the color to set

void lv_img_buf_free(lv_img_dsc_t *dsc)

Free an allocated image buffer
Parameters
dsc -- image buffer to free

uint32_t lv_img_buf_get_img_size(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf)

Get the memory consumption of a raw bitmap, given color format and dimensions.
Parameters
  • w -- width
  • h -- height
  • cf -- color format
Returns
size in bytes

void _lv_img_buf_transform_init(lv_img_transform_dsc_t *dsc)

Initialize a descriptor to rotate an image
Parameters
dsc -- pointer to an lv_img_transform_dsc_t variable whose cfg field is initialized

bool _lv_img_buf_transform_anti_alias(lv_img_transform_dsc_t *dsc)

Continue transformation by taking the neighbors into account
Parameters
dsc -- pointer to the transformation descriptor

bool _lv_img_buf_transform(lv_img_transform_dsc_t *dsc, lv_coord_t x, lv_coord_t y)

Get which color and opa would come to a pixel if it were rotated Note the result is written back to dsc->res_color and dsc->res_opa
Parameters
  • dsc -- a descriptor initialized by lv_img_buf_rotate_init
  • x -- the coordinate which color and opa should be get
  • y -- the coordinate which color and opa should be get
Returns
true: there is valid pixel on these x/y coordinates; false: the rotated pixel was out of the image

void _lv_img_buf_get_transformed_area(lv_area_t *res, lv_coord_t w, lv_coord_t h, int16_t angle, uint16_t zoom, const lv_point_t *pivot)

Get the area of a rectangle if its rotated and scaled
Parameters
  • res -- store the coordinates here
  • w -- width of the rectangle to transform
  • h -- height of the rectangle to transform
  • angle -- angle of rotation
  • zoom -- zoom, (256 no zoom)
  • pivot -- x,y pivot coordinates of rotation

struct lv_img_header_t

#include <lv_img_b'uf.h> The first 8 bit is very important to distinguish the different source types. For more info see lv_img_get_src_type() in lv_img.c On big endian systems the order is reversed so cf and always_zero must be at the end of the struct. Public Members
uint32_t h
uint32_t w
uint32_t reserved
uint32_t always_zero
uint32_t cf

struct lv_img_header_t

#include <lv_img_buf.h> The first 8 bit is very important to distinguish the different source types. For more info see lv_img_get_src_type() in lv_img.c On big endian systems the order is reversed so cf and always_zero must be at the end of the struct. Public Members
uint32_t h
uint32_t w
uint32_t reserved
uint32_t always_zero
uint32_t cf

struct lv_img_dsc_t

#include <lv_im'g_buf.h> Image header it is compatible with the result from image converter utility Public Members
lv_img_header_t header
A header describing the basics of the image
uint32_t data_size
Size of the image in bytes
const uint8_t *data
Pointer to the data of the image

struct lv_img_transform_dsc_t

Public Members
const void *src
lv_coord_t src_w
lv_coord_t src_h
lv_coord_t pivot_x
lv_coord_t pivot_y
int16_t angle
uint16_t zoom
lv_color_t color
lv_img_cf_t cf
bool antialias
struct lv_img_transform_dsc_t::[anonymous] cfg
lv_opa_t opa
struct lv_img_transform_dsc_t::[anonymous] res
lv_img_dsc_t img_dsc
int32_t pivot_x_256
int32_t pivot_y_256
int32_t sinma
int32_t cosma
uint8_t chroma_keyed
uint8_t has_alpha
uint8_t native_color
uint32_t zoom_inv
lv_coord_t xs
lv_coord_t ys
lv_coord_t xs_int
lv_coord_t ys_int
uint32_t pxi
uint8_t px_size
struct lv_img_transform_dsc_t::[anonymous] tmp


戻る : Previous