mikroSDK Reference Manual
lv_vglite_utils.h
Go to the documentation of this file.
1
30#ifndef LV_VGLITE_UTILS_H
31#define LV_VGLITE_UTILS_H
32
33#ifdef __cplusplus
34extern "C" {
35#endif
36
37/*********************
38 * INCLUDES
39 *********************/
41
42#if LV_USE_GPU_NXP_VG_LITE
43#include "vg_lite.h"
44#include "../../sw/lv_draw_sw.h"
46
47/*********************
48 * DEFINES
49 *********************/
50
51#ifndef LV_GPU_NXP_VG_LITE_LOG_ERRORS
53#define LV_GPU_NXP_VG_LITE_LOG_ERRORS 1
54#endif
55
56#ifndef LV_GPU_NXP_VG_LITE_LOG_TRACES
58#define LV_GPU_NXP_VG_LITE_LOG_TRACES 0
59#endif
60
61
62/* The optimal Bezier control point offset for radial unit
63 * see: https://spencermortensen.com/articles/bezier-circle/
64 **/
65#define BEZIER_OPTIM_CIRCLE 0.551915024494f
66
67/* Draw lines for control points of Bezier curves */
68#define BEZIER_DBG_CONTROL_POINTS 0
69
70/**********************
71 * TYPEDEFS
72 **********************/
73
74/**********************
75 * GLOBAL PROTOTYPES
76 **********************/
77
89lv_res_t lv_vglite_premult_and_swizzle(vg_lite_color_t * vg_col32, lv_color32_t lv_col32, lv_opa_t opa,
90 vg_lite_buffer_format_t vg_col_format);
91
99vg_lite_blend_t lv_vglite_get_blend_mode(lv_blend_mode_t lv_blend_mode);
100
107lv_res_t lv_vglite_run(void);
108
109/**********************
110 * MACROS
111 **********************/
112
113#define VG_LITE_COND_STOP(cond, txt) \
114 do { \
115 if (cond) { \
116 LV_LOG_ERROR("%s. STOP!", txt); \
117 for ( ; ; ); \
118 } \
119 } while(0)
120
121#if LV_GPU_NXP_VG_LITE_LOG_ERRORS
122#define VG_LITE_ERR_RETURN_INV(err, fmt, ...) \
123 do { \
124 if(err != VG_LITE_SUCCESS) { \
125 LV_LOG_ERROR(fmt" (err = %d)", \
126 err, ##__VA_ARGS__); \
127 return LV_RES_INV; \
128 } \
129 } while (0)
130#else
131#define VG_LITE_ERR_RETURN_INV(err, fmt, ...) \
132 do { \
133 if(err != VG_LITE_SUCCESS) { \
134 return LV_RES_INV; \
135 } \
136 }while(0)
137#endif /*LV_GPU_NXP_VG_LITE_LOG_ERRORS*/
138
139#if LV_GPU_NXP_VG_LITE_LOG_TRACES
140#define VG_LITE_LOG_TRACE(fmt, ...) \
141 do { \
142 LV_LOG(fmt, ##__VA_ARGS__); \
143 } while (0)
144
145#define VG_LITE_RETURN_INV(fmt, ...) \
146 do { \
147 LV_LOG_ERROR(fmt, ##__VA_ARGS__); \
148 return LV_RES_INV; \
149 } while (0)
150#else
151#define VG_LITE_LOG_TRACE(fmt, ...) \
152 do { \
153 } while (0)
154#define VG_LITE_RETURN_INV(fmt, ...) \
155 do { \
156 return LV_RES_INV; \
157 }while(0)
158#endif /*LV_GPU_NXP_VG_LITE_LOG_TRACES*/
159
160#endif /*LV_USE_GPU_NXP_VG_LITE*/
161
162#ifdef __cplusplus
163} /*extern "C"*/
164#endif
165
166#endif /*LV_VGLITE_UTILS_H*/
Definition lv_color.h:224