Add AVIF encoder

This commit is contained in:
Surma
2020-02-05 17:45:48 -08:00
committed by Ingvar Stepanyan
parent 409df481db
commit e1ab43b76f
9 changed files with 1353 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
const fs = require("fs");
const avifEnc = require("./avif_enc.js")(fs.readFileSync("./avif_enc.wasm"));
avifEnc.onRuntimeInitialized = () => {
const avif = avifEnc.encode(
new Uint8Array([255, 0, 0, 255, 0, 255, 0, 255, 0, 0, 255, 255]),
3,
1
);
fs.writeFileSync("lol.avif", avif);
};