README: cosmetics

- update swig function references
- remove references to decode_vp8.h (no longer installed)
- add lossless references
- some grammar/spelling changes

Change-Id: Icebfbcf6f638762f42d844b6bd3c0129c64d9340
This commit is contained in:
James Zern 2012-07-19 11:40:42 -07:00
parent 3e5bbe1c2e
commit c37c23e594

57
README
View File

@ -49,11 +49,13 @@ will build the binaries examples/cwebp and examples/dwebp, along
with the static library src/libwebp.a. No system-wide installation with the static library src/libwebp.a. No system-wide installation
is supplied, as this is a simple alternative to the full installation is supplied, as this is a simple alternative to the full installation
system based on the autoconf tools (see below). system based on the autoconf tools (see below).
Please refer the makefile.unix for additional details and customizations. Please refer to the makefile.unix for additional details and customizations.
Using autoconf tools: Using autoconf tools:
--------------------- ---------------------
./autogen.sh When building from git sources, you will need to run autogen.sh to generate the
configure script.
./configure ./configure
make make
make install make install
@ -61,7 +63,6 @@ make install
should be all you need to have the following files should be all you need to have the following files
/usr/local/include/webp/decode.h /usr/local/include/webp/decode.h
/usr/local/include/webp/decode_vp8.h
/usr/local/include/webp/encode.h /usr/local/include/webp/encode.h
/usr/local/include/webp/types.h /usr/local/include/webp/types.h
/usr/local/lib/libwebp.* /usr/local/lib/libwebp.*
@ -85,17 +86,22 @@ Currently the following functions are mapped:
Decode: Decode:
WebPGetDecoderVersion WebPGetDecoderVersion
WebPGetInfo WebPGetInfo
WebPDecodeRGB
WebPDecodeRGBA WebPDecodeRGBA
WebPDecodeARGB WebPDecodeARGB
WebPDecodeBGR
WebPDecodeBGRA WebPDecodeBGRA
WebPDecodeBGR
WebPDecodeRGB
Encode: Encode:
WebPGetEncoderVersion WebPGetEncoderVersion
WebPEncodeRGB
WebPEncodeRGBA WebPEncodeRGBA
WebPEncodeBGR
WebPEncodeBGRA WebPEncodeBGRA
WebPEncodeRGB
WebPEncodeBGR
WebPEncodeLosslessRGBA
WebPEncodeLosslessBGRA
WebPEncodeLosslessRGB
WebPEncodeLosslessBGR
Java bindings: Java bindings:
@ -111,9 +117,13 @@ decoding (dwebp) images.
The easiest use should look like: The easiest use should look like:
cwebp input.png -q 80 -o output.webp cwebp input.png -q 80 -o output.webp
which will convert the input PNG or JPEG file to a WebP file using a which will convert the input file to a WebP file using a quality factor of 80
quality factor of 80 on a 0->100 scale (0 being the lowest quality, on a 0->100 scale (0 being the lowest quality, 100 being the best. Default
100 being the best. Default value is 75). value is 75).
You might want to try the -lossless flag too, which will compress the source
(in RGBA format) without any loss. The -q quality parameter will in this case
control the amount of processing time spent trying to make the output file as
small as possible.
A longer list of options is available using the -longhelp command line flag: A longer list of options is available using the -longhelp command line flag:
@ -192,10 +202,11 @@ Namely:
but with better quality. but with better quality.
Typical value is around '75'. Typical value is around '75'.
* 'f' option directly links to the filtering strength used by the codec's * 'f' option directly links to the filtering strength used by the codec's
in-loop processing. The higher, the smoother will highly-compressed area in-loop processing. The higher the value, the smoother the
look. This is particularly useful when aiming at very small files. highly-compressed area will look. This is particularly useful when aiming
Typical values are around 20-30. Note that using the option -strong will at very small files. Typical values are around 20-30. Note that using the
change the type of filtering. Use "-f 0" to turn filtering off. option -strong will change the type of filtering. Use "-f 0" to turn
filtering off.
* 'm' controls the trade-off between encoding speed and quality. Default is 4. * 'm' controls the trade-off between encoding speed and quality. Default is 4.
You can try -m 5 or -m 6 to explore more (time-consuming) encoding You can try -m 5 or -m 6 to explore more (time-consuming) encoding
possibilities. A lower value will result in faster encoding at the expense possibilities. A lower value will result in faster encoding at the expense
@ -342,20 +353,18 @@ This is mainly just one function to call:
#include "webp/decode.h" #include "webp/decode.h"
uint8_t* WebPDecodeRGB(const uint8_t* data, size_t data_size, uint8_t* WebPDecodeRGB(const uint8_t* data, size_t data_size,
int *width, int *height); int* width, int* height);
Please have a look at the file src/webp/decode.h for the details. Please have a look at the file src/webp/decode.h for the details.
There are variants for decoding in BGR/RGBA/ARGB/BGRA order, along with There are variants for decoding in BGR/RGBA/ARGB/BGRA order, along with
decoding to raw Y'CbCr samples. One can also decode the image directly into a decoding to raw Y'CbCr samples. One can also decode the image directly into a
pre-allocated buffer. pre-allocated buffer.
To detect a WebP file and gather picture's dimensions, the function: To detect a WebP file and gather the picture's dimensions, the function:
int WebPGetInfo(const uint8_t* data, size_t data_size, int WebPGetInfo(const uint8_t* data, size_t data_size,
int *width, int *height); int* width, int* height);
is supplied. No decoding is involved when using it. is supplied. No decoding is involved when using it.
A lower-level API is available from the header file <webp/decode_vp8.h>
Incremental decoding API: Incremental decoding API:
========================= =========================
@ -383,15 +392,15 @@ or by just mentioning the new size of the transmitted data:
WebPIUpdate(idec, buffer, size_of_transmitted_buffer); WebPIUpdate(idec, buffer, size_of_transmitted_buffer);
Note that 'buffer' can be modified between each calls to WebPIUpdate, in Note that 'buffer' can be modified between each call to WebPIUpdate, in
particular when the buffer is resized to accommodate larger data. particular when the buffer is resized to accommodate larger data.
These functions will return the decoding status: either VP8_STATUS_SUSPENDED if These functions will return the decoding status: either VP8_STATUS_SUSPENDED if
decoding is not finished yet, or VP8_STATUS_OK when decoding is done. decoding is not finished yet or VP8_STATUS_OK when decoding is done. Any other
Any other status is an error condition. status is an error condition.
The idec object must always be released (even upon an error condition) The 'idec' object must always be released (even upon an error condition) by
by calling: WebPDelete(idec). calling: WebPDelete(idec).
To retrieve partially decoded picture samples, one must use the corresponding To retrieve partially decoded picture samples, one must use the corresponding
method: WebPIDecGetRGB or WebPIDecGetYUV. method: WebPIDecGetRGB or WebPIDecGetYUV.