1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00
lvgl/lv_objx/lv_img.h
2016-10-07 11:15:46 +02:00

87 lines
1.7 KiB
C

/**
* @file lv_img.h
*
*/
#ifndef LV_IMG_H
#define LV_IMG_H
/*********************
* INCLUDES
*********************/
#include "lv_conf.h"
#if USE_LV_IMG != 0
#include "../lv_obj/lv_obj.h"
#include "misc/fs/fsint.h"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/*Style of template*/
typedef struct
{
lv_objs_t objs; /*Style of ancestor*/
/*New style element for this type */
opa_t recolor_opa;
}lv_imgs_t;
/*Built-in styles of template*/
typedef enum
{
LV_IMGS_DEF,
LV_IMGS_LIGHT,
LV_IMGS_DARK,
}lv_imgs_builtin_t;
/*Data of template*/
typedef struct
{
/*No ext. because inherited from the base object*/ /*Ext. of ancestor*/
/*New data for this type */
char* fn;
cord_t w;
cord_t h;
uint8_t auto_size :1;
uint8_t transp :1; /*Transp. bit in the images header (library handles this)*/
}lv_img_ext_t;
/*Image header*/
typedef struct
{
uint16_t w;
uint16_t h;
uint16_t cd; /*Color depth*/
uint16_t transp :1; /*Do not draw LV_IMG_TRANSP_COLOR pixels*/
}lv_img_raw_header_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
/*Create function*/
lv_obj_t * lv_img_create(lv_obj_t * par, lv_obj_t * copy);
bool lv_img_signal(lv_obj_t * img, lv_signal_t sign, void * param);
void lv_img_set_file(lv_obj_t * img, const char * fn);
fs_res_t lv_img_create_file(const char * fn, const color_int_t * data_p);
void lv_img_set_auto_size(lv_obj_t * img, bool autotosize);
bool lv_img_get_auto_size(lv_obj_t * img);
lv_imgs_t * lv_imgs_get(lv_imgs_builtin_t style, lv_imgs_t * copy);
/**********************
* MACROS
**********************/
#define LV_IMG_DECLARE(var_name) extern const color_int_t var_name[];
#endif
#endif