luavgl icon indicating copy to clipboard operation
luavgl copied to clipboard

Drawing API?

Open jonsmirl opened this issue 1 year ago • 2 comments

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 avatar Mar 10 '24 02:03 jonsmirl

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

jonsmirl avatar Mar 10 '24 05:03 jonsmirl

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.

XuNeo avatar Mar 11 '24 17:03 XuNeo