-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wasm #148
Comments
I just saw that this code is already designed to compile to wasm. But odes it allow passing in the images as byte array though ? -- For example: https://kornel.ski/dssim shows that the image is passed in by ref. I need to pass in as bytes because WASM environment can't use file system or network. Is that currently designed for ? |
The command-line version that takes PNG/JPEG files is not supported in WASM. The library interface of https://docs.rs/dssim-core/latest/dssim_core/ is supported in WASM. It's up to you how to load images. The library takes raw pixels: https://docs.rs/dssim-core/latest/dssim_core/struct.Dssim.html#method.create_image_rgba There are no bindings for JS - you'll need to make your own Rust library that computes what you want, and make your own WASM bindings for JS in there. |
Right .. thats @kornelski I am not great at rust, and can't work out how to do that. |
Would make it easier for me to use if I can compile it as wasm.
Anyone know how to do that ? Am not a rust expert but with rust I think it’s pretty easy by adding the right wasm export annotations to the rust functions we want exported.
then I can use it as part of a bigger system.
the wasm host runner will need to feed each image in as a byte array or similar because the wasm guest ( the rust code ) does not have access to the file system or network.
The text was updated successfully, but these errors were encountered: