| Index: third_party/libwebp/webp/encode.h
|
| diff --git a/third_party/libwebp/webp/encode.h b/third_party/libwebp/webp/encode.h
|
| index fea8ee428de64a56e3d3b401bb315960a51b5b14..726992f570474e2f19ce903534bc37936c844b15 100644
|
| --- a/third_party/libwebp/webp/encode.h
|
| +++ b/third_party/libwebp/webp/encode.h
|
| @@ -1,8 +1,10 @@
|
| // Copyright 2011 Google Inc. All Rights Reserved.
|
| //
|
| -// This code is licensed under the same terms as WebM:
|
| -// Software License Agreement: http://www.webmproject.org/license/software/
|
| -// Additional IP Rights Grant: http://www.webmproject.org/license/additional/
|
| +// Use of this source code is governed by a BSD-style license
|
| +// that can be found in the COPYING file in the root of the source
|
| +// tree. An additional intellectual property rights grant can be found
|
| +// in the file PATENTS. All contributing project authors may
|
| +// be found in the AUTHORS file in the root of the source tree.
|
| // -----------------------------------------------------------------------------
|
| //
|
| // WebP encoder: main interface
|
| @@ -20,12 +22,12 @@ extern "C" {
|
|
|
| #define WEBP_ENCODER_ABI_VERSION 0x0201 // MAJOR(8b) + MINOR(8b)
|
|
|
| -#if !(defined(__cplusplus) || defined(c_plusplus))
|
| -typedef enum WebPImageHint WebPImageHint;
|
| -typedef enum WebPEncCSP WebPEncCSP;
|
| -typedef enum WebPPreset WebPPreset;
|
| -typedef enum WebPEncodingError WebPEncodingError;
|
| -#endif
|
| +// Note: forward declaring enumerations is not allowed in (strict) C and C++,
|
| +// the types are left here for reference.
|
| +// typedef enum WebPImageHint WebPImageHint;
|
| +// typedef enum WebPEncCSP WebPEncCSP;
|
| +// typedef enum WebPPreset WebPPreset;
|
| +// typedef enum WebPEncodingError WebPEncodingError;
|
| typedef struct WebPConfig WebPConfig;
|
| typedef struct WebPPicture WebPPicture; // main structure for I/O
|
| typedef struct WebPAuxStats WebPAuxStats;
|
| @@ -77,13 +79,13 @@ WEBP_EXTERN(size_t) WebPEncodeLosslessBGRA(const uint8_t* bgra,
|
| // Coding parameters
|
|
|
| // Image characteristics hint for the underlying encoder.
|
| -enum WebPImageHint {
|
| +typedef enum WebPImageHint {
|
| WEBP_HINT_DEFAULT = 0, // default preset.
|
| WEBP_HINT_PICTURE, // digital picture, like portrait, inner shot
|
| WEBP_HINT_PHOTO, // outdoor photograph, with natural lighting
|
| WEBP_HINT_GRAPH, // Discrete tone image (graph, map-tile etc).
|
| WEBP_HINT_LAST
|
| -};
|
| +} WebPImageHint;
|
|
|
| // Compression parameters.
|
| struct WebPConfig {
|
| @@ -133,14 +135,14 @@ struct WebPConfig {
|
|
|
| // Enumerate some predefined settings for WebPConfig, depending on the type
|
| // of source picture. These presets are used when calling WebPConfigPreset().
|
| -enum WebPPreset {
|
| +typedef enum WebPPreset {
|
| WEBP_PRESET_DEFAULT = 0, // default preset.
|
| WEBP_PRESET_PICTURE, // digital picture, like portrait, inner shot
|
| WEBP_PRESET_PHOTO, // outdoor photograph, with natural lighting
|
| WEBP_PRESET_DRAWING, // hand or line drawing, with high-contrast details
|
| WEBP_PRESET_ICON, // small-sized colorful images
|
| WEBP_PRESET_TEXT // text-like
|
| -};
|
| +} WebPPreset;
|
|
|
| // Internal, version-checked, entry point
|
| WEBP_EXTERN(int) WebPConfigInitInternal(WebPConfig*, WebPPreset, float, int);
|
| @@ -230,7 +232,7 @@ WEBP_EXTERN(int) WebPMemoryWrite(const uint8_t* data, size_t data_size,
|
| typedef int (*WebPProgressHook)(int percent, const WebPPicture* picture);
|
|
|
| // Color spaces.
|
| -enum WebPEncCSP {
|
| +typedef enum WebPEncCSP {
|
| // chroma sampling
|
| WEBP_YUV420 = 0, // 4:2:0
|
| WEBP_YUV422 = 1, // 4:2:2
|
| @@ -243,10 +245,10 @@ enum WebPEncCSP {
|
| WEBP_YUV444A = 6,
|
| WEBP_YUV400A = 7, // grayscale + alpha
|
| WEBP_CSP_ALPHA_BIT = 4 // bit that is set if alpha is present
|
| -};
|
| +} WebPEncCSP;
|
|
|
| // Encoding error conditions.
|
| -enum WebPEncodingError {
|
| +typedef enum WebPEncodingError {
|
| VP8_ENC_OK = 0,
|
| VP8_ENC_ERROR_OUT_OF_MEMORY, // memory error allocating objects
|
| VP8_ENC_ERROR_BITSTREAM_OUT_OF_MEMORY, // memory error while flushing bits
|
| @@ -259,7 +261,7 @@ enum WebPEncodingError {
|
| VP8_ENC_ERROR_FILE_TOO_BIG, // file is bigger than 4G
|
| VP8_ENC_ERROR_USER_ABORT, // abort request by user
|
| VP8_ENC_ERROR_LAST // list terminator. always last.
|
| -};
|
| +} WebPEncodingError;
|
|
|
| // maximum width/height allowed (inclusive), in pixels
|
| #define WEBP_MAX_DIMENSION 16383
|
| @@ -360,8 +362,9 @@ WEBP_EXTERN(int) WebPPictureAlloc(WebPPicture* picture);
|
| // preserved.
|
| WEBP_EXTERN(void) WebPPictureFree(WebPPicture* picture);
|
|
|
| -// Copy the pixels of *src into *dst, using WebPPictureAlloc. Upon return,
|
| -// *dst will fully own the copied pixels (this is not a view).
|
| +// Copy the pixels of *src into *dst, using WebPPictureAlloc. Upon return, *dst
|
| +// will fully own the copied pixels (this is not a view). The 'dst' picture need
|
| +// not be initialized as its content is overwritten.
|
| // Returns false in case of memory allocation error.
|
| WEBP_EXTERN(int) WebPPictureCopy(const WebPPicture* src, WebPPicture* dst);
|
|
|
| @@ -392,7 +395,9 @@ WEBP_EXTERN(int) WebPPictureCrop(WebPPicture* picture,
|
| // the top and left coordinates will be snapped to even values.
|
| // Picture 'src' must out-live 'dst' picture. Self-extraction of view is allowed
|
| // ('src' equal to 'dst') as a mean of fast-cropping (but note that doing so,
|
| -// the original dimension will be lost).
|
| +// the original dimension will be lost). Picture 'dst' need not be initialized
|
| +// with WebPPictureInit() if it is different from 'src', since its content will
|
| +// be overwritten.
|
| // Returns false in case of memory allocation error or invalid parameters.
|
| WEBP_EXTERN(int) WebPPictureView(const WebPPicture* src,
|
| int left, int top, int width, int height,
|
|
|