I have the following problem. I have an stdweb::web::html_element::ImageElement - Rust
I want to take this ImageElement, convert it to a Vec<u8>
of (width * height * [r,g,b,a]), do some processing, convert the Vec<u8>
back to ImageElement.
This seems surprisingly messy.
Rust solutions shows something like this: javascript - Accessing UInt8ClampedArray in Rust web assembly - Stack Overflow (wtf, wasm32 ffi?)
JS solutions involve "ImageElement -> draw to Canvas -> get ImageData -> manip -> redraw to Canvas -> convert to DataURL -> construct ImageElement"
Is there an easier way to handle this?