Files
squoosh/codecs/webp_enc
2018-06-14 13:32:05 +01:00
..
2018-06-14 13:32:05 +01:00
2018-06-13 23:40:24 +01:00
2018-06-14 13:32:05 +01:00
2018-05-29 15:39:46 +02:00
2018-06-14 13:32:05 +01:00
2018-06-14 13:32:05 +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.