mikroSDK Reference Manual
lv_draw.h
Go to the documentation of this file.
1
6#ifndef LV_DRAW_H
7#define LV_DRAW_H
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13/*********************
14 * INCLUDES
15 *********************/
16#include "../lv_conf_internal.h"
17
18#include "../misc/lv_style.h"
19#include "../misc/lv_txt.h"
20#include "lv_img_decoder.h"
21#include "lv_img_cache.h"
22
23#include "lv_draw_rect.h"
24#include "lv_draw_label.h"
25#include "lv_draw_img.h"
26#include "lv_draw_line.h"
27#include "lv_draw_triangle.h"
28#include "lv_draw_arc.h"
29#include "lv_draw_mask.h"
30#include "lv_draw_transform.h"
31#include "lv_draw_layer.h"
32
33/*********************
34 * DEFINES
35 *********************/
36
37/**********************
38 * TYPEDEFS
39 **********************/
40
41typedef struct {
42 void * user_data;
44
45typedef struct _lv_draw_layer_ctx_t {
46 lv_area_t area_full;
47 lv_area_t area_act;
48 lv_coord_t max_row_with_alpha;
49 lv_coord_t max_row_with_no_alpha;
50 void * buf;
51 struct {
52 const lv_area_t * clip_area;
53 lv_area_t * buf_area;
54 void * buf;
55 bool screen_transp;
56 } original;
58
59typedef struct _lv_draw_ctx_t {
63 void * buf;
64
69
74
75 void (*init_buf)(struct _lv_draw_ctx_t * draw_ctx);
76
77 void (*draw_rect)(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords);
78
79 void (*draw_arc)(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_arc_dsc_t * dsc, const lv_point_t * center,
80 uint16_t radius, uint16_t start_angle, uint16_t end_angle);
81
82 void (*draw_img_decoded)(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_img_dsc_t * dsc,
83 const lv_area_t * coords, const uint8_t * map_p, lv_img_cf_t color_format);
84
85 lv_res_t (*draw_img)(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_img_dsc_t * draw_dsc,
86 const lv_area_t * coords, const void * src);
87
88 void (*draw_letter)(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_label_dsc_t * dsc, const lv_point_t * pos_p,
89 uint32_t letter);
90
91
92 void (*draw_line)(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_line_dsc_t * dsc, const lv_point_t * point1,
93 const lv_point_t * point2);
94
95
96 void (*draw_polygon)(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * draw_dsc,
97 const lv_point_t * points, uint16_t point_cnt);
98
99
113 void (*draw_transform)(struct _lv_draw_ctx_t * draw_ctx, const lv_area_t * dest_area, const void * src_buf,
114 lv_coord_t src_w, lv_coord_t src_h, lv_coord_t src_stride,
115 const lv_draw_img_dsc_t * draw_dsc, lv_img_cf_t cf, lv_color_t * cbuf, lv_opa_t * abuf);
116
120 void (*draw_bg)(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * draw_dsc, const lv_area_t * coords);
121
125 void (*wait_for_finish)(struct _lv_draw_ctx_t * draw_ctx);
126
141 void (*buffer_copy)(struct _lv_draw_ctx_t * draw_ctx, void * dest_buf, lv_coord_t dest_stride,
142 const lv_area_t * dest_area,
143 void * src_buf, lv_coord_t src_stride, const lv_area_t * src_area);
144
153 struct _lv_draw_layer_ctx_t * (*layer_init)(struct _lv_draw_ctx_t * draw_ctx, struct _lv_draw_layer_ctx_t * layer_ctx,
154 lv_draw_layer_flags_t flags);
155
163 void (*layer_adjust)(struct _lv_draw_ctx_t * draw_ctx, struct _lv_draw_layer_ctx_t * layer_ctx,
164 lv_draw_layer_flags_t flags);
165
172 void (*layer_blend)(struct _lv_draw_ctx_t * draw_ctx, struct _lv_draw_layer_ctx_t * layer_ctx,
173 const lv_draw_img_dsc_t * draw_dsc);
174
181 void (*layer_destroy)(struct _lv_draw_ctx_t * draw_ctx, lv_draw_layer_ctx_t * layer_ctx);
182
187
188#if LV_USE_USER_DATA
189 void * user_data;
190#endif
191
193
194/**********************
195 * GLOBAL PROTOTYPES
196 **********************/
197
198void lv_draw_init(void);
199
200
201void lv_draw_wait_for_finish(lv_draw_ctx_t * draw_ctx);
202
203/**********************
204 * GLOBAL VARIABLES
205 **********************/
206
207/**********************
208 * MACROS
209 **********************/
210
211/**********************
212 * POST INCLUDES
213 *********************/
214
215#ifdef __cplusplus
216} /*extern "C"*/
217#endif
218
219#endif /*LV_DRAW_H*/
Definition lv_draw.h:59
void(* draw_bg)(struct _lv_draw_ctx_t *draw_ctx, const lv_draw_rect_dsc_t *draw_dsc, const lv_area_t *coords)
Definition lv_draw.h:120
void(* layer_adjust)(struct _lv_draw_ctx_t *draw_ctx, struct _lv_draw_layer_ctx_t *layer_ctx, lv_draw_layer_flags_t flags)
Definition lv_draw.h:163
void(* wait_for_finish)(struct _lv_draw_ctx_t *draw_ctx)
Definition lv_draw.h:125
void * buf
Definition lv_draw.h:63
void(* draw_transform)(struct _lv_draw_ctx_t *draw_ctx, const lv_area_t *dest_area, const void *src_buf, lv_coord_t src_w, lv_coord_t src_h, lv_coord_t src_stride, const lv_draw_img_dsc_t *draw_dsc, lv_img_cf_t cf, lv_color_t *cbuf, lv_opa_t *abuf)
Definition lv_draw.h:113
lv_area_t * buf_area
Definition lv_draw.h:68
const lv_area_t * clip_area
Definition lv_draw.h:73
size_t layer_instance_size
Definition lv_draw.h:186
void(* buffer_copy)(struct _lv_draw_ctx_t *draw_ctx, void *dest_buf, lv_coord_t dest_stride, const lv_area_t *dest_area, void *src_buf, lv_coord_t src_stride, const lv_area_t *src_area)
Definition lv_draw.h:141
void(* layer_destroy)(struct _lv_draw_ctx_t *draw_ctx, lv_draw_layer_ctx_t *layer_ctx)
Definition lv_draw.h:181
void(* layer_blend)(struct _lv_draw_ctx_t *draw_ctx, struct _lv_draw_layer_ctx_t *layer_ctx, const lv_draw_img_dsc_t *draw_dsc)
Definition lv_draw.h:172
Definition lv_draw.h:45
Definition lv_area.h:43
Definition lv_draw_arc.h:28
Definition lv_draw_img.h:32
Definition lv_draw_label.h:30
Definition lv_draw_line.h:28
Definition lv_draw.h:41
Definition lv_draw_rect.h:32
Definition lv_area.h:37