- Update to newer APIs.
- Avoid manual pixel-by-pixel copy in favour of decoding directly to desired format & bit depth.
- Avoid use-after-free by cloning the Uint8Array Wasm memory view into a JS-owned Uint8Array right away.
Porting over few more improvements from #777 that can be applied to HQX despite the older Rust version:
- Removed Cargo.lock from .gitignore (the file itself was added in the original PR, but is still ignored and wouldn't get committed on changes).
- Removed couple of stray .DS_Store accidentally added in that PR.
- Added a `--locked` to `wasm-pack` build to make sure we rebuild HQX with the same versions from Cargo.lock.
- Removed separate `wasm-strip` and `wasm-opt -Os` steps from build.sh in HQX because they're already included in wasm-pack, and running twice only makes build slower.
Use a shared base image with fixed Emscripten version, autotools and optimisation flags for all C++ codecs.
Additionally, move build commands for codecs themselves to Makefile - they're already platform-specific, and Make allows for better caching and parallelisation that custom ad-hoc scripts.
This is essentially same as #777 but for C++.
It's not possible to share them across threads, so in case we decide to use multithreading in the future, it's best to mark them as thread_local right away, even if it's a no-op right now.