README.mux: add a reference to the AnimDecoder API

this balances the AnimEncoder section

Change-Id: I205c8d0bd6104509e06737dcbf9a7651fd4bc6a3
This commit is contained in:
James Zern 2018-11-06 18:47:38 -08:00
parent 3be698c3d3
commit 825389acba

View File

@ -211,6 +211,35 @@ Code example:
For a detailed AnimEncoder API reference, please refer to the header file For a detailed AnimEncoder API reference, please refer to the header file
(src/webp/mux.h). (src/webp/mux.h).
AnimDecoder API:
================
This AnimDecoder API allows decoding (possibly) animated WebP images.
Code Example:
WebPAnimDecoderOptions dec_options;
WebPAnimDecoderOptionsInit(&dec_options);
// Tune 'dec_options' as needed.
WebPAnimDecoder* dec = WebPAnimDecoderNew(webp_data, &dec_options);
WebPAnimInfo anim_info;
WebPAnimDecoderGetInfo(dec, &anim_info);
for (uint32_t i = 0; i < anim_info.loop_count; ++i) {
while (WebPAnimDecoderHasMoreFrames(dec)) {
uint8_t* buf;
int timestamp;
WebPAnimDecoderGetNext(dec, &buf, &timestamp);
// ... (Render 'buf' based on 'timestamp').
// ... (Do NOT free 'buf', as it is owned by 'dec').
}
WebPAnimDecoderReset(dec);
}
const WebPDemuxer* demuxer = WebPAnimDecoderGetDemuxer(dec);
// ... (Do something using 'demuxer'; e.g. get EXIF/XMP/ICC data).
WebPAnimDecoderDelete(dec);
For a detailed AnimDecoder API reference, please refer to the header file
(src/webp/demux.h).
Bugs: Bugs:
===== =====