Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
CTCaer
GitHub Repository: CTCaer/hekate
Path: blob/master/bdk/libs/lvgl/lv_draw/lv_draw.h
1476 views
1
/**
2
* @file lv_draw.h
3
*
4
*/
5
6
#ifndef LV_DRAW_H
7
#define LV_DRAW_H
8
9
#ifdef __cplusplus
10
extern "C" {
11
#endif
12
13
/*********************
14
* INCLUDES
15
*********************/
16
#ifdef LV_CONF_INCLUDE_SIMPLE
17
#include "lv_conf.h"
18
#else
19
#include "../../lv_conf.h"
20
#endif
21
22
#include "../lv_core/lv_style.h"
23
#include "../lv_misc/lv_txt.h"
24
25
/*********************
26
* DEFINES
27
*********************/
28
/*If image pixels contains alpha we need to know how much byte is a pixel*/
29
#if LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8
30
# define LV_IMG_PX_SIZE_ALPHA_BYTE 2
31
#elif LV_COLOR_DEPTH == 16
32
# define LV_IMG_PX_SIZE_ALPHA_BYTE 3
33
#elif LV_COLOR_DEPTH == 32
34
# define LV_IMG_PX_SIZE_ALPHA_BYTE 4
35
#endif
36
37
/**********************
38
* TYPEDEFS
39
**********************/
40
41
enum {
42
LV_IMG_SRC_VARIABLE,
43
LV_IMG_SRC_FILE,
44
LV_IMG_SRC_SYMBOL,
45
LV_IMG_SRC_UNKNOWN,
46
};
47
typedef uint8_t lv_img_src_t;
48
49
50
/**********************
51
* GLOBAL PROTOTYPES
52
**********************/
53
54
#if LV_ANTIALIAS != 0
55
56
/**
57
* Get the opacity of a pixel based it's position in a line segment
58
* @param seg segment length
59
* @param px_id position of of a pixel which opacity should be get [0..seg-1]
60
* @param base_opa the base opacity
61
* @return the opacity of the given pixel
62
*/
63
lv_opa_t lv_draw_aa_get_opa(lv_coord_t seg, lv_coord_t px_id, lv_opa_t base_opa);
64
65
/**
66
* Add a vertical anti-aliasing segment (pixels with decreasing opacity)
67
* @param x start point x coordinate
68
* @param y start point y coordinate
69
* @param length length of segment (negative value to start from 0 opacity)
70
* @param mask draw only in this area
71
* @param color color of pixels
72
* @param opa maximum opacity
73
*/
74
void lv_draw_aa_ver_seg(lv_coord_t x, lv_coord_t y, lv_coord_t length, const lv_area_t * mask, lv_color_t color, lv_opa_t opa);
75
76
/**
77
* Add a horizontal anti-aliasing segment (pixels with decreasing opacity)
78
* @param x start point x coordinate
79
* @param y start point y coordinate
80
* @param length length of segment (negative value to start from 0 opacity)
81
* @param mask draw only in this area
82
* @param color color of pixels
83
* @param opa maximum opacity
84
*/
85
void lv_draw_aa_hor_seg(lv_coord_t x, lv_coord_t y, lv_coord_t length, const lv_area_t * mask, lv_color_t color, lv_opa_t opa);
86
#endif
87
88
/**********************
89
* GLOBAL VARIABLES
90
**********************/
91
extern void (*const px_fp)(lv_coord_t x, lv_coord_t y, const lv_area_t * mask, lv_color_t color, lv_opa_t opa);
92
extern void (*const fill_fp)(const lv_area_t * coords, const lv_area_t * mask, lv_color_t color, lv_opa_t opa);
93
extern void (*const letter_fp)(const lv_point_t * pos_p, const lv_area_t * mask, const lv_font_t * font_p, uint32_t letter, lv_color_t color, lv_opa_t opa);
94
extern void (*const map_fp)(const lv_area_t * cords_p, const lv_area_t * mask_p,
95
const uint8_t * map_p, lv_opa_t opa, bool chroma_key, bool alpha_byte,
96
lv_color_t recolor, lv_opa_t recolor_opa);
97
98
/**********************
99
* MACROS
100
**********************/
101
102
/**********************
103
* POST INCLUDES
104
*********************/
105
#include "lv_draw_rect.h"
106
#include "lv_draw_label.h"
107
#include "lv_draw_img.h"
108
#include "lv_draw_line.h"
109
#include "lv_draw_triangle.h"
110
111
#ifdef __cplusplus
112
} /* extern "C" */
113
#endif
114
115
#endif /*LV_DRAW_H*/
116
117