No Description

rexim 193302ab19 Add more resources to the Research Notes 5 years ago
.gitignore 9512028cfb Rename bng.in.wat -> bng.wat.in 5 years ago
LICENSE a660b2ace0 Release under MIT license 5 years ago
Makefile 9512028cfb Rename bng.in.wat -> bng.wat.in 5 years ago
README.md 193302ab19 Add more resources to the Research Notes 5 years ago
bng.h 9b729eb5d1 Generate names for all possible pixel formats 5 years ago
bng.html 7bba26f4f5 Display both processed and unprocessed BNG images 5 years ago
bng.js 4f140ea498 Add TODO(#5) 5 years ago
bng.wat.in 12aa1f33c5 Add RLE decompression to bng.wasm 5 years ago
bng_test.c 0090abafb1 Separate bng_test from png2bng 5 years ago
bngviewer.c e4309fcde9 RLE_Compressed_Bng -> Bng 5 years ago
png2bng.c e4309fcde9 RLE_Compressed_Bng -> Bng 5 years ago
stb_image.h 0004d2cb29 Move everything back to the root 5 years ago
tsodinw.png 0004d2cb29 Move everything back to the root 5 years ago

README.md

Extending Native Browser Capabilities with WebAssembly

Quick Start

$ make -B
$ python -m SimpleHTTPServer 8080
$ iexplorer.exe http://localhost:8080/bng.html

Research Notes

  • Premise: Performance of WASM is probably comparable to native code
  • Idea: Let's imagine we invented a new image format that didn't exist before
    • If we implement the image support in WASM can we make it feel like a native browser support
    • Implement png2bng
    • Implement bngviewer
    • [x] Implement bng support in WASM

      • [x] fetch("tsodinw.bng"):

        fetch("./tsodinw.bng").then((x) => console.log(x.arrayBuffer()))
        
      • [x] Put the fetched file into WASM memory

        let bngFile = await fetch("tsodinw.bng");
        let fileData = await bngFile.arrayBuffer();
        let memory = new WebAssembly.Memory({initial: 10, maximum: 10});
        new Uint8Array(memory.buffer).set(new Uint8Array(fileData));
        
      • [x] Call a WASM function that turns the file into Image Data

      • [x] Take out the Image Data from WASM memory and display it

    • [x] Add more interesting features to bng to test the support

      • Different pixel formats
      • Different compressions
    • [ ] Reusable BNG library that works both natively and being compiled to WASM

    • [ ] img tag integration