# lv_image_dsc.h (/api/draw/lv_image_dsc_h)



<ApiSummary enums="2" structs="4" typedefs="1" macros="2" />

Enums [#enums]

<ApiMember kind="enum" name="_lvimage_flags_t" file="draw/lv_image_dsc.h" line="37" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_image_dsc.h#L37">
  \_lvimage_flags_t [#_lvimage_flags_t]

  | Name                           | Value    | Description                                                                                                                                                                          |
  | ------------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
  | `LV_IMAGE_FLAGS_PREMULTIPLIED` | `0x0001` | For RGB map of the image data, mark if it's pre-multiplied with alpha. For indexed image, this bit indicated palette data is pre-multiplied with alpha.                              |
  | `LV_IMAGE_FLAGS_COMPRESSED`    | `0x0008` | The image data is compressed, so decoder needs to decode image firstly. If this flag is set, the whole image will be decompressed upon decode, and `get_area_cb` won't be necessary. |
  | `LV_IMAGE_FLAGS_ALLOCATED`     | `0x0010` | The image is allocated from heap, thus should be freed after use.                                                                                                                    |
  | `LV_IMAGE_FLAGS_MODIFIABLE`    | `0x0020` | If the image data is malloced and can be processed in place. In image decoder post processing, this flag means we modify it in-place.                                                |
  | `LV_IMAGE_FLAGS_CUSTOM_DRAW`   | `0x0040` | The image has custom drawing methods.                                                                                                                                                |
  | `LV_IMAGE_FLAGS_USER1`         | `0x0100` | Flags reserved for user, lvgl won't use these bits.                                                                                                                                  |
  | `LV_IMAGE_FLAGS_USER2`         | `0x0200` |                                                                                                                                                                                      |
  | `LV_IMAGE_FLAGS_USER3`         | `0x0400` |                                                                                                                                                                                      |
  | `LV_IMAGE_FLAGS_USER4`         | `0x0800` |                                                                                                                                                                                      |
  | `LV_IMAGE_FLAGS_USER5`         | `0x1000` |                                                                                                                                                                                      |
  | `LV_IMAGE_FLAGS_USER6`         | `0x2000` |                                                                                                                                                                                      |
  | `LV_IMAGE_FLAGS_USER7`         | `0x4000` |                                                                                                                                                                                      |
  | `LV_IMAGE_FLAGS_USER8`         | `0x8000` |                                                                                                                                                                                      |
</ApiMember>

<ApiMember kind="enum" name="lv_image_compress_t" file="draw/lv_image_dsc.h" line="81" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_image_dsc.h#L81">
  lv_image_compress_t [#lv_image_compress_t]

  | Name                     | Value | Description                 |
  | ------------------------ | ----- | --------------------------- |
  | `LV_IMAGE_COMPRESS_NONE` | `0`   |                             |
  | `LV_IMAGE_COMPRESS_RLE`  |       | LVGL custom RLE compression |
  | `LV_IMAGE_COMPRESS_LZ4`  |       |                             |
</ApiMember>

Structs [#structs]

<ApiMember kind="struct" name="lv_image_header_t">
  lv_image_header_t [#lv_image_header_t]

  | Member       | Type                        | Description                                    |
  | ------------ | --------------------------- | ---------------------------------------------- |
  | `magic`      | <ApiLink name="uint32_t" /> | Magic number. Must be LV\_IMAGE\_HEADER\_MAGIC |
  | `cf`         | <ApiLink name="uint32_t" /> | Color format: See `lv_color_format_t`          |
  | `flags`      | <ApiLink name="uint32_t" /> | Image flags, see `lv_image_flags_t`            |
  | `w`          | <ApiLink name="uint32_t" /> |                                                |
  | `h`          | <ApiLink name="uint32_t" /> |                                                |
  | `stride`     | <ApiLink name="uint32_t" /> | Number of bytes in a row                       |
  | `reserved_2` | <ApiLink name="uint32_t" /> | Reserved to be used later                      |
</ApiMember>

<TypeUsedBy name="lv_image_header_t" count="3">
  * `lv_image_decoder_get_info` — param `header`
  * `lv_nanovg_image_cache_get_handle` — param `header`
  * `lv_bin_decoder_info` — param `header`
</TypeUsedBy>

<ApiMember kind="struct" name="lv_yuv_plane_t">
  lv_yuv_plane_t [#lv_yuv_plane_t]

  | Member   | Type                        | Description              |
  | -------- | --------------------------- | ------------------------ |
  | `buf`    | `void *`                    |                          |
  | `stride` | <ApiLink name="uint32_t" /> | Number of bytes in a row |
</ApiMember>

<ApiMember kind="struct" name="lv_yuv_buf_t">
  lv_yuv_buf_t [#lv_yuv_buf_t]

  | Member        | Type                                                          | Description                |
  | ------------- | ------------------------------------------------------------- | -------------------------- |
  | `yuv`         | <ApiLink name="lv_yuv_plane_t" />                             | packed format              |
  | `y`           | <ApiLink name="lv_yuv_plane_t" />                             |                            |
  | `u`           | <ApiLink name="lv_yuv_plane_t" />                             |                            |
  | `v`           | <ApiLink name="lv_yuv_plane_t" />                             |                            |
  | `planar`      | <ApiLink name="lv_yuv_buf_t" display="struct lv_yuv_buf_t" /> | planar format with 3 plane |
  | `uv`          | <ApiLink name="lv_yuv_plane_t" />                             |                            |
  | `semi_planar` | <ApiLink name="lv_yuv_buf_t" display="struct lv_yuv_buf_t" /> | planar format with 2 plane |
</ApiMember>

<ApiMember kind="struct" name="lv_image_dsc_t">
  lv_image_dsc_t [#lv_image_dsc_t]

  Struct to describe a constant image resource. It's similar to lv\_draw\_buf\_t, but the data is constant.

  | Member       | Type                                                 | Description                                                   |
  | ------------ | ---------------------------------------------------- | ------------------------------------------------------------- |
  | `header`     | <ApiLink name="lv_image_header_t" />                 | A header describing the basics of the image                   |
  | `data_size`  | <ApiLink name="uint32_t" />                          | Size of the image in bytes                                    |
  | `data`       | <ApiLink name="uint8_t" display="const uint8_t *" /> | Pointer to the data of the image                              |
  | `reserved`   | `const void *`                                       | A reserved field to make it has same size as lv\_draw\_buf\_t |
  | `reserved_2` | `const void *`                                       | A reserved field to make it has same size as lv\_draw\_buf\_t |
</ApiMember>

<TypeUsedBy name="lv_image_dsc_t" count="9">
  * `lv_draw_eve_image_upload_image` — param `img_dsc`
  * `lv_draw_buf_from_image` — param `img`
  * `lv_draw_buf_to_image` — param `img`
  * `lv_image_buf_set_palette` — param `dsc`
  * `lv_image_buf_free` — param `dsc`
  * `lv_snapshot_free` — param `dsc`
  * `lv_snapshot_take_to_buf` — param `dsc`
  * `lv_x11_inputs_create` — param `mouse_img`
  * `lv_image_set_bitmap_map_src` — param `src`
</TypeUsedBy>

Typedefs [#typedefs]

<ApiMember kind="typedef" name="lv_image_flags_t" file="draw/lv_image_dsc.h" line="79" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_image_dsc.h#L79">
  lv_image_flags_t [#lv_image_flags_t]

  ```c title=" " lineNumbers=1
  typedef enum _lvimage_flags_t lv_image_flags_t
  ```
</ApiMember>

<TypeUsedBy name="lv_image_flags_t" count="3">
  * `lv_draw_buf_has_flag` — param `flag`
  * `lv_draw_buf_set_flag` — param `flag`
  * `lv_draw_buf_clear_flag` — param `flag`
</TypeUsedBy>

Macros [#macros]

<ApiMember kind="macro" name="LV_IMAGE_HEADER_MAGIC" file="draw/lv_image_dsc.h" line="25" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_image_dsc.h#L25">
  LV_IMAGE_HEADER_MAGIC [#lv_image_header_magic]

  ```c title=" " lineNumbers=1
  #define LV_IMAGE_HEADER_MAGIC (0x19)
  ```

  Magic number for lvgl image, 9 means lvgl version 9 It must be neither a valid ASCII character nor larger than 0x80. See `lv_image_src_get_type`.
</ApiMember>

<ApiMember kind="macro" name="LV_IMAGE_FLAGS_USER_MASK" file="draw/lv_image_dsc.h" line="31" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/draw/lv_image_dsc.h#L31">
  LV_IMAGE_FLAGS_USER_MASK [#lv_image_flags_user_mask]

  ```c title=" " lineNumbers=1
  #define LV_IMAGE_FLAGS_USER_MASK (0xFF00)
  ```

  Flags reserved for user, lvgl won't use these bits.
</ApiMember>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_conf_internal.h&#x22;]" includedBy="[&#x22;lv_draw_buf.h&#x22;, &#x22;lv_x11.h&#x22;]" transitiveIncludes="[&#x22;lv_conf_kconfig.h&#x22;]" />
