Compile JXL encoder

This commit is contained in:
Surma
2020-02-06 15:42:14 -08:00
parent 7a4076156a
commit c659018550
9 changed files with 1398 additions and 0 deletions

12
codecs/jxl_enc/example.js Normal file
View File

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