lv_image_buf.h

Defines

LV_IMAGE_BUF_SIZE_TRUE_COLOR(w, h)
LV_IMAGE_BUF_SIZE_TRUE_COLOR_CHROMA_KEYED(w, h)
LV_IMAGE_BUF_SIZE_TRUE_COLOR_ALPHA(w, h)
LV_IMAGE_BUF_SIZE_ALPHA_1BIT(w, h)
LV_IMAGE_BUF_SIZE_ALPHA_2BIT(w, h)
LV_IMAGE_BUF_SIZE_ALPHA_4BIT(w, h)
LV_IMAGE_BUF_SIZE_ALPHA_8BIT(w, h)
LV_IMAGE_BUF_SIZE_INDEXED_1BIT(w, h)
LV_IMAGE_BUF_SIZE_INDEXED_2BIT(w, h)
LV_IMAGE_BUF_SIZE_INDEXED_4BIT(w, h)
LV_IMAGE_BUF_SIZE_INDEXED_8BIT(w, h)
_LV_ZOOM_INV_UPSCALE

Functions

void lv_image_buf_set_palette(lv_image_dsc_t *dsc, uint8_t id, lv_color32_t c)

Set the palette color of an indexed image. Valid only for LV_IMAGE_CF_INDEXED1/2/4/8

Parameters:
  • dsc -- pointer to an image descriptor

  • id -- the palette color to set:

    • for LV_IMAGE_CF_INDEXED1: 0..1

    • for LV_IMAGE_CF_INDEXED2: 0..3

    • for LV_IMAGE_CF_INDEXED4: 0..15

    • for LV_IMAGE_CF_INDEXED8: 0..255

  • c -- the color to set in lv_color32_t format

void lv_image_buf_free(lv_image_dsc_t *dsc)

Free an allocated image buffer

Parameters:

dsc -- image buffer to free

void _lv_image_buf_get_transformed_area(lv_area_t *res, lv_coord_t w, lv_coord_t h, lv_coord_t angle, uint16_t zoom_x, uint16_t zoom_y, 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_image_header_t
#include <lv_image_buf.h>

The first 8 bit is very important to distinguish the different source types. For more info see lv_image_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 cf
uint32_t always_zero
uint32_t format
uint32_t user
uint32_t reserved
uint32_t w
uint32_t h
uint32_t stride
uint32_t reserved_2
struct lv_image_dsc_t
#include <lv_image_buf.h>

Image header it is compatible with the result from image converter utility

Public Members

lv_image_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