mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-27 06:08:21 +01:00
Merge "AnimEncoder API: Add info in README.mux"
This commit is contained in:
commit
07c39559ea
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