I am trying to improve performance of a fairly intensive graphical method by porting it from Typescript to WebAssembly using AssemblyScript. The method manipulates ImageData
of a canvas.
I am having trouble passing this ImageData
(or at least the Uint8ClampedArray
) from Typescript to AssemblyScript. I found a really nice tutorial detailing how to create and send this data from AS to TS, but haven't found much information about going the other way around.
I'd love to find out how to do this, preferably without having to make a new copy of the Uint8ClampedArray
in AS, but I am not sure if that is even possible. Details as to why it is(n't) would be much appreciated!