@img/sharp-libvips-dev-wasm32 1.3.0-rc.1 → 1.3.0-rc.10

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 (191) hide show
  1. package/README.md +23 -23
  2. package/include/aom/aom_codec.h +1 -1
  3. package/include/aom/aom_decoder.h +4 -0
  4. package/include/aom/aom_encoder.h +19 -8
  5. package/include/aom/aom_ext_ratectrl.h +664 -0
  6. package/include/aom/aom_image.h +93 -30
  7. package/include/aom/aom_tpl.h +99 -0
  8. package/include/aom/aomcx.h +89 -16
  9. package/include/aom/aomdx.h +12 -0
  10. package/include/expat.h +15 -3
  11. package/include/expat_config.h +6 -6
  12. package/include/expat_external.h +4 -4
  13. package/include/glib-2.0/gio/gdbusconnection.h +2 -8
  14. package/include/glib-2.0/gio/gfileattribute.h +1 -1
  15. package/include/glib-2.0/gio/gfileinfo.h +5 -0
  16. package/include/glib-2.0/gio/gicon.h +1 -1
  17. package/include/glib-2.0/gio/gio-autocleanups.h +0 -1
  18. package/include/glib-2.0/gio/gio-visibility.h +34 -0
  19. package/include/glib-2.0/gio/gio.h +2 -0
  20. package/include/glib-2.0/gio/gioenums.h +66 -44
  21. package/include/glib-2.0/gio/gioenumtypes.h +2 -0
  22. package/include/glib-2.0/gio/giptosmessage.h +46 -0
  23. package/include/glib-2.0/gio/gipv6tclassmessage.h +46 -0
  24. package/include/glib-2.0/gio/gresolver.h +1 -1
  25. package/include/glib-2.0/gio/gsettings.h +1 -1
  26. package/include/glib-2.0/gio/gsocketcontrolmessage.h +2 -0
  27. package/include/glib-2.0/glib/gatomic.h +26 -2
  28. package/include/glib-2.0/glib/gfileutils.h +2 -2
  29. package/include/glib-2.0/glib/ghook.h +3 -1
  30. package/include/glib-2.0/glib/giochannel.h +1 -1
  31. package/include/glib-2.0/glib/gkeyfile.h +1 -1
  32. package/include/glib-2.0/glib/glib-visibility.h +34 -0
  33. package/include/glib-2.0/glib/gmacros.h +32 -0
  34. package/include/glib-2.0/glib/gmain.h +4 -0
  35. package/include/glib-2.0/glib/gmarkup.h +18 -1
  36. package/include/glib-2.0/glib/gmem.h +4 -4
  37. package/include/glib-2.0/glib/gmessages.h +7 -9
  38. package/include/glib-2.0/glib/gnode.h +1 -1
  39. package/include/glib-2.0/glib/goption.h +1 -1
  40. package/include/glib-2.0/glib/gsequence.h +2 -2
  41. package/include/glib-2.0/glib/gslice.h +12 -4
  42. package/include/glib-2.0/glib/gspawn.h +1 -1
  43. package/include/glib-2.0/glib/gstrfuncs.h +191 -1
  44. package/include/glib-2.0/glib/gtestutils.h +6 -3
  45. package/include/glib-2.0/glib/gtimer.h +1 -0
  46. package/include/glib-2.0/glib/guri.h +3 -3
  47. package/include/glib-2.0/glib/gutils.h +10 -1
  48. package/include/glib-2.0/glib/gvarianttype.h +16 -16
  49. package/include/glib-2.0/glib/gversionmacros.h +22 -0
  50. package/include/glib-2.0/gmodule/gmodule-visibility.h +34 -0
  51. package/include/glib-2.0/gmodule.h +1 -1
  52. package/include/glib-2.0/gobject/gbinding.h +1 -1
  53. package/include/glib-2.0/gobject/gobject-visibility.h +34 -0
  54. package/include/glib-2.0/gobject/gobject.h +1 -1
  55. package/include/glib-2.0/gobject/gparam.h +1 -1
  56. package/include/glib-2.0/gobject/gsignal.h +8 -8
  57. package/include/glib-2.0/gobject/gtype.h +17 -17
  58. package/include/hwy/aligned_allocator.h +44 -2
  59. package/include/hwy/auto_tune.h +22 -6
  60. package/include/hwy/base.h +60 -90
  61. package/include/hwy/bit_set.h +410 -0
  62. package/include/hwy/cache_control.h +3 -2
  63. package/include/hwy/detect_compiler_arch.h +134 -14
  64. package/include/hwy/detect_targets.h +82 -36
  65. package/include/hwy/highway.h +15 -0
  66. package/include/hwy/nanobenchmark.h +12 -3
  67. package/include/hwy/ops/arm_neon-inl.h +96 -25
  68. package/include/hwy/ops/arm_sve-inl.h +250 -95
  69. package/include/hwy/ops/emu128-inl.h +12 -7
  70. package/include/hwy/ops/generic_ops-inl.h +271 -131
  71. package/include/hwy/ops/loongarch_lasx-inl.h +31 -9
  72. package/include/hwy/ops/loongarch_lsx-inl.h +33 -12
  73. package/include/hwy/ops/ppc_vsx-inl.h +99 -19
  74. package/include/hwy/ops/rvv-inl.h +239 -130
  75. package/include/hwy/ops/scalar-inl.h +22 -7
  76. package/include/hwy/ops/set_macros-inl.h +163 -107
  77. package/include/hwy/ops/wasm_128-inl.h +13 -22
  78. package/include/hwy/ops/x86_128-inl.h +223 -120
  79. package/include/hwy/ops/x86_256-inl.h +70 -134
  80. package/include/hwy/ops/x86_512-inl.h +130 -134
  81. package/include/hwy/print-inl.h +2 -0
  82. package/include/hwy/profiler.h +355 -264
  83. package/include/hwy/robust_statistics.h +3 -1
  84. package/include/hwy/timer.h +44 -0
  85. package/include/lcms2.h +35 -5
  86. package/include/lcms2_plugin.h +1 -1
  87. package/include/libexif/exif-utils.h +1 -1
  88. package/include/libheif/heif.h +2 -0
  89. package/include/libheif/heif_aux_images.h +2 -2
  90. package/include/libheif/heif_brands.h +16 -4
  91. package/include/libheif/heif_color.h +147 -25
  92. package/include/libheif/heif_components.h +264 -0
  93. package/include/libheif/heif_context.h +18 -4
  94. package/include/libheif/heif_cxx.h +20 -18
  95. package/include/libheif/heif_decoding.h +63 -9
  96. package/include/libheif/heif_encoding.h +46 -12
  97. package/include/libheif/heif_error.h +15 -6
  98. package/include/libheif/heif_export.h +48 -0
  99. package/include/libheif/heif_image.h +94 -32
  100. package/include/libheif/heif_image_handle.h +54 -3
  101. package/include/libheif/heif_items.h +25 -2
  102. package/include/libheif/heif_library.h +13 -18
  103. package/include/libheif/heif_metadata.h +5 -2
  104. package/include/libheif/heif_omaf.h +104 -0
  105. package/include/libheif/heif_plugin.h +80 -13
  106. package/include/libheif/heif_properties.h +259 -5
  107. package/include/libheif/heif_regions.h +5 -3
  108. package/include/libheif/heif_security.h +24 -2
  109. package/include/libheif/heif_sequences.h +163 -14
  110. package/include/libheif/heif_text.h +161 -0
  111. package/include/libheif/heif_tiling.h +2 -2
  112. package/include/libheif/heif_uncompressed.h +29 -5
  113. package/include/libheif/heif_version.h +2 -2
  114. package/include/libpng16/png.h +637 -488
  115. package/include/libpng16/pngconf.h +2 -2
  116. package/include/libpng16/pnglibconf.h +2 -2
  117. package/include/png.h +637 -488
  118. package/include/pngconf.h +2 -2
  119. package/include/pnglibconf.h +2 -2
  120. package/include/resvg.h +3 -3
  121. package/include/tiffconf.h +9 -10
  122. package/include/tiffio.h +10 -9
  123. package/include/tiffvers.h +1 -1
  124. package/include/ultrahdr_api.h +5 -11
  125. package/include/vips/colour.h +2 -2
  126. package/include/vips/memory.h +1 -1
  127. package/include/vips/version.h +4 -4
  128. package/include/zlib.h +3 -3
  129. package/lib/glib-2.0/include/glibconfig.h +1 -3
  130. package/lib/libaom.a +0 -0
  131. package/lib/libcgif.a +0 -0
  132. package/lib/libexif.a +0 -0
  133. package/lib/libexif.la +1 -1
  134. package/lib/libexpat.a +0 -0
  135. package/lib/libexpat.la +2 -2
  136. package/lib/libffi.a +0 -0
  137. package/lib/libgio-2.0.a +0 -0
  138. package/lib/libglib-2.0.a +0 -0
  139. package/lib/libgmodule-2.0.a +0 -0
  140. package/lib/libgobject-2.0.a +0 -0
  141. package/lib/libgthread-2.0.a +0 -0
  142. package/lib/libheif.a +0 -0
  143. package/lib/libhwy.a +0 -0
  144. package/lib/libimagequant.a +0 -0
  145. package/lib/libjpeg.a +0 -0
  146. package/lib/liblcms2.a +0 -0
  147. package/lib/libpng.a +0 -0
  148. package/lib/libpng.la +2 -2
  149. package/lib/libpng16.a +0 -0
  150. package/lib/libpng16.la +2 -2
  151. package/lib/libresvg.a +0 -0
  152. package/lib/libsharpyuv.a +0 -0
  153. package/lib/libtiff.a +0 -0
  154. package/lib/libuhdr.a +0 -0
  155. package/lib/libvips-cpp.a +0 -0
  156. package/lib/libvips.a +0 -0
  157. package/lib/libwebp.a +0 -0
  158. package/lib/libwebpdecoder.a +0 -0
  159. package/lib/libwebpdemux.a +0 -0
  160. package/lib/libwebpmux.a +0 -0
  161. package/lib/libz.a +0 -0
  162. package/lib/pkgconfig/aom.pc +2 -2
  163. package/lib/pkgconfig/cgif.pc +1 -1
  164. package/lib/pkgconfig/expat.pc +1 -1
  165. package/lib/pkgconfig/gio-2.0.pc +1 -1
  166. package/lib/pkgconfig/glib-2.0.pc +1 -1
  167. package/lib/pkgconfig/gmodule-2.0.pc +1 -1
  168. package/lib/pkgconfig/gmodule-export-2.0.pc +1 -1
  169. package/lib/pkgconfig/gmodule-no-export-2.0.pc +1 -1
  170. package/lib/pkgconfig/gobject-2.0.pc +1 -1
  171. package/lib/pkgconfig/gthread-2.0.pc +1 -1
  172. package/lib/pkgconfig/lcms2.pc +1 -1
  173. package/lib/pkgconfig/libexif.pc +1 -1
  174. package/lib/pkgconfig/libheif.pc +1 -1
  175. package/lib/pkgconfig/libhwy.pc +3 -4
  176. package/lib/pkgconfig/libpng.pc +1 -1
  177. package/lib/pkgconfig/libpng16.pc +1 -1
  178. package/lib/pkgconfig/libsharpyuv.pc +1 -1
  179. package/lib/pkgconfig/libtiff-4.pc +2 -2
  180. package/lib/pkgconfig/libwebp.pc +1 -1
  181. package/lib/pkgconfig/libwebpdecoder.pc +11 -0
  182. package/lib/pkgconfig/libwebpmux.pc +1 -1
  183. package/lib/pkgconfig/vips-cpp.pc +1 -1
  184. package/lib/pkgconfig/vips.pc +1 -1
  185. package/package.json +1 -1
  186. package/versions.json +15 -15
  187. package/lib/libsharpyuv.la +0 -41
  188. package/lib/libtiff.la +0 -41
  189. package/lib/libwebp.la +0 -41
  190. package/lib/libwebpdemux.la +0 -41
  191. package/lib/libwebpmux.la +0 -41
@@ -48,23 +48,18 @@ extern "C" {
48
48
  // 1.18 5 7 1 1 1 1
49
49
  // 1.19 6 7 2 1 1 1
50
50
  // 1.20 7 7 2 1 1 1
51
+ // 1.21 8 7 2 1 1 1
52
+ // 1.22 9 8 2 1 1 1
53
+ // 1.23 10 8 2 1 1 1
51
54
 
52
- #if (defined(_WIN32) || defined __CYGWIN__) && !defined(LIBHEIF_STATIC_BUILD)
53
- #ifdef LIBHEIF_EXPORTS
54
- #define LIBHEIF_API __declspec(dllexport)
55
- #else
56
- #define LIBHEIF_API __declspec(dllimport)
57
- #endif
58
- #elif defined(HAVE_VISIBILITY) && HAVE_VISIBILITY
59
- #ifdef LIBHEIF_EXPORTS
60
- #define LIBHEIF_API __attribute__((__visibility__("default")))
61
- #else
62
- #define LIBHEIF_API
63
- #endif
64
- #else
65
- #define LIBHEIF_API
66
- #endif
55
+ // The LIBHEIF_API export macro is defined in its own dependency-free header so
56
+ // that heif_error.h (which is needed by this header) can use it without
57
+ // creating an include cycle.
58
+ #include <libheif/heif_export.h>
67
59
 
60
+ /**
61
+ * Build a 32 bit integer from a 4-character code.
62
+ */
68
63
  #define heif_fourcc(a, b, c, d) ((uint32_t)((a<<24) | (b<<16) | (c<<8) | d))
69
64
 
70
65
  #include <libheif/heif_version.h>
@@ -157,16 +152,16 @@ void heif_deinit(void);
157
152
 
158
153
  // --- Plugins are currently only supported on Unix platforms.
159
154
 
160
- enum heif_plugin_type
155
+ typedef enum heif_plugin_type
161
156
  {
162
157
  heif_plugin_type_encoder,
163
158
  heif_plugin_type_decoder
164
- };
159
+ } heif_plugin_type;
165
160
 
166
161
  typedef struct heif_plugin_info
167
162
  {
168
163
  int version; // version of this info struct
169
- enum heif_plugin_type type;
164
+ heif_plugin_type type;
170
165
  const void* plugin;
171
166
  void* internal_handle; // for internal use only
172
167
  } heif_plugin_info;
@@ -28,7 +28,7 @@ extern "C" {
28
28
  #include <libheif/heif_library.h>
29
29
 
30
30
 
31
- enum heif_metadata_compression
31
+ typedef enum heif_metadata_compression
32
32
  {
33
33
  heif_metadata_compression_off = 0,
34
34
  heif_metadata_compression_auto = 1,
@@ -36,7 +36,10 @@ enum heif_metadata_compression
36
36
  heif_metadata_compression_deflate = 3,
37
37
  heif_metadata_compression_zlib = 4, // do not use for header data
38
38
  heif_metadata_compression_brotli = 5
39
- };
39
+ } heif_metadata_compression;
40
+
41
+ LIBHEIF_API
42
+ int heif_metadata_compression_method_supported(enum heif_metadata_compression method);
40
43
 
41
44
  // ------------------------- metadata (Exif / XMP) -------------------------
42
45
 
@@ -0,0 +1,104 @@
1
+ /*
2
+ * HEIF codec.
3
+ * Copyright (c) 2026 Brad Hards <bradh@frogmouth.net>
4
+ * Copyright (c) 2026 Dirk Farin <dirk.farin@gmail.com>
5
+ *
6
+ * This file is part of libheif.
7
+ *
8
+ * libheif is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU Lesser General Public License as
10
+ * published by the Free Software Foundation, either version 3 of
11
+ * the License, or (at your option) any later version.
12
+ *
13
+ * libheif is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU Lesser General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU Lesser General Public License
19
+ * along with libheif. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+
22
+ #ifndef LIBHEIF_HEIF_OMAF_H
23
+ #define LIBHEIF_HEIF_OMAF_H
24
+
25
+ #include <libheif/heif_library.h>
26
+ #include <libheif/heif_error.h>
27
+ #include <libheif/heif_image.h>
28
+ #include <libheif/heif_image_handle.h>
29
+
30
+ #ifdef __cplusplus
31
+ extern "C" {
32
+ #endif
33
+
34
+ // ------------------------- OMAF projection information -------------------------
35
+ //
36
+ // ISO/IEC 23090-2 "Omnidirectional media format" describes formats for
37
+ // representing immersive / 360-degree imagery. The 'prfr' (projection format)
38
+ // item property records the kind of projection used by the encoded image.
39
+
40
+ /**
41
+ * OMAF Image projection.
42
+ *
43
+ * The image projection for most images is flat - it is projected as intended to be shown on
44
+ * a flat screen or print. For immersive or omnidirectional media (e.g. VR headsets, or
45
+ * equivalent), there are alternatives such as an equirectangular projection or cubemap projection.
46
+ *
47
+ * See ISO/IEC 23090-2 "Omnidirectional media format" for more information.
48
+ */
49
+ typedef enum heif_omaf_image_projection
50
+ {
51
+ /**
52
+ * Equirectangular projection.
53
+ */
54
+ heif_omaf_image_projection_equirectangular = 0x00,
55
+
56
+ /**
57
+ * Cube map.
58
+ */
59
+ heif_omaf_image_projection_cube_map = 0x01,
60
+
61
+ /*
62
+ * Values 2 through 31 are reserved in ISO/IEC 23090-2:2023 Table 10.
63
+ * Files may carry any of them; libheif passes the raw projection_type
64
+ * value through unchanged, so callers can log or round-trip it.
65
+ * Handle anything outside the named constants in a `default:` arm.
66
+ */
67
+
68
+ /**
69
+ * Flat projection. Also returned by the get-projection accessors when no
70
+ * projection information is present on the image, so callers can use
71
+ * `result == heif_omaf_image_projection_flat` to test for "no prfr box".
72
+ * 0xFF lies outside the prfr value range reserved by ISO 23090-2:2023
73
+ * Table 10, so it cannot collide with a value read from a file.
74
+ */
75
+ heif_omaf_image_projection_flat = 0xFF,
76
+ } heif_omaf_image_projection;
77
+
78
+
79
+ // To test whether projection information is present, compare the getter's
80
+ // result against heif_omaf_image_projection_flat.
81
+
82
+ LIBHEIF_API
83
+ heif_omaf_image_projection heif_image_handle_get_omaf_image_projection(const heif_image_handle* handle);
84
+
85
+ LIBHEIF_API
86
+ void heif_image_handle_set_omaf_image_projection(heif_image_handle* handle,
87
+ heif_omaf_image_projection image_projection);
88
+
89
+ // Variants operating on a heif_image (a decoded or about-to-be-encoded pixel
90
+ // image). Setting the projection on a heif_image before encoding causes the
91
+ // resulting image item to carry the corresponding prfr property.
92
+
93
+ LIBHEIF_API
94
+ heif_omaf_image_projection heif_image_get_omaf_image_projection(const heif_image* image);
95
+
96
+ LIBHEIF_API
97
+ void heif_image_set_omaf_image_projection(heif_image* image,
98
+ heif_omaf_image_projection image_projection);
99
+
100
+ #ifdef __cplusplus
101
+ }
102
+ #endif
103
+
104
+ #endif
@@ -20,6 +20,7 @@
20
20
 
21
21
  #ifndef LIBHEIF_HEIF_PLUGIN_H
22
22
  #define LIBHEIF_HEIF_PLUGIN_H
23
+ #include "heif_sequences.h"
23
24
 
24
25
  #ifdef __cplusplus
25
26
  extern "C" {
@@ -43,9 +44,15 @@ extern "C" {
43
44
  // 1.13 2 3 2
44
45
  // 1.15 3 3 2
45
46
  // 1.20 4 3 2
47
+ // 1.21 5 4 2
48
+ // 1.22 6 4 2
46
49
 
47
- #define heif_decoder_plugin_latest_version 4
48
- #define heif_encoder_plugin_latest_version 3
50
+ #define heif_decoder_plugin_latest_version 6
51
+ #define heif_encoder_plugin_latest_version 4
52
+
53
+ // The minimum plugin versions that can be used with this libheif version.
54
+ #define heif_decoder_plugin_minimum_version 5
55
+ #define heif_encoder_plugin_minimum_version 4
49
56
 
50
57
  // ====================================================================================================
51
58
  // Decoder plugin API
@@ -53,6 +60,28 @@ extern "C" {
53
60
  // added as plugins. A plugin has to implement the functions specified in heif_decoder_plugin
54
61
  // and the plugin has to be registered to the libheif library using heif_register_decoder().
55
62
 
63
+ typedef struct heif_decoder_plugin_compressed_format_description
64
+ {
65
+ heif_compression_format format;
66
+
67
+ } heif_decoder_plugin_compressed_format_description;
68
+
69
+
70
+ typedef struct heif_decoder_plugin_options
71
+ {
72
+ heif_compression_format format;
73
+ int strict_decoding; // bool
74
+ int num_threads; // 0 - undefined, use decoder default
75
+
76
+ // --- added in plugin_api_version 6 ---
77
+ // Security limits the plugin must enforce for image allocations during decoding.
78
+ // The pointee must outlive the decoder instance (typically the context's limits).
79
+ // Only read by plugins reporting plugin_api_version >= 6.
80
+ const heif_security_limits* limits;
81
+
82
+ } heif_decoder_plugin_options;
83
+
84
+
56
85
  typedef struct heif_decoder_plugin
57
86
  {
58
87
  // API version supported by this plugin (see table above for supported versions)
@@ -73,7 +102,7 @@ typedef struct heif_decoder_plugin
73
102
  // Query whether the plugin supports decoding of the given format
74
103
  // Result is a priority value. The plugin with the largest value wins.
75
104
  // Default priority is 100. Returning 0 indicates that the plugin cannot decode this format.
76
- int (* does_support_format)(enum heif_compression_format format);
105
+ int (* does_support_format)(heif_compression_format format);
77
106
 
78
107
  // Create a new decoder context for decoding an image
79
108
  heif_error (* new_decoder)(void** decoder);
@@ -118,28 +147,46 @@ typedef struct heif_decoder_plugin
118
147
 
119
148
  // --- version 5 functions will follow below ... ---
120
149
 
150
+ uint32_t minimum_required_libheif_version;
151
+
152
+ // Query whether the plugin supports decoding of the given format
153
+ // Result is a priority value. The plugin with the largest value wins.
154
+ // Default priority is 100. Returning 0 indicates that the plugin cannot decode this format.
155
+ int (* does_support_format2)(const heif_decoder_plugin_compressed_format_description* format);
156
+
157
+ // Create a new decoder context for decoding an image
158
+ heif_error (* new_decoder2)(void** decoder, const heif_decoder_plugin_options*);
159
+
160
+ heif_error (* push_data2)(void* decoder, const void* data, size_t size, uintptr_t user_data);
161
+
162
+ heif_error (* flush_data)(void* decoder);
163
+
164
+ heif_error (* decode_next_image2)(void* decoder, heif_image** out_img,
165
+ uintptr_t* out_user_data,
166
+ const heif_security_limits* limits);
167
+
121
168
  // --- Note: when adding new versions, also update `heif_decoder_plugin_latest_version`.
122
169
  } heif_decoder_plugin;
123
170
 
124
171
 
125
- enum heif_encoded_data_type
172
+ typedef enum heif_encoded_data_type
126
173
  {
127
174
  heif_encoded_data_type_HEVC_header = 1,
128
175
  heif_encoded_data_type_HEVC_image = 2,
129
176
  heif_encoded_data_type_HEVC_depth_SEI = 3
130
- };
177
+ } heif_encoded_data_type;
131
178
 
132
179
 
133
180
  // Specifies the class of the input image content.
134
181
  // The encoder may want to encode different classes with different parameters
135
182
  // (e.g. always encode alpha lossless)
136
- enum heif_image_input_class
183
+ typedef enum heif_image_input_class
137
184
  {
138
185
  heif_image_input_class_normal = 1,
139
186
  heif_image_input_class_alpha = 2,
140
187
  heif_image_input_class_depth = 3,
141
188
  heif_image_input_class_thumbnail = 4
142
- };
189
+ } heif_image_input_class;
143
190
 
144
191
 
145
192
  typedef struct heif_encoder_plugin
@@ -151,7 +198,7 @@ typedef struct heif_encoder_plugin
151
198
  // --- version 1 functions ---
152
199
 
153
200
  // The compression format generated by this plugin.
154
- enum heif_compression_format compression_format;
201
+ heif_compression_format compression_format;
155
202
 
156
203
  // Short name of the encoder that can be used as command line parameter when selecting an encoder.
157
204
  // Hence, it should stay stable and not contain any version numbers that will change.
@@ -210,8 +257,8 @@ typedef struct heif_encoder_plugin
210
257
 
211
258
  // Replace the input colorspace/chroma with the one that is supported by the encoder and that
212
259
  // comes as close to the input colorspace/chroma as possible.
213
- void (* query_input_colorspace)(enum heif_colorspace* inout_colorspace,
214
- enum heif_chroma* inout_chroma);
260
+ void (* query_input_colorspace)(heif_colorspace* inout_colorspace,
261
+ heif_chroma* inout_chroma);
215
262
 
216
263
  // Encode an image.
217
264
  // After pushing an image into the encoder, you should call get_compressed_data() to
@@ -228,8 +275,8 @@ typedef struct heif_encoder_plugin
228
275
  // --- version 2 ---
229
276
 
230
277
  void (* query_input_colorspace2)(void* encoder,
231
- enum heif_colorspace* inout_colorspace,
232
- enum heif_chroma* inout_chroma);
278
+ heif_colorspace* inout_colorspace,
279
+ heif_chroma* inout_chroma);
233
280
 
234
281
  // --- version 3 ---
235
282
 
@@ -240,7 +287,27 @@ typedef struct heif_encoder_plugin
240
287
  void (* query_encoded_size)(void* encoder, uint32_t input_width, uint32_t input_height,
241
288
  uint32_t* encoded_width, uint32_t* encoded_height);
242
289
 
243
- // --- version 4 functions will follow below ... ---
290
+ // --- version 4 ---
291
+
292
+ uint32_t minimum_required_libheif_version;
293
+
294
+ heif_error (* start_sequence_encoding)(void* encoder, const heif_image* image,
295
+ enum heif_image_input_class image_class,
296
+ uint32_t framerate_num, uint32_t framerate_denom,
297
+ const heif_sequence_encoding_options* options);
298
+ // TODO: is heif_sequence_encoding_options a good choice here?
299
+
300
+ heif_error (* encode_sequence_frame)(void* encoder, const heif_image* image, uintptr_t frame_nr);
301
+
302
+ heif_error (* end_sequence_encoding)(void* encoder);
303
+
304
+ heif_error (* get_compressed_data2)(void* encoder, uint8_t** data, int* size,
305
+ uintptr_t* frame_nr,
306
+ int* is_keyframe, int* more_frame_packets);
307
+
308
+ int does_indicate_keyframes;
309
+
310
+ // --- version 5 functions will follow below ... ---
244
311
 
245
312
  // --- Note: when adding new versions, also update `heif_encoder_plugin_latest_version`.
246
313
  } heif_encoder_plugin;
@@ -29,7 +29,7 @@ extern "C" {
29
29
 
30
30
  // ------------------------- item properties -------------------------
31
31
 
32
- enum heif_item_property_type
32
+ typedef enum heif_item_property_type
33
33
  {
34
34
  // heif_item_property_unknown = -1,
35
35
  heif_item_property_type_invalid = 0,
@@ -40,8 +40,9 @@ enum heif_item_property_type
40
40
  heif_item_property_type_image_size = heif_fourcc('i', 's', 'p', 'e'),
41
41
  heif_item_property_type_uuid = heif_fourcc('u', 'u', 'i', 'd'),
42
42
  heif_item_property_type_tai_clock_info = heif_fourcc('t', 'a', 'i', 'c'),
43
- heif_item_property_type_tai_timestamp = heif_fourcc('i', 't', 'a', 'i')
44
- };
43
+ heif_item_property_type_tai_timestamp = heif_fourcc('i', 't', 'a', 'i'),
44
+ heif_item_property_type_extended_language = heif_fourcc('e', 'l', 'n', 'g')
45
+ } heif_item_property_type;
45
46
 
46
47
  // Get the heif_property_id for a heif_item_id.
47
48
  // You may specify which property 'type' you want to receive.
@@ -104,14 +105,15 @@ heif_error heif_item_add_property_user_description(const heif_context* context,
104
105
  LIBHEIF_API
105
106
  void heif_property_user_description_release(heif_property_user_description*);
106
107
 
107
- enum heif_transform_mirror_direction
108
+ typedef enum heif_transform_mirror_direction
108
109
  {
109
110
  heif_transform_mirror_direction_invalid = -1,
110
111
  heif_transform_mirror_direction_vertical = 0, // flip image vertically
111
112
  heif_transform_mirror_direction_horizontal = 1 // flip image horizontally
112
- };
113
+ } heif_transform_mirror_direction;
113
114
 
114
115
  // Will return 'heif_transform_mirror_direction_invalid' in case of error.
116
+ // If 'propertyId==0', it returns the first imir property found.
115
117
  LIBHEIF_API
116
118
  enum heif_transform_mirror_direction heif_item_get_property_transform_mirror(const heif_context* context,
117
119
  heif_item_id itemId,
@@ -119,6 +121,7 @@ enum heif_transform_mirror_direction heif_item_get_property_transform_mirror(con
119
121
 
120
122
  // Returns only 0, 90, 180, or 270 angle values.
121
123
  // Returns -1 in case of error (but it will only return an error in case of wrong usage).
124
+ // If 'propertyId==0', it returns the first irot property found.
122
125
  LIBHEIF_API
123
126
  int heif_item_get_property_transform_rotation_ccw(const heif_context* context,
124
127
  heif_item_id itemId,
@@ -127,6 +130,7 @@ int heif_item_get_property_transform_rotation_ccw(const heif_context* context,
127
130
  // Returns the number of pixels that should be removed from the four edges.
128
131
  // Because of the way this data is stored, you have to pass the image size at the moment of the crop operation
129
132
  // to compute the cropped border sizes.
133
+ // If 'propertyId==0', it returns the first clap property found.
130
134
  LIBHEIF_API
131
135
  void heif_item_get_property_transform_crop_borders(const heif_context* context,
132
136
  heif_item_id itemId,
@@ -188,6 +192,256 @@ heif_error heif_item_get_property_uuid_type(const heif_context* context,
188
192
  uint8_t out_extended_type[16]);
189
193
 
190
194
 
195
+ // ------------------------- ISO/IEC 23001-17 properties -------------------------
196
+ //
197
+ // Imaging-metadata properties defined by ISO/IEC 23001-17 (uncompressed-image
198
+ // format) and currently surfaced on uncompressed images. They operate on a
199
+ // heif_image (the in-memory pixel image) rather than on (context, item_id) like
200
+ // the box-level property API above.
201
+
202
+
203
+ // --- Bayer / filter array pattern (cpat box)
204
+
205
+ typedef struct heif_bayer_pattern_pixel
206
+ {
207
+ uint32_t component_id;
208
+ float component_gain;
209
+ } heif_bayer_pattern_pixel;
210
+
211
+
212
+ // Set a Bayer / filter array pattern on an image.
213
+ // The pattern is a 2D array of component indices with dimensions pattern_width x pattern_height.
214
+ // The number of entries in patternPixels must be pattern_width * pattern_height.
215
+ // The component_index values are indices into the cmpd component definition table.
216
+ // On the encoder path, these indices are generated by heif_image_add_component() and the
217
+ // encoder adds reference components to cmpd for pattern entries that don't have image planes.
218
+ // On the decoder path, they come directly from the cpat box.
219
+ LIBHEIF_API
220
+ heif_error heif_image_set_bayer_pattern(heif_image*,
221
+ uint32_t bayer_component_id,
222
+ uint16_t pattern_width,
223
+ uint16_t pattern_height,
224
+ const heif_bayer_pattern_pixel* patternPixels);
225
+
226
+ // Add a reference-only component to the image's component description table for use as
227
+ // a Bayer pattern entry. The component is registered (its component_type appears in the
228
+ // cmpd box) but carries no pixel plane of its own — the actual pixel data lives in the
229
+ // single combined Bayer component (added with heif_image_add_component()).
230
+ //
231
+ // Use this for the per-cell colors that the Bayer pattern references (e.g. red, green,
232
+ // blue) when those colors have no standalone plane. Pass the returned component_id in
233
+ // heif_bayer_pattern_pixel::component_id of the patternPixels array given to
234
+ // heif_image_set_bayer_pattern().
235
+ //
236
+ // component_type: one of heif_cmpd_component_type_* (e.g. _red, _green, _blue).
237
+ // out_component_id: receives the minted component id. Must not be NULL.
238
+ LIBHEIF_API
239
+ heif_error heif_image_add_bayer_component(heif_image*,
240
+ uint16_t component_type,
241
+ uint32_t* out_component_id);
242
+
243
+ // Returns whether the image has a Bayer / filter array pattern.
244
+ // If the image has a pattern, out_pattern_width and out_pattern_height are set.
245
+ // Either output pointer may be NULL if the caller does not need that value.
246
+ LIBHEIF_API
247
+ int heif_image_get_bayer_pattern_size(const heif_image*,
248
+ uint32_t bayer_component_id,
249
+ uint16_t* out_pattern_width,
250
+ uint16_t* out_pattern_height);
251
+
252
+ // Get the Bayer / filter array pattern pixels.
253
+ // The caller must provide an array large enough for pattern_width * pattern_height entries
254
+ // (use heif_image_get_bayer_pattern_size() to query the dimensions first).
255
+ // Returns heif_error_Ok on success, or an error if no pattern is set.
256
+ LIBHEIF_API
257
+ heif_error heif_image_get_bayer_pattern(const heif_image*,
258
+ uint32_t bayer_component_id,
259
+ heif_bayer_pattern_pixel* out_patternPixels);
260
+
261
+
262
+ // --- Polarization pattern (ISO 23001-17, Section 6.1.5)
263
+
264
+ // Special float value indicating "no polarization filter" at a pattern position.
265
+ // On the wire this is the IEEE 754 bit pattern 0xFFFFFFFF (a signaling NaN).
266
+ // Test with heif_polarization_angle_is_no_filter() below, or with isnan()/std::isnan().
267
+
268
+ // Returns a float with the 0xFFFFFFFF bit pattern (NaN) representing "no polarization filter".
269
+ LIBHEIF_API
270
+ float heif_polarization_angle_no_filter(void);
271
+
272
+ // Returns non-zero if the given angle has the "no filter" bit pattern (0xFFFFFFFF).
273
+ LIBHEIF_API
274
+ int heif_polarization_angle_is_no_filter(float angle);
275
+
276
+ // Add a polarization pattern to an image.
277
+ // component_indices: array of component indices this pattern applies to (may be NULL if num_component_indices == 0,
278
+ // meaning the pattern applies to all components).
279
+ // polarization_angles: array of pattern_width * pattern_height float values.
280
+ // Each is an angle in degrees [0.0, 360.0), or heif_polarization_angle_no_filter() for "no filter".
281
+ // Multiple patterns can be added (one per distinct component group).
282
+ LIBHEIF_API
283
+ heif_error heif_image_add_polarization_pattern(heif_image*,
284
+ uint32_t num_component_indices,
285
+ const uint32_t* component_indices,
286
+ uint16_t pattern_width,
287
+ uint16_t pattern_height,
288
+ const float* polarization_angles);
289
+
290
+ // Returns the number of polarization patterns on this image (0 if none).
291
+ LIBHEIF_API
292
+ int heif_image_get_number_of_polarization_patterns(const heif_image*);
293
+
294
+ // Get the sizes/dimensions of a polarization pattern (to allocate arrays for the data query).
295
+ LIBHEIF_API
296
+ heif_error heif_image_get_polarization_pattern_info(const heif_image*,
297
+ int pattern_index,
298
+ uint32_t* out_num_component_indices,
299
+ uint16_t* out_pattern_width,
300
+ uint16_t* out_pattern_height);
301
+
302
+ // Get the actual data of a polarization pattern.
303
+ // Caller must provide pre-allocated arrays:
304
+ // out_component_indices: num_component_indices entries (may be NULL if num_component_indices == 0)
305
+ // out_polarization_angles: pattern_width * pattern_height entries
306
+ LIBHEIF_API
307
+ heif_error heif_image_get_polarization_pattern_data(const heif_image*,
308
+ int pattern_index,
309
+ uint32_t* out_component_indices,
310
+ float* out_polarization_angles);
311
+
312
+ // Find the polarization pattern index that applies to a given component index.
313
+ // Returns the pattern index (>= 0), or -1 if no pattern matches.
314
+ // A pattern with an empty component list (component_count == 0) matches all components.
315
+ LIBHEIF_API
316
+ int heif_image_get_polarization_pattern_index_for_component(const heif_image*,
317
+ uint32_t component_index);
318
+
319
+
320
+ // --- Sensor bad pixels map (ISO 23001-17, Section 6.1.7)
321
+
322
+ typedef struct heif_bad_pixel
323
+ {
324
+ uint32_t row; uint32_t column;
325
+ } heif_bad_pixel;
326
+
327
+ // Add a sensor bad pixels map to an image.
328
+ // component_indices: array of component indices this map applies to (may be NULL if num_component_indices == 0,
329
+ // meaning the map applies to all components).
330
+ // Multiple maps can be added (one per distinct component group with different defects).
331
+ LIBHEIF_API
332
+ heif_error heif_image_add_sensor_bad_pixels_map(heif_image*,
333
+ uint32_t num_component_indices,
334
+ const uint32_t* component_indices,
335
+ int correction_applied,
336
+ uint32_t num_bad_rows,
337
+ const uint32_t* bad_rows,
338
+ uint32_t num_bad_columns,
339
+ const uint32_t* bad_columns,
340
+ uint32_t num_bad_pixels,
341
+ const heif_bad_pixel* bad_pixels);
342
+
343
+ // Returns the number of sensor bad pixels maps on this image (0 if none).
344
+ LIBHEIF_API
345
+ int heif_image_get_number_of_sensor_bad_pixels_maps(const heif_image*);
346
+
347
+ // Get the sizes of a sensor bad pixels map (to allocate arrays for the data query).
348
+ LIBHEIF_API
349
+ heif_error heif_image_get_sensor_bad_pixels_map_info(const heif_image*,
350
+ int map_index,
351
+ uint32_t* out_num_component_indices,
352
+ int* out_correction_applied,
353
+ uint32_t* out_num_bad_rows,
354
+ uint32_t* out_num_bad_columns,
355
+ uint32_t* out_num_bad_pixels);
356
+
357
+ // Get the actual data of a sensor bad pixels map.
358
+ // Caller must provide pre-allocated arrays:
359
+ // out_component_indices: num_component_indices entries (may be NULL if num_component_indices == 0)
360
+ // out_bad_rows: num_bad_rows entries (may be NULL if num_bad_rows == 0)
361
+ // out_bad_columns: num_bad_columns entries (may be NULL if num_bad_columns == 0)
362
+ // out_bad_pixels: num_bad_pixels entries (may be NULL if num_bad_pixels == 0)
363
+ LIBHEIF_API
364
+ heif_error heif_image_get_sensor_bad_pixels_map_data(const heif_image*,
365
+ int map_index,
366
+ uint32_t* out_component_indices,
367
+ uint32_t* out_bad_rows,
368
+ uint32_t* out_bad_columns,
369
+ struct heif_bad_pixel* out_bad_pixels);
370
+
371
+
372
+ // --- Sensor non-uniformity correction (ISO 23001-17, Section 6.1.6)
373
+
374
+ // Add a sensor non-uniformity correction table to an image.
375
+ // component_indices: array of component indices this NUC applies to (may be NULL if num_component_indices == 0,
376
+ // meaning it applies to all components).
377
+ // nuc_gains and nuc_offsets: arrays of image_width * image_height float values.
378
+ // Correction equation: y = nuc_gain * x + nuc_offset.
379
+ // Multiple NUC tables can be added (one per distinct component group).
380
+ LIBHEIF_API
381
+ heif_error heif_image_add_sensor_nuc(heif_image*,
382
+ uint32_t num_component_indices,
383
+ const uint32_t* component_indices,
384
+ int nuc_is_applied,
385
+ uint32_t image_width,
386
+ uint32_t image_height,
387
+ const float* nuc_gains,
388
+ const float* nuc_offsets);
389
+
390
+ // Returns the number of sensor NUC tables on this image (0 if none).
391
+ LIBHEIF_API
392
+ int heif_image_get_number_of_sensor_nucs(const heif_image*);
393
+
394
+ // Get the sizes of a sensor NUC table (to allocate arrays for the data query).
395
+ LIBHEIF_API
396
+ heif_error heif_image_get_sensor_nuc_info(const heif_image*,
397
+ int nuc_index,
398
+ uint32_t* out_num_component_indices,
399
+ int* out_nuc_is_applied,
400
+ uint32_t* out_image_width,
401
+ uint32_t* out_image_height);
402
+
403
+ // Get the actual data of a sensor NUC table.
404
+ // Caller must provide pre-allocated arrays:
405
+ // out_component_indices: num_component_indices entries (may be NULL if num_component_indices == 0)
406
+ // out_nuc_gains: image_width * image_height entries
407
+ // out_nuc_offsets: image_width * image_height entries
408
+ LIBHEIF_API
409
+ heif_error heif_image_get_sensor_nuc_data(const heif_image*,
410
+ int nuc_index,
411
+ uint32_t* out_component_indices,
412
+ float* out_nuc_gains,
413
+ float* out_nuc_offsets);
414
+
415
+
416
+ // --- Chroma sample location (ISO 23091-2 / ITU-T H.273 + ISO 23001-17, Section 6.1.4) [cloc box]
417
+
418
+ typedef enum heif_chroma420_sample_location {
419
+ // values 0-5 according to ISO 23091-2 / ITU-T H.273
420
+ heif_chroma420_sample_location_00_05 = 0,
421
+ heif_chroma420_sample_location_05_05 = 1,
422
+ heif_chroma420_sample_location_00_00 = 2,
423
+ heif_chroma420_sample_location_05_00 = 3,
424
+ heif_chroma420_sample_location_00_10 = 4,
425
+ heif_chroma420_sample_location_05_10 = 5,
426
+
427
+ // value 6 according to ISO 23001-17
428
+ heif_chroma420_sample_location_00_00_01_00 = 6
429
+ } heif_chroma420_sample_location;
430
+
431
+ // Set the chroma sample location on an image.
432
+ // chroma_location must be in the range 0-6 (see heif_chroma420_sample_location).
433
+ LIBHEIF_API
434
+ heif_error heif_image_set_chroma_location(heif_image*, uint8_t chroma_location);
435
+
436
+ // Returns non-zero if the image has a chroma sample location set.
437
+ LIBHEIF_API
438
+ int heif_image_has_chroma_location(const heif_image*);
439
+
440
+ // Returns the chroma sample location (0-6), or 0 if none is set.
441
+ LIBHEIF_API
442
+ uint8_t heif_image_get_chroma_location(const heif_image*);
443
+
444
+
191
445
  // ------------------------- intrinsic and extrinsic matrices -------------------------
192
446
 
193
447
  typedef struct heif_camera_intrinsic_matrix