diff --git a/README.mux b/README.mux index 644b9747..74d86264 100644 --- a/README.mux +++ b/README.mux @@ -133,7 +133,7 @@ WebP files. This API currently supports reading of XMP/EXIF metadata, ICC profile and animated images. Other features may be added in subsequent releases. -Code Example: Demuxing WebP data to extract all the frames, ICC profile +Code example: Demuxing WebP data to extract all the frames, ICC profile and EXIF/XMP metadata. WebPDemuxer* demux = WebPDemux(&webp_data); @@ -170,6 +170,30 @@ and EXIF/XMP metadata. For a detailed Demux API reference, please refer to the header file (src/webp/demux.h). +AnimEncoder API: +================ +The AnimEncoder API can be used to create animated WebP images. + +Code example: + + WebPAnimEncoderOptions enc_options; + WebPAnimEncoderOptionsInit(&enc_options); + // ... (Tune 'enc_options' as needed). + WebPAnimEncoder* enc = WebPAnimEncoderNew(width, height, &enc_options); + while() { + WebPConfig config; + WebPConfigInit(&config); + // ... (Tune 'config' as needed). + WebPAnimEncoderAdd(enc, frame, duration, &config); + } + WebPAnimEncoderAssemble(enc, webp_data); + WebPAnimEncoderDelete(enc); + // ... (Write the 'webp_data' to a file, or re-mux it further). + + +For a detailed AnimEncoder API reference, please refer to the header file +(src/webp/mux.h). + Bugs: ===== diff --git a/src/webp/mux.h b/src/webp/mux.h index 40ae239f..5126ad5d 100644 --- a/src/webp/mux.h +++ b/src/webp/mux.h @@ -401,8 +401,12 @@ WEBP_EXTERN(WebPMuxError) WebPMuxAssemble(WebPMux* mux, /* WebPAnimEncoderOptions enc_options; WebPAnimEncoderOptionsInit(&enc_options); + // Tune 'enc_options' as needed. WebPAnimEncoder* enc = WebPAnimEncoderNew(width, height, &enc_options); while() { + WebPConfig config; + WebPConfigInit(&config); + // Tune 'config' as needed. WebPAnimEncoderAdd(enc, frame, duration, &config); } WebPAnimEncoderAssemble(enc, webp_data);