| OLD | NEW |
| 1 // Copyright 2012 Google Inc. All Rights Reserved. | 1 // Copyright 2012 Google Inc. All Rights Reserved. |
| 2 // | 2 // |
| 3 // Use of this source code is governed by a BSD-style license | 3 // Use of this source code is governed by a BSD-style license |
| 4 // that can be found in the COPYING file in the root of the source | 4 // that can be found in the COPYING file in the root of the source |
| 5 // tree. An additional intellectual property rights grant can be found | 5 // tree. An additional intellectual property rights grant can be found |
| 6 // in the file PATENTS. All contributing project authors may | 6 // in the file PATENTS. All contributing project authors may |
| 7 // be found in the AUTHORS file in the root of the source tree. | 7 // be found in the AUTHORS file in the root of the source tree. |
| 8 // ----------------------------------------------------------------------------- | 8 // ----------------------------------------------------------------------------- |
| 9 // | 9 // |
| 10 // Data-types common to the mux and demux libraries. | 10 // Data-types common to the mux and demux libraries. |
| 11 // | 11 // |
| 12 // Author: Urvang (urvang@google.com) | 12 // Author: Urvang (urvang@google.com) |
| 13 | 13 |
| 14 #ifndef WEBP_WEBP_MUX_TYPES_H_ | 14 #ifndef WEBP_WEBP_MUX_TYPES_H_ |
| 15 #define WEBP_WEBP_MUX_TYPES_H_ | 15 #define WEBP_WEBP_MUX_TYPES_H_ |
| 16 | 16 |
| 17 #include <stdlib.h> // free() | 17 #include <stdlib.h> // free() |
| 18 #include <string.h> // memset() | 18 #include <string.h> // memset() |
| 19 #include "./types.h" | 19 #include "./types.h" |
| 20 | 20 |
| 21 #if defined(__cplusplus) || defined(c_plusplus) | 21 #if defined(__cplusplus) || defined(c_plusplus) |
| 22 extern "C" { | 22 extern "C" { |
| 23 #endif | 23 #endif |
| 24 | 24 |
| 25 // Note: forward declaring enumerations is not allowed in (strict) C and C++, | 25 // Note: forward declaring enumerations is not allowed in (strict) C and C++, |
| 26 // the types are left here for reference. | 26 // the types are left here for reference. |
| 27 // typedef enum WebPFeatureFlags WebPFeatureFlags; | 27 // typedef enum WebPFeatureFlags WebPFeatureFlags; |
| 28 // typedef enum WebPMuxAnimDispose WebPMuxAnimDispose; | 28 // typedef enum WebPMuxAnimDispose WebPMuxAnimDispose; |
| 29 // typedef enum WebPMuxAnimBlend WebPMuxAnimBlend; |
| 29 typedef struct WebPData WebPData; | 30 typedef struct WebPData WebPData; |
| 30 | 31 |
| 31 // VP8X Feature Flags. | 32 // VP8X Feature Flags. |
| 32 typedef enum WebPFeatureFlags { | 33 typedef enum WebPFeatureFlags { |
| 33 FRAGMENTS_FLAG = 0x00000001, | 34 FRAGMENTS_FLAG = 0x00000001, |
| 34 ANIMATION_FLAG = 0x00000002, | 35 ANIMATION_FLAG = 0x00000002, |
| 35 XMP_FLAG = 0x00000004, | 36 XMP_FLAG = 0x00000004, |
| 36 EXIF_FLAG = 0x00000008, | 37 EXIF_FLAG = 0x00000008, |
| 37 ALPHA_FLAG = 0x00000010, | 38 ALPHA_FLAG = 0x00000010, |
| 38 ICCP_FLAG = 0x00000020 | 39 ICCP_FLAG = 0x00000020 |
| 39 } WebPFeatureFlags; | 40 } WebPFeatureFlags; |
| 40 | 41 |
| 41 // Dispose method (animation only). Indicates how the area used by the current | 42 // Dispose method (animation only). Indicates how the area used by the current |
| 42 // frame is to be treated before rendering the next frame on the canvas. | 43 // frame is to be treated before rendering the next frame on the canvas. |
| 43 typedef enum WebPMuxAnimDispose { | 44 typedef enum WebPMuxAnimDispose { |
| 44 WEBP_MUX_DISPOSE_NONE, // Do not dispose. | 45 WEBP_MUX_DISPOSE_NONE, // Do not dispose. |
| 45 WEBP_MUX_DISPOSE_BACKGROUND // Dispose to background color. | 46 WEBP_MUX_DISPOSE_BACKGROUND // Dispose to background color. |
| 46 } WebPMuxAnimDispose; | 47 } WebPMuxAnimDispose; |
| 47 | 48 |
| 49 // Blend operation (animation only). Indicates how transparent pixels of the |
| 50 // current frame are blended with those of the previous canvas. |
| 51 typedef enum WebPMuxAnimBlend { |
| 52 WEBP_MUX_BLEND, // Blend. |
| 53 WEBP_MUX_NO_BLEND // Do not blend. |
| 54 } WebPMuxAnimBlend; |
| 55 |
| 48 // Data type used to describe 'raw' data, e.g., chunk data | 56 // Data type used to describe 'raw' data, e.g., chunk data |
| 49 // (ICC profile, metadata) and WebP compressed image data. | 57 // (ICC profile, metadata) and WebP compressed image data. |
| 50 struct WebPData { | 58 struct WebPData { |
| 51 const uint8_t* bytes; | 59 const uint8_t* bytes; |
| 52 size_t size; | 60 size_t size; |
| 53 }; | 61 }; |
| 54 | 62 |
| 55 // Initializes the contents of the 'webp_data' object with default values. | 63 // Initializes the contents of the 'webp_data' object with default values. |
| 56 static WEBP_INLINE void WebPDataInit(WebPData* webp_data) { | 64 static WEBP_INLINE void WebPDataInit(WebPData* webp_data) { |
| 57 if (webp_data != NULL) { | 65 if (webp_data != NULL) { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 80 dst->size = src->size; | 88 dst->size = src->size; |
| 81 } | 89 } |
| 82 return 1; | 90 return 1; |
| 83 } | 91 } |
| 84 | 92 |
| 85 #if defined(__cplusplus) || defined(c_plusplus) | 93 #if defined(__cplusplus) || defined(c_plusplus) |
| 86 } // extern "C" | 94 } // extern "C" |
| 87 #endif | 95 #endif |
| 88 | 96 |
| 89 #endif /* WEBP_WEBP_MUX_TYPES_H_ */ | 97 #endif /* WEBP_WEBP_MUX_TYPES_H_ */ |
| OLD | NEW |