mirror of
https://github.com/webmproject/libwebp.git
synced 2024-11-19 20:08:28 +01:00
AnimEncoder API: Add info in README.mux
Also, add code snippet for WebPConfig in the example. Change-Id: Ia50222690d0e2a84bdc5e9bf362675902a810f22
This commit is contained in:
parent
d581ba40ba
commit
9d299469d2
26
README.mux
26
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(<there are more frames>) {
|
||||
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:
|
||||
=====
|
||||
|
@ -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(<there are more frames>) {
|
||||
WebPConfig config;
|
||||
WebPConfigInit(&config);
|
||||
// Tune 'config' as needed.
|
||||
WebPAnimEncoderAdd(enc, frame, duration, &config);
|
||||
}
|
||||
WebPAnimEncoderAssemble(enc, webp_data);
|
||||
|
Loading…
Reference in New Issue
Block a user