Since mapPixel requires userdata and is very slow, it's something that fits well with the use of a thread.
In the demo script, thread.lua is generic and can be easily adapted to any project.
Edit1:
Sorry 'userdata' above not correct - should be 'imagedata'.
Question: Canvas creates 'userdata' - Is there a way to convert 'userdata' to 'imagedata'?
Edit2:
imageData=userData:getImageData( ) does the trick.
Simple Example of Using mapPixel in a Thread
Simple Example of Using mapPixel in a Thread
- Attachments
-
- thread_map.love
- Simple demo of thread and mapPixel
- (16.99 KiB) Downloaded 131 times
Who is online
Users browsing this forum: Google [Bot] and 78 guests