Subscribe for interesting News and useful Tutorials. (one or two newsletter per month)
Here is the new v5.1 release of LittelvGL with a lot of updates including 4x faster anti-aliasing, sparse font support to save ROM for Asian fonts, scalable and beautiful font anti-aliasing, pixel level opacity on images, easy to use online font and image converters and significant code size reduction.
Due to a massive rework in the anti-aliasing system it become 4 times faster then it was in v5.0. It means practically no performance loss for anti-aliasing! In v5.1 anti-aliasing is calculated during the rendering process hence the old "draw everything in double size and downscale" is not required anymore. This way only few pixel will be put to the appropriate position to make lines or curves smooth and even.
The diagram below shows some measurement with v5.0 and v5.1 using the benchmark application. The results are expressed in FPS.
|Setting||v5.0 no AA||v5.0 AA||v5.1 no AA||v5.1 AA|
To generate fonts for v5.1 you can use a brand new online TTF font converter tool. Available here: https://littlevgl.com/ttf-font-to-c-array With this tool you can specify a range of character to convert and optionally you can list the characters to include in the font. It is very useful Asian fonts where only a few characters are used from a big Unicode range.
LV_FONT_ANTIALIAS option is removed from lv_conf.h. Instead you can specify a bpp (bit-per-pixel) value for each font (1, 2, 4 or 8 bpp are supported). It result better customization to save memory (high bpp for small fonts, low bpp for larger fonts) and in general gives better result with same font memory footprint. You can enable the built-in fonts with 1, 2, 4 or 8 values to specify their bpp.
The old chrma keying (LV_COLOR_TRANSP pixels are transparent) is still available but there is a new feature too: you can assign an Alpha byte to every pixel to realize pixel level opacity. The images with pixel level opacity can have really smooth edges compared to Chroma keying. To convert images for LittlevGL and other online tool is created: https://littlevgl.com/image-to-c-array
In v5.0 you needed to create a file from image data in the RAMFS and then use the file's path in
lv_img_set_file(). Now - in v5.1 - a more general and resource friendly way is introduced. You can use the
lv_img_set_src() function to set a new source for an image object. There are 3 image sources:
lv_img_set_src(img1, &wallpaper_img). In the example wallpaper_img is generated by the online converter.
lv_img_set_src(img1, "S:/path/to/image.bin"). image.bin is also created with the online tool and stored for example on an SD card.
To learn more check the tutorial about the images: https://github.com/littlevgl/lv_examples/tree/master/lv_tutorial/6_images
The v5.1 can be compiled in less then 50kB with 10 kB RAM usage. In such a configuration you can use a few object types (a new object type needs ~3kB ROM) and buffer drawing (LV_VDB_SIZE 2048). It makes LittlevGL capable to run on simple cheap devices with only 64kB ROM like STM32F103C8
However its a minor release you need to do a few things when updating to v5.1:
v5.1 brought a lot of changes to fulfill your needs and we will continue to add new features for you! If you have an idea or have question don't hesitate to ask on GitHub. Don't forget to Star the repository to be informed about news and become part of the community!
If you are pleased with LittelvGL and successfully used it a project please Donate to support the library's further development!
Did you like this article? Share it with your friends!
Subscribe for more interesting News and useful Tutorials (one or two newsletter per month)
Have a question or have experience in this field? Share with us!
LittlevGL - Open-source Embedded GUI Library
LittlevGL is a free and open-source graphics library providing everything you need to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint.
If you like LittlevGL, please
support its deveopment!
The founder of Littlev Graphics Library (LittlevGL) and related software modules is:
All Rights Reserved © 2018 Hungary