Comments (8)
My idea was to return an lv_image_dsc_t or lv_draw_buf_t.
Yes. I agree. I mean the lv_image_dsc_t->data
field should have a type of lv_vector_dsc_t, we need a way to describe loaded vector image.
I found that in many project it would be quite useful to just preload some images e.g. from an SD card, or convert all SVG on startup according to the display size.
We have done similar thing by call lv_image_decoder_open() early before apps starts, put them to cache. Maybe a cache attribute of persist
would be even better.
from lvgl.
We need some feedback on this issue.
Now we mark this as "stale" because there was no activity here for 14 days.
Remove the "stale" label or comment else this will be closed in 7 days.
from lvgl.
Not stale, I'll work on it when the Lottie update is merge.
from lvgl.
It can be just a simple function like
lv_image_preload(img_src, buf, ...);
I imagined this function will return a const struct lv_vector_dsc_t, and this is why #5970 is opened.
There are other cases may need consideration. For example how to add a normal image rotation to const
lv_vector_dsc_t. It's great you can work on it. 👍
from lvgl.
My idea was to return an lv_image_dsc_t
or lv_draw_buf_t
. It's basically just an image saved in a memory managed by you (and not the cache). So it applies to PNG, JPG, etc too.
I found that in many project it would be quite useful to just preload some images e.g. from an SD card, or convert all SVG on startup according to the display size.
from lvgl.
Yes. I agree. I mean the lv_image_dsc_t->data field should have a type of lv_vector_dsc_t, we need a way to describe loaded vector image.
I was thinking only in rasterized images. However, if we had a description for vector data using lv_vector_dsc_t
as an image, it would be a convenient way for the user to draw any vector graphics by hand too.
We have done similar thing by call lv_image_decoder_open() early before apps starts, put them to cache. Maybe a cache attribute of persist would be even better.
My only concern is that this way the user has less control over the memory usage. With lv_image_preload(img_src, buf, ...);
as buf
any memory address can used e.g. in external RAM.
from lvgl.
My only concern is that this way the user has less control over the memory usage. With
lv_image_preload(img_src, buf, ...);
asbuf
any memory address can used e.g. in external RAM.
That can be done by
static lv_draw_buf_t ext_ram_draw_buf;
lv_image_decoder_open(&decoder_dsc, src, &args);
// lv_image_dsc_t* I_manage_the_memory_draw_buf = (void*)lv_draw_buf_dup(decoded);
lv_draw_buf_copy(&ext_ram_draw_buf, NULL, decoded, NULL);
lv_image_decoder_close(&decoder_dsc);
// lv_image_cache_drop(src);
from lvgl.
In lv_image_decoder_open(&decoder_dsc, src, &args);
there were a malloc temporarily. What if in args
we optionally pass a buffer?
from lvgl.
Related Issues (20)
- Compilation error using VG-Lite HOT 9
- [NOT A BUG] Label of List can't be centered. HOT 2
- [scale] Be able to configure the part drawing order HOT 2
- LVGL Forum SPAMMER HOT 6
- Object Rotation for Binary Images HOT 5
- Incomplete implementation of lv_canvas_set_px() for indexed color format HOT 5
- The display will not receive the input event like press and release if a new screen is loaded. HOT 5
- Compilation error using PXP HOT 16
- Draw line using VG-Lite HOT 5
- Mosaic HOT 2
- Scrolling does not respect padding of parent. HOT 5
- Automatioc check for broken links in documentation HOT 4
- How to display Thai on the interface HOT 5
- Recoloring in V9 HOT 1
- ESP32 Rotate doesn't work HOT 3
- ESP32-3248S035C with GT911 touch chip, arduino demo compile error HOT 14
- How can LVGL be better used on wayland/ DRM-enabled SoCs?
- have the C++ version image convert tool and font generate tool? HOT 9
- lv_demo_widgets example in windows, get stuck and break! HOT 11
- Rotate Base object (lv_obj) v9 HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lvgl.