Files
squoosh/codecs/webp_enc
Jake Archibald 1ae65dd4a1 Mozjpeg opts (#140)
* Switching to embind

* Adding options to mozjpeg wasm

* Updating packages

* Ditching enum - causing more problems than it's worth

* Adding mozjpeg options UI

* Forgot about this enum

* Bools just work
2018-08-17 16:25:28 +01:00
..
2018-07-27 14:06:45 +01:00
2018-06-13 23:40:24 +01:00
2018-08-17 16:25:28 +01:00
2018-05-29 15:39:46 +02:00
2018-07-27 14:06:45 +01:00
2018-07-27 14:06:45 +01:00
2018-07-27 14:06:45 +01:00
2018-07-27 14:06:45 +01:00

WebP encoder

Dependencies

  • Docker

Example

See example.html

API

int version()

Returns the version of libwebp as a number. va.b.c is encoded as 0x0a0b0c

uint8_t* create_buffer(int width, int height)

Allocates an RGBA buffer for an image with the given dimension.

void destroy_buffer(uint8_t* p)

Frees a buffer created with create_buffer.

void encode(uint8_t* image_buffer, int image_width, int image_height, float quality)

Encodes the given image with given dimension to WebP. quality is a number between 0 and 100. The higher the number, the better the quality of the encoded image. The result is implicitly stored and can be accessed using the get_result_*() functions.

void free_result()

Frees the result created by encode().

int get_result_pointer()

Returns the pointer to the start of the buffer holding the encoded data.

int get_result_size()

Returns the length of the buffer holding the encoded data.