mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-25 11:46:31 +00:00
ESP32 LVGL library from v8.3.8 to v8.3.9 (no functional change) (#19510)
This commit is contained in:
parent
860e12b88a
commit
156f1988b2
@ -14,6 +14,7 @@ All notable changes to this project will be documented in this file.
|
||||
- Reduce IRAM consumption of HDMI CEC to 1453 bytes
|
||||
- `Sendmail` upgraded to ESP-Mail-Client v3.4.9 from v1.2.0, using BearSSL instead of MbedTLS
|
||||
- ESP32 Framework (Arduino Core) from v2.0.11 to v2.0.12
|
||||
- ESP32 LVGL library from v8.3.8 to v8.3.9 (no functional change)
|
||||
|
||||
### Fixed
|
||||
- PCF8574 mode 1 with base relays exception 3/28 regression from v12.4.0.4 (#19408)
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lvgl",
|
||||
"version": "8.3.8",
|
||||
"version": "8.3.9",
|
||||
"keywords": "graphics, gui, embedded, tft, lvgl",
|
||||
"description": "Graphics library to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint. It offers anti-aliasing, opacity, and animations using only one frame buffer.",
|
||||
"repository": {
|
||||
|
@ -1,5 +1,5 @@
|
||||
name=lvgl
|
||||
version=8.3.8
|
||||
version=8.3.9
|
||||
author=kisvegabor
|
||||
maintainer=kisvegabor,embeddedt,pete-pjb
|
||||
sentence=Full-featured Graphics Library for Embedded Systems
|
||||
|
@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @file lv_conf.h
|
||||
* Configuration file for v8.3.8
|
||||
* Configuration file for v8.3.9
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -15,7 +15,7 @@ extern "C" {
|
||||
***************************/
|
||||
#define LVGL_VERSION_MAJOR 8
|
||||
#define LVGL_VERSION_MINOR 3
|
||||
#define LVGL_VERSION_PATCH 8
|
||||
#define LVGL_VERSION_PATCH 9
|
||||
#define LVGL_VERSION_INFO ""
|
||||
|
||||
/*********************
|
||||
|
@ -356,16 +356,16 @@ static void indev_pointer_proc(lv_indev_t * i, lv_indev_data_t * data)
|
||||
|
||||
/*Simple sanity check*/
|
||||
if(data->point.x < 0) {
|
||||
LV_LOG_WARN("X is %d which is smaller than zero", data->point.x);
|
||||
LV_LOG_WARN("X is %d which is smaller than zero", (int)data->point.x);
|
||||
}
|
||||
if(data->point.x >= lv_disp_get_hor_res(i->driver->disp)) {
|
||||
LV_LOG_WARN("X is %d which is greater than hor. res", data->point.x);
|
||||
LV_LOG_WARN("X is %d which is greater than hor. res", (int)data->point.x);
|
||||
}
|
||||
if(data->point.y < 0) {
|
||||
LV_LOG_WARN("Y is %d which is smaller than zero", data->point.y);
|
||||
LV_LOG_WARN("Y is %d which is smaller than zero", (int)data->point.y);
|
||||
}
|
||||
if(data->point.y >= lv_disp_get_ver_res(i->driver->disp)) {
|
||||
LV_LOG_WARN("Y is %d which is greater than ver. res", data->point.y);
|
||||
LV_LOG_WARN("Y is %d which is greater than ver. res", (int)data->point.y);
|
||||
}
|
||||
|
||||
/*Move the cursor if set and moved*/
|
||||
|
@ -232,12 +232,22 @@ void lv_obj_add_flag(lv_obj_t * obj, lv_obj_flag_t f)
|
||||
|
||||
bool was_on_layout = lv_obj_is_layout_positioned(obj);
|
||||
|
||||
/* We must invalidate the area occupied by the object before we hide it as calls to invalidate hidden objects are ignored */
|
||||
if(f & LV_OBJ_FLAG_HIDDEN) lv_obj_invalidate(obj);
|
||||
|
||||
obj->flags |= f;
|
||||
|
||||
if(f & LV_OBJ_FLAG_HIDDEN) {
|
||||
lv_obj_invalidate(obj);
|
||||
if(lv_obj_has_state(obj, LV_STATE_FOCUSED)) {
|
||||
lv_group_t * group = lv_obj_get_group(obj);
|
||||
if(group != NULL) {
|
||||
lv_group_focus_next(group);
|
||||
lv_obj_t * next_obj = lv_group_get_focused(group);
|
||||
if(next_obj != NULL) {
|
||||
lv_obj_invalidate(next_obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if((was_on_layout != lv_obj_is_layout_positioned(obj)) || (f & (LV_OBJ_FLAG_LAYOUT_1 | LV_OBJ_FLAG_LAYOUT_2))) {
|
||||
@ -718,9 +728,9 @@ static void lv_obj_event(const lv_obj_class_t * class_p, lv_event_t * e)
|
||||
}
|
||||
else if(code == LV_EVENT_RELEASED) {
|
||||
lv_obj_clear_state(obj, LV_STATE_PRESSED);
|
||||
void * param = lv_event_get_param(e);
|
||||
lv_indev_t * indev = lv_event_get_indev(e);
|
||||
/*Go the checked state if enabled*/
|
||||
if(lv_indev_get_scroll_obj(param) == NULL && lv_obj_has_flag(obj, LV_OBJ_FLAG_CHECKABLE)) {
|
||||
if(lv_indev_get_scroll_obj(indev) == NULL && lv_obj_has_flag(obj, LV_OBJ_FLAG_CHECKABLE)) {
|
||||
if(!(lv_obj_get_state(obj) & LV_STATE_CHECKED)) lv_obj_add_state(obj, LV_STATE_CHECKED);
|
||||
else lv_obj_clear_state(obj, LV_STATE_CHECKED);
|
||||
|
||||
|
@ -188,6 +188,7 @@ typedef struct _lv_obj_t {
|
||||
uint16_t style_cnt : 6;
|
||||
uint16_t h_layout : 1;
|
||||
uint16_t w_layout : 1;
|
||||
uint16_t being_deleted : 1;
|
||||
} lv_obj_t;
|
||||
|
||||
|
||||
|
@ -360,6 +360,8 @@ static void obj_del_core(lv_obj_t * obj)
|
||||
lv_res_t res = lv_event_send(obj, LV_EVENT_DELETE, NULL);
|
||||
if(res == LV_RES_INV) return;
|
||||
|
||||
obj->being_deleted = 1;
|
||||
|
||||
/*Recursively delete the children*/
|
||||
lv_obj_t * child = lv_obj_get_child(obj, 0);
|
||||
while(child) {
|
||||
|
@ -1027,7 +1027,7 @@ static void draw_buf_rotate_180(lv_disp_drv_t * drv, lv_area_t * area, lv_color_
|
||||
area->x1 = drv->hor_res - tmp_coord - 1;
|
||||
}
|
||||
|
||||
static LV_ATTRIBUTE_FAST_MEM void draw_buf_rotate_90(bool invert_i, lv_coord_t area_w, lv_coord_t area_h,
|
||||
static void LV_ATTRIBUTE_FAST_MEM draw_buf_rotate_90(bool invert_i, lv_coord_t area_w, lv_coord_t area_h,
|
||||
lv_color_t * orig_color_p, lv_color_t * rot_buf)
|
||||
{
|
||||
|
||||
|
@ -418,19 +418,17 @@
|
||||
**********************/
|
||||
|
||||
#if __ARM_2D_HAS_HW_ACC__
|
||||
LV_ATTRIBUTE_FAST_MEM
|
||||
static bool lv_draw_arm2d_fill_colour(const arm_2d_tile_t * target_tile,
|
||||
const arm_2d_region_t * region,
|
||||
lv_color_t color,
|
||||
lv_opa_t opa,
|
||||
const arm_2d_tile_t * mask_tile);
|
||||
static bool /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_arm2d_fill_colour(const arm_2d_tile_t * target_tile,
|
||||
const arm_2d_region_t * region,
|
||||
lv_color_t color,
|
||||
lv_opa_t opa,
|
||||
const arm_2d_tile_t * mask_tile);
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM
|
||||
static bool lv_draw_arm2d_tile_copy(const arm_2d_tile_t * target_tile,
|
||||
const arm_2d_region_t * region,
|
||||
arm_2d_tile_t * source_tile,
|
||||
lv_opa_t opa,
|
||||
arm_2d_tile_t * mask_tile);
|
||||
static bool /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_arm2d_tile_copy(const arm_2d_tile_t * target_tile,
|
||||
const arm_2d_region_t * region,
|
||||
arm_2d_tile_t * source_tile,
|
||||
lv_opa_t opa,
|
||||
arm_2d_tile_t * mask_tile);
|
||||
#else
|
||||
|
||||
static void convert_cb(const lv_area_t * dest_area,
|
||||
@ -443,36 +441,32 @@ static void convert_cb(const lv_area_t * dest_area,
|
||||
lv_color_t * cbuf,
|
||||
lv_opa_t * abuf);
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM
|
||||
static bool arm_2d_fill_normal(lv_color_t * dest_buf,
|
||||
const lv_area_t * dest_area,
|
||||
lv_coord_t dest_stride,
|
||||
lv_color_t color,
|
||||
lv_opa_t opa,
|
||||
const lv_opa_t * mask,
|
||||
lv_coord_t mask_stride);
|
||||
static bool /* LV_ATTRIBUTE_FAST_MEM */ arm_2d_fill_normal(lv_color_t * dest_buf,
|
||||
const lv_area_t * dest_area,
|
||||
lv_coord_t dest_stride,
|
||||
lv_color_t color,
|
||||
lv_opa_t opa,
|
||||
const lv_opa_t * mask,
|
||||
lv_coord_t mask_stride);
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM
|
||||
static bool arm_2d_copy_normal(lv_color_t * dest_buf,
|
||||
const lv_area_t * dest_area,
|
||||
lv_coord_t dest_stride,
|
||||
const lv_color_t * src_buf,
|
||||
lv_coord_t src_stride,
|
||||
lv_opa_t opa,
|
||||
const lv_opa_t * mask,
|
||||
lv_coord_t mask_stride);
|
||||
static bool /* LV_ATTRIBUTE_FAST_MEM */ arm_2d_copy_normal(lv_color_t * dest_buf,
|
||||
const lv_area_t * dest_area,
|
||||
lv_coord_t dest_stride,
|
||||
const lv_color_t * src_buf,
|
||||
lv_coord_t src_stride,
|
||||
lv_opa_t opa,
|
||||
const lv_opa_t * mask,
|
||||
lv_coord_t mask_stride);
|
||||
#endif
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM
|
||||
static void lv_draw_arm2d_blend(lv_draw_ctx_t * draw_ctx, const lv_draw_sw_blend_dsc_t * dsc);
|
||||
LV_ATTRIBUTE_FAST_MEM
|
||||
static void lv_gpu_arm2d_wait_cb(lv_draw_ctx_t * draw_ctx);
|
||||
LV_ATTRIBUTE_FAST_MEM
|
||||
static void lv_draw_arm2d_img_decoded(struct _lv_draw_ctx_t * draw_ctx,
|
||||
const lv_draw_img_dsc_t * draw_dsc,
|
||||
const lv_area_t * coords,
|
||||
const uint8_t * src_buf,
|
||||
lv_img_cf_t cf);
|
||||
static void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_arm2d_blend(lv_draw_ctx_t * draw_ctx,
|
||||
const lv_draw_sw_blend_dsc_t * dsc);
|
||||
static void /* LV_ATTRIBUTE_FAST_MEM */ lv_gpu_arm2d_wait_cb(lv_draw_ctx_t * draw_ctx);
|
||||
static void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_arm2d_img_decoded(struct _lv_draw_ctx_t * draw_ctx,
|
||||
const lv_draw_img_dsc_t * draw_dsc,
|
||||
const lv_area_t * coords,
|
||||
const uint8_t * src_buf,
|
||||
lv_img_cf_t cf);
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
@ -512,8 +506,8 @@ void lv_draw_arm2d_ctx_deinit(lv_disp_drv_t * drv, lv_draw_ctx_t * draw_ctx)
|
||||
extern void test_flush(lv_color_t * color_p);
|
||||
|
||||
#if __ARM_2D_HAS_HW_ACC__
|
||||
LV_ATTRIBUTE_FAST_MEM
|
||||
static void lv_draw_arm2d_blend(lv_draw_ctx_t * draw_ctx, const lv_draw_sw_blend_dsc_t * dsc)
|
||||
static void LV_ATTRIBUTE_FAST_MEM lv_draw_arm2d_blend(lv_draw_ctx_t * draw_ctx,
|
||||
const lv_draw_sw_blend_dsc_t * dsc)
|
||||
{
|
||||
const lv_opa_t * mask;
|
||||
if(dsc->mask_buf == NULL) mask = NULL;
|
||||
@ -560,12 +554,11 @@ static void lv_draw_arm2d_blend(lv_draw_ctx_t * draw_ctx, const lv_draw_sw_blend
|
||||
}
|
||||
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM
|
||||
static bool lv_draw_arm2d_fill_colour(const arm_2d_tile_t * target_tile,
|
||||
const arm_2d_region_t * region,
|
||||
lv_color_t color,
|
||||
lv_opa_t opa,
|
||||
const arm_2d_tile_t * mask_tile)
|
||||
static bool LV_ATTRIBUTE_FAST_MEM lv_draw_arm2d_fill_colour(const arm_2d_tile_t * target_tile,
|
||||
const arm_2d_region_t * region,
|
||||
lv_color_t color,
|
||||
lv_opa_t opa,
|
||||
const arm_2d_tile_t * mask_tile)
|
||||
{
|
||||
arm_fsm_rt_t result = (arm_fsm_rt_t)ARM_2D_ERR_NONE;
|
||||
|
||||
@ -623,12 +616,11 @@ static bool lv_draw_arm2d_fill_colour(const arm_2d_tile_t * target_tile,
|
||||
|
||||
}
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM
|
||||
static bool lv_draw_arm2d_tile_copy(const arm_2d_tile_t * target_tile,
|
||||
const arm_2d_region_t * region,
|
||||
arm_2d_tile_t * source_tile,
|
||||
lv_opa_t opa,
|
||||
arm_2d_tile_t * mask_tile)
|
||||
static bool LV_ATTRIBUTE_FAST_MEM lv_draw_arm2d_tile_copy(const arm_2d_tile_t * target_tile,
|
||||
const arm_2d_region_t * region,
|
||||
arm_2d_tile_t * source_tile,
|
||||
lv_opa_t opa,
|
||||
arm_2d_tile_t * mask_tile)
|
||||
{
|
||||
arm_fsm_rt_t result = (arm_fsm_rt_t)ARM_2D_ERR_NONE;
|
||||
|
||||
@ -691,8 +683,8 @@ static void lv_gpu_arm2d_wait_cb(lv_draw_ctx_t * draw_ctx)
|
||||
#else
|
||||
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM
|
||||
static void lv_draw_arm2d_blend(lv_draw_ctx_t * draw_ctx, const lv_draw_sw_blend_dsc_t * dsc)
|
||||
static void LV_ATTRIBUTE_FAST_MEM lv_draw_arm2d_blend(lv_draw_ctx_t * draw_ctx,
|
||||
const lv_draw_sw_blend_dsc_t * dsc)
|
||||
{
|
||||
const lv_opa_t * mask;
|
||||
if(dsc->mask_buf == NULL) mask = NULL;
|
||||
@ -777,14 +769,13 @@ static void lv_draw_arm2d_blend(lv_draw_ctx_t * draw_ctx, const lv_draw_sw_blend
|
||||
if(!is_accelerated) lv_draw_sw_blend_basic(draw_ctx, dsc);
|
||||
}
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM
|
||||
static bool arm_2d_fill_normal(lv_color_t * dest_buf,
|
||||
const lv_area_t * dest_area,
|
||||
lv_coord_t dest_stride,
|
||||
lv_color_t color,
|
||||
lv_opa_t opa,
|
||||
const lv_opa_t * mask,
|
||||
lv_coord_t mask_stride)
|
||||
static bool LV_ATTRIBUTE_FAST_MEM arm_2d_fill_normal(lv_color_t * dest_buf,
|
||||
const lv_area_t * dest_area,
|
||||
lv_coord_t dest_stride,
|
||||
lv_color_t color,
|
||||
lv_opa_t opa,
|
||||
const lv_opa_t * mask,
|
||||
lv_coord_t mask_stride)
|
||||
{
|
||||
arm_2d_size_t target_size = {
|
||||
.iWidth = lv_area_get_width(dest_area),
|
||||
@ -835,15 +826,14 @@ static bool arm_2d_fill_normal(lv_color_t * dest_buf,
|
||||
}
|
||||
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM
|
||||
static bool arm_2d_copy_normal(lv_color_t * dest_buf,
|
||||
const lv_area_t * dest_area,
|
||||
lv_coord_t dest_stride,
|
||||
const lv_color_t * src_buf,
|
||||
lv_coord_t src_stride,
|
||||
lv_opa_t opa,
|
||||
const lv_opa_t * mask,
|
||||
lv_coord_t mask_stride)
|
||||
static bool LV_ATTRIBUTE_FAST_MEM arm_2d_copy_normal(lv_color_t * dest_buf,
|
||||
const lv_area_t * dest_area,
|
||||
lv_coord_t dest_stride,
|
||||
const lv_color_t * src_buf,
|
||||
lv_coord_t src_stride,
|
||||
lv_opa_t opa,
|
||||
const lv_opa_t * mask,
|
||||
lv_coord_t mask_stride)
|
||||
|
||||
{
|
||||
int32_t w = lv_area_get_width(dest_area);
|
||||
@ -908,12 +898,11 @@ static bool arm_2d_copy_normal(lv_color_t * dest_buf,
|
||||
return true;
|
||||
}
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM
|
||||
static void lv_draw_arm2d_img_decoded(struct _lv_draw_ctx_t * draw_ctx,
|
||||
const lv_draw_img_dsc_t * draw_dsc,
|
||||
const lv_area_t * coords,
|
||||
const uint8_t * src_buf,
|
||||
lv_img_cf_t cf)
|
||||
static void LV_ATTRIBUTE_FAST_MEM lv_draw_arm2d_img_decoded(struct _lv_draw_ctx_t * draw_ctx,
|
||||
const lv_draw_img_dsc_t * draw_dsc,
|
||||
const lv_area_t * coords,
|
||||
const uint8_t * src_buf,
|
||||
lv_img_cf_t cf)
|
||||
{
|
||||
/*Use the clip area as draw area*/
|
||||
lv_area_t draw_area;
|
||||
|
@ -25,8 +25,9 @@
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
LV_ATTRIBUTE_FAST_MEM static lv_res_t decode_and_draw(lv_draw_ctx_t * draw_ctx, const lv_draw_img_dsc_t * draw_dsc,
|
||||
const lv_area_t * coords, const void * src);
|
||||
static lv_res_t /* LV_ATTRIBUTE_FAST_MEM */ decode_and_draw(lv_draw_ctx_t * draw_ctx,
|
||||
const lv_draw_img_dsc_t * draw_dsc,
|
||||
const lv_area_t * coords, const void * src);
|
||||
|
||||
static void show_error(lv_draw_ctx_t * draw_ctx, const lv_area_t * coords, const char * msg);
|
||||
static void draw_cleanup(_lv_img_cache_entry_t * cache);
|
||||
@ -236,7 +237,8 @@ void lv_draw_img_decoded(lv_draw_ctx_t * draw_ctx, const lv_draw_img_dsc_t * dsc
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM static lv_res_t decode_and_draw(lv_draw_ctx_t * draw_ctx, const lv_draw_img_dsc_t * draw_dsc,
|
||||
static lv_res_t LV_ATTRIBUTE_FAST_MEM decode_and_draw(lv_draw_ctx_t * draw_ctx,
|
||||
const lv_draw_img_dsc_t * draw_dsc,
|
||||
const lv_area_t * coords, const void * src)
|
||||
{
|
||||
if(draw_dsc->opa <= LV_OPA_MIN) return LV_RES_OK;
|
||||
|
@ -52,7 +52,7 @@ static uint8_t hex_char_to_num(char hex);
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
void lv_draw_label_dsc_init(lv_draw_label_dsc_t * dsc)
|
||||
void LV_ATTRIBUTE_FAST_MEM lv_draw_label_dsc_init(lv_draw_label_dsc_t * dsc)
|
||||
{
|
||||
lv_memset_00(dsc, sizeof(lv_draw_label_dsc_t));
|
||||
dsc->opa = LV_OPA_COVER;
|
||||
@ -74,7 +74,7 @@ void lv_draw_label_dsc_init(lv_draw_label_dsc_t * dsc)
|
||||
* @param hint pointer to a `lv_draw_label_hint_t` variable.
|
||||
* It is managed by the draw to speed up the drawing of very long texts (thousands of lines).
|
||||
*/
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_draw_label(lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc,
|
||||
void LV_ATTRIBUTE_FAST_MEM lv_draw_label(lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc,
|
||||
const lv_area_t * coords, const char * txt, lv_draw_label_hint_t * hint)
|
||||
{
|
||||
if(dsc->opa <= LV_OPA_MIN) return;
|
||||
|
@ -68,7 +68,7 @@ struct _lv_draw_ctx_t;
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_draw_label_dsc_init(lv_draw_label_dsc_t * dsc);
|
||||
void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_label_dsc_init(lv_draw_label_dsc_t * dsc);
|
||||
|
||||
/**
|
||||
* Write a text
|
||||
@ -79,8 +79,8 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label_dsc_init(lv_draw_label_dsc_t * dsc);
|
||||
* @param hint pointer to a `lv_draw_label_hint_t` variable.
|
||||
* It is managed by the draw to speed up the drawing of very long texts (thousands of lines).
|
||||
*/
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_draw_label(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc,
|
||||
const lv_area_t * coords, const char * txt, lv_draw_label_hint_t * hint);
|
||||
void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_label(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc,
|
||||
const lv_area_t * coords, const char * txt, lv_draw_label_hint_t * hint);
|
||||
|
||||
void lv_draw_letter(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc, const lv_point_t * pos_p,
|
||||
uint32_t letter);
|
||||
|
@ -34,7 +34,7 @@
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_draw_line_dsc_init(lv_draw_line_dsc_t * dsc)
|
||||
void LV_ATTRIBUTE_FAST_MEM lv_draw_line_dsc_init(lv_draw_line_dsc_t * dsc)
|
||||
{
|
||||
lv_memset_00(dsc, sizeof(lv_draw_line_dsc_t));
|
||||
dsc->width = 1;
|
||||
@ -42,7 +42,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_line_dsc_init(lv_draw_line_dsc_t * dsc)
|
||||
dsc->color = lv_color_black();
|
||||
}
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_draw_line(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc,
|
||||
void LV_ATTRIBUTE_FAST_MEM lv_draw_line(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc,
|
||||
const lv_point_t * point1, const lv_point_t * point2)
|
||||
{
|
||||
if(dsc->width == 0) return;
|
||||
|
@ -43,7 +43,7 @@ struct _lv_draw_ctx_t;
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_draw_line_dsc_init(lv_draw_line_dsc_t * dsc);
|
||||
void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_line_dsc_init(lv_draw_line_dsc_t * dsc);
|
||||
|
||||
/**
|
||||
* Draw a line
|
||||
@ -52,8 +52,8 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_line_dsc_init(lv_draw_line_dsc_t * dsc);
|
||||
* @param clip the line will be drawn only in this area
|
||||
* @param dsc pointer to an initialized `lv_draw_line_dsc_t` variable
|
||||
*/
|
||||
void lv_draw_line(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc, const lv_point_t * point1,
|
||||
const lv_point_t * point2);
|
||||
void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_line(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc,
|
||||
const lv_point_t * point1, const lv_point_t * point2);
|
||||
|
||||
|
||||
/**********************
|
||||
|
@ -26,31 +26,31 @@
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_line(lv_opa_t * mask_buf, lv_coord_t abs_x,
|
||||
lv_coord_t abs_y, lv_coord_t len,
|
||||
lv_draw_mask_line_param_t * param);
|
||||
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * mask_buf, lv_coord_t abs_x,
|
||||
lv_coord_t abs_y, lv_coord_t len,
|
||||
lv_draw_mask_radius_param_t * param);
|
||||
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_angle(lv_opa_t * mask_buf, lv_coord_t abs_x,
|
||||
lv_coord_t abs_y, lv_coord_t len,
|
||||
lv_draw_mask_angle_param_t * param);
|
||||
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_fade(lv_opa_t * mask_buf, lv_coord_t abs_x,
|
||||
lv_coord_t abs_y, lv_coord_t len,
|
||||
lv_draw_mask_fade_param_t * param);
|
||||
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_map(lv_opa_t * mask_buf, lv_coord_t abs_x,
|
||||
lv_coord_t abs_y, lv_coord_t len,
|
||||
lv_draw_mask_map_param_t * param);
|
||||
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_polygon(lv_opa_t * mask_buf, lv_coord_t abs_x,
|
||||
lv_coord_t abs_y, lv_coord_t len,
|
||||
lv_draw_mask_polygon_param_t * param);
|
||||
static lv_draw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_mask_line(lv_opa_t * mask_buf, lv_coord_t abs_x,
|
||||
lv_coord_t abs_y, lv_coord_t len,
|
||||
lv_draw_mask_line_param_t * param);
|
||||
static lv_draw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_mask_radius(lv_opa_t * mask_buf, lv_coord_t abs_x,
|
||||
lv_coord_t abs_y, lv_coord_t len,
|
||||
lv_draw_mask_radius_param_t * param);
|
||||
static lv_draw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_mask_angle(lv_opa_t * mask_buf, lv_coord_t abs_x,
|
||||
lv_coord_t abs_y, lv_coord_t len,
|
||||
lv_draw_mask_angle_param_t * param);
|
||||
static lv_draw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_mask_fade(lv_opa_t * mask_buf, lv_coord_t abs_x,
|
||||
lv_coord_t abs_y, lv_coord_t len,
|
||||
lv_draw_mask_fade_param_t * param);
|
||||
static lv_draw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_mask_map(lv_opa_t * mask_buf, lv_coord_t abs_x,
|
||||
lv_coord_t abs_y, lv_coord_t len,
|
||||
lv_draw_mask_map_param_t * param);
|
||||
static lv_draw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_mask_polygon(lv_opa_t * mask_buf, lv_coord_t abs_x,
|
||||
lv_coord_t abs_y, lv_coord_t len,
|
||||
lv_draw_mask_polygon_param_t * param);
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t line_mask_flat(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y,
|
||||
lv_coord_t len,
|
||||
lv_draw_mask_line_param_t * p);
|
||||
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t line_mask_steep(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y,
|
||||
lv_coord_t len,
|
||||
lv_draw_mask_line_param_t * p);
|
||||
static lv_draw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ line_mask_flat(lv_opa_t * mask_buf, lv_coord_t abs_x,
|
||||
lv_coord_t abs_y, lv_coord_t len,
|
||||
lv_draw_mask_line_param_t * p);
|
||||
static lv_draw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ line_mask_steep(lv_opa_t * mask_buf, lv_coord_t abs_x,
|
||||
lv_coord_t abs_y, lv_coord_t len,
|
||||
lv_draw_mask_line_param_t * p);
|
||||
|
||||
static void circ_init(lv_point_t * c, lv_coord_t * tmp, lv_coord_t radius);
|
||||
static bool circ_cont(lv_point_t * c);
|
||||
@ -58,7 +58,7 @@ static void circ_next(lv_point_t * c, lv_coord_t * tmp);
|
||||
static void circ_calc_aa4(_lv_draw_mask_radius_circle_dsc_t * c, lv_coord_t radius);
|
||||
static lv_opa_t * get_next_line(_lv_draw_mask_radius_circle_dsc_t * c, lv_coord_t y, lv_coord_t * len,
|
||||
lv_coord_t * x_start);
|
||||
LV_ATTRIBUTE_FAST_MEM static inline lv_opa_t mask_mix(lv_opa_t mask_act, lv_opa_t mask_new);
|
||||
static inline lv_opa_t /* LV_ATTRIBUTE_FAST_MEM */ mask_mix(lv_opa_t mask_act, lv_opa_t mask_new);
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
@ -108,8 +108,8 @@ int16_t lv_draw_mask_add(void * param, void * custom_id)
|
||||
* - `LV_DRAW_MASK_RES_FULL_COVER`: the whole line is fully visible. `mask_buf` is unchanged
|
||||
* - `LV_DRAW_MASK_RES_CHANGED`: `mask_buf` has changed, it shows the desired opacity of each pixel in the given line
|
||||
*/
|
||||
LV_ATTRIBUTE_FAST_MEM lv_draw_mask_res_t lv_draw_mask_apply(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y,
|
||||
lv_coord_t len)
|
||||
lv_draw_mask_res_t LV_ATTRIBUTE_FAST_MEM lv_draw_mask_apply(lv_opa_t * mask_buf, lv_coord_t abs_x,
|
||||
lv_coord_t abs_y, lv_coord_t len)
|
||||
{
|
||||
bool changed = false;
|
||||
_lv_draw_mask_common_dsc_t * dsc;
|
||||
@ -142,8 +142,9 @@ LV_ATTRIBUTE_FAST_MEM lv_draw_mask_res_t lv_draw_mask_apply(lv_opa_t * mask_buf,
|
||||
* - `LV_DRAW_MASK_RES_FULL_COVER`: the whole line is fully visible. `mask_buf` is unchanged
|
||||
* - `LV_DRAW_MASK_RES_CHANGED`: `mask_buf` has changed, it shows the desired opacity of each pixel in the given line
|
||||
*/
|
||||
LV_ATTRIBUTE_FAST_MEM lv_draw_mask_res_t lv_draw_mask_apply_ids(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y,
|
||||
lv_coord_t len, const int16_t * ids, int16_t ids_count)
|
||||
lv_draw_mask_res_t LV_ATTRIBUTE_FAST_MEM lv_draw_mask_apply_ids(lv_opa_t * mask_buf, lv_coord_t abs_x,
|
||||
lv_coord_t abs_y, lv_coord_t len,
|
||||
const int16_t * ids, int16_t ids_count)
|
||||
{
|
||||
bool changed = false;
|
||||
_lv_draw_mask_common_dsc_t * dsc;
|
||||
@ -243,7 +244,7 @@ void _lv_draw_mask_cleanup(void)
|
||||
* Count the currently added masks
|
||||
* @return number of active masks
|
||||
*/
|
||||
LV_ATTRIBUTE_FAST_MEM uint8_t lv_draw_mask_get_cnt(void)
|
||||
uint8_t LV_ATTRIBUTE_FAST_MEM lv_draw_mask_get_cnt(void)
|
||||
{
|
||||
uint8_t cnt = 0;
|
||||
uint8_t i;
|
||||
@ -593,7 +594,7 @@ void lv_draw_mask_polygon_init(lv_draw_mask_polygon_param_t * param, const lv_po
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_line(lv_opa_t * mask_buf, lv_coord_t abs_x,
|
||||
static lv_draw_mask_res_t LV_ATTRIBUTE_FAST_MEM lv_draw_mask_line(lv_opa_t * mask_buf, lv_coord_t abs_x,
|
||||
lv_coord_t abs_y, lv_coord_t len,
|
||||
lv_draw_mask_line_param_t * p)
|
||||
{
|
||||
@ -653,7 +654,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_line(lv_opa_t * mas
|
||||
return res;
|
||||
}
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t line_mask_flat(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y,
|
||||
static lv_draw_mask_res_t LV_ATTRIBUTE_FAST_MEM line_mask_flat(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y,
|
||||
lv_coord_t len,
|
||||
lv_draw_mask_line_param_t * p)
|
||||
{
|
||||
@ -769,7 +770,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t line_mask_flat(lv_opa_t * mask_b
|
||||
return LV_DRAW_MASK_RES_CHANGED;
|
||||
}
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t line_mask_steep(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y,
|
||||
static lv_draw_mask_res_t LV_ATTRIBUTE_FAST_MEM line_mask_steep(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y,
|
||||
lv_coord_t len,
|
||||
lv_draw_mask_line_param_t * p)
|
||||
{
|
||||
@ -911,7 +912,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t line_mask_steep(lv_opa_t * mask_
|
||||
return LV_DRAW_MASK_RES_CHANGED;
|
||||
}
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_angle(lv_opa_t * mask_buf, lv_coord_t abs_x,
|
||||
static lv_draw_mask_res_t LV_ATTRIBUTE_FAST_MEM lv_draw_mask_angle(lv_opa_t * mask_buf, lv_coord_t abs_x,
|
||||
lv_coord_t abs_y, lv_coord_t len,
|
||||
lv_draw_mask_angle_param_t * p)
|
||||
{
|
||||
@ -1050,7 +1051,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_angle(lv_opa_t * ma
|
||||
|
||||
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * mask_buf, lv_coord_t abs_x,
|
||||
static lv_draw_mask_res_t LV_ATTRIBUTE_FAST_MEM lv_draw_mask_radius(lv_opa_t * mask_buf, lv_coord_t abs_x,
|
||||
lv_coord_t abs_y, lv_coord_t len,
|
||||
lv_draw_mask_radius_param_t * p)
|
||||
{
|
||||
@ -1167,7 +1168,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * m
|
||||
return LV_DRAW_MASK_RES_CHANGED;
|
||||
}
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_fade(lv_opa_t * mask_buf, lv_coord_t abs_x,
|
||||
static lv_draw_mask_res_t LV_ATTRIBUTE_FAST_MEM lv_draw_mask_fade(lv_opa_t * mask_buf, lv_coord_t abs_x,
|
||||
lv_coord_t abs_y, lv_coord_t len,
|
||||
lv_draw_mask_fade_param_t * p)
|
||||
{
|
||||
@ -1213,7 +1214,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_fade(lv_opa_t * mas
|
||||
}
|
||||
}
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_map(lv_opa_t * mask_buf, lv_coord_t abs_x,
|
||||
static lv_draw_mask_res_t LV_ATTRIBUTE_FAST_MEM lv_draw_mask_map(lv_opa_t * mask_buf, lv_coord_t abs_x,
|
||||
lv_coord_t abs_y, lv_coord_t len,
|
||||
lv_draw_mask_map_param_t * p)
|
||||
{
|
||||
@ -1247,7 +1248,7 @@ LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_map(lv_opa_t * mask
|
||||
return LV_DRAW_MASK_RES_CHANGED;
|
||||
}
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM static lv_draw_mask_res_t lv_draw_mask_polygon(lv_opa_t * mask_buf, lv_coord_t abs_x,
|
||||
static lv_draw_mask_res_t LV_ATTRIBUTE_FAST_MEM lv_draw_mask_polygon(lv_opa_t * mask_buf, lv_coord_t abs_x,
|
||||
lv_coord_t abs_y, lv_coord_t len,
|
||||
lv_draw_mask_polygon_param_t * param)
|
||||
{
|
||||
@ -1518,7 +1519,7 @@ static lv_opa_t * get_next_line(_lv_draw_mask_radius_circle_dsc_t * c, lv_coord_
|
||||
}
|
||||
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM static inline lv_opa_t mask_mix(lv_opa_t mask_act, lv_opa_t mask_new)
|
||||
static inline lv_opa_t LV_ATTRIBUTE_FAST_MEM mask_mix(lv_opa_t mask_act, lv_opa_t mask_new)
|
||||
{
|
||||
if(mask_new >= LV_OPA_MAX) return mask_act;
|
||||
if(mask_new <= LV_OPA_MIN) return 0;
|
||||
|
@ -241,8 +241,8 @@ int16_t lv_draw_mask_add(void * param, void * custom_id);
|
||||
* - `LV_DRAW_MASK_RES_FULL_COVER`: the whole line is fully visible. `mask_buf` is unchanged
|
||||
* - `LV_DRAW_MASK_RES_CHANGED`: `mask_buf` has changed, it shows the desired opacity of each pixel in the given line
|
||||
*/
|
||||
LV_ATTRIBUTE_FAST_MEM lv_draw_mask_res_t lv_draw_mask_apply(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y,
|
||||
lv_coord_t len);
|
||||
lv_draw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_mask_apply(lv_opa_t * mask_buf, lv_coord_t abs_x,
|
||||
lv_coord_t abs_y, lv_coord_t len);
|
||||
|
||||
/**
|
||||
* Apply the specified buffers on a line. Used internally by the library's drawing routines.
|
||||
@ -257,8 +257,9 @@ LV_ATTRIBUTE_FAST_MEM lv_draw_mask_res_t lv_draw_mask_apply(lv_opa_t * mask_buf,
|
||||
* - `LV_DRAW_MASK_RES_FULL_COVER`: the whole line is fully visible. `mask_buf` is unchanged
|
||||
* - `LV_DRAW_MASK_RES_CHANGED`: `mask_buf` has changed, it shows the desired opacity of each pixel in the given line
|
||||
*/
|
||||
LV_ATTRIBUTE_FAST_MEM lv_draw_mask_res_t lv_draw_mask_apply_ids(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y,
|
||||
lv_coord_t len, const int16_t * ids, int16_t ids_count);
|
||||
lv_draw_mask_res_t /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_mask_apply_ids(lv_opa_t * mask_buf, lv_coord_t abs_x,
|
||||
lv_coord_t abs_y, lv_coord_t len,
|
||||
const int16_t * ids, int16_t ids_count);
|
||||
|
||||
//! @endcond
|
||||
|
||||
@ -299,7 +300,7 @@ void _lv_draw_mask_cleanup(void);
|
||||
* Count the currently added masks
|
||||
* @return number of active masks
|
||||
*/
|
||||
LV_ATTRIBUTE_FAST_MEM uint8_t lv_draw_mask_get_cnt(void);
|
||||
uint8_t /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_mask_get_cnt(void);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -34,7 +34,7 @@
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_draw_rect_dsc_init(lv_draw_rect_dsc_t * dsc)
|
||||
void LV_ATTRIBUTE_FAST_MEM lv_draw_rect_dsc_init(lv_draw_rect_dsc_t * dsc)
|
||||
{
|
||||
lv_memset_00(dsc, sizeof(lv_draw_rect_dsc_t));
|
||||
dsc->bg_color = lv_color_white();
|
||||
|
@ -74,7 +74,7 @@ struct _lv_draw_ctx_t;
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_draw_rect_dsc_init(lv_draw_rect_dsc_t * dsc);
|
||||
void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_rect_dsc_init(lv_draw_rect_dsc_t * dsc);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -38,17 +38,7 @@
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Get the color of an image's pixel
|
||||
* @param dsc an image descriptor
|
||||
* @param x x coordinate of the point to get
|
||||
* @param y x coordinate of the point to get
|
||||
* @param 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.
|
||||
* @param safe true: check out of bounds
|
||||
* @return color of the point
|
||||
*/
|
||||
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)
|
||||
lv_color_t lv_img_buf_get_px_color(const lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_color_t color)
|
||||
{
|
||||
lv_color_t p_color = lv_color_black();
|
||||
uint8_t * buf_u8 = (uint8_t *)dsc->data;
|
||||
@ -107,15 +97,7 @@ lv_color_t lv_img_buf_get_px_color(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t
|
||||
return p_color;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the alpha value of an image's pixel
|
||||
* @param dsc pointer to an image descriptor
|
||||
* @param x x coordinate of the point to set
|
||||
* @param y x coordinate of the point to set
|
||||
* @param safe true: check out of bounds
|
||||
* @return alpha value 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)
|
||||
lv_opa_t lv_img_buf_get_px_alpha(const lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y)
|
||||
{
|
||||
uint8_t * buf_u8 = (uint8_t *)dsc->data;
|
||||
|
||||
@ -170,15 +152,7 @@ lv_opa_t lv_img_buf_get_px_alpha(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y)
|
||||
return LV_OPA_COVER;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the alpha value of a pixel of an image. The color won't be affected
|
||||
* @param dsc pointer to an image descriptor
|
||||
* @param x x coordinate of the point to set
|
||||
* @param y x coordinate of the point to set
|
||||
* @param opa the desired opacity
|
||||
* @param 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)
|
||||
void lv_img_buf_set_px_alpha(const lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_opa_t opa)
|
||||
{
|
||||
uint8_t * buf_u8 = (uint8_t *)dsc->data;
|
||||
|
||||
@ -229,15 +203,7 @@ void lv_img_buf_set_px_alpha(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the color of a pixel of an image. The alpha channel won't be affected.
|
||||
* @param dsc pointer to an image descriptor
|
||||
* @param x x coordinate of the point to set
|
||||
* @param y x coordinate of the point to set
|
||||
* @param c color of the point
|
||||
* @param safe true: check out of bounds
|
||||
*/
|
||||
void lv_img_buf_set_px_color(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_color_t c)
|
||||
void lv_img_buf_set_px_color(const lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_color_t c)
|
||||
{
|
||||
uint8_t * buf_u8 = (uint8_t *)dsc->data;
|
||||
|
||||
@ -296,17 +262,7 @@ void lv_img_buf_set_px_color(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the palette color of an indexed image. Valid only for `LV_IMG_CF_INDEXED1/2/4/8`
|
||||
* @param dsc pointer to an image descriptor
|
||||
* @param 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
|
||||
* @param c the color to set
|
||||
*/
|
||||
void lv_img_buf_set_palette(lv_img_dsc_t * dsc, uint8_t id, lv_color_t c)
|
||||
void lv_img_buf_set_palette(const lv_img_dsc_t * dsc, uint8_t id, lv_color_t c)
|
||||
{
|
||||
if((dsc->header.cf == LV_IMG_CF_ALPHA_1BIT && id > 1) || (dsc->header.cf == LV_IMG_CF_ALPHA_2BIT && id > 3) ||
|
||||
(dsc->header.cf == LV_IMG_CF_ALPHA_4BIT && id > 15) || (dsc->header.cf == LV_IMG_CF_ALPHA_8BIT)) {
|
||||
@ -320,13 +276,6 @@ void lv_img_buf_set_palette(lv_img_dsc_t * dsc, uint8_t id, lv_color_t c)
|
||||
lv_memcpy_small(&buf[id * sizeof(c32)], &c32, sizeof(c32));
|
||||
}
|
||||
|
||||
/**
|
||||
* Allocate an image buffer in RAM
|
||||
* @param w width of image
|
||||
* @param h height of image
|
||||
* @param cf a color format (`LV_IMG_CF_...`)
|
||||
* @return an allocated image, or NULL on failure
|
||||
*/
|
||||
lv_img_dsc_t * lv_img_buf_alloc(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf)
|
||||
{
|
||||
/*Allocate image descriptor*/
|
||||
@ -359,10 +308,6 @@ lv_img_dsc_t * lv_img_buf_alloc(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf)
|
||||
return dsc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Free an allocated image buffer
|
||||
* @param dsc image buffer to free
|
||||
*/
|
||||
void lv_img_buf_free(lv_img_dsc_t * dsc)
|
||||
{
|
||||
if(dsc != NULL) {
|
||||
@ -373,13 +318,6 @@ void lv_img_buf_free(lv_img_dsc_t * dsc)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the memory consumption of a raw bitmap, given color format and dimensions.
|
||||
* @param w width
|
||||
* @param h height
|
||||
* @param cf color format
|
||||
* @return size in bytes
|
||||
*/
|
||||
uint32_t lv_img_buf_get_img_size(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf)
|
||||
{
|
||||
switch(cf) {
|
||||
@ -411,15 +349,6 @@ uint32_t lv_img_buf_get_img_size(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the area of a rectangle if its rotated and scaled
|
||||
* @param res store the coordinates here
|
||||
* @param w width of the rectangle to transform
|
||||
* @param h height of the rectangle to transform
|
||||
* @param angle angle of rotation
|
||||
* @param zoom zoom, (256 no zoom)
|
||||
* @param pivot x,y pivot coordinates of rotation
|
||||
*/
|
||||
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)
|
||||
{
|
||||
|
@ -167,7 +167,7 @@ lv_img_dsc_t * lv_img_buf_alloc(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf);
|
||||
* @param safe true: check out of bounds
|
||||
* @return color of the point
|
||||
*/
|
||||
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);
|
||||
lv_color_t lv_img_buf_get_px_color(const lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_color_t color);
|
||||
|
||||
/**
|
||||
* Get the alpha value of an image's pixel
|
||||
@ -177,7 +177,7 @@ lv_color_t lv_img_buf_get_px_color(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t
|
||||
* @param safe true: check out of bounds
|
||||
* @return alpha value 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);
|
||||
lv_opa_t lv_img_buf_get_px_alpha(const lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y);
|
||||
|
||||
/**
|
||||
* Set the color of a pixel of an image. The alpha channel won't be affected.
|
||||
@ -187,7 +187,7 @@ lv_opa_t lv_img_buf_get_px_alpha(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y)
|
||||
* @param c color of the point
|
||||
* @param safe true: check out of bounds
|
||||
*/
|
||||
void lv_img_buf_set_px_color(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_color_t c);
|
||||
void lv_img_buf_set_px_color(const lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_color_t c);
|
||||
|
||||
/**
|
||||
* Set the alpha value of a pixel of an image. The color won't be affected
|
||||
@ -197,7 +197,7 @@ void lv_img_buf_set_px_color(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_
|
||||
* @param opa the desired opacity
|
||||
* @param 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);
|
||||
void lv_img_buf_set_px_alpha(const lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_opa_t opa);
|
||||
|
||||
/**
|
||||
* Set the palette color of an indexed image. Valid only for `LV_IMG_CF_INDEXED1/2/4/8`
|
||||
@ -209,7 +209,7 @@ void lv_img_buf_set_px_alpha(lv_img_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_
|
||||
* - for `LV_IMG_CF_INDEXED8`: 0..255
|
||||
* @param c the color to set
|
||||
*/
|
||||
void lv_img_buf_set_palette(lv_img_dsc_t * dsc, uint8_t id, lv_color_t c);
|
||||
void lv_img_buf_set_palette(const lv_img_dsc_t * dsc, uint8_t id, lv_color_t c);
|
||||
|
||||
/**
|
||||
* Free an allocated image buffer
|
||||
|
@ -360,10 +360,35 @@ lv_res_t lv_img_decoder_built_in_open(lv_img_decoder_t * decoder, lv_img_decoder
|
||||
}
|
||||
|
||||
lv_img_cf_t cf = dsc->header.cf;
|
||||
/*Process A8, RGB565A8, need load file to ram after https://github.com/lvgl/lvgl/pull/3337*/
|
||||
if(cf == LV_IMG_CF_ALPHA_8BIT || cf == LV_IMG_CF_RGB565A8) {
|
||||
if(dsc->src_type == LV_IMG_SRC_VARIABLE) {
|
||||
/*In case of uncompressed formats the image stored in the ROM/RAM.
|
||||
*So simply give its pointer*/
|
||||
dsc->img_data = ((lv_img_dsc_t *)dsc->src)->data;
|
||||
return LV_RES_OK;
|
||||
}
|
||||
else {
|
||||
/*If it's a file, read all to memory*/
|
||||
uint32_t len = dsc->header.w * dsc->header.h;
|
||||
len *= cf == LV_IMG_CF_RGB565A8 ? 3 : 1;
|
||||
uint8_t * fs_buf = lv_mem_alloc(len);
|
||||
if(fs_buf == NULL) return LV_RES_INV;
|
||||
|
||||
lv_img_decoder_built_in_data_t * user_data = dsc->user_data;
|
||||
lv_fs_seek(&user_data->f, 4, LV_FS_SEEK_SET); /*+4 to skip the header*/
|
||||
lv_fs_res_t res = lv_fs_read(&user_data->f, fs_buf, len, NULL);
|
||||
if(res != LV_FS_RES_OK) {
|
||||
lv_mem_free(fs_buf);
|
||||
return LV_RES_INV;
|
||||
}
|
||||
dsc->img_data = fs_buf;
|
||||
return LV_RES_OK;
|
||||
}
|
||||
}
|
||||
/*Process true color formats*/
|
||||
if(cf == LV_IMG_CF_TRUE_COLOR || cf == LV_IMG_CF_TRUE_COLOR_ALPHA ||
|
||||
cf == LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED || cf == LV_IMG_CF_RGB565A8 ||
|
||||
cf == LV_IMG_CF_ALPHA_8BIT) {
|
||||
else if(cf == LV_IMG_CF_TRUE_COLOR || cf == LV_IMG_CF_TRUE_COLOR_ALPHA ||
|
||||
cf == LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED) {
|
||||
if(dsc->src_type == LV_IMG_SRC_VARIABLE) {
|
||||
/*In case of uncompressed formats the image stored in the ROM/RAM.
|
||||
*So simply give its pointer*/
|
||||
|
@ -0,0 +1,7 @@
|
||||
CSRCS += lv_gpu_d2_ra6m3.c
|
||||
CSRCS += lv_gpu_d2_draw_label.c
|
||||
|
||||
DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/renesas
|
||||
VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/renesas
|
||||
|
||||
CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/draw/renesas"
|
@ -40,7 +40,7 @@ extern const uint8_t _lv_bpp8_opa_table[256];
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM static void draw_letter_normal(lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc,
|
||||
static void LV_ATTRIBUTE_FAST_MEM draw_letter_normal(lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc,
|
||||
const lv_point_t * pos, lv_font_glyph_dsc_t * g, const uint8_t * map_p)
|
||||
{
|
||||
|
||||
|
@ -61,11 +61,13 @@ void lv_draw_sw_bg(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, con
|
||||
void lv_draw_sw_letter(lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc, const lv_point_t * pos_p,
|
||||
uint32_t letter);
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_draw_sw_img_decoded(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_img_dsc_t * draw_dsc,
|
||||
const lv_area_t * coords, const uint8_t * src_buf, lv_img_cf_t cf);
|
||||
void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_sw_img_decoded(struct _lv_draw_ctx_t * draw_ctx,
|
||||
const lv_draw_img_dsc_t * draw_dsc,
|
||||
const lv_area_t * coords, const uint8_t * src_buf,
|
||||
lv_img_cf_t cf);
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_draw_sw_line(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc,
|
||||
const lv_point_t * point1, const lv_point_t * point2);
|
||||
void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_sw_line(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc,
|
||||
const lv_point_t * point1, const lv_point_t * point2);
|
||||
|
||||
void lv_draw_sw_polygon(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * draw_dsc,
|
||||
const lv_point_t * points, uint16_t point_cnt);
|
||||
|
@ -26,13 +26,15 @@
|
||||
static void fill_set_px(lv_color_t * dest_buf, const lv_area_t * blend_area, lv_coord_t dest_stride,
|
||||
lv_color_t color, lv_opa_t opa, const lv_opa_t * mask, lv_coord_t mask_stide);
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM static void fill_normal(lv_color_t * dest_buf, const lv_area_t * dest_area,
|
||||
lv_coord_t dest_stride, lv_color_t color, lv_opa_t opa, const lv_opa_t * mask, lv_coord_t mask_stride);
|
||||
static void /* LV_ATTRIBUTE_FAST_MEM */ fill_normal(lv_color_t * dest_buf, const lv_area_t * dest_area,
|
||||
lv_coord_t dest_stride, lv_color_t color, lv_opa_t opa,
|
||||
const lv_opa_t * mask, lv_coord_t mask_stride);
|
||||
|
||||
|
||||
#if LV_COLOR_SCREEN_TRANSP
|
||||
LV_ATTRIBUTE_FAST_MEM static void fill_argb(lv_color_t * dest_buf, const lv_area_t * dest_area,
|
||||
lv_coord_t dest_stride, lv_color_t color, lv_opa_t opa, const lv_opa_t * mask, lv_coord_t mask_stride);
|
||||
static void /* LV_ATTRIBUTE_FAST_MEM */ fill_argb(lv_color_t * dest_buf, const lv_area_t * dest_area,
|
||||
lv_coord_t dest_stride, lv_color_t color, lv_opa_t opa,
|
||||
const lv_opa_t * mask, lv_coord_t mask_stride);
|
||||
#endif /*LV_COLOR_SCREEN_TRANSP*/
|
||||
|
||||
#if LV_DRAW_COMPLEX
|
||||
@ -41,15 +43,19 @@ static void fill_blended(lv_color_t * dest_buf, const lv_area_t * dest_area, lv_
|
||||
#endif /*LV_DRAW_COMPLEX*/
|
||||
|
||||
static void map_set_px(lv_color_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride,
|
||||
const lv_color_t * src_buf, lv_coord_t src_stride, lv_opa_t opa, const lv_opa_t * mask, lv_coord_t mask_stride);
|
||||
const lv_color_t * src_buf, lv_coord_t src_stride, lv_opa_t opa,
|
||||
const lv_opa_t * mask, lv_coord_t mask_stride);
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM static void map_normal(lv_color_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride,
|
||||
const lv_color_t * src_buf, lv_coord_t src_stride, lv_opa_t opa, const lv_opa_t * mask, lv_coord_t mask_stride);
|
||||
static void /* LV_ATTRIBUTE_FAST_MEM */ map_normal(lv_color_t * dest_buf, const lv_area_t * dest_area,
|
||||
lv_coord_t dest_stride, const lv_color_t * src_buf,
|
||||
lv_coord_t src_stride, lv_opa_t opa, const lv_opa_t * mask,
|
||||
lv_coord_t mask_stride);
|
||||
|
||||
#if LV_COLOR_SCREEN_TRANSP
|
||||
LV_ATTRIBUTE_FAST_MEM static void map_argb(lv_color_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride,
|
||||
const lv_color_t * src_buf, lv_coord_t src_stride, lv_opa_t opa,
|
||||
const lv_opa_t * mask, lv_coord_t mask_stride, lv_blend_mode_t blend_mode);
|
||||
static void /* LV_ATTRIBUTE_FAST_MEM */ map_argb(lv_color_t * dest_buf, const lv_area_t * dest_area,
|
||||
lv_coord_t dest_stride, const lv_color_t * src_buf,
|
||||
lv_coord_t src_stride, lv_opa_t opa, const lv_opa_t * mask,
|
||||
lv_coord_t mask_stride, lv_blend_mode_t blend_mode);
|
||||
|
||||
#endif /*LV_COLOR_SCREEN_TRANSP*/
|
||||
|
||||
@ -101,7 +107,8 @@ void lv_draw_sw_blend(lv_draw_ctx_t * draw_ctx, const lv_draw_sw_blend_dsc_t * d
|
||||
((lv_draw_sw_ctx_t *)draw_ctx)->blend(draw_ctx, dsc);
|
||||
}
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_draw_sw_blend_basic(lv_draw_ctx_t * draw_ctx, const lv_draw_sw_blend_dsc_t * dsc)
|
||||
void LV_ATTRIBUTE_FAST_MEM lv_draw_sw_blend_basic(lv_draw_ctx_t * draw_ctx,
|
||||
const lv_draw_sw_blend_dsc_t * dsc)
|
||||
{
|
||||
lv_opa_t * mask;
|
||||
if(dsc->mask_buf == NULL) mask = NULL;
|
||||
@ -237,8 +244,9 @@ static void fill_set_px(lv_color_t * dest_buf, const lv_area_t * blend_area, lv_
|
||||
}
|
||||
}
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM static void fill_normal(lv_color_t * dest_buf, const lv_area_t * dest_area,
|
||||
lv_coord_t dest_stride, lv_color_t color, lv_opa_t opa, const lv_opa_t * mask, lv_coord_t mask_stride)
|
||||
static LV_ATTRIBUTE_FAST_MEM void fill_normal(lv_color_t * dest_buf, const lv_area_t * dest_area,
|
||||
lv_coord_t dest_stride, lv_color_t color, lv_opa_t opa,
|
||||
const lv_opa_t * mask, lv_coord_t mask_stride)
|
||||
{
|
||||
int32_t w = lv_area_get_width(dest_area);
|
||||
int32_t h = lv_area_get_height(dest_area);
|
||||
@ -442,8 +450,9 @@ static inline void set_px_argb_blend(uint8_t * buf, lv_color_t color, lv_opa_t o
|
||||
|
||||
}
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM static void fill_argb(lv_color_t * dest_buf, const lv_area_t * dest_area,
|
||||
lv_coord_t dest_stride, lv_color_t color, lv_opa_t opa, const lv_opa_t * mask, lv_coord_t mask_stride)
|
||||
static void LV_ATTRIBUTE_FAST_MEM fill_argb(lv_color_t * dest_buf, const lv_area_t * dest_area,
|
||||
lv_coord_t dest_stride, lv_color_t color, lv_opa_t opa,
|
||||
const lv_opa_t * mask, lv_coord_t mask_stride)
|
||||
{
|
||||
uint8_t * dest_buf8 = (uint8_t *) dest_buf;
|
||||
int32_t w = lv_area_get_width(dest_area);
|
||||
@ -599,7 +608,8 @@ static void fill_blended(lv_color_t * dest_buf, const lv_area_t * dest_area,
|
||||
#endif
|
||||
|
||||
static void map_set_px(lv_color_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride,
|
||||
const lv_color_t * src_buf, lv_coord_t src_stride, lv_opa_t opa, const lv_opa_t * mask, lv_coord_t mask_stride)
|
||||
const lv_color_t * src_buf, lv_coord_t src_stride, lv_opa_t opa,
|
||||
const lv_opa_t * mask, lv_coord_t mask_stride)
|
||||
|
||||
{
|
||||
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
|
||||
@ -633,8 +643,10 @@ static void map_set_px(lv_color_t * dest_buf, const lv_area_t * dest_area, lv_co
|
||||
}
|
||||
}
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM static void map_normal(lv_color_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride,
|
||||
const lv_color_t * src_buf, lv_coord_t src_stride, lv_opa_t opa, const lv_opa_t * mask, lv_coord_t mask_stride)
|
||||
static void LV_ATTRIBUTE_FAST_MEM map_normal(lv_color_t * dest_buf, const lv_area_t * dest_area,
|
||||
lv_coord_t dest_stride, const lv_color_t * src_buf,
|
||||
lv_coord_t src_stride, lv_opa_t opa, const lv_opa_t * mask,
|
||||
lv_coord_t mask_stride)
|
||||
|
||||
{
|
||||
int32_t w = lv_area_get_width(dest_area);
|
||||
@ -729,9 +741,10 @@ LV_ATTRIBUTE_FAST_MEM static void map_normal(lv_color_t * dest_buf, const lv_are
|
||||
|
||||
|
||||
#if LV_COLOR_SCREEN_TRANSP
|
||||
LV_ATTRIBUTE_FAST_MEM static void map_argb(lv_color_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride,
|
||||
const lv_color_t * src_buf, lv_coord_t src_stride, lv_opa_t opa,
|
||||
const lv_opa_t * mask, lv_coord_t mask_stride, lv_blend_mode_t blend_mode)
|
||||
static void LV_ATTRIBUTE_FAST_MEM map_argb(lv_color_t * dest_buf, const lv_area_t * dest_area,
|
||||
lv_coord_t dest_stride, const lv_color_t * src_buf,
|
||||
lv_coord_t src_stride, lv_opa_t opa, const lv_opa_t * mask,
|
||||
lv_coord_t mask_stride, lv_blend_mode_t blend_mode)
|
||||
|
||||
{
|
||||
uint8_t * dest_buf8 = (uint8_t *) dest_buf;
|
||||
|
@ -56,7 +56,8 @@ void lv_draw_sw_blend(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_sw_blend_d
|
||||
* @param draw_ctx pointer to a draw context
|
||||
* @param dsc pointer to an initialized blend descriptor
|
||||
*/
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_draw_sw_blend_basic(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_sw_blend_dsc_t * dsc);
|
||||
void /* LV_ATTRIBUTE_FAST_MEM */ lv_draw_sw_blend_basic(struct _lv_draw_ctx_t * draw_ctx,
|
||||
const lv_draw_sw_blend_dsc_t * dsc);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
#if _DITHER_GRADIENT
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_dither_none(lv_grad_t * grad, lv_coord_t x, lv_coord_t y, lv_coord_t w)
|
||||
void LV_ATTRIBUTE_FAST_MEM lv_dither_none(lv_grad_t * grad, lv_coord_t x, lv_coord_t y, lv_coord_t w)
|
||||
{
|
||||
LV_UNUSED(x);
|
||||
LV_UNUSED(y);
|
||||
@ -40,7 +40,7 @@ static const uint8_t dither_ordered_threshold_matrix[8 * 8] = {
|
||||
}; /* Shift by 6 to normalize */
|
||||
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_dither_ordered_hor(lv_grad_t * grad, lv_coord_t x, lv_coord_t y, lv_coord_t w)
|
||||
void LV_ATTRIBUTE_FAST_MEM lv_dither_ordered_hor(lv_grad_t * grad, lv_coord_t x, lv_coord_t y, lv_coord_t w)
|
||||
{
|
||||
LV_UNUSED(x);
|
||||
/* For vertical dithering, the error is spread on the next column (and not next line).
|
||||
@ -63,7 +63,8 @@ LV_ATTRIBUTE_FAST_MEM void lv_dither_ordered_hor(lv_grad_t * grad, lv_coord_t x,
|
||||
grad->map[j] = lv_color_hex(t.full);
|
||||
}
|
||||
}
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_dither_ordered_ver(lv_grad_t * grad, lv_coord_t x, lv_coord_t y, lv_coord_t w)
|
||||
|
||||
void LV_ATTRIBUTE_FAST_MEM lv_dither_ordered_ver(lv_grad_t * grad, lv_coord_t x, lv_coord_t y, lv_coord_t w)
|
||||
{
|
||||
/* For vertical dithering, the error is spread on the next column (and not next line).
|
||||
Since the renderer is scanline based, it's not obvious what could be used to perform the rendering efficiently.
|
||||
@ -97,9 +98,8 @@ LV_ATTRIBUTE_FAST_MEM void lv_dither_ordered_ver(lv_grad_t * grad, lv_coord_t x,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if LV_DITHER_ERROR_DIFFUSION == 1
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_dither_err_diff_hor(lv_grad_t * grad, lv_coord_t xs, lv_coord_t y, lv_coord_t w)
|
||||
void LV_ATTRIBUTE_FAST_MEM lv_dither_err_diff_hor(lv_grad_t * grad, lv_coord_t xs, lv_coord_t y, lv_coord_t w)
|
||||
{
|
||||
LV_UNUSED(xs);
|
||||
LV_UNUSED(y);
|
||||
@ -153,7 +153,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_dither_err_diff_hor(lv_grad_t * grad, lv_coord_t x
|
||||
grad->map[grad->size - 1] = lv_color_hex(grad->hmap[grad->size - 1].full);
|
||||
}
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_dither_err_diff_ver(lv_grad_t * grad, lv_coord_t xs, lv_coord_t y, lv_coord_t w)
|
||||
void LV_ATTRIBUTE_FAST_MEM lv_dither_err_diff_ver(lv_grad_t * grad, lv_coord_t xs, lv_coord_t y, lv_coord_t w)
|
||||
{
|
||||
/* Try to implement error diffusion on a vertical gradient and an horizontal map using those tricks:
|
||||
Since the given hi-resolution gradient (in src) is vertical, the Floyd Steinberg algorithm pass need to be rotated,
|
||||
|
@ -45,18 +45,19 @@ typedef void (*lv_dither_func_t)(struct _lv_gradient_cache_t * grad, lv_coord_t
|
||||
**********************/
|
||||
#if LV_DRAW_COMPLEX
|
||||
#if _DITHER_GRADIENT
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_dither_none(struct _lv_gradient_cache_t * grad, lv_coord_t x, lv_coord_t y, lv_coord_t w);
|
||||
void /* LV_ATTRIBUTE_FAST_MEM */ lv_dither_none(struct _lv_gradient_cache_t * grad, lv_coord_t x, lv_coord_t y,
|
||||
lv_coord_t w);
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_dither_ordered_hor(struct _lv_gradient_cache_t * grad, const lv_coord_t xs,
|
||||
const lv_coord_t y, const lv_coord_t w);
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_dither_ordered_ver(struct _lv_gradient_cache_t * grad, const lv_coord_t xs,
|
||||
const lv_coord_t y, const lv_coord_t w);
|
||||
void /* LV_ATTRIBUTE_FAST_MEM */ lv_dither_ordered_hor(struct _lv_gradient_cache_t * grad, const lv_coord_t xs,
|
||||
const lv_coord_t y, const lv_coord_t w);
|
||||
void /* LV_ATTRIBUTE_FAST_MEM */ lv_dither_ordered_ver(struct _lv_gradient_cache_t * grad, const lv_coord_t xs,
|
||||
const lv_coord_t y, const lv_coord_t w);
|
||||
|
||||
#if LV_DITHER_ERROR_DIFFUSION == 1
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_dither_err_diff_hor(struct _lv_gradient_cache_t * grad, const lv_coord_t xs,
|
||||
const lv_coord_t y, const lv_coord_t w);
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_dither_err_diff_ver(struct _lv_gradient_cache_t * grad, const lv_coord_t xs,
|
||||
const lv_coord_t y, const lv_coord_t w);
|
||||
void /* LV_ATTRIBUTE_FAST_MEM */ lv_dither_err_diff_hor(struct _lv_gradient_cache_t * grad, const lv_coord_t xs,
|
||||
const lv_coord_t y, const lv_coord_t w);
|
||||
void /* LV_ATTRIBUTE_FAST_MEM */ lv_dither_err_diff_ver(struct _lv_gradient_cache_t * grad, const lv_coord_t xs,
|
||||
const lv_coord_t y, const lv_coord_t w);
|
||||
#endif /* LV_DITHER_ERROR_DIFFUSION */
|
||||
|
||||
#endif /* _DITHER_GRADIENT */
|
||||
|
@ -293,7 +293,7 @@ lv_grad_t * lv_gradient_get(const lv_grad_dsc_t * g, lv_coord_t w, lv_coord_t h)
|
||||
return item;
|
||||
}
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM lv_grad_color_t lv_gradient_calculate(const lv_grad_dsc_t * dsc, lv_coord_t range,
|
||||
lv_grad_color_t LV_ATTRIBUTE_FAST_MEM lv_gradient_calculate(const lv_grad_dsc_t * dsc, lv_coord_t range,
|
||||
lv_coord_t frac)
|
||||
{
|
||||
lv_grad_color_t tmp;
|
||||
|
@ -69,8 +69,8 @@ typedef struct _lv_gradient_cache_t {
|
||||
* @param range The range to use in computation.
|
||||
* @param frac The current part used in the range. frac is in [0; range]
|
||||
*/
|
||||
LV_ATTRIBUTE_FAST_MEM lv_grad_color_t lv_gradient_calculate(const lv_grad_dsc_t * dsc, lv_coord_t range,
|
||||
lv_coord_t frac);
|
||||
lv_grad_color_t /* LV_ATTRIBUTE_FAST_MEM */ lv_gradient_calculate(const lv_grad_dsc_t * dsc, lv_coord_t range,
|
||||
lv_coord_t frac);
|
||||
|
||||
/**
|
||||
* Set the gradient cache size
|
||||
|
@ -42,8 +42,10 @@ static void convert_cb(const lv_area_t * dest_area, const void * src_buf, lv_coo
|
||||
**********************/
|
||||
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_draw_sw_img_decoded(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_img_dsc_t * draw_dsc,
|
||||
const lv_area_t * coords, const uint8_t * src_buf, lv_img_cf_t cf)
|
||||
void LV_ATTRIBUTE_FAST_MEM lv_draw_sw_img_decoded(struct _lv_draw_ctx_t * draw_ctx,
|
||||
const lv_draw_img_dsc_t * draw_dsc,
|
||||
const lv_area_t * coords, const uint8_t * src_buf,
|
||||
lv_img_cf_t cf)
|
||||
{
|
||||
/*Use the clip area as draw area*/
|
||||
lv_area_t draw_area;
|
||||
|
@ -27,8 +27,8 @@
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM static void draw_letter_normal(lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc,
|
||||
const lv_point_t * pos, lv_font_glyph_dsc_t * g, const uint8_t * map_p);
|
||||
static void /* LV_ATTRIBUTE_FAST_MEM */ draw_letter_normal(lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc,
|
||||
const lv_point_t * pos, lv_font_glyph_dsc_t * g, const uint8_t * map_p);
|
||||
|
||||
|
||||
#if LV_DRAW_COMPLEX && LV_USE_FONT_SUBPX
|
||||
@ -162,7 +162,7 @@ void lv_draw_sw_letter(lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM static void draw_letter_normal(lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc,
|
||||
static void LV_ATTRIBUTE_FAST_MEM draw_letter_normal(lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc,
|
||||
const lv_point_t * pos, lv_font_glyph_dsc_t * g, const uint8_t * map_p)
|
||||
{
|
||||
|
||||
|
@ -23,12 +23,12 @@
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM static void draw_line_skew(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc,
|
||||
const lv_point_t * point1, const lv_point_t * point2);
|
||||
LV_ATTRIBUTE_FAST_MEM static void draw_line_hor(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc,
|
||||
const lv_point_t * point1, const lv_point_t * point2);
|
||||
LV_ATTRIBUTE_FAST_MEM static void draw_line_ver(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc,
|
||||
const lv_point_t * point1, const lv_point_t * point2);
|
||||
static void /* LV_ATTRIBUTE_FAST_MEM */ draw_line_skew(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc,
|
||||
const lv_point_t * point1, const lv_point_t * point2);
|
||||
static void /* LV_ATTRIBUTE_FAST_MEM */ draw_line_hor(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc,
|
||||
const lv_point_t * point1, const lv_point_t * point2);
|
||||
static void /* LV_ATTRIBUTE_FAST_MEM */ draw_line_ver(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc,
|
||||
const lv_point_t * point1, const lv_point_t * point2);
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
@ -49,7 +49,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_ver(struct _lv_draw_ctx_t * draw_ctx
|
||||
* @param clip the line will be drawn only in this area
|
||||
* @param dsc pointer to an initialized `lv_draw_line_dsc_t` variable
|
||||
*/
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_draw_sw_line(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc,
|
||||
void LV_ATTRIBUTE_FAST_MEM lv_draw_sw_line(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc,
|
||||
const lv_point_t * point1, const lv_point_t * point2)
|
||||
{
|
||||
if(dsc->width == 0) return;
|
||||
@ -109,7 +109,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_sw_line(struct _lv_draw_ctx_t * draw_ctx, con
|
||||
**********************/
|
||||
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM static void draw_line_hor(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc,
|
||||
static void LV_ATTRIBUTE_FAST_MEM draw_line_hor(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc,
|
||||
const lv_point_t * point1, const lv_point_t * point2)
|
||||
{
|
||||
int32_t w = dsc->width - 1;
|
||||
@ -195,7 +195,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_hor(struct _lv_draw_ctx_t * draw_ctx
|
||||
#endif /*LV_DRAW_COMPLEX*/
|
||||
}
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM static void draw_line_ver(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc,
|
||||
static void LV_ATTRIBUTE_FAST_MEM draw_line_ver(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc,
|
||||
const lv_point_t * point1, const lv_point_t * point2)
|
||||
{
|
||||
int32_t w = dsc->width - 1;
|
||||
@ -275,7 +275,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_ver(struct _lv_draw_ctx_t * draw_ctx
|
||||
#endif /*LV_DRAW_COMPLEX*/
|
||||
}
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM static void draw_line_skew(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc,
|
||||
static void LV_ATTRIBUTE_FAST_MEM draw_line_skew(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc,
|
||||
const lv_point_t * point1, const lv_point_t * point2)
|
||||
{
|
||||
#if LV_DRAW_COMPLEX
|
||||
|
@ -35,11 +35,11 @@ static void draw_border(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc
|
||||
static void draw_outline(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords);
|
||||
|
||||
#if LV_DRAW_COMPLEX
|
||||
LV_ATTRIBUTE_FAST_MEM static void draw_shadow(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc,
|
||||
const lv_area_t * coords);
|
||||
LV_ATTRIBUTE_FAST_MEM static void shadow_draw_corner_buf(const lv_area_t * coords, uint16_t * sh_buf, lv_coord_t s,
|
||||
lv_coord_t r);
|
||||
LV_ATTRIBUTE_FAST_MEM static void shadow_blur_corner(lv_coord_t size, lv_coord_t sw, uint16_t * sh_ups_buf);
|
||||
static void /* LV_ATTRIBUTE_FAST_MEM */ draw_shadow(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc,
|
||||
const lv_area_t * coords);
|
||||
static void /* LV_ATTRIBUTE_FAST_MEM */ shadow_draw_corner_buf(const lv_area_t * coords, uint16_t * sh_buf,
|
||||
lv_coord_t s, lv_coord_t r);
|
||||
static void /* LV_ATTRIBUTE_FAST_MEM */ shadow_blur_corner(lv_coord_t size, lv_coord_t sw, uint16_t * sh_ups_buf);
|
||||
#endif
|
||||
|
||||
void draw_border_generic(lv_draw_ctx_t * draw_ctx, const lv_area_t * outer_area, const lv_area_t * inner_area,
|
||||
@ -430,7 +430,7 @@ static void draw_border(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc
|
||||
}
|
||||
|
||||
#if LV_DRAW_COMPLEX
|
||||
LV_ATTRIBUTE_FAST_MEM static void draw_shadow(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc,
|
||||
static void LV_ATTRIBUTE_FAST_MEM draw_shadow(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc,
|
||||
const lv_area_t * coords)
|
||||
{
|
||||
/*Check whether the shadow is visible*/
|
||||
@ -950,8 +950,8 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(lv_draw_ctx_t * draw_ctx, const lv
|
||||
* @param sw shadow width
|
||||
* @param r radius
|
||||
*/
|
||||
LV_ATTRIBUTE_FAST_MEM static void shadow_draw_corner_buf(const lv_area_t * coords, uint16_t * sh_buf, lv_coord_t sw,
|
||||
lv_coord_t r)
|
||||
static void LV_ATTRIBUTE_FAST_MEM shadow_draw_corner_buf(const lv_area_t * coords, uint16_t * sh_buf,
|
||||
lv_coord_t sw, lv_coord_t r)
|
||||
{
|
||||
int32_t sw_ori = sw;
|
||||
int32_t size = sw_ori + r;
|
||||
@ -1037,7 +1037,7 @@ LV_ATTRIBUTE_FAST_MEM static void shadow_draw_corner_buf(const lv_area_t * coord
|
||||
|
||||
}
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM static void shadow_blur_corner(lv_coord_t size, lv_coord_t sw, uint16_t * sh_ups_buf)
|
||||
static void LV_ATTRIBUTE_FAST_MEM shadow_blur_corner(lv_coord_t size, lv_coord_t sw, uint16_t * sh_ups_buf)
|
||||
{
|
||||
int32_t s_left = sw >> 1;
|
||||
int32_t s_right = (sw >> 1);
|
||||
|
@ -261,10 +261,10 @@ uint16_t lv_chart_get_point_count(const lv_obj_t * obj)
|
||||
|
||||
uint16_t lv_chart_get_x_start_point(const lv_obj_t * obj, lv_chart_series_t * ser)
|
||||
{
|
||||
LV_UNUSED(obj);
|
||||
LV_ASSERT_NULL(ser);
|
||||
lv_chart_t * chart = (lv_chart_t *)obj;
|
||||
|
||||
return ser->start_point;
|
||||
return chart->update_mode == LV_CHART_UPDATE_MODE_SHIFT ? ser->start_point : 0;
|
||||
}
|
||||
|
||||
void lv_chart_get_point_pos_by_id(lv_obj_t * obj, lv_chart_series_t * ser, uint16_t id, lv_point_t * p_out)
|
||||
@ -292,28 +292,34 @@ void lv_chart_get_point_pos_by_id(lv_obj_t * obj, lv_chart_series_t * ser, uint1
|
||||
}
|
||||
else if(chart->type == LV_CHART_TYPE_BAR) {
|
||||
uint32_t ser_cnt = _lv_ll_get_len(&chart->series_ll);
|
||||
int32_t ser_gap = ((int32_t)lv_obj_get_style_pad_column(obj,
|
||||
LV_PART_ITEMS) * chart->zoom_x) >> 8; /*Gap between the column on the ~same X*/
|
||||
int32_t block_gap = ((int32_t)lv_obj_get_style_pad_column(obj,
|
||||
LV_PART_MAIN) * chart->zoom_x) >> 8; /*Gap between the column on ~adjacent X*/
|
||||
lv_coord_t block_w = (w - ((chart->point_cnt - 1) * block_gap)) / chart->point_cnt;
|
||||
lv_coord_t col_w = block_w / ser_cnt;
|
||||
/*Gap between the column on the X tick*/
|
||||
int32_t ser_gap = ((int32_t)lv_obj_get_style_pad_column(obj, LV_PART_ITEMS) * chart->zoom_x) >> 8;
|
||||
|
||||
p_out->x = (int32_t)((int32_t)w * id) / chart->point_cnt;
|
||||
/*Gap between the columns on adjacent X ticks*/
|
||||
int32_t block_gap = ((int32_t)lv_obj_get_style_pad_column(obj, LV_PART_MAIN) * chart->zoom_x) >> 8;
|
||||
|
||||
lv_coord_t block_w = (w - ((chart->point_cnt - 1) * block_gap)) / chart->point_cnt;
|
||||
|
||||
lv_chart_series_t * ser_i = NULL;
|
||||
uint32_t ser_idx = 0;
|
||||
_LV_LL_READ_BACK(&chart->series_ll, ser_i) {
|
||||
if(ser_i == ser) break;
|
||||
p_out->x += col_w;
|
||||
ser_idx++;
|
||||
}
|
||||
|
||||
p_out->x += (col_w - ser_gap) / 2;
|
||||
p_out->x = (int32_t)((int32_t)(w + block_gap) * id) / chart->point_cnt;
|
||||
p_out->x += block_w * ser_idx / ser_cnt;
|
||||
|
||||
lv_coord_t col_w = (block_w - (ser_gap * (ser_cnt - 1))) / ser_cnt;
|
||||
p_out->x += col_w / 2;
|
||||
}
|
||||
|
||||
lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN);
|
||||
p_out->x += lv_obj_get_style_pad_left(obj, LV_PART_MAIN) + border_width;
|
||||
p_out->x -= lv_obj_get_scroll_left(obj);
|
||||
|
||||
uint32_t start_point = lv_chart_get_x_start_point(obj, ser);
|
||||
id = ((int32_t)start_point + id) % chart->point_cnt;
|
||||
int32_t temp_y = 0;
|
||||
temp_y = (int32_t)((int32_t)ser->y_points[id] - chart->ymin[ser->y_axis_sec]) * h;
|
||||
temp_y = temp_y / (chart->ymax[ser->y_axis_sec] - chart->ymin[ser->y_axis_sec]);
|
||||
@ -913,7 +919,7 @@ static void draw_series_line(lv_obj_t * obj, lv_draw_ctx_t * draw_ctx)
|
||||
line_dsc_default.color = ser->color;
|
||||
point_dsc_default.bg_color = ser->color;
|
||||
|
||||
lv_coord_t start_point = chart->update_mode == LV_CHART_UPDATE_MODE_SHIFT ? ser->start_point : 0;
|
||||
lv_coord_t start_point = lv_chart_get_x_start_point(obj, ser);
|
||||
|
||||
p1.x = x_ofs;
|
||||
p2.x = x_ofs;
|
||||
@ -1075,7 +1081,7 @@ static void draw_series_scatter(lv_obj_t * obj, lv_draw_ctx_t * draw_ctx)
|
||||
line_dsc_default.color = ser->color;
|
||||
point_dsc_default.bg_color = ser->color;
|
||||
|
||||
lv_coord_t start_point = chart->update_mode == LV_CHART_UPDATE_MODE_SHIFT ? ser->start_point : 0;
|
||||
lv_coord_t start_point = lv_chart_get_x_start_point(obj, ser);
|
||||
|
||||
p1.x = x_ofs;
|
||||
p2.x = x_ofs;
|
||||
@ -1229,7 +1235,8 @@ static void draw_series_bar(lv_obj_t * obj, lv_draw_ctx_t * draw_ctx)
|
||||
/*Draw the current point of all data line*/
|
||||
_LV_LL_READ_BACK(&chart->series_ll, ser) {
|
||||
if(ser->hidden) continue;
|
||||
lv_coord_t start_point = chart->update_mode == LV_CHART_UPDATE_MODE_SHIFT ? ser->start_point : 0;
|
||||
|
||||
lv_coord_t start_point = lv_chart_get_x_start_point(obj, ser);
|
||||
|
||||
col_a.x1 = x_act;
|
||||
col_a.x2 = col_a.x1 + col_w - 1;
|
||||
|
@ -205,6 +205,15 @@ static void lv_imgbtn_event(const lv_obj_class_t * class_p, lv_event_t * e)
|
||||
p->x = LV_MAX(p->x, header.w);
|
||||
}
|
||||
}
|
||||
/*Sent when the widget is checked due to LV_OBJ_FLAG_CHECKABLE */
|
||||
else if(code == LV_EVENT_VALUE_CHANGED) {
|
||||
if(lv_obj_has_state(obj, LV_STATE_CHECKED)) {
|
||||
lv_imgbtn_set_state(obj, LV_IMGBTN_STATE_CHECKED_RELEASED);
|
||||
}
|
||||
else {
|
||||
lv_imgbtn_set_state(obj, LV_IMGBTN_STATE_RELEASED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void draw_main(lv_event_t * e)
|
||||
|
@ -77,8 +77,8 @@ lv_obj_t * lv_tabview_add_tab(lv_obj_t * obj, const char * name)
|
||||
|
||||
lv_obj_t * btns = lv_tabview_get_tab_btns(obj);
|
||||
|
||||
char ** old_map = tabview->map;
|
||||
char ** new_map;
|
||||
const char ** old_map = (const char **)tabview->map;
|
||||
const char ** new_map;
|
||||
|
||||
/*top or bottom dir*/
|
||||
if(tabview->tab_pos & LV_DIR_VER) {
|
||||
@ -129,15 +129,17 @@ void lv_tabview_rename_tab(lv_obj_t * obj, uint32_t id, const char * new_name)
|
||||
if(id >= tabview->tab_cnt) return;
|
||||
if(tabview->tab_pos & LV_DIR_HOR) id *= 2;
|
||||
|
||||
lv_mem_free(tabview->map[id]);
|
||||
lv_mem_free((void *)tabview->map[id]);
|
||||
tabview->map[id] = lv_mem_alloc(strlen(new_name) + 1);
|
||||
strcpy(tabview->map[id], new_name);
|
||||
strcpy((void *)tabview->map[id], new_name);
|
||||
lv_obj_invalidate(obj);
|
||||
}
|
||||
|
||||
void lv_tabview_set_act(lv_obj_t * obj, uint32_t id, lv_anim_enable_t anim_en)
|
||||
{
|
||||
LV_ASSERT_OBJ(obj, MY_CLASS);
|
||||
if(obj->being_deleted) return;
|
||||
|
||||
lv_tabview_t * tabview = (lv_tabview_t *)obj;
|
||||
|
||||
if(id >= tabview->tab_cnt) {
|
||||
@ -271,13 +273,13 @@ static void lv_tabview_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj
|
||||
uint32_t i;
|
||||
if(tabview->tab_pos & LV_DIR_VER) {
|
||||
for(i = 0; i < tabview->tab_cnt; i++) {
|
||||
lv_mem_free(tabview->map[i]);
|
||||
lv_mem_free((void *)tabview->map[i]);
|
||||
tabview->map[i] = NULL;
|
||||
}
|
||||
}
|
||||
if(tabview->tab_pos & LV_DIR_HOR) {
|
||||
for(i = 0; i < tabview->tab_cnt; i++) {
|
||||
lv_mem_free(tabview->map[i * 2]);
|
||||
lv_mem_free((void *)tabview->map[i * 2]);
|
||||
tabview->map[i * 2] = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ extern "C" {
|
||||
|
||||
typedef struct {
|
||||
lv_obj_t obj;
|
||||
char ** map;
|
||||
const char ** map;
|
||||
uint16_t tab_cnt;
|
||||
uint16_t tab_cur;
|
||||
lv_dir_t tab_pos;
|
||||
|
@ -148,10 +148,10 @@ const uint8_t * lv_font_get_bitmap_fmt_txt(const lv_font_t * font, uint32_t unic
|
||||
bool lv_font_get_glyph_dsc_fmt_txt(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter,
|
||||
uint32_t unicode_letter_next)
|
||||
{
|
||||
bool is_tab = false;
|
||||
if(unicode_letter == '\t') {
|
||||
/*It fixes a strange compiler optimization issue: https://github.com/lvgl/lvgl/issues/4370*/
|
||||
bool is_tab = unicode_letter == '\t';
|
||||
if(is_tab) {
|
||||
unicode_letter = ' ';
|
||||
is_tab = true;
|
||||
}
|
||||
lv_font_fmt_txt_dsc_t * fdsc = (lv_font_fmt_txt_dsc_t *)font->dsc;
|
||||
uint32_t gid = get_glyph_dsc_id(font, unicode_letter);
|
||||
|
@ -513,7 +513,7 @@ lv_coord_t lv_disp_get_dpi(const lv_disp_t * disp)
|
||||
* Call in the display driver's `flush_cb` function when the flushing is finished
|
||||
* @param disp_drv pointer to display driver in `flush_cb` where this function is called
|
||||
*/
|
||||
LV_ATTRIBUTE_FLUSH_READY void lv_disp_flush_ready(lv_disp_drv_t * disp_drv)
|
||||
void LV_ATTRIBUTE_FLUSH_READY lv_disp_flush_ready(lv_disp_drv_t * disp_drv)
|
||||
{
|
||||
disp_drv->draw_buf->flushing = 0;
|
||||
disp_drv->draw_buf->flushing_last = 0;
|
||||
@ -525,7 +525,7 @@ LV_ATTRIBUTE_FLUSH_READY void lv_disp_flush_ready(lv_disp_drv_t * disp_drv)
|
||||
* @param disp_drv pointer to display driver
|
||||
* @return true: it's the last area to flush; false: there are other areas too which will be refreshed soon
|
||||
*/
|
||||
LV_ATTRIBUTE_FLUSH_READY bool lv_disp_flush_is_last(lv_disp_drv_t * disp_drv)
|
||||
bool LV_ATTRIBUTE_FLUSH_READY lv_disp_flush_is_last(lv_disp_drv_t * disp_drv)
|
||||
{
|
||||
return disp_drv->draw_buf->flushing_last;
|
||||
}
|
||||
|
@ -173,10 +173,8 @@ typedef struct _lv_disp_t {
|
||||
struct _lv_obj_t * top_layer; /**< @see lv_disp_get_layer_top*/
|
||||
struct _lv_obj_t * sys_layer; /**< @see lv_disp_get_layer_sys*/
|
||||
uint32_t screen_cnt;
|
||||
uint8_t draw_prev_over_act :
|
||||
1; /**< 1: Draw previous screen over active screen*/
|
||||
uint8_t del_prev :
|
||||
1; /**< 1: Automatically delete the previous screen when the screen load animation is ready*/
|
||||
uint8_t draw_prev_over_act : 1; /**< 1: Draw previous screen over active screen*/
|
||||
uint8_t del_prev : 1; /**< 1: Automatically delete the previous screen when the screen load anim. is ready*/
|
||||
uint8_t rendering_in_progress : 1; /**< 1: The current screen rendering is in progress*/
|
||||
|
||||
lv_opa_t bg_opa; /**<Opacity of the background color or wallpaper*/
|
||||
@ -332,7 +330,7 @@ lv_disp_rot_t lv_disp_get_rotation(lv_disp_t * disp);
|
||||
* Call in the display driver's `flush_cb` function when the flushing is finished
|
||||
* @param disp_drv pointer to display driver in `flush_cb` where this function is called
|
||||
*/
|
||||
LV_ATTRIBUTE_FLUSH_READY void lv_disp_flush_ready(lv_disp_drv_t * disp_drv);
|
||||
void /* LV_ATTRIBUTE_FLUSH_READY */ lv_disp_flush_ready(lv_disp_drv_t * disp_drv);
|
||||
|
||||
/**
|
||||
* Tell if it's the last area of the refreshing process.
|
||||
@ -340,7 +338,7 @@ LV_ATTRIBUTE_FLUSH_READY void lv_disp_flush_ready(lv_disp_drv_t * disp_drv);
|
||||
* @param disp_drv pointer to display driver
|
||||
* @return true: it's the last area to flush; false: there are other areas too which will be refreshed soon
|
||||
*/
|
||||
LV_ATTRIBUTE_FLUSH_READY bool lv_disp_flush_is_last(lv_disp_drv_t * disp_drv);
|
||||
bool /* LV_ATTRIBUTE_FLUSH_READY */ lv_disp_flush_is_last(lv_disp_drv_t * disp_drv);
|
||||
|
||||
//! @endcond
|
||||
|
||||
|
@ -46,7 +46,7 @@
|
||||
* You have to call this function periodically
|
||||
* @param tick_period the call period of this function in milliseconds
|
||||
*/
|
||||
LV_ATTRIBUTE_TICK_INC void lv_tick_inc(uint32_t tick_period)
|
||||
void LV_ATTRIBUTE_TICK_INC lv_tick_inc(uint32_t tick_period)
|
||||
{
|
||||
tick_irq_flag = 0;
|
||||
sys_time += tick_period;
|
||||
|
@ -40,7 +40,7 @@ extern "C" {
|
||||
* You have to call this function periodically
|
||||
* @param tick_period the call period of this function in milliseconds
|
||||
*/
|
||||
LV_ATTRIBUTE_TICK_INC void lv_tick_inc(uint32_t tick_period);
|
||||
void /* LV_ATTRIBUTE_TICK_INC */ lv_tick_inc(uint32_t tick_period);
|
||||
#endif
|
||||
|
||||
//! @endcond
|
||||
|
@ -47,7 +47,7 @@ extern "C" {
|
||||
|
||||
#ifdef CONFIG_LV_PERF_MONITOR_ALIGN_TOP_LEFT
|
||||
# define CONFIG_LV_USE_PERF_MONITOR_POS LV_ALIGN_TOP_LEFT
|
||||
#elif defined(CONFIG_LV_USE_PERF_MONITOR_ALIGN_TOP_MID)
|
||||
#elif defined(CONFIG_LV_PERF_MONITOR_ALIGN_TOP_MID)
|
||||
# define CONFIG_LV_USE_PERF_MONITOR_POS LV_ALIGN_TOP_MID
|
||||
#elif defined(CONFIG_LV_PERF_MONITOR_ALIGN_TOP_RIGHT)
|
||||
# define CONFIG_LV_USE_PERF_MONITOR_POS LV_ALIGN_TOP_RIGHT
|
||||
@ -67,7 +67,7 @@ extern "C" {
|
||||
|
||||
#ifdef CONFIG_LV_MEM_MONITOR_ALIGN_TOP_LEFT
|
||||
# define CONFIG_LV_USE_MEM_MONITOR_POS LV_ALIGN_TOP_LEFT
|
||||
#elif defined(CONFIG_LV_USE_MEM_MONITOR_ALIGN_TOP_MID)
|
||||
#elif defined(CONFIG_LV_MEM_MONITOR_ALIGN_TOP_MID)
|
||||
# define CONFIG_LV_USE_MEM_MONITOR_POS LV_ALIGN_TOP_MID
|
||||
#elif defined(CONFIG_LV_MEM_MONITOR_ALIGN_TOP_RIGHT)
|
||||
# define CONFIG_LV_USE_MEM_MONITOR_POS LV_ALIGN_TOP_RIGHT
|
||||
|
@ -33,7 +33,7 @@
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_color_fill(lv_color_t * buf, lv_color_t color, uint32_t px_num)
|
||||
void LV_ATTRIBUTE_FAST_MEM lv_color_fill(lv_color_t * buf, lv_color_t color, uint32_t px_num)
|
||||
{
|
||||
#if LV_COLOR_DEPTH == 16
|
||||
uintptr_t buf_int = (uintptr_t)buf;
|
||||
|
@ -436,7 +436,7 @@ static inline uint32_t lv_color_to32(lv_color_t color)
|
||||
* @param mix The ratio of the colors. 0: full `c2`, 255: full `c1`, 127: half `c1` and half`c2`
|
||||
* @return the mixed color
|
||||
*/
|
||||
LV_ATTRIBUTE_FAST_MEM static inline lv_color_t lv_color_mix(lv_color_t c1, lv_color_t c2, uint8_t mix)
|
||||
static inline lv_color_t LV_ATTRIBUTE_FAST_MEM lv_color_mix(lv_color_t c1, lv_color_t c2, uint8_t mix)
|
||||
{
|
||||
lv_color_t ret;
|
||||
|
||||
@ -472,7 +472,7 @@ LV_ATTRIBUTE_FAST_MEM static inline lv_color_t lv_color_mix(lv_color_t c1, lv_co
|
||||
return ret;
|
||||
}
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM static inline void lv_color_premult(lv_color_t c, uint8_t mix, uint16_t * out)
|
||||
static inline void LV_ATTRIBUTE_FAST_MEM lv_color_premult(lv_color_t c, uint8_t mix, uint16_t * out)
|
||||
{
|
||||
#if LV_COLOR_DEPTH != 1
|
||||
out[0] = (uint16_t)LV_COLOR_GET_R(c) * mix;
|
||||
@ -497,7 +497,7 @@ LV_ATTRIBUTE_FAST_MEM static inline void lv_color_premult(lv_color_t c, uint8_t
|
||||
* @return the mixed color
|
||||
* @note 255 won't give clearly `c1`.
|
||||
*/
|
||||
LV_ATTRIBUTE_FAST_MEM static inline lv_color_t lv_color_mix_premult(uint16_t * premult_c1, lv_color_t c2, uint8_t mix)
|
||||
static inline lv_color_t LV_ATTRIBUTE_FAST_MEM lv_color_mix_premult(uint16_t * premult_c1, lv_color_t c2, uint8_t mix)
|
||||
{
|
||||
lv_color_t ret;
|
||||
#if LV_COLOR_DEPTH != 1
|
||||
@ -528,7 +528,7 @@ LV_ATTRIBUTE_FAST_MEM static inline lv_color_t lv_color_mix_premult(uint16_t * p
|
||||
* @param res_color the result color
|
||||
* @param res_opa the result opacity
|
||||
*/
|
||||
LV_ATTRIBUTE_FAST_MEM static inline void lv_color_mix_with_alpha(lv_color_t bg_color, lv_opa_t bg_opa,
|
||||
static inline void LV_ATTRIBUTE_FAST_MEM lv_color_mix_with_alpha(lv_color_t bg_color, lv_opa_t bg_opa,
|
||||
lv_color_t fg_color, lv_opa_t fg_opa,
|
||||
lv_color_t * res_color, lv_opa_t * res_opa)
|
||||
{
|
||||
@ -644,7 +644,7 @@ static inline void lv_color_filter_dsc_init(lv_color_filter_dsc_t * dsc, lv_colo
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
//!
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_color_fill(lv_color_t * buf, lv_color_t color, uint32_t px_num);
|
||||
void /* LV_ATTRIBUTE_FAST_MEM */ lv_color_fill(lv_color_t * buf, lv_color_t color, uint32_t px_num);
|
||||
|
||||
//! @endcond
|
||||
lv_color_t lv_color_lighten(lv_color_t c, lv_opa_t lvl);
|
||||
|
@ -45,7 +45,7 @@ static const int16_t sin0_90_table[] = {
|
||||
* @param angle
|
||||
* @return sinus of 'angle'. sin(-90) = -32767, sin(90) = 32767
|
||||
*/
|
||||
LV_ATTRIBUTE_FAST_MEM int16_t lv_trigo_sin(int16_t angle)
|
||||
int16_t LV_ATTRIBUTE_FAST_MEM lv_trigo_sin(int16_t angle)
|
||||
{
|
||||
int16_t ret = 0;
|
||||
angle = angle % 360;
|
||||
@ -106,7 +106,7 @@ uint32_t lv_bezier3(uint32_t t, uint32_t u0, uint32_t u1, uint32_t u2, uint32_t
|
||||
* If root < 256: mask = 0x800
|
||||
* Else: mask = 0x8000
|
||||
*/
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_sqrt(uint32_t x, lv_sqrt_res_t * q, uint32_t mask)
|
||||
void LV_ATTRIBUTE_FAST_MEM lv_sqrt(uint32_t x, lv_sqrt_res_t * q, uint32_t mask)
|
||||
{
|
||||
x = x << 8; /*To get 4 bit precision. (sqrt(256) = 16 = 4 bit)*/
|
||||
|
||||
|
@ -44,9 +44,9 @@ typedef struct {
|
||||
* @param angle
|
||||
* @return sinus of 'angle'. sin(-90) = -32767, sin(90) = 32767
|
||||
*/
|
||||
LV_ATTRIBUTE_FAST_MEM int16_t lv_trigo_sin(int16_t angle);
|
||||
int16_t /* LV_ATTRIBUTE_FAST_MEM */ lv_trigo_sin(int16_t angle);
|
||||
|
||||
static inline LV_ATTRIBUTE_FAST_MEM int16_t lv_trigo_cos(int16_t angle)
|
||||
static inline int16_t LV_ATTRIBUTE_FAST_MEM lv_trigo_cos(int16_t angle)
|
||||
{
|
||||
return lv_trigo_sin(angle + 90);
|
||||
}
|
||||
@ -84,7 +84,7 @@ uint16_t lv_atan2(int x, int y);
|
||||
* If root < 256: mask = 0x800
|
||||
* Else: mask = 0x8000
|
||||
*/
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_sqrt(uint32_t x, lv_sqrt_res_t * q, uint32_t mask);
|
||||
void /* LV_ATTRIBUTE_FAST_MEM */ lv_sqrt(uint32_t x, lv_sqrt_res_t * q, uint32_t mask);
|
||||
|
||||
//! @endcond
|
||||
|
||||
|
@ -365,7 +365,7 @@ void lv_mem_buf_free_all(void)
|
||||
* @param src pointer to the source buffer
|
||||
* @param len number of byte to copy
|
||||
*/
|
||||
LV_ATTRIBUTE_FAST_MEM void * lv_memcpy(void * dst, const void * src, size_t len)
|
||||
void * LV_ATTRIBUTE_FAST_MEM lv_memcpy(void * dst, const void * src, size_t len)
|
||||
{
|
||||
uint8_t * d8 = dst;
|
||||
const uint8_t * s8 = src;
|
||||
@ -427,7 +427,7 @@ LV_ATTRIBUTE_FAST_MEM void * lv_memcpy(void * dst, const void * src, size_t len)
|
||||
* @param v value to set [0..255]
|
||||
* @param len number of byte to set
|
||||
*/
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_memset(void * dst, uint8_t v, size_t len)
|
||||
void LV_ATTRIBUTE_FAST_MEM lv_memset(void * dst, uint8_t v, size_t len)
|
||||
{
|
||||
|
||||
uint8_t * d8 = (uint8_t *)dst;
|
||||
@ -470,7 +470,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_memset(void * dst, uint8_t v, size_t len)
|
||||
* @param dst pointer to the destination buffer
|
||||
* @param len number of byte to set
|
||||
*/
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_memset_00(void * dst, size_t len)
|
||||
void LV_ATTRIBUTE_FAST_MEM lv_memset_00(void * dst, size_t len)
|
||||
{
|
||||
uint8_t * d8 = (uint8_t *)dst;
|
||||
uintptr_t d_align = (lv_uintptr_t) d8 & ALIGN_MASK;
|
||||
@ -508,7 +508,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_memset_00(void * dst, size_t len)
|
||||
* @param dst pointer to the destination buffer
|
||||
* @param len number of byte to set
|
||||
*/
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_memset_ff(void * dst, size_t len)
|
||||
void LV_ATTRIBUTE_FAST_MEM lv_memset_ff(void * dst, size_t len)
|
||||
{
|
||||
uint8_t * d8 = (uint8_t *)dst;
|
||||
uintptr_t d_align = (lv_uintptr_t) d8 & ALIGN_MASK;
|
||||
|
@ -183,7 +183,7 @@ static inline void lv_memset_ff(void * dst, size_t len)
|
||||
* @param src pointer to the source buffer
|
||||
* @param len number of byte to copy
|
||||
*/
|
||||
LV_ATTRIBUTE_FAST_MEM void * lv_memcpy(void * dst, const void * src, size_t len);
|
||||
void * /* LV_ATTRIBUTE_FAST_MEM */ lv_memcpy(void * dst, const void * src, size_t len);
|
||||
|
||||
/**
|
||||
* Same as `memcpy` but optimized to copy only a few bytes.
|
||||
@ -191,7 +191,7 @@ LV_ATTRIBUTE_FAST_MEM void * lv_memcpy(void * dst, const void * src, size_t len)
|
||||
* @param src pointer to the source buffer
|
||||
* @param len number of byte to copy
|
||||
*/
|
||||
LV_ATTRIBUTE_FAST_MEM static inline void * lv_memcpy_small(void * dst, const void * src, size_t len)
|
||||
static inline void * LV_ATTRIBUTE_FAST_MEM lv_memcpy_small(void * dst, const void * src, size_t len)
|
||||
{
|
||||
uint8_t * d8 = (uint8_t *)dst;
|
||||
const uint8_t * s8 = (const uint8_t *)src;
|
||||
@ -212,21 +212,21 @@ LV_ATTRIBUTE_FAST_MEM static inline void * lv_memcpy_small(void * dst, const voi
|
||||
* @param v value to set [0..255]
|
||||
* @param len number of byte to set
|
||||
*/
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_memset(void * dst, uint8_t v, size_t len);
|
||||
void /* LV_ATTRIBUTE_FAST_MEM */ lv_memset(void * dst, uint8_t v, size_t len);
|
||||
|
||||
/**
|
||||
* Same as `memset(dst, 0x00, len)` but optimized for 4 byte operation.
|
||||
* @param dst pointer to the destination buffer
|
||||
* @param len number of byte to set
|
||||
*/
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_memset_00(void * dst, size_t len);
|
||||
void /* LV_ATTRIBUTE_FAST_MEM */ lv_memset_00(void * dst, size_t len);
|
||||
|
||||
/**
|
||||
* Same as `memset(dst, 0xFF, len)` but optimized for 4 byte operation.
|
||||
* @param dst pointer to the destination buffer
|
||||
* @param len number of byte to set
|
||||
*/
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_memset_ff(void * dst, size_t len);
|
||||
void /* LV_ATTRIBUTE_FAST_MEM */ lv_memset_ff(void * dst, size_t len);
|
||||
|
||||
//! @endcond
|
||||
|
||||
|
@ -64,7 +64,7 @@ void _lv_timer_core_init(void)
|
||||
* Call it periodically to handle lv_timers.
|
||||
* @return the time after which it must be called again
|
||||
*/
|
||||
LV_ATTRIBUTE_TIMER_HANDLER uint32_t lv_timer_handler(void)
|
||||
uint32_t LV_ATTRIBUTE_TIMER_HANDLER lv_timer_handler(void)
|
||||
{
|
||||
TIMER_TRACE("begin");
|
||||
|
||||
|
@ -65,7 +65,7 @@ void _lv_timer_core_init(void);
|
||||
* Call it periodically to handle lv_timers.
|
||||
* @return time till it needs to be run next (in ms)
|
||||
*/
|
||||
LV_ATTRIBUTE_TIMER_HANDLER uint32_t lv_timer_handler(void);
|
||||
uint32_t /* LV_ATTRIBUTE_TIMER_HANDLER */ lv_timer_handler(void);
|
||||
|
||||
//! @endcond
|
||||
|
||||
@ -75,7 +75,7 @@ LV_ATTRIBUTE_TIMER_HANDLER uint32_t lv_timer_handler(void);
|
||||
* This function is used to simplify the porting.
|
||||
* @param __ms the period for running lv_timer_handler()
|
||||
*/
|
||||
static inline LV_ATTRIBUTE_TIMER_HANDLER uint32_t lv_timer_handler_run_in_period(uint32_t ms)
|
||||
static inline uint32_t LV_ATTRIBUTE_TIMER_HANDLER lv_timer_handler_run_in_period(uint32_t ms)
|
||||
{
|
||||
static uint32_t last_tick = 0;
|
||||
uint32_t curr_tick = lv_tick_get();
|
||||
|
@ -208,7 +208,7 @@ void lv_btnmatrix_set_btn_ctrl(lv_obj_t * obj, uint16_t btn_id, lv_btnmatrix_ctr
|
||||
{
|
||||
LV_ASSERT_OBJ(obj, MY_CLASS);
|
||||
|
||||
lv_btnmatrix_t * btnm = (lv_btnmatrix_t *)obj;;
|
||||
lv_btnmatrix_t * btnm = (lv_btnmatrix_t *)obj;
|
||||
|
||||
if(btn_id >= btnm->btn_cnt) return;
|
||||
|
||||
@ -216,6 +216,19 @@ void lv_btnmatrix_set_btn_ctrl(lv_obj_t * obj, uint16_t btn_id, lv_btnmatrix_ctr
|
||||
lv_btnmatrix_clear_btn_ctrl_all(obj, LV_BTNMATRIX_CTRL_CHECKED);
|
||||
}
|
||||
|
||||
/* If we hide a button if all buttons are now hidden hide the whole button matrix to make focus behave correctly */
|
||||
if(ctrl & LV_BTNMATRIX_CTRL_HIDDEN) {
|
||||
bool all_buttons_hidden = true;
|
||||
if(btnm->btn_cnt > 1) {
|
||||
for(uint16_t btn_idx = 0; btn_idx < btnm->btn_cnt; btn_idx++) {
|
||||
if(btn_idx == btn_id) continue;
|
||||
if(!(btnm->ctrl_bits[btn_idx] & LV_BTNMATRIX_CTRL_HIDDEN)) all_buttons_hidden = false;
|
||||
}
|
||||
|
||||
}
|
||||
if(all_buttons_hidden) lv_obj_add_flag(obj, LV_OBJ_FLAG_HIDDEN);
|
||||
}
|
||||
|
||||
btnm->ctrl_bits[btn_id] |= ctrl;
|
||||
invalidate_button_area(obj, btn_id);
|
||||
|
||||
@ -228,10 +241,15 @@ void lv_btnmatrix_clear_btn_ctrl(lv_obj_t * obj, uint16_t btn_id, lv_btnmatrix_c
|
||||
{
|
||||
LV_ASSERT_OBJ(obj, MY_CLASS);
|
||||
|
||||
lv_btnmatrix_t * btnm = (lv_btnmatrix_t *)obj;;
|
||||
lv_btnmatrix_t * btnm = (lv_btnmatrix_t *)obj;
|
||||
|
||||
if(btn_id >= btnm->btn_cnt) return;
|
||||
|
||||
/* If all buttons were hidden the whole button matrix is hidden so we need to check and remove hidden flag if present */
|
||||
if(ctrl & LV_BTNMATRIX_CTRL_HIDDEN) {
|
||||
if(lv_obj_has_flag(obj, LV_OBJ_FLAG_HIDDEN)) lv_obj_clear_flag(obj, LV_OBJ_FLAG_HIDDEN);
|
||||
}
|
||||
|
||||
btnm->ctrl_bits[btn_id] &= (~ctrl);
|
||||
invalidate_button_area(obj, btn_id);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user