Skip to content

Commit

Permalink
docs(disp): LV_COLOR_SCREEN_TRANSP remove dependency on LV_COLOR_DEPT…
Browse files Browse the repository at this point in the history
…H_32 as transparency is supported across all color depths (#3556)

* Kconfig - LV_COLOR_SCREEN_TRANSP remove dependency on LV_COLOR_DEPTH_32 as transparency is supported across all color depths

* display.md - LV_COLOR_SCREEN_TRANSP remove mention of 32bpp requirement that is no longer necessary
  • Loading branch information
chmorgan committed Aug 10, 2022
1 parent d59bba1 commit f58dcd9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 1 addition & 3 deletions Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,9 @@ menu "LVGL configuration"

config LV_COLOR_SCREEN_TRANSP
bool "Enable more complex drawing routines to manage screens transparency."
depends on LV_COLOR_DEPTH_32
help
Can be used if the UI is above another layer, e.g. an OSD menu or video player.
Requires `LV_COLOR_DEPTH = 32` colors and the screen's `bg_opa` should be set to
non LV_OPA_COVER value
The screen's `bg_opa` should be set to non LV_OPA_COVER value

config LV_COLOR_MIX_ROUND_OFS
int "Adjust color mix functions rounding"
Expand Down
3 changes: 1 addition & 2 deletions docs/overview/display.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,10 @@ See the [Display background](#display-background) section for more details. If t
This configuration (transparent screen and display) could be used to create for example OSD menus where a video is played on a lower layer, and a menu is overlayed on an upper layer.

To handle transparent displays, special (slower) color mixing algorithms need to be used by LVGL so this feature needs to enabled with `LV_COLOR_SCREEN_TRANSP` in `lv_conf.h`.
As this mode operates on the Alpha channel of the pixels `LV_COLOR_DEPTH = 32` is also required. The Alpha channel of 32-bit colors will be 0 where there are no objects and 255 where there are solid objects.
The Alpha channel of 32-bit colors will be 0 where there are no objects and 255 where there are solid objects.

In summary, to enable transparent screens and displays for OSD menu-like UIs:
- Enable `LV_COLOR_SCREEN_TRANSP` in `lv_conf.h`
- Be sure to use `LV_COLOR_DEPTH 32`
- Set the screen's opacity to `LV_OPA_TRANSP` e.g. with `lv_obj_set_style_local_bg_opa(lv_scr_act(), LV_OBJMASK_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_TRANSP)`
- Set the display opacity to `LV_OPA_TRANSP` with `lv_disp_set_bg_opa(NULL, LV_OPA_TRANSP);`

Expand Down

0 comments on commit f58dcd9

Please sign in to comment.