Closed oheil closed 2 years ago
It looks great! I don't use this bit of the package at all (except for answering queries 😄) so anything that might add useful features for other people is great. If it doesn't affect current functionality (image buffers, snapshots, etc) then adding it would be straightforward and hopefully not breaking. However, adding tests and documentation is required! 😛
You might like to search through some of the old issues for "buffer" where people have asked about image buffer functionality, thread-safety, etc, just in case there are other considerations you haven't thought of.
Hm, thread-safety is surely nothing I can address on the way, snapshot and preview is something which would be nice to have if MiniFB is not used... I will have a look...
Closed via #233 - thanks!
Playing around with MiniFB and Luxor the currently only available Drawing methods turned out not to be the perfect match for MiniFB because the image buffer is copied a lot. But in Cairo.jl there is also:
CairoImageSurface(img::Matrix{T}) where {T<:Union{RGB24,ARGB32}}
where the image buffer is provided by the user.
So I forked Luxor and added this method to drawings.jl :
The following example shows an example which wasn't possible as smooth as it is now. First, I wanted to have a MiniFB window which is updated automatically in the background and let's me put Luxor graphic commands at the REPL together with a FPS display as a layer on top without overwriting the image buffer:
Now doing some graphics on the image buffer rendered directly in the MiniFB window. Pressing "q" + "return" stops the while loop and brings you back to the REPL.
What do you think? Do you see what I mean and why I think this is a nice way to expand on Luxor? I can do a PR but for now, the state of my proposal is still a bit rough and needs some discussion.