XuNeo / luavgl

lua + lvgl = luavgl An optimized lvgl Lua binding
MIT License
57 stars 13 forks source link

Drawing API? #34

Open jonsmirl opened 3 months ago

jonsmirl commented 3 months ago

Introduce the problem

I don't see any way to construct an image, either draw_ctx or canvas. I need to construct RGB and HSL spectrum gradient bitmaps. I can make them in C and pass back to Lua, but do you have plans for a drawing API?

Proposal

No response

jonsmirl commented 3 months ago

I wrote some test code in C, this isn't working out very well on my small LCD so I may drop generating bitmaps.

XuNeo commented 3 months ago

I image it could be achieved by generating data from lua and use those data as source of image widget. The image header needs to be added though. I have never tested this way.

Another method would be develop a custom widget that do the magic work from C. The example widget locates in simulator/widgets.