mirror of
https://github.com/webmproject/libwebp.git
synced 2025-02-13 07:22:52 +01:00
README.mux: add info about Demux API and vwebp
Also use a naming 'extended format' rather than 'container file' to be consistent with the container specification. Change-Id: I3b07f95e0244d3534fe17b03f60db22f61e17836
This commit is contained in:
parent
c0ba090335
commit
5f557f3c1b
88
README.mux
88
README.mux
@ -7,17 +7,18 @@
|
|||||||
Description:
|
Description:
|
||||||
============
|
============
|
||||||
|
|
||||||
WebP Mux: library to create a WebP container object for features like
|
WebPMux: set of two libraries 'Mux' and 'Demux' for creation, extraction and
|
||||||
color profile, metadata, animation and fragmented images. A reference command
|
manipulation of an extended format WebP file, which can have features like
|
||||||
line tool 'webpmux' and WebP container specification
|
color profile, metadata, animation and fragmented images. Reference
|
||||||
'doc/webp-container-spec.txt' are also provided in this package.
|
command-line tools 'webpmux' and 'vwebp' as well as the WebP container
|
||||||
|
specification 'doc/webp-container-spec.txt' are also provided in this package.
|
||||||
|
|
||||||
WebP Mux tool:
|
WebP Mux tool:
|
||||||
==============
|
==============
|
||||||
|
|
||||||
The examples/ directory contains a tool (webpmux) for manipulating WebP
|
The examples/ directory contains a tool (webpmux) for manipulating WebP
|
||||||
files. The webpmux tool can be used to create a WebP container file and to
|
files. The webpmux tool can be used to create an extended format WebP file and
|
||||||
extract or strip relevant data from the container file.
|
also to extract or strip relevant data from such a file.
|
||||||
|
|
||||||
A list of options is available using the -help command line flag:
|
A list of options is available using the -help command line flag:
|
||||||
|
|
||||||
@ -84,12 +85,29 @@ INPUT & OUTPUT are in WebP format.
|
|||||||
Note: The nature of EXIF, XMP and ICC data is not checked and is assumed to be
|
Note: The nature of EXIF, XMP and ICC data is not checked and is assumed to be
|
||||||
valid.
|
valid.
|
||||||
|
|
||||||
WebP Mux API:
|
WebP viewer tool:
|
||||||
==============
|
================
|
||||||
The WebP Mux API contains methods for adding data to and reading data from
|
|
||||||
WebPMux (a WebP container object). This API currently supports XMP/EXIF
|
The examples/ directory also contains a tool (vwebp) for viewing WebP files.
|
||||||
metadata, ICC profile, animation and fragmented images. Other features
|
It decodes the image and visualizes it using OpenGL.
|
||||||
will be added in subsequent releases.
|
|
||||||
|
A list of options is available using the -h command line flag:
|
||||||
|
|
||||||
|
> vwebp -h
|
||||||
|
Decodes the WebP image file and visualize it using OpenGL
|
||||||
|
Options are:
|
||||||
|
-version .... print version number and exit.
|
||||||
|
-nofancy ..... don't use the fancy YUV420 upscaler.
|
||||||
|
-nofilter .... disable in-loop filtering.
|
||||||
|
-mt .......... use multi-threading
|
||||||
|
-info ........ print info.
|
||||||
|
-h ....... this help message.
|
||||||
|
|
||||||
|
Mux API:
|
||||||
|
========
|
||||||
|
The Mux API contains methods for adding data to and reading data from WebP
|
||||||
|
files. This API currently supports XMP/EXIF metadata, ICC profile, animation
|
||||||
|
and fragmented images. Other features may be added in subsequent releases.
|
||||||
|
|
||||||
Example#1 (pseudo code): Creating a WebPMux object with image data, color
|
Example#1 (pseudo code): Creating a WebPMux object with image data, color
|
||||||
profile and XMP metadata.
|
profile and XMP metadata.
|
||||||
@ -122,7 +140,51 @@ Example#2 (pseudo code): Get image and color profile data from a WebP file.
|
|||||||
free(data);
|
free(data);
|
||||||
|
|
||||||
|
|
||||||
For detailed Mux API reference, please refer to the header file (src/webp/mux.h)
|
For a detailed Mux API reference, please refer to the header file
|
||||||
|
(src/webp/mux.h).
|
||||||
|
|
||||||
|
Demux API:
|
||||||
|
=========
|
||||||
|
The Demux API enables extraction of images and extended format data from
|
||||||
|
WebP files. This API currently supports reading of XMP/EXIF metadata, ICC
|
||||||
|
profile, animation and fragmented images. Other features may be added in
|
||||||
|
subsequent releases.
|
||||||
|
|
||||||
|
Code Example: Demuxing WebP data to extract all the frames, ICC profile
|
||||||
|
and EXIF/XMP metadata.
|
||||||
|
|
||||||
|
WebPDemuxer* demux = WebPDemux(&webp_data);
|
||||||
|
uint32_t width = WebPDemuxGetI(demux, WEBP_FF_CANVAS_WIDTH);
|
||||||
|
uint32_t height = WebPDemuxGetI(demux, WEBP_FF_CANVAS_HEIGHT);
|
||||||
|
// ... (Get information about the features present in the WebP file).
|
||||||
|
uint32_t flags = WebPDemuxGetI(demux, WEBP_FF_FORMAT_FLAGS);
|
||||||
|
|
||||||
|
// ... (Iterate over all frames).
|
||||||
|
WebPIterator iter;
|
||||||
|
if (WebPDemuxGetFrame(demux, 1, &iter)) {
|
||||||
|
do {
|
||||||
|
// ... (Consume 'iter'; e.g. Decode 'iter.fragment' with WebPDecode(),
|
||||||
|
// ... and get other frame properties like width, height, offsets etc.
|
||||||
|
// ... see 'struct WebPIterator' below for more info).
|
||||||
|
} while (WebPDemuxNextFrame(&iter));
|
||||||
|
WebPDemuxReleaseIterator(&iter);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ... (Extract metadata).
|
||||||
|
WebPChunkIterator chunk_iter;
|
||||||
|
if (flags & ICCP_FLAG) WebPDemuxGetChunk(demux, "ICCP", 1, &chunk_iter);
|
||||||
|
// ... (Consume the ICC profile in 'chunk_iter.chunk').
|
||||||
|
if (flags & EXIF_FLAG) WebPDemuxGetChunk(demux, "EXIF", 1, &chunk_iter);
|
||||||
|
// ... (Consume the EXIF metadata in 'chunk_iter.chunk').
|
||||||
|
if (flags & XMP_FLAG) WebPDemuxGetChunk(demux, "XMP ", 1, &chunk_iter);
|
||||||
|
// ... (Consume the XMP metadata in 'chunk_iter.chunk').
|
||||||
|
WebPDemuxReleaseChunkIterator(&chunk_iter);
|
||||||
|
WebPDemuxDelete(demux);
|
||||||
|
|
||||||
|
|
||||||
|
For a detailed Demux API reference, please refer to the header file
|
||||||
|
(src/webp/demux.h).
|
||||||
|
|
||||||
|
|
||||||
Bugs:
|
Bugs:
|
||||||
=====
|
=====
|
||||||
|
Loading…
x
Reference in New Issue
Block a user