wasmCV
Rust bindings for wasmCV WebAssembly interfaces to computer vision systems.
See https://github.com/wasmvision/wasmcv for information about wasmCV.
How to use
This example Rust module exports a process() function to the WASM host application. When the host calls the processor, it passes in the wasmCV image Mat to be processed. The wasmCV module then calls functions on that Mat which are handled by the host application, by calling OpenCV to actually perform the operations.
extern crate core;
extern crate wee_alloc;
extern crate alloc;
extern crate wasmcv;
use String;
use ToString;
use cv;
pub extern
/// Print a message to the host [`_println`].
extern "C"
unsafe
// Use `wee_alloc` as the global allocator...for now.
static ALLOC: WeeAlloc = INIT;
You can then compile this module using the Rust compiler.
cargo build --target wasm32-unknown-unknown --release
The wasm32-unknown-unknown target can be used with wasmCV to produce very lightweight guest modules when combined with no_std. The example above compiles to around 14k, including debug information.
-rwxrwxr-x 1 ron ron 14488 sep 12 14:23 processrs.wasm