Coder Social home page Coder Social logo

wasm-webp's Introduction

Wasm-Webp

Web Assembly - WebP Client Encoding

functional example according this article: https://developers.google.com/web/updates/2018/03/emscripting-a-c-library

Requirements:

Emscripten

http://kripken.github.io/emscripten-site/docs/getting_started/downloads.html

LibwebP

https://github.com/webmproject/libwebp

c code of exported functions under "c" library in the project

compile command:

sudo emcc -O1 -s WASM=1 -s EXTRA_EXPORTED_RUNTIME_METHODS='["cwrap"]' -s ALLOW_MEMORY_GROWTH=1 -I libwebp webp.c libwebp/src/{dec,dsp,demux,enc,mux,utils}/*.c

Javascript c functions signatures:

 api = {
       version: Module.cwrap('version', 'number', []),
       create_buffer: Module.cwrap('create_buffer', 'number', ['number', 'number']),
       destroy_buffer: Module.cwrap('destroy_buffer', '', ['number']),
       encode: Module.cwrap('encode', '', ['number', 'number', 'number', 'number']),
       get_result_pointer: Module.cwrap('get_result_pointer', 'number', ''),
       get_result_size: Module.cwrap('get_result_size', 'number', ''),
       free_result: Module.cwrap('free_result', '', ['number']),
 };

wasm-webp's People

Contributors

proxytype avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.