Simple Example of Using mapPixel in a Thread

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
Ref
Party member
Posts: 702
Joined: Wed May 02, 2012 11:05 pm

Simple Example of Using mapPixel in a Thread

Post by Ref »

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.
Attachments
thread_map.love
Simple demo of thread and mapPixel
(16.99 KiB) Downloaded 131 times
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 78 guests