Upgrade AVIF decoding code

- 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.
This commit is contained in:
Ingvar Stepanyan
2020-05-07 16:09:44 +01:00
parent 0ac3d17969
commit 2edb8cbd7e
5 changed files with 21 additions and 84 deletions

View File

@@ -6,7 +6,6 @@ interface RawImage {
interface AVIFModule extends EmscriptenWasm.Module {
decode(data: BufferSource): RawImage;
free_result(): void;
}
export default function(opts: EmscriptenWasm.ModuleOpts): AVIFModule;