LVGL add enums and dithering

This commit is contained in:
Stephan Hadinger 2022-02-23 19:19:54 +01:00
parent 0a2e6fd4ae
commit 4d1ca3916d
4 changed files with 53 additions and 22 deletions

View File

@ -186,6 +186,8 @@ const be_const_member_t lv0_constants[] = {
{ "ANIM_IMG_PART_MAIN", be_cconst_int(LV_ANIM_IMG_PART_MAIN) },
{ "ANIM_OFF", be_cconst_int(LV_ANIM_OFF) },
{ "ANIM_ON", be_cconst_int(LV_ANIM_ON) },
{ "ANIM_PLAYTIME_INFINITE", be_cconst_int(LV_ANIM_PLAYTIME_INFINITE) },
{ "ANIM_REPEAT_INFINITE", be_cconst_int(LV_ANIM_REPEAT_INFINITE) },
{ "ARC_DRAW_PART_BACKGROUND", be_cconst_int(LV_ARC_DRAW_PART_BACKGROUND) },
{ "ARC_DRAW_PART_FOREGROUND", be_cconst_int(LV_ARC_DRAW_PART_FOREGROUND) },
{ "ARC_DRAW_PART_KNOB", be_cconst_int(LV_ARC_DRAW_PART_KNOB) },
@ -213,6 +215,7 @@ const be_const_member_t lv0_constants[] = {
{ "BORDER_SIDE_NONE", be_cconst_int(LV_BORDER_SIDE_NONE) },
{ "BORDER_SIDE_RIGHT", be_cconst_int(LV_BORDER_SIDE_RIGHT) },
{ "BORDER_SIDE_TOP", be_cconst_int(LV_BORDER_SIDE_TOP) },
{ "BTNMATRIX_BTN_NONE", be_cconst_int(LV_BTNMATRIX_BTN_NONE) },
{ "BTNMATRIX_CTRL_CHECKABLE", be_cconst_int(LV_BTNMATRIX_CTRL_CHECKABLE) },
{ "BTNMATRIX_CTRL_CHECKED", be_cconst_int(LV_BTNMATRIX_CTRL_CHECKED) },
{ "BTNMATRIX_CTRL_CLICK_TRIG", be_cconst_int(LV_BTNMATRIX_CTRL_CLICK_TRIG) },
@ -235,6 +238,7 @@ const be_const_member_t lv0_constants[] = {
{ "CHART_DRAW_PART_DIV_LINE_VER", be_cconst_int(LV_CHART_DRAW_PART_DIV_LINE_VER) },
{ "CHART_DRAW_PART_LINE_AND_POINT", be_cconst_int(LV_CHART_DRAW_PART_LINE_AND_POINT) },
{ "CHART_DRAW_PART_TICK_LABEL", be_cconst_int(LV_CHART_DRAW_PART_TICK_LABEL) },
{ "CHART_POINT_NONE", be_cconst_int(LV_CHART_POINT_NONE) },
{ "CHART_TYPE_BAR", be_cconst_int(LV_CHART_TYPE_BAR) },
{ "CHART_TYPE_LINE", be_cconst_int(LV_CHART_TYPE_LINE) },
{ "CHART_TYPE_NONE", be_cconst_int(LV_CHART_TYPE_NONE) },
@ -245,10 +249,12 @@ const be_const_member_t lv0_constants[] = {
{ "COLORWHEEL_MODE_HUE", be_cconst_int(LV_COLORWHEEL_MODE_HUE) },
{ "COLORWHEEL_MODE_SATURATION", be_cconst_int(LV_COLORWHEEL_MODE_SATURATION) },
{ "COLORWHEEL_MODE_VALUE", be_cconst_int(LV_COLORWHEEL_MODE_VALUE) },
{ "COLOR_16_SWAP", be_cconst_int(LV_COLOR_16_SWAP) },
{ "COLOR_AQUA", be_cconst_int(0x00FFFF) },
{ "COLOR_BLACK", be_cconst_int(0x000000) },
{ "COLOR_BLUE", be_cconst_int(0x0000FF) },
{ "COLOR_CYAN", be_cconst_int(0x00FFFF) },
{ "COLOR_DEPTH", be_cconst_int(LV_COLOR_DEPTH) },
{ "COLOR_GRAY", be_cconst_int(0x808080) },
{ "COLOR_GREEN", be_cconst_int(0x008000) },
{ "COLOR_LIME", be_cconst_int(0x00FF00) },
@ -262,6 +268,8 @@ const be_const_member_t lv0_constants[] = {
{ "COLOR_TEAL", be_cconst_int(0x008080) },
{ "COLOR_WHITE", be_cconst_int(0xFFFFFF) },
{ "COLOR_YELLOW", be_cconst_int(0xFFFF00) },
{ "COORD_MAX", be_cconst_int(LV_COORD_MAX) },
{ "COORD_MIN", be_cconst_int(LV_COORD_MIN) },
{ "COVER_RES_COVER", be_cconst_int(LV_COVER_RES_COVER) },
{ "COVER_RES_MASKED", be_cconst_int(LV_COVER_RES_MASKED) },
{ "COVER_RES_NOT_COVER", be_cconst_int(LV_COVER_RES_NOT_COVER) },
@ -294,6 +302,7 @@ const be_const_member_t lv0_constants[] = {
{ "DRAW_MASK_TYPE_MAP", be_cconst_int(LV_DRAW_MASK_TYPE_MAP) },
{ "DRAW_MASK_TYPE_POLYGON", be_cconst_int(LV_DRAW_MASK_TYPE_POLYGON) },
{ "DRAW_MASK_TYPE_RADIUS", be_cconst_int(LV_DRAW_MASK_TYPE_RADIUS) },
{ "DROPDOWN_POS_LAST", be_cconst_int(LV_DROPDOWN_POS_LAST) },
{ "EVENT_ALL", be_cconst_int(LV_EVENT_ALL) },
{ "EVENT_CANCEL", be_cconst_int(LV_EVENT_CANCEL) },
{ "EVENT_CHILD_CHANGED", be_cconst_int(LV_EVENT_CHILD_CHANGED) },
@ -417,6 +426,7 @@ const be_const_member_t lv0_constants[] = {
{ "IMG_SRC_SYMBOL", be_cconst_int(LV_IMG_SRC_SYMBOL) },
{ "IMG_SRC_UNKNOWN", be_cconst_int(LV_IMG_SRC_UNKNOWN) },
{ "IMG_SRC_VARIABLE", be_cconst_int(LV_IMG_SRC_VARIABLE) },
{ "IMG_ZOOM_NONE", be_cconst_int(LV_IMG_ZOOM_NONE) },
{ "INDEV_STATE_PRESSED", be_cconst_int(LV_INDEV_STATE_PRESSED) },
{ "INDEV_STATE_RELEASED", be_cconst_int(LV_INDEV_STATE_RELEASED) },
{ "INDEV_TYPE_BUTTON", be_cconst_int(LV_INDEV_TYPE_BUTTON) },
@ -436,12 +446,21 @@ const be_const_member_t lv0_constants[] = {
{ "KEY_PREV", be_cconst_int(LV_KEY_PREV) },
{ "KEY_RIGHT", be_cconst_int(LV_KEY_RIGHT) },
{ "KEY_UP", be_cconst_int(LV_KEY_UP) },
{ "LABEL_DOT_NUM", be_cconst_int(LV_LABEL_DOT_NUM) },
{ "LABEL_LONG_CLIP", be_cconst_int(LV_LABEL_LONG_CLIP) },
{ "LABEL_LONG_DOT", be_cconst_int(LV_LABEL_LONG_DOT) },
{ "LABEL_LONG_SCROLL", be_cconst_int(LV_LABEL_LONG_SCROLL) },
{ "LABEL_LONG_SCROLL_CIRCULAR", be_cconst_int(LV_LABEL_LONG_SCROLL_CIRCULAR) },
{ "LABEL_LONG_WRAP", be_cconst_int(LV_LABEL_LONG_WRAP) },
{ "LABEL_POS_LAST", be_cconst_int(LV_LABEL_POS_LAST) },
{ "LABEL_TEXT_SELECTION_OFF", be_cconst_int(LV_LABEL_TEXT_SELECTION_OFF) },
{ "LED_DRAW_PART_RECTANGLE", be_cconst_int(LV_LED_DRAW_PART_RECTANGLE) },
{ "LOG_LEVEL_ERROR", be_cconst_int(LV_LOG_LEVEL_ERROR) },
{ "LOG_LEVEL_INFO", be_cconst_int(LV_LOG_LEVEL_INFO) },
{ "LOG_LEVEL_NONE", be_cconst_int(LV_LOG_LEVEL_NONE) },
{ "LOG_LEVEL_TRACE", be_cconst_int(LV_LOG_LEVEL_TRACE) },
{ "LOG_LEVEL_USER", be_cconst_int(LV_LOG_LEVEL_USER) },
{ "LOG_LEVEL_WARN", be_cconst_int(LV_LOG_LEVEL_WARN) },
{ "MENU_HEADER_BOTTOM_FIXED", be_cconst_int(LV_MENU_HEADER_BOTTOM_FIXED) },
{ "MENU_HEADER_TOP_FIXED", be_cconst_int(LV_MENU_HEADER_TOP_FIXED) },
{ "MENU_HEADER_TOP_UNFIXED", be_cconst_int(LV_MENU_HEADER_TOP_UNFIXED) },
@ -747,6 +766,7 @@ const be_const_member_t lv0_constants[] = {
{ "TABLE_CELL_CTRL_CUSTOM_4", be_cconst_int(LV_TABLE_CELL_CTRL_CUSTOM_4) },
{ "TABLE_CELL_CTRL_MERGE_RIGHT", be_cconst_int(LV_TABLE_CELL_CTRL_MERGE_RIGHT) },
{ "TABLE_CELL_CTRL_TEXT_CROP", be_cconst_int(LV_TABLE_CELL_CTRL_TEXT_CROP) },
{ "TABLE_CELL_NONE", be_cconst_int(LV_TABLE_CELL_NONE) },
{ "TABLE_DRAW_PART_CELL", be_cconst_int(LV_TABLE_DRAW_PART_CELL) },
{ "TEXTAREA_CURSOR_LAST", be_cconst_int(LV_TEXTAREA_CURSOR_LAST) },
{ "TEXT_ALIGN_AUTO", be_cconst_int(LV_TEXT_ALIGN_AUTO) },

View File

@ -33,17 +33,7 @@ FT_FONT_STYLE_ITALIC=FT_FONT_STYLE_ITALIC
FT_FONT_STYLE_BOLD=FT_FONT_STYLE_BOLD
// following are #define, not enum
LV_RADIUS_CIRCLE
LV_TEXTAREA_CURSOR_LAST
LV_STYLE_PROP_ANY
LV_SIZE_CONTENT
LV_GRID_FR=LV_GRID_FR(0)
LV_GRID_CONTENT
LV_GRID_TEMPLATE_LAST
LV_OBJ_FLAG_FLEX_IN_NEW_TRACK
// ======================================================================
// Symbols
@ -312,6 +302,7 @@ LV_DRAW_MASK_LINE_SIDE_TOP
LV_DRAW_MASK_LINE_SIDE_BOTTOM
// File: ../../lvgl/src/draw/lv_draw_rect.h
LV_RADIUS_CIRCLE
// File: ../../lvgl/src/draw/lv_draw_triangle.h
// File: ../../lvgl/src/draw/lv_img_buf.h
LV_IMG_CF_UNKNOWN
@ -354,6 +345,7 @@ LV_FLEX_FLOW_COLUMN_WRAP
LV_FLEX_FLOW_COLUMN_REVERSE
LV_FLEX_FLOW_COLUMN_WRAP_REVERSE
LV_OBJ_FLAG_FLEX_IN_NEW_TRACK
// File: ../../lvgl/src/extra/layouts/grid/lv_grid.h
LV_GRID_ALIGN_START
LV_GRID_ALIGN_CENTER
@ -363,6 +355,8 @@ LV_GRID_ALIGN_SPACE_EVENLY
LV_GRID_ALIGN_SPACE_AROUND
LV_GRID_ALIGN_SPACE_BETWEEN
LV_GRID_CONTENT
LV_GRID_TEMPLATE_LAST
// File: ../../lvgl/src/extra/layouts/lv_layouts.h
// File: ../../lvgl/src/extra/widgets/animimg/lv_animimg.h
LV_ANIM_IMG_PART_MAIN
@ -391,6 +385,7 @@ LV_CHART_DRAW_PART_BAR
LV_CHART_DRAW_PART_CURSOR
LV_CHART_DRAW_PART_TICK_LABEL
LV_CHART_POINT_NONE
// File: ../../lvgl/src/extra/widgets/colorwheel/lv_colorwheel.h
LV_COLORWHEEL_MODE_HUE
LV_COLORWHEEL_MODE_SATURATION
@ -461,6 +456,8 @@ LV_INDEV_STATE_PRESSED
LV_ANIM_OFF
LV_ANIM_ON
LV_ANIM_REPEAT_INFINITE
LV_ANIM_PLAYTIME_INFINITE
// File: ../../lvgl/src/misc/lv_anim_timeline.h
// File: ../../lvgl/src/misc/lv_area.h
LV_ALIGN_DEFAULT
@ -495,6 +492,9 @@ LV_DIR_HOR
LV_DIR_VER
LV_DIR_ALL
LV_SIZE_CONTENT
LV_COORD_MAX
LV_COORD_MIN
// File: ../../lvgl/src/misc/lv_assert.h
// File: ../../lvgl/src/misc/lv_async.h
// File: ../../lvgl/src/misc/lv_bidi.h
@ -540,6 +540,8 @@ LV_PALETTE_BLUE_GREY
LV_PALETTE_GREY
LV_PALETTE_NONE
LV_COLOR_DEPTH
LV_COLOR_16_SWAP
// File: ../../lvgl/src/misc/lv_fs.h
LV_FS_RES_OK
LV_FS_RES_HW_ERR
@ -565,6 +567,12 @@ LV_FS_SEEK_END
// File: ../../lvgl/src/misc/lv_gc.h
// File: ../../lvgl/src/misc/lv_ll.h
// File: ../../lvgl/src/misc/lv_log.h
LV_LOG_LEVEL_TRACE
LV_LOG_LEVEL_INFO
LV_LOG_LEVEL_WARN
LV_LOG_LEVEL_ERROR
LV_LOG_LEVEL_USER
LV_LOG_LEVEL_NONE
// File: ../../lvgl/src/misc/lv_lru.h
// File: ../../lvgl/src/misc/lv_math.h
// File: ../../lvgl/src/misc/lv_mem.h
@ -689,6 +697,7 @@ LV_STYLE_BLEND_MODE
LV_STYLE_LAYOUT
LV_STYLE_BASE_DIR
LV_STYLE_PROP_ANY
LV_IMG_ZOOM_NONE
// File: ../../lvgl/src/misc/lv_style_gen.h
// File: ../../lvgl/src/misc/lv_templ.h
// File: ../../lvgl/src/misc/lv_timer.h
@ -743,11 +752,13 @@ LV_BTNMATRIX_CTRL_CUSTOM_2
LV_BTNMATRIX_DRAW_PART_BTN
LV_BTNMATRIX_BTN_NONE
// File: ../../lvgl/src/widgets/lv_canvas.h
// File: ../../lvgl/src/widgets/lv_checkbox.h
LV_CHECKBOX_DRAW_PART_BOX
// File: ../../lvgl/src/widgets/lv_dropdown.h
LV_DROPDOWN_POS_LAST
// File: ../../lvgl/src/widgets/lv_img.h
LV_IMG_SIZE_MODE_VIRTUAL
LV_IMG_SIZE_MODE_REAL
@ -759,6 +770,9 @@ LV_LABEL_LONG_SCROLL
LV_LABEL_LONG_SCROLL_CIRCULAR
LV_LABEL_LONG_CLIP
LV_LABEL_DOT_NUM
LV_LABEL_POS_LAST
LV_LABEL_TEXT_SELECTION_OFF
// File: ../../lvgl/src/widgets/lv_line.h
// File: ../../lvgl/src/widgets/lv_objx_templ.h
// File: ../../lvgl/src/widgets/lv_roller.h
@ -783,6 +797,8 @@ LV_TABLE_CELL_CTRL_CUSTOM_4
LV_TABLE_DRAW_PART_CELL
LV_TABLE_CELL_NONE
// File: ../../lvgl/src/widgets/lv_textarea.h
LV_PART_TEXTAREA_PLACEHOLDER
LV_TEXTAREA_CURSOR_LAST

View File

@ -230,17 +230,7 @@ FT_FONT_STYLE_ITALIC=FT_FONT_STYLE_ITALIC
FT_FONT_STYLE_BOLD=FT_FONT_STYLE_BOLD
// following are #define, not enum
LV_RADIUS_CIRCLE
LV_TEXTAREA_CURSOR_LAST
LV_STYLE_PROP_ANY
LV_SIZE_CONTENT
LV_GRID_FR=LV_GRID_FR(0)
LV_GRID_CONTENT
LV_GRID_TEMPLATE_LAST
LV_OBJ_FLAG_FLEX_IN_NEW_TRACK
// ======================================================================
// Symbols
@ -340,4 +330,9 @@ for header_name in headers_names:
if exclude: continue
print(enum_item)
# extract `LV_EXPORT_CONST_INT()` int constants
constints = re.findall('LV_EXPORT_CONST_INT\((\w+)\)', raw, flags=re.DOTALL)
for constint in constints:
print(constint)
sys.stdout.close()

View File

@ -142,12 +142,12 @@
/*Allow dithering the gradients (to achieve visual smooth color gradients on limited color depth display)
*LV_DITHER_GRADIENT implies allocating one or two more lines of the object's rendering surface
*The increase in memory consumption is (32 bits * object width) plus 24 bits * object width if using error diffusion */
#define LV_DITHER_GRADIENT 0
#define LV_DITHER_GRADIENT 1
#if LV_DITHER_GRADIENT
/*Add support for error diffusion dithering.
*Error diffusion dithering gets a much better visual result, but implies more CPU consumption and memory when drawing.
*The increase in memory consumption is (24 bits * object's width)*/
#define LV_DITHER_ERROR_DIFFUSION 0
#define LV_DITHER_ERROR_DIFFUSION 1
#endif
/*Maximum buffer size to allocate for rotation.