Skip to content

westwood846/waim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WAIM - Web Assembly Image Manipulator

This is a demo for using C++ code through WebAssembly in a simple web application

Visit the demo at https://westwood846.github.io/waim, choose an image file from your machine and the buttons in the toolbar.

screenshot

Technical Notes

To compile the C++ code:

emcc invert.cpp -O3 \
  -s WASM=1 \
  -s EXPORTED_FUNCTIONS='["_invert", "_sort", "_malloc", "_free"]' \
  -s EXPORTED_RUNTIME_METHODS='["ccall", "cwrap", "HEAPU8"]' \
  -s ALLOW_MEMORY_GROWTH \
  -s ASSERTIONS \
  -o invert.js

Make sure you've got EMScripten SDK installed.