@cpp.js/package-webp 1.0.0-beta.24 → 2.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +1 -1
  3. package/cppjs.config.js +12 -11
  4. package/package.json +8 -12
  5. package/dist/prebuilt/Android-arm64-v8a/include/webp/decode.h +0 -506
  6. package/dist/prebuilt/Android-arm64-v8a/include/webp/demux.h +0 -367
  7. package/dist/prebuilt/Android-arm64-v8a/include/webp/encode.h +0 -557
  8. package/dist/prebuilt/Android-arm64-v8a/include/webp/mux.h +0 -591
  9. package/dist/prebuilt/Android-arm64-v8a/include/webp/mux_types.h +0 -99
  10. package/dist/prebuilt/Android-arm64-v8a/include/webp/sharpyuv/sharpyuv.h +0 -172
  11. package/dist/prebuilt/Android-arm64-v8a/include/webp/sharpyuv/sharpyuv_csp.h +0 -60
  12. package/dist/prebuilt/Android-arm64-v8a/include/webp/types.h +0 -93
  13. package/dist/prebuilt/Android-arm64-v8a/lib/libsharpyuv.la +0 -41
  14. package/dist/prebuilt/Android-arm64-v8a/lib/libsharpyuv.so +0 -0
  15. package/dist/prebuilt/Android-arm64-v8a/lib/libwebp.la +0 -41
  16. package/dist/prebuilt/Android-arm64-v8a/lib/libwebp.so +0 -0
  17. package/dist/prebuilt/Android-arm64-v8a/lib/libwebpdemux.la +0 -41
  18. package/dist/prebuilt/Android-arm64-v8a/lib/libwebpdemux.so +0 -0
  19. package/dist/prebuilt/Android-arm64-v8a/lib/libwebpmux.la +0 -41
  20. package/dist/prebuilt/Android-arm64-v8a/lib/libwebpmux.so +0 -0
  21. package/dist/prebuilt/Android-arm64-v8a/lib/pkgconfig/libsharpyuv.pc +0 -11
  22. package/dist/prebuilt/Android-arm64-v8a/lib/pkgconfig/libwebp.pc +0 -12
  23. package/dist/prebuilt/Android-arm64-v8a/lib/pkgconfig/libwebpdemux.pc +0 -11
  24. package/dist/prebuilt/Android-arm64-v8a/lib/pkgconfig/libwebpmux.pc +0 -12
  25. package/dist/prebuilt/Android-arm64-v8a/share/man/man1/cwebp.1 +0 -332
  26. package/dist/prebuilt/Android-arm64-v8a/share/man/man1/dwebp.1 +0 -150
  27. package/dist/prebuilt/Android-arm64-v8a/share/man/man1/img2webp.1 +0 -117
  28. package/dist/prebuilt/Android-arm64-v8a/share/man/man1/webpinfo.1 +0 -80
  29. package/dist/prebuilt/Android-arm64-v8a/share/man/man1/webpmux.1 +0 -271
  30. package/dist/prebuilt/Android-x86_64/include/webp/decode.h +0 -506
  31. package/dist/prebuilt/Android-x86_64/include/webp/demux.h +0 -367
  32. package/dist/prebuilt/Android-x86_64/include/webp/encode.h +0 -557
  33. package/dist/prebuilt/Android-x86_64/include/webp/mux.h +0 -591
  34. package/dist/prebuilt/Android-x86_64/include/webp/mux_types.h +0 -99
  35. package/dist/prebuilt/Android-x86_64/include/webp/sharpyuv/sharpyuv.h +0 -172
  36. package/dist/prebuilt/Android-x86_64/include/webp/sharpyuv/sharpyuv_csp.h +0 -60
  37. package/dist/prebuilt/Android-x86_64/include/webp/types.h +0 -93
  38. package/dist/prebuilt/Android-x86_64/lib/libsharpyuv.la +0 -41
  39. package/dist/prebuilt/Android-x86_64/lib/libsharpyuv.so +0 -0
  40. package/dist/prebuilt/Android-x86_64/lib/libwebp.la +0 -41
  41. package/dist/prebuilt/Android-x86_64/lib/libwebp.so +0 -0
  42. package/dist/prebuilt/Android-x86_64/lib/libwebpdemux.la +0 -41
  43. package/dist/prebuilt/Android-x86_64/lib/libwebpdemux.so +0 -0
  44. package/dist/prebuilt/Android-x86_64/lib/libwebpmux.la +0 -41
  45. package/dist/prebuilt/Android-x86_64/lib/libwebpmux.so +0 -0
  46. package/dist/prebuilt/Android-x86_64/lib/pkgconfig/libsharpyuv.pc +0 -11
  47. package/dist/prebuilt/Android-x86_64/lib/pkgconfig/libwebp.pc +0 -12
  48. package/dist/prebuilt/Android-x86_64/lib/pkgconfig/libwebpdemux.pc +0 -11
  49. package/dist/prebuilt/Android-x86_64/lib/pkgconfig/libwebpmux.pc +0 -12
  50. package/dist/prebuilt/Android-x86_64/share/man/man1/cwebp.1 +0 -332
  51. package/dist/prebuilt/Android-x86_64/share/man/man1/dwebp.1 +0 -150
  52. package/dist/prebuilt/Android-x86_64/share/man/man1/img2webp.1 +0 -117
  53. package/dist/prebuilt/Android-x86_64/share/man/man1/webpinfo.1 +0 -80
  54. package/dist/prebuilt/Android-x86_64/share/man/man1/webpmux.1 +0 -271
  55. package/dist/prebuilt/CMakeLists.txt +0 -44
  56. package/dist/prebuilt/Emscripten-x86_64/include/webp/decode.h +0 -506
  57. package/dist/prebuilt/Emscripten-x86_64/include/webp/demux.h +0 -367
  58. package/dist/prebuilt/Emscripten-x86_64/include/webp/encode.h +0 -557
  59. package/dist/prebuilt/Emscripten-x86_64/include/webp/mux.h +0 -591
  60. package/dist/prebuilt/Emscripten-x86_64/include/webp/mux_types.h +0 -99
  61. package/dist/prebuilt/Emscripten-x86_64/include/webp/sharpyuv/sharpyuv.h +0 -172
  62. package/dist/prebuilt/Emscripten-x86_64/include/webp/sharpyuv/sharpyuv_csp.h +0 -60
  63. package/dist/prebuilt/Emscripten-x86_64/include/webp/types.h +0 -93
  64. package/dist/prebuilt/Emscripten-x86_64/lib/libsharpyuv.a +0 -0
  65. package/dist/prebuilt/Emscripten-x86_64/lib/libsharpyuv.la +0 -41
  66. package/dist/prebuilt/Emscripten-x86_64/lib/libwebp.a +0 -0
  67. package/dist/prebuilt/Emscripten-x86_64/lib/libwebp.la +0 -41
  68. package/dist/prebuilt/Emscripten-x86_64/lib/libwebpdemux.a +0 -0
  69. package/dist/prebuilt/Emscripten-x86_64/lib/libwebpdemux.la +0 -41
  70. package/dist/prebuilt/Emscripten-x86_64/lib/libwebpmux.a +0 -0
  71. package/dist/prebuilt/Emscripten-x86_64/lib/libwebpmux.la +0 -41
  72. package/dist/prebuilt/Emscripten-x86_64/lib/pkgconfig/libsharpyuv.pc +0 -11
  73. package/dist/prebuilt/Emscripten-x86_64/lib/pkgconfig/libwebp.pc +0 -12
  74. package/dist/prebuilt/Emscripten-x86_64/lib/pkgconfig/libwebpdemux.pc +0 -11
  75. package/dist/prebuilt/Emscripten-x86_64/lib/pkgconfig/libwebpmux.pc +0 -12
  76. package/dist/prebuilt/Emscripten-x86_64/share/man/man1/cwebp.1 +0 -332
  77. package/dist/prebuilt/Emscripten-x86_64/share/man/man1/dwebp.1 +0 -150
  78. package/dist/prebuilt/Emscripten-x86_64/share/man/man1/img2webp.1 +0 -117
  79. package/dist/prebuilt/Emscripten-x86_64/share/man/man1/webpinfo.1 +0 -80
  80. package/dist/prebuilt/Emscripten-x86_64/share/man/man1/webpmux.1 +0 -271
  81. package/dist/prebuilt/iOS-iphoneos/include/webp/decode.h +0 -506
  82. package/dist/prebuilt/iOS-iphoneos/include/webp/demux.h +0 -367
  83. package/dist/prebuilt/iOS-iphoneos/include/webp/encode.h +0 -557
  84. package/dist/prebuilt/iOS-iphoneos/include/webp/mux.h +0 -591
  85. package/dist/prebuilt/iOS-iphoneos/include/webp/mux_types.h +0 -99
  86. package/dist/prebuilt/iOS-iphoneos/include/webp/sharpyuv/sharpyuv.h +0 -172
  87. package/dist/prebuilt/iOS-iphoneos/include/webp/sharpyuv/sharpyuv_csp.h +0 -60
  88. package/dist/prebuilt/iOS-iphoneos/include/webp/types.h +0 -93
  89. package/dist/prebuilt/iOS-iphoneos/lib/libsharpyuv.a +0 -0
  90. package/dist/prebuilt/iOS-iphoneos/lib/libsharpyuv.la +0 -41
  91. package/dist/prebuilt/iOS-iphoneos/lib/libwebp.a +0 -0
  92. package/dist/prebuilt/iOS-iphoneos/lib/libwebp.la +0 -41
  93. package/dist/prebuilt/iOS-iphoneos/lib/libwebpdemux.a +0 -0
  94. package/dist/prebuilt/iOS-iphoneos/lib/libwebpdemux.la +0 -41
  95. package/dist/prebuilt/iOS-iphoneos/lib/libwebpmux.a +0 -0
  96. package/dist/prebuilt/iOS-iphoneos/lib/libwebpmux.la +0 -41
  97. package/dist/prebuilt/iOS-iphoneos/lib/pkgconfig/libsharpyuv.pc +0 -11
  98. package/dist/prebuilt/iOS-iphoneos/lib/pkgconfig/libwebp.pc +0 -12
  99. package/dist/prebuilt/iOS-iphoneos/lib/pkgconfig/libwebpdemux.pc +0 -11
  100. package/dist/prebuilt/iOS-iphoneos/lib/pkgconfig/libwebpmux.pc +0 -12
  101. package/dist/prebuilt/iOS-iphoneos/share/man/man1/cwebp.1 +0 -332
  102. package/dist/prebuilt/iOS-iphoneos/share/man/man1/dwebp.1 +0 -150
  103. package/dist/prebuilt/iOS-iphoneos/share/man/man1/img2webp.1 +0 -117
  104. package/dist/prebuilt/iOS-iphoneos/share/man/man1/webpinfo.1 +0 -80
  105. package/dist/prebuilt/iOS-iphoneos/share/man/man1/webpmux.1 +0 -271
  106. package/dist/prebuilt/iOS-iphonesimulator/include/webp/decode.h +0 -506
  107. package/dist/prebuilt/iOS-iphonesimulator/include/webp/demux.h +0 -367
  108. package/dist/prebuilt/iOS-iphonesimulator/include/webp/encode.h +0 -557
  109. package/dist/prebuilt/iOS-iphonesimulator/include/webp/mux.h +0 -591
  110. package/dist/prebuilt/iOS-iphonesimulator/include/webp/mux_types.h +0 -99
  111. package/dist/prebuilt/iOS-iphonesimulator/include/webp/sharpyuv/sharpyuv.h +0 -172
  112. package/dist/prebuilt/iOS-iphonesimulator/include/webp/sharpyuv/sharpyuv_csp.h +0 -60
  113. package/dist/prebuilt/iOS-iphonesimulator/include/webp/types.h +0 -93
  114. package/dist/prebuilt/iOS-iphonesimulator/lib/libsharpyuv.a +0 -0
  115. package/dist/prebuilt/iOS-iphonesimulator/lib/libsharpyuv.la +0 -41
  116. package/dist/prebuilt/iOS-iphonesimulator/lib/libwebp.a +0 -0
  117. package/dist/prebuilt/iOS-iphonesimulator/lib/libwebp.la +0 -41
  118. package/dist/prebuilt/iOS-iphonesimulator/lib/libwebpdemux.a +0 -0
  119. package/dist/prebuilt/iOS-iphonesimulator/lib/libwebpdemux.la +0 -41
  120. package/dist/prebuilt/iOS-iphonesimulator/lib/libwebpmux.a +0 -0
  121. package/dist/prebuilt/iOS-iphonesimulator/lib/libwebpmux.la +0 -41
  122. package/dist/prebuilt/iOS-iphonesimulator/lib/pkgconfig/libsharpyuv.pc +0 -11
  123. package/dist/prebuilt/iOS-iphonesimulator/lib/pkgconfig/libwebp.pc +0 -12
  124. package/dist/prebuilt/iOS-iphonesimulator/lib/pkgconfig/libwebpdemux.pc +0 -11
  125. package/dist/prebuilt/iOS-iphonesimulator/lib/pkgconfig/libwebpmux.pc +0 -12
  126. package/dist/prebuilt/iOS-iphonesimulator/share/man/man1/cwebp.1 +0 -332
  127. package/dist/prebuilt/iOS-iphonesimulator/share/man/man1/dwebp.1 +0 -150
  128. package/dist/prebuilt/iOS-iphonesimulator/share/man/man1/img2webp.1 +0 -117
  129. package/dist/prebuilt/iOS-iphonesimulator/share/man/man1/webpinfo.1 +0 -80
  130. package/dist/prebuilt/iOS-iphonesimulator/share/man/man1/webpmux.1 +0 -271
  131. package/sharpyuv.xcframework/Info.plist +0 -50
  132. package/sharpyuv.xcframework/ios-arm64_arm64e/Headers/webp/decode.h +0 -506
  133. package/sharpyuv.xcframework/ios-arm64_arm64e/Headers/webp/demux.h +0 -367
  134. package/sharpyuv.xcframework/ios-arm64_arm64e/Headers/webp/encode.h +0 -557
  135. package/sharpyuv.xcframework/ios-arm64_arm64e/Headers/webp/mux.h +0 -591
  136. package/sharpyuv.xcframework/ios-arm64_arm64e/Headers/webp/mux_types.h +0 -99
  137. package/sharpyuv.xcframework/ios-arm64_arm64e/Headers/webp/sharpyuv/sharpyuv.h +0 -172
  138. package/sharpyuv.xcframework/ios-arm64_arm64e/Headers/webp/sharpyuv/sharpyuv_csp.h +0 -60
  139. package/sharpyuv.xcframework/ios-arm64_arm64e/Headers/webp/types.h +0 -93
  140. package/sharpyuv.xcframework/ios-arm64_arm64e/libsharpyuv.a +0 -0
  141. package/sharpyuv.xcframework/ios-arm64_arm64e_x86_64-simulator/Headers/webp/decode.h +0 -506
  142. package/sharpyuv.xcframework/ios-arm64_arm64e_x86_64-simulator/Headers/webp/demux.h +0 -367
  143. package/sharpyuv.xcframework/ios-arm64_arm64e_x86_64-simulator/Headers/webp/encode.h +0 -557
  144. package/sharpyuv.xcframework/ios-arm64_arm64e_x86_64-simulator/Headers/webp/mux.h +0 -591
  145. package/sharpyuv.xcframework/ios-arm64_arm64e_x86_64-simulator/Headers/webp/mux_types.h +0 -99
  146. package/sharpyuv.xcframework/ios-arm64_arm64e_x86_64-simulator/Headers/webp/sharpyuv/sharpyuv.h +0 -172
  147. package/sharpyuv.xcframework/ios-arm64_arm64e_x86_64-simulator/Headers/webp/sharpyuv/sharpyuv_csp.h +0 -60
  148. package/sharpyuv.xcframework/ios-arm64_arm64e_x86_64-simulator/Headers/webp/types.h +0 -93
  149. package/sharpyuv.xcframework/ios-arm64_arm64e_x86_64-simulator/libsharpyuv.a +0 -0
  150. package/webp.xcframework/Info.plist +0 -50
  151. package/webp.xcframework/ios-arm64_arm64e/Headers/webp/decode.h +0 -506
  152. package/webp.xcframework/ios-arm64_arm64e/Headers/webp/demux.h +0 -367
  153. package/webp.xcframework/ios-arm64_arm64e/Headers/webp/encode.h +0 -557
  154. package/webp.xcframework/ios-arm64_arm64e/Headers/webp/mux.h +0 -591
  155. package/webp.xcframework/ios-arm64_arm64e/Headers/webp/mux_types.h +0 -99
  156. package/webp.xcframework/ios-arm64_arm64e/Headers/webp/sharpyuv/sharpyuv.h +0 -172
  157. package/webp.xcframework/ios-arm64_arm64e/Headers/webp/sharpyuv/sharpyuv_csp.h +0 -60
  158. package/webp.xcframework/ios-arm64_arm64e/Headers/webp/types.h +0 -93
  159. package/webp.xcframework/ios-arm64_arm64e/libwebp.a +0 -0
  160. package/webp.xcframework/ios-arm64_arm64e_x86_64-simulator/Headers/webp/decode.h +0 -506
  161. package/webp.xcframework/ios-arm64_arm64e_x86_64-simulator/Headers/webp/demux.h +0 -367
  162. package/webp.xcframework/ios-arm64_arm64e_x86_64-simulator/Headers/webp/encode.h +0 -557
  163. package/webp.xcframework/ios-arm64_arm64e_x86_64-simulator/Headers/webp/mux.h +0 -591
  164. package/webp.xcframework/ios-arm64_arm64e_x86_64-simulator/Headers/webp/mux_types.h +0 -99
  165. package/webp.xcframework/ios-arm64_arm64e_x86_64-simulator/Headers/webp/sharpyuv/sharpyuv.h +0 -172
  166. package/webp.xcframework/ios-arm64_arm64e_x86_64-simulator/Headers/webp/sharpyuv/sharpyuv_csp.h +0 -60
  167. package/webp.xcframework/ios-arm64_arm64e_x86_64-simulator/Headers/webp/types.h +0 -93
  168. package/webp.xcframework/ios-arm64_arm64e_x86_64-simulator/libwebp.a +0 -0
@@ -1,99 +0,0 @@
1
- // Copyright 2012 Google Inc. All Rights Reserved.
2
- //
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
5
- // tree. An additional intellectual property rights grant can be found
6
- // in the file PATENTS. All contributing project authors may
7
- // be found in the AUTHORS file in the root of the source tree.
8
- // -----------------------------------------------------------------------------
9
- //
10
- // Data-types common to the mux and demux libraries.
11
- //
12
- // Author: Urvang (urvang@google.com)
13
-
14
- #ifndef WEBP_WEBP_MUX_TYPES_H_
15
- #define WEBP_WEBP_MUX_TYPES_H_
16
-
17
- #include <string.h> // memset()
18
- #include "./types.h"
19
-
20
- #ifdef __cplusplus
21
- extern "C" {
22
- #endif
23
-
24
- // Note: forward declaring enumerations is not allowed in (strict) C and C++,
25
- // the types are left here for reference.
26
- // typedef enum WebPFeatureFlags WebPFeatureFlags;
27
- // typedef enum WebPMuxAnimDispose WebPMuxAnimDispose;
28
- // typedef enum WebPMuxAnimBlend WebPMuxAnimBlend;
29
- typedef struct WebPData WebPData;
30
-
31
- // VP8X Feature Flags.
32
- typedef enum WebPFeatureFlags {
33
- ANIMATION_FLAG = 0x00000002,
34
- XMP_FLAG = 0x00000004,
35
- EXIF_FLAG = 0x00000008,
36
- ALPHA_FLAG = 0x00000010,
37
- ICCP_FLAG = 0x00000020,
38
-
39
- ALL_VALID_FLAGS = 0x0000003e
40
- } WebPFeatureFlags;
41
-
42
- // Dispose method (animation only). Indicates how the area used by the current
43
- // frame is to be treated before rendering the next frame on the canvas.
44
- typedef enum WebPMuxAnimDispose {
45
- WEBP_MUX_DISPOSE_NONE, // Do not dispose.
46
- WEBP_MUX_DISPOSE_BACKGROUND // Dispose to background color.
47
- } WebPMuxAnimDispose;
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
-
56
- // Data type used to describe 'raw' data, e.g., chunk data
57
- // (ICC profile, metadata) and WebP compressed image data.
58
- // 'bytes' memory must be allocated using WebPMalloc() and such.
59
- struct WebPData {
60
- const uint8_t* bytes;
61
- size_t size;
62
- };
63
-
64
- // Initializes the contents of the 'webp_data' object with default values.
65
- static WEBP_INLINE void WebPDataInit(WebPData* webp_data) {
66
- if (webp_data != NULL) {
67
- memset(webp_data, 0, sizeof(*webp_data));
68
- }
69
- }
70
-
71
- // Clears the contents of the 'webp_data' object by calling WebPFree().
72
- // Does not deallocate the object itself.
73
- static WEBP_INLINE void WebPDataClear(WebPData* webp_data) {
74
- if (webp_data != NULL) {
75
- WebPFree((void*)webp_data->bytes);
76
- WebPDataInit(webp_data);
77
- }
78
- }
79
-
80
- // Allocates necessary storage for 'dst' and copies the contents of 'src'.
81
- // Returns true on success.
82
- WEBP_NODISCARD static WEBP_INLINE int WebPDataCopy(const WebPData* src,
83
- WebPData* dst) {
84
- if (src == NULL || dst == NULL) return 0;
85
- WebPDataInit(dst);
86
- if (src->bytes != NULL && src->size != 0) {
87
- dst->bytes = (uint8_t*)WebPMalloc(src->size);
88
- if (dst->bytes == NULL) return 0;
89
- memcpy((void*)dst->bytes, src->bytes, src->size);
90
- dst->size = src->size;
91
- }
92
- return 1;
93
- }
94
-
95
- #ifdef __cplusplus
96
- } // extern "C"
97
- #endif
98
-
99
- #endif // WEBP_WEBP_MUX_TYPES_H_
@@ -1,172 +0,0 @@
1
- // Copyright 2022 Google Inc. All Rights Reserved.
2
- //
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
5
- // tree. An additional intellectual property rights grant can be found
6
- // in the file PATENTS. All contributing project authors may
7
- // be found in the AUTHORS file in the root of the source tree.
8
- // -----------------------------------------------------------------------------
9
- //
10
- // Sharp RGB to YUV conversion.
11
-
12
- #ifndef WEBP_SHARPYUV_SHARPYUV_H_
13
- #define WEBP_SHARPYUV_SHARPYUV_H_
14
-
15
- #ifdef __cplusplus
16
- extern "C" {
17
- #endif
18
-
19
- #ifndef SHARPYUV_EXTERN
20
- #ifdef WEBP_EXTERN
21
- #define SHARPYUV_EXTERN WEBP_EXTERN
22
- #else
23
- // This explicitly marks library functions and allows for changing the
24
- // signature for e.g., Windows DLL builds.
25
- #if defined(_WIN32) && defined(WEBP_DLL)
26
- #define SHARPYUV_EXTERN __declspec(dllexport)
27
- #elif defined(__GNUC__) && __GNUC__ >= 4
28
- #define SHARPYUV_EXTERN extern __attribute__((visibility("default")))
29
- #else
30
- #define SHARPYUV_EXTERN extern
31
- #endif /* defined(_WIN32) && defined(WEBP_DLL) */
32
- #endif /* WEBP_EXTERN */
33
- #endif /* SHARPYUV_EXTERN */
34
-
35
- #ifndef SHARPYUV_INLINE
36
- #ifdef WEBP_INLINE
37
- #define SHARPYUV_INLINE WEBP_INLINE
38
- #else
39
- #ifndef _MSC_VER
40
- #if defined(__cplusplus) || !defined(__STRICT_ANSI__) || \
41
- (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
42
- #define SHARPYUV_INLINE inline
43
- #else
44
- #define SHARPYUV_INLINE
45
- #endif
46
- #else
47
- #define SHARPYUV_INLINE __forceinline
48
- #endif /* _MSC_VER */
49
- #endif /* WEBP_INLINE */
50
- #endif /* SHARPYUV_INLINE */
51
-
52
- // SharpYUV API version following the convention from semver.org
53
- #define SHARPYUV_VERSION_MAJOR 0
54
- #define SHARPYUV_VERSION_MINOR 4
55
- #define SHARPYUV_VERSION_PATCH 0
56
- // Version as a uint32_t. The major number is the high 8 bits.
57
- // The minor number is the middle 8 bits. The patch number is the low 16 bits.
58
- #define SHARPYUV_MAKE_VERSION(MAJOR, MINOR, PATCH) \
59
- (((MAJOR) << 24) | ((MINOR) << 16) | (PATCH))
60
- #define SHARPYUV_VERSION \
61
- SHARPYUV_MAKE_VERSION(SHARPYUV_VERSION_MAJOR, SHARPYUV_VERSION_MINOR, \
62
- SHARPYUV_VERSION_PATCH)
63
-
64
- // Returns the library's version number, packed in hexadecimal. See
65
- // SHARPYUV_VERSION.
66
- SHARPYUV_EXTERN int SharpYuvGetVersion(void);
67
-
68
- // RGB to YUV conversion matrix, in 16 bit fixed point.
69
- // y = rgb_to_y[0] * r + rgb_to_y[1] * g + rgb_to_y[2] * b + rgb_to_y[3]
70
- // u = rgb_to_u[0] * r + rgb_to_u[1] * g + rgb_to_u[2] * b + rgb_to_u[3]
71
- // v = rgb_to_v[0] * r + rgb_to_v[1] * g + rgb_to_v[2] * b + rgb_to_v[3]
72
- // Then y, u and v values are divided by 1<<16 and rounded.
73
- typedef struct {
74
- int rgb_to_y[4];
75
- int rgb_to_u[4];
76
- int rgb_to_v[4];
77
- } SharpYuvConversionMatrix;
78
-
79
- typedef struct SharpYuvOptions SharpYuvOptions;
80
-
81
- // Enums for transfer functions, as defined in H.273,
82
- // https://www.itu.int/rec/T-REC-H.273-202107-I/en
83
- typedef enum SharpYuvTransferFunctionType {
84
- // 0 is reserved
85
- kSharpYuvTransferFunctionBt709 = 1,
86
- // 2 is unspecified
87
- // 3 is reserved
88
- kSharpYuvTransferFunctionBt470M = 4,
89
- kSharpYuvTransferFunctionBt470Bg = 5,
90
- kSharpYuvTransferFunctionBt601 = 6,
91
- kSharpYuvTransferFunctionSmpte240 = 7,
92
- kSharpYuvTransferFunctionLinear = 8,
93
- kSharpYuvTransferFunctionLog100 = 9,
94
- kSharpYuvTransferFunctionLog100_Sqrt10 = 10,
95
- kSharpYuvTransferFunctionIec61966 = 11,
96
- kSharpYuvTransferFunctionBt1361 = 12,
97
- kSharpYuvTransferFunctionSrgb = 13,
98
- kSharpYuvTransferFunctionBt2020_10Bit = 14,
99
- kSharpYuvTransferFunctionBt2020_12Bit = 15,
100
- kSharpYuvTransferFunctionSmpte2084 = 16, // PQ
101
- kSharpYuvTransferFunctionSmpte428 = 17,
102
- kSharpYuvTransferFunctionHlg = 18,
103
- kSharpYuvTransferFunctionNum
104
- } SharpYuvTransferFunctionType;
105
-
106
- // Converts RGB to YUV420 using a downsampling algorithm that minimizes
107
- // artefacts caused by chroma subsampling.
108
- // This is slower than standard downsampling (averaging of 4 UV values).
109
- // Assumes that the image will be upsampled using a bilinear filter. If nearest
110
- // neighbor is used instead, the upsampled image might look worse than with
111
- // standard downsampling.
112
- // r_ptr, g_ptr, b_ptr: pointers to the source r, g and b channels. Should point
113
- // to uint8_t buffers if rgb_bit_depth is 8, or uint16_t buffers otherwise.
114
- // rgb_step: distance in bytes between two horizontally adjacent pixels on the
115
- // r, g and b channels. If rgb_bit_depth is > 8, it should be a
116
- // multiple of 2.
117
- // rgb_stride: distance in bytes between two vertically adjacent pixels on the
118
- // r, g, and b channels. If rgb_bit_depth is > 8, it should be a
119
- // multiple of 2.
120
- // rgb_bit_depth: number of bits for each r/g/b value. One of: 8, 10, 12, 16.
121
- // Note: 16 bit input is truncated to 14 bits before conversion to yuv.
122
- // yuv_bit_depth: number of bits for each y/u/v value. One of: 8, 10, 12.
123
- // y_ptr, u_ptr, v_ptr: pointers to the destination y, u and v channels. Should
124
- // point to uint8_t buffers if yuv_bit_depth is 8, or uint16_t buffers
125
- // otherwise.
126
- // y_stride, u_stride, v_stride: distance in bytes between two vertically
127
- // adjacent pixels on the y, u and v channels. If yuv_bit_depth > 8, they
128
- // should be multiples of 2.
129
- // width, height: width and height of the image in pixels
130
- // This function calls SharpYuvConvertWithOptions with a default transfer
131
- // function of kSharpYuvTransferFunctionSrgb.
132
- SHARPYUV_EXTERN int SharpYuvConvert(const void* r_ptr, const void* g_ptr,
133
- const void* b_ptr, int rgb_step,
134
- int rgb_stride, int rgb_bit_depth,
135
- void* y_ptr, int y_stride, void* u_ptr,
136
- int u_stride, void* v_ptr, int v_stride,
137
- int yuv_bit_depth, int width, int height,
138
- const SharpYuvConversionMatrix* yuv_matrix);
139
-
140
- struct SharpYuvOptions {
141
- // This matrix cannot be NULL and can be initialized by
142
- // SharpYuvComputeConversionMatrix.
143
- const SharpYuvConversionMatrix* yuv_matrix;
144
- SharpYuvTransferFunctionType transfer_type;
145
- };
146
-
147
- // Internal, version-checked, entry point
148
- SHARPYUV_EXTERN int SharpYuvOptionsInitInternal(const SharpYuvConversionMatrix*,
149
- SharpYuvOptions*, int);
150
-
151
- // Should always be called, to initialize a fresh SharpYuvOptions
152
- // structure before modification. SharpYuvOptionsInit() must have succeeded
153
- // before using the 'options' object.
154
- static SHARPYUV_INLINE int SharpYuvOptionsInit(
155
- const SharpYuvConversionMatrix* yuv_matrix, SharpYuvOptions* options) {
156
- return SharpYuvOptionsInitInternal(yuv_matrix, options, SHARPYUV_VERSION);
157
- }
158
-
159
- SHARPYUV_EXTERN int SharpYuvConvertWithOptions(
160
- const void* r_ptr, const void* g_ptr, const void* b_ptr, int rgb_step,
161
- int rgb_stride, int rgb_bit_depth, void* y_ptr, int y_stride, void* u_ptr,
162
- int u_stride, void* v_ptr, int v_stride, int yuv_bit_depth, int width,
163
- int height, const SharpYuvOptions* options);
164
-
165
- // TODO(b/194336375): Add YUV444 to YUV420 conversion. Maybe also add 422
166
- // support (it's rarely used in practice, especially for images).
167
-
168
- #ifdef __cplusplus
169
- } // extern "C"
170
- #endif
171
-
172
- #endif // WEBP_SHARPYUV_SHARPYUV_H_
@@ -1,60 +0,0 @@
1
- // Copyright 2022 Google Inc. All Rights Reserved.
2
- //
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
5
- // tree. An additional intellectual property rights grant can be found
6
- // in the file PATENTS. All contributing project authors may
7
- // be found in the AUTHORS file in the root of the source tree.
8
- // -----------------------------------------------------------------------------
9
- //
10
- // Colorspace utilities.
11
-
12
- #ifndef WEBP_SHARPYUV_SHARPYUV_CSP_H_
13
- #define WEBP_SHARPYUV_SHARPYUV_CSP_H_
14
-
15
- #include "sharpyuv/sharpyuv.h"
16
-
17
- #ifdef __cplusplus
18
- extern "C" {
19
- #endif
20
-
21
- // Range of YUV values.
22
- typedef enum {
23
- kSharpYuvRangeFull, // YUV values between [0;255] (for 8 bit)
24
- kSharpYuvRangeLimited // Y in [16;235], YUV in [16;240] (for 8 bit)
25
- } SharpYuvRange;
26
-
27
- // Constants that define a YUV color space.
28
- typedef struct {
29
- // Kr and Kb are defined such that:
30
- // Y = Kr * r + Kg * g + Kb * b where Kg = 1 - Kr - Kb.
31
- float kr;
32
- float kb;
33
- int bit_depth; // 8, 10 or 12
34
- SharpYuvRange range;
35
- } SharpYuvColorSpace;
36
-
37
- // Fills in 'matrix' for the given YUVColorSpace.
38
- SHARPYUV_EXTERN void SharpYuvComputeConversionMatrix(
39
- const SharpYuvColorSpace* yuv_color_space,
40
- SharpYuvConversionMatrix* matrix);
41
-
42
- // Enums for precomputed conversion matrices.
43
- typedef enum {
44
- kSharpYuvMatrixWebp = 0,
45
- kSharpYuvMatrixRec601Limited,
46
- kSharpYuvMatrixRec601Full,
47
- kSharpYuvMatrixRec709Limited,
48
- kSharpYuvMatrixRec709Full,
49
- kSharpYuvMatrixNum
50
- } SharpYuvMatrixType;
51
-
52
- // Returns a pointer to a matrix for one of the predefined colorspaces.
53
- SHARPYUV_EXTERN const SharpYuvConversionMatrix* SharpYuvGetConversionMatrix(
54
- SharpYuvMatrixType matrix_type);
55
-
56
- #ifdef __cplusplus
57
- } // extern "C"
58
- #endif
59
-
60
- #endif // WEBP_SHARPYUV_SHARPYUV_CSP_H_
@@ -1,93 +0,0 @@
1
- // Copyright 2010 Google Inc. All Rights Reserved.
2
- //
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
5
- // tree. An additional intellectual property rights grant can be found
6
- // in the file PATENTS. All contributing project authors may
7
- // be found in the AUTHORS file in the root of the source tree.
8
- // -----------------------------------------------------------------------------
9
- //
10
- // Common types + memory wrappers
11
- //
12
- // Author: Skal (pascal.massimino@gmail.com)
13
-
14
- #ifndef WEBP_WEBP_TYPES_H_
15
- #define WEBP_WEBP_TYPES_H_
16
-
17
- #include <stddef.h> // for size_t
18
-
19
- #ifndef _MSC_VER
20
- #include <inttypes.h>
21
- #if defined(__cplusplus) || !defined(__STRICT_ANSI__) || \
22
- (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
23
- #define WEBP_INLINE inline
24
- #else
25
- #define WEBP_INLINE
26
- #endif
27
- #else
28
- typedef signed char int8_t;
29
- typedef unsigned char uint8_t;
30
- typedef signed short int16_t;
31
- typedef unsigned short uint16_t;
32
- typedef signed int int32_t;
33
- typedef unsigned int uint32_t;
34
- typedef unsigned long long int uint64_t;
35
- typedef long long int int64_t;
36
- #define WEBP_INLINE __forceinline
37
- #endif /* _MSC_VER */
38
-
39
- #ifndef WEBP_NODISCARD
40
- #if defined(WEBP_ENABLE_NODISCARD) && WEBP_ENABLE_NODISCARD
41
- #if (defined(__cplusplus) && __cplusplus >= 201700L) || \
42
- (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L)
43
- #define WEBP_NODISCARD [[nodiscard]]
44
- #else
45
- // gcc's __has_attribute does not work for enums.
46
- #if defined(__clang__) && defined(__has_attribute)
47
- #if __has_attribute(warn_unused_result)
48
- #define WEBP_NODISCARD __attribute__((warn_unused_result))
49
- #else
50
- #define WEBP_NODISCARD
51
- #endif /* __has_attribute(warn_unused_result) */
52
- #else
53
- #define WEBP_NODISCARD
54
- #endif /* defined(__clang__) && defined(__has_attribute) */
55
- #endif /* (defined(__cplusplus) && __cplusplus >= 201700L) ||
56
- (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) */
57
- #else
58
- #define WEBP_NODISCARD
59
- #endif /* defined(WEBP_ENABLE_NODISCARD) && WEBP_ENABLE_NODISCARD */
60
- #endif /* WEBP_NODISCARD */
61
-
62
- #ifndef WEBP_EXTERN
63
- // This explicitly marks library functions and allows for changing the
64
- // signature for e.g., Windows DLL builds.
65
- # if defined(_WIN32) && defined(WEBP_DLL)
66
- # define WEBP_EXTERN __declspec(dllexport)
67
- # elif defined(__GNUC__) && __GNUC__ >= 4
68
- # define WEBP_EXTERN extern __attribute__ ((visibility ("default")))
69
- # else
70
- # define WEBP_EXTERN extern
71
- # endif /* defined(_WIN32) && defined(WEBP_DLL) */
72
- #endif /* WEBP_EXTERN */
73
-
74
- // Macro to check ABI compatibility (same major revision number)
75
- #define WEBP_ABI_IS_INCOMPATIBLE(a, b) (((a) >> 8) != ((b) >> 8))
76
-
77
- #ifdef __cplusplus
78
- extern "C" {
79
- #endif
80
-
81
- // Allocates 'size' bytes of memory. Returns NULL upon error. Memory
82
- // must be deallocated by calling WebPFree(). This function is made available
83
- // by the core 'libwebp' library.
84
- WEBP_NODISCARD WEBP_EXTERN void* WebPMalloc(size_t size);
85
-
86
- // Releases memory returned by the WebPDecode*() functions (from decode.h).
87
- WEBP_EXTERN void WebPFree(void* ptr);
88
-
89
- #ifdef __cplusplus
90
- } // extern "C"
91
- #endif
92
-
93
- #endif // WEBP_WEBP_TYPES_H_