LVGL源码解析之 lv_draw_sw_img_decoded
lv_draw_sw_img_decoded
img_decoded 是用于解码图片并且将图片绘制到指定buffer区域。
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
)
/**
struct _lv_draw_ctx_t * draw_ctx // 绘制上下文
const lv_draw_img_dsc_t * draw_dsc // 图像素材绘制描述
const lv_area_t * coords // 绘制区(图像在output buffer上的绝对定位)
const uint8_t * src_buf // 图像buffer
lv_img_cf_t cf // 图像色彩格式
**/
绘制上下文中,与当前绘制图像相关的属性:
typedef struct _lv_draw_ctx_t {
/**
* Pointer to a buffer to draw into
*/
void * buf;
/**
* The position and size of `buf` (absolute coordinates)
*/
lv_area_t * buf_area;
/**
* The current clip area with absolute coordinates, always the same or smaller than `buf_area`
*/
const lv_area_t * clip_area;
} lv_draw_ctx_t;
与图像本身的绘制效果相关的:
typedef struct {
int16_t angle;
uint16_t zoom;
lv_point_t pivot;
lv_color_t recolor;
lv_opa_t recolor_opa;
lv_opa_t opa;
lv_blend_mode_t blend_mode : 4;
int32_t frame_id;
uint8_t antialias : 1;
} lv_draw_img_dsc_t;
文章地址: LVGL源码解析之 lv_draw_sw_img_decoded - Sprite keep learning
最近回复