@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
@@ -0,0 +1,264 @@
1
+ /*
2
+ * HEIF codec.
3
+ * Copyright (c) 2026 Dirk Farin <dirk.farin@gmail.com>
4
+ *
5
+ * This file is part of libheif.
6
+ *
7
+ * libheif is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as
9
+ * published by the Free Software Foundation, either version 3 of
10
+ * the License, or (at your option) any later version.
11
+ *
12
+ * libheif is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with libheif. If not, see <http://www.gnu.org/licenses/>.
19
+ */
20
+
21
+ #ifndef LIBHEIF_HEIF_COMPONENTS_H
22
+ #define LIBHEIF_HEIF_COMPONENTS_H
23
+
24
+ #include "libheif/heif_library.h"
25
+ #include "libheif/heif_image.h"
26
+ #include "libheif/heif_image_handle.h"
27
+
28
+ #ifdef __cplusplus
29
+ extern "C" {
30
+ #endif
31
+
32
+ /* @file heif_components.h
33
+ * @brief Multi-component image API.
34
+ *
35
+ * The component model (id-addressed pixel planes with per-component type,
36
+ * datatype and bit-depth) is codec-agnostic. It was introduced for ISO 23001-17
37
+ * (uncompressed) images but is also expected to be reused by other codecs that
38
+ * carry multiple typed components (e.g. JPEG-2000).
39
+ */
40
+
41
+
42
+ // --- pixel datatype support
43
+ //
44
+ // The numeric values are aligned with the ISO/IEC 23001-17 Table 2
45
+ // component_format byte (used by the uncC box of the uncompressed codec).
46
+ // This is an internal convenience and should not be relied upon.
47
+
48
+ typedef enum heif_component_datatype
49
+ {
50
+ heif_component_datatype_unsigned_integer = 0,
51
+ heif_component_datatype_floating_point = 1,
52
+ heif_component_datatype_complex_number = 2,
53
+ heif_component_datatype_signed_integer = 3,
54
+ heif_component_datatype_undefined = 0xFF
55
+ } heif_component_datatype;
56
+
57
+ typedef struct heif_complex32
58
+ {
59
+ float real, imaginary;
60
+ } heif_complex32;
61
+
62
+ typedef struct heif_complex64
63
+ {
64
+ double real, imaginary;
65
+ } heif_complex64;
66
+
67
+
68
+ // --- component types (ISO/IEC 23001-17 Table 1, used in the cmpd box)
69
+
70
+ typedef enum heif_cmpd_component_type
71
+ {
72
+ heif_cmpd_component_type_monochrome = 0,
73
+ heif_cmpd_component_type_Y = 1,
74
+ heif_cmpd_component_type_Cb = 2,
75
+ heif_cmpd_component_type_Cr = 3,
76
+ heif_cmpd_component_type_red = 4,
77
+ heif_cmpd_component_type_green = 5,
78
+ heif_cmpd_component_type_blue = 6,
79
+ heif_cmpd_component_type_alpha = 7,
80
+ heif_cmpd_component_type_depth = 8,
81
+ heif_cmpd_component_type_disparity = 9,
82
+ heif_cmpd_component_type_palette = 10,
83
+ heif_cmpd_component_type_filter_array = 11,
84
+ heif_cmpd_component_type_padded = 12,
85
+ heif_cmpd_component_type_cyan = 13,
86
+ heif_cmpd_component_type_magenta = 14,
87
+ heif_cmpd_component_type_yellow = 15,
88
+ heif_cmpd_component_type_key_black = 16
89
+ } heif_cmpd_component_type;
90
+
91
+
92
+ // --- ID-based component access (operates on a decoded heif_image)
93
+
94
+ // Returns the number of components that have pixel data (planes) in this image.
95
+ LIBHEIF_API
96
+ uint32_t heif_image_get_number_of_used_components(const heif_image*);
97
+
98
+ // Fills `out_component_ids` with the valid component IDs.
99
+ // The caller must allocate an array of at least heif_image_get_number_of_used_components() elements.
100
+ LIBHEIF_API
101
+ void heif_image_get_used_component_ids(const heif_image*, uint32_t* out_component_ids);
102
+
103
+ LIBHEIF_API
104
+ heif_channel heif_image_get_component_channel(const heif_image*, uint32_t component_id);
105
+
106
+ LIBHEIF_API
107
+ uint32_t heif_image_get_component_width(const heif_image*, uint32_t component_id);
108
+
109
+ LIBHEIF_API
110
+ uint32_t heif_image_get_component_height(const heif_image*, uint32_t component_id);
111
+
112
+ LIBHEIF_API
113
+ int heif_image_get_component_bits_per_pixel(const heif_image*, uint32_t component_id);
114
+
115
+ LIBHEIF_API
116
+ uint16_t heif_image_get_component_type(const heif_image*, uint32_t component_id);
117
+
118
+ // Returns the datatype (unsigned/signed integer, floating point, or complex
119
+ // number) of the given component.
120
+ LIBHEIF_API
121
+ heif_component_datatype heif_image_get_component_datatype(const heif_image*, uint32_t component_id);
122
+
123
+
124
+ // --- ID-based component access via heif_image_handle (before decoding)
125
+ //
126
+ // These let the caller introspect a multi-component image's components without
127
+ // decoding any tile. They return 0 / -1 / heif_component_datatype_undefined for
128
+ // images that do not expose a component model or for unknown component IDs.
129
+ //
130
+ // The component IDs returned here match the IDs that
131
+ // heif_image_get_used_component_ids() will report after the same image is
132
+ // decoded, so the same numerical id can be used to address a component on
133
+ // either side of the API.
134
+
135
+ LIBHEIF_API
136
+ uint32_t heif_image_handle_get_number_of_components(const heif_image_handle*);
137
+
138
+ // Fills `out_component_ids` with the valid component IDs.
139
+ // The caller must allocate an array of at least
140
+ // heif_image_handle_get_number_of_components() elements.
141
+ LIBHEIF_API
142
+ void heif_image_handle_get_used_component_ids(const heif_image_handle*, uint32_t* out_component_ids);
143
+
144
+ LIBHEIF_API
145
+ uint16_t heif_image_handle_get_component_type(const heif_image_handle*, uint32_t component_id);
146
+
147
+ LIBHEIF_API
148
+ int heif_image_handle_get_component_bits_per_pixel(const heif_image_handle*, uint32_t component_id);
149
+
150
+ LIBHEIF_API
151
+ heif_component_datatype heif_image_handle_get_component_datatype(const heif_image_handle*, uint32_t component_id);
152
+
153
+
154
+ // --- adding components to a heif_image (encoder path)
155
+
156
+ LIBHEIF_API
157
+ heif_error heif_image_add_component(heif_image* image,
158
+ int width, int height,
159
+ uint16_t component_type,
160
+ heif_component_datatype datatype,
161
+ int bit_depth,
162
+ uint32_t* out_component_id);
163
+
164
+
165
+ // --- untyped uint8 component data getters: stride is in BYTES per row.
166
+
167
+ LIBHEIF_API
168
+ const uint8_t* heif_image_get_component_readonly(const heif_image*, uint32_t component_id, size_t* out_stride);
169
+
170
+ LIBHEIF_API
171
+ uint8_t* heif_image_get_component(heif_image*, uint32_t component_id, size_t* out_stride);
172
+
173
+
174
+ // --- typed component data getters: `out_row_elements` is the number of T
175
+ // elements per row, not bytes. Index with `data[y * row_elements + x]` (no
176
+ // casts, no sizeof). libheif allocates rows with element-aligned padding, so
177
+ // this count is always exact for the named type T.
178
+
179
+ LIBHEIF_API
180
+ const uint16_t* heif_image_get_component_uint16_readonly(const heif_image*, uint32_t component_id, size_t* out_row_elements);
181
+
182
+ LIBHEIF_API
183
+ uint16_t* heif_image_get_component_uint16(heif_image*, uint32_t component_id, size_t* out_row_elements);
184
+
185
+ LIBHEIF_API
186
+ const uint32_t* heif_image_get_component_uint32_readonly(const heif_image*, uint32_t component_id, size_t* out_row_elements);
187
+
188
+ LIBHEIF_API
189
+ uint32_t* heif_image_get_component_uint32(heif_image*, uint32_t component_id, size_t* out_row_elements);
190
+
191
+ LIBHEIF_API
192
+ const uint64_t* heif_image_get_component_uint64_readonly(const heif_image*, uint32_t component_id, size_t* out_row_elements);
193
+
194
+ LIBHEIF_API
195
+ uint64_t* heif_image_get_component_uint64(heif_image*, uint32_t component_id, size_t* out_row_elements);
196
+
197
+ LIBHEIF_API
198
+ const int8_t* heif_image_get_component_int8_readonly(const heif_image*, uint32_t component_id, size_t* out_row_elements);
199
+
200
+ LIBHEIF_API
201
+ int8_t* heif_image_get_component_int8(heif_image*, uint32_t component_id, size_t* out_row_elements);
202
+
203
+ LIBHEIF_API
204
+ const int16_t* heif_image_get_component_int16_readonly(const heif_image*, uint32_t component_id, size_t* out_row_elements);
205
+
206
+ LIBHEIF_API
207
+ int16_t* heif_image_get_component_int16(heif_image*, uint32_t component_id, size_t* out_row_elements);
208
+
209
+ LIBHEIF_API
210
+ const int32_t* heif_image_get_component_int32_readonly(const heif_image*, uint32_t component_id, size_t* out_row_elements);
211
+
212
+ LIBHEIF_API
213
+ int32_t* heif_image_get_component_int32(heif_image*, uint32_t component_id, size_t* out_row_elements);
214
+
215
+ LIBHEIF_API
216
+ const int64_t* heif_image_get_component_int64_readonly(const heif_image*, uint32_t component_id, size_t* out_row_elements);
217
+
218
+ LIBHEIF_API
219
+ int64_t* heif_image_get_component_int64(heif_image*, uint32_t component_id, size_t* out_row_elements);
220
+
221
+ LIBHEIF_API
222
+ const float* heif_image_get_component_float32_readonly(const heif_image*, uint32_t component_id, size_t* out_row_elements);
223
+
224
+ LIBHEIF_API
225
+ float* heif_image_get_component_float32(heif_image*, uint32_t component_id, size_t* out_row_elements);
226
+
227
+ LIBHEIF_API
228
+ const double* heif_image_get_component_float64_readonly(const heif_image*, uint32_t component_id, size_t* out_row_elements);
229
+
230
+ LIBHEIF_API
231
+ double* heif_image_get_component_float64(heif_image*, uint32_t component_id, size_t* out_row_elements);
232
+
233
+ LIBHEIF_API
234
+ const heif_complex32* heif_image_get_component_complex32_readonly(const heif_image*, uint32_t component_id, size_t* out_row_elements);
235
+
236
+ LIBHEIF_API
237
+ heif_complex32* heif_image_get_component_complex32(heif_image*, uint32_t component_id, size_t* out_row_elements);
238
+
239
+ LIBHEIF_API
240
+ const heif_complex64* heif_image_get_component_complex64_readonly(const heif_image*, uint32_t component_id, size_t* out_row_elements);
241
+
242
+ LIBHEIF_API
243
+ heif_complex64* heif_image_get_component_complex64(heif_image*, uint32_t component_id, size_t* out_row_elements);
244
+
245
+
246
+ // --- GIMI component content IDs (set before encoding)
247
+
248
+ // Set a GIMI component content ID for the component with the given
249
+ // component_id (as minted by heif_image_add_component / returned via the
250
+ // component access API). Pass an empty string to clear a previously set id.
251
+ // Returns an error if no component with this id exists on the image.
252
+ // The collected ids are written into an ItemComponentContentIDProperty box
253
+ // during encoding.
254
+ LIBHEIF_API
255
+ heif_error heif_image_set_gimi_component_content_id(heif_image*,
256
+ uint32_t component_id,
257
+ const char* content_id);
258
+
259
+
260
+ #ifdef __cplusplus
261
+ }
262
+ #endif
263
+
264
+ #endif
@@ -35,7 +35,7 @@ extern "C" {
35
35
  /**
36
36
  * libheif known compression formats.
37
37
  */
38
- enum heif_compression_format
38
+ typedef enum heif_compression_format
39
39
  {
40
40
  /**
41
41
  * Unspecified / undefined compression format.
@@ -115,7 +115,7 @@ enum heif_compression_format
115
115
  * The core encoding is defined in ISO/IEC 15444-15, or ITU-T T.814.
116
116
  */
117
117
  heif_compression_HTJ2K = 10
118
- };
118
+ } heif_compression_format;
119
119
 
120
120
 
121
121
  // ========================= heif_context =========================
@@ -136,13 +136,13 @@ void heif_context_free(heif_context*);
136
136
 
137
137
  typedef struct heif_reading_options heif_reading_options;
138
138
 
139
- enum heif_reader_grow_status
139
+ typedef enum heif_reader_grow_status
140
140
  {
141
141
  heif_reader_grow_status_size_reached, // requested size has been reached, we can read until this point
142
142
  heif_reader_grow_status_timeout, // size has not been reached yet, but it may still grow further (deprecated)
143
143
  heif_reader_grow_status_size_beyond_eof, // size has not been reached and never will. The file has grown to its full size
144
144
  heif_reader_grow_status_error // an error has occurred
145
- };
145
+ } heif_reader_grow_status;
146
146
 
147
147
 
148
148
  typedef struct heif_reader_range_request_result
@@ -295,6 +295,20 @@ heif_error heif_context_get_image_handle(heif_context* ctx,
295
295
  LIBHEIF_API
296
296
  void heif_context_debug_dump_boxes_to_file(heif_context* ctx, int fd);
297
297
 
298
+ // ====================================================================================================
299
+ // Mini format (experimental)
300
+
301
+ // Enable writing in the compact 'mini' box format (ISO/IEC 23008-12 DAmd2).
302
+ // When enabled, the output file will use a single 'mini' box instead of the standard
303
+ // meta+mdat box structure, if the file content is compatible with the mini format.
304
+ // If the content cannot be represented as a mini box, the standard format is used as fallback.
305
+ // Note: the mini box format is defined by a draft amendment to ISO/IEC 23008-12
306
+ // and may have reduced interoperability with other readers.
307
+ // Default: disabled.
308
+ LIBHEIF_API
309
+ void heif_context_set_write_mini_format(heif_context*, int enable);
310
+
311
+
298
312
  // ====================================================================================================
299
313
  // Write the heif_context to a HEIF file
300
314
 
@@ -283,7 +283,7 @@ namespace heif {
283
283
  public:
284
284
  ColorProfile_nclx();
285
285
 
286
- ~ColorProfile_nclx();
286
+ ~ColorProfile_nclx() = default;
287
287
 
288
288
  heif_color_primaries get_color_primaries() const;
289
289
 
@@ -305,10 +305,9 @@ namespace heif {
305
305
  void set_full_range_flag(bool is_full_range);
306
306
 
307
307
  private:
308
- ColorProfile_nclx(heif_color_profile_nclx* nclx)
309
- { mProfile = nclx; }
308
+ ColorProfile_nclx(heif_color_profile_nclx* nclx);
310
309
 
311
- heif_color_profile_nclx* mProfile;
310
+ std::shared_ptr<heif_color_profile_nclx> mProfile;
312
311
 
313
312
  friend class Image;
314
313
  };
@@ -324,8 +323,8 @@ namespace heif {
324
323
 
325
324
  // throws Error
326
325
  void create(int width, int height,
327
- enum heif_colorspace colorspace,
328
- enum heif_chroma chroma);
326
+ heif_colorspace colorspace,
327
+ heif_chroma chroma);
329
328
 
330
329
  // throws Error
331
330
  void add_plane(enum heif_channel channel,
@@ -392,14 +391,14 @@ namespace heif {
392
391
  {
393
392
  public:
394
393
  static std::vector<EncoderDescriptor>
395
- get_encoder_descriptors(enum heif_compression_format format_filter,
394
+ get_encoder_descriptors(heif_compression_format format_filter,
396
395
  const char* name_filter) noexcept;
397
396
 
398
397
  std::string get_name() const noexcept;
399
398
 
400
399
  std::string get_id_name() const noexcept;
401
400
 
402
- enum heif_compression_format get_compression_format() const noexcept;
401
+ heif_compression_format get_compression_format() const noexcept;
403
402
 
404
403
  // DEPRECATED: typo in function name
405
404
  bool supportes_lossy_compression() const noexcept;
@@ -454,7 +453,7 @@ namespace heif {
454
453
  {
455
454
  public:
456
455
  // throws Error
457
- Encoder(enum heif_compression_format format);
456
+ Encoder(heif_compression_format format);
458
457
 
459
458
  // throws Error
460
459
  void set_lossy_quality(int quality);
@@ -813,12 +812,15 @@ namespace heif {
813
812
 
814
813
  inline ColorProfile_nclx::ColorProfile_nclx()
815
814
  {
816
- mProfile = heif_nclx_color_profile_alloc();
815
+ auto profile = heif_nclx_color_profile_alloc();
816
+ mProfile = std::shared_ptr<heif_color_profile_nclx>(profile,
817
+ [](heif_color_profile_nclx* p) { heif_nclx_color_profile_free(p); });
817
818
  }
818
819
 
819
- inline ColorProfile_nclx::~ColorProfile_nclx()
820
+ inline ColorProfile_nclx::ColorProfile_nclx(heif_color_profile_nclx* nclx)
820
821
  {
821
- heif_nclx_color_profile_free(mProfile);
822
+ mProfile = std::shared_ptr<heif_color_profile_nclx>(nclx,
823
+ [](heif_color_profile_nclx* p) { heif_nclx_color_profile_free(p); });
822
824
  }
823
825
 
824
826
  inline heif_color_primaries ColorProfile_nclx::get_color_primaries() const
@@ -857,8 +859,8 @@ namespace heif {
857
859
 
858
860
 
859
861
  inline void Image::create(int width, int height,
860
- enum heif_colorspace colorspace,
861
- enum heif_chroma chroma)
862
+ heif_colorspace colorspace,
863
+ heif_chroma chroma)
862
864
  {
863
865
  heif_image* image;
864
866
  Error err = Error(heif_image_create(width, height, colorspace, chroma, &image));
@@ -938,7 +940,7 @@ namespace heif {
938
940
 
939
941
  inline void Image::set_nclx_color_profile(const ColorProfile_nclx& nclx)
940
942
  {
941
- Error err = Error(heif_image_set_nclx_color_profile(m_image.get(), nclx.mProfile));
943
+ Error err = Error(heif_image_set_nclx_color_profile(m_image.get(), nclx.mProfile.get()));
942
944
  if (err) {
943
945
  throw err;
944
946
  }
@@ -1021,7 +1023,7 @@ namespace heif {
1021
1023
 
1022
1024
 
1023
1025
  inline std::vector<EncoderDescriptor>
1024
- EncoderDescriptor::get_encoder_descriptors(enum heif_compression_format format_filter,
1026
+ EncoderDescriptor::get_encoder_descriptors(heif_compression_format format_filter,
1025
1027
  const char* name_filter) noexcept
1026
1028
  {
1027
1029
  int maxDescriptors = 10;
@@ -1064,7 +1066,7 @@ namespace heif {
1064
1066
  return heif_encoder_descriptor_get_id_name(m_descriptor);
1065
1067
  }
1066
1068
 
1067
- inline enum heif_compression_format EncoderDescriptor::get_compression_format() const noexcept
1069
+ inline heif_compression_format EncoderDescriptor::get_compression_format() const noexcept
1068
1070
  {
1069
1071
  return heif_encoder_descriptor_get_compression_format(m_descriptor);
1070
1072
  }
@@ -1101,7 +1103,7 @@ namespace heif {
1101
1103
  }
1102
1104
 
1103
1105
 
1104
- inline Encoder::Encoder(enum heif_compression_format format)
1106
+ inline Encoder::Encoder(heif_compression_format format)
1105
1107
  {
1106
1108
  heif_encoder* encoder;
1107
1109
  Error err = Error(heif_context_get_encoder_for_format(nullptr, format, &encoder));
@@ -39,18 +39,25 @@ extern "C" {
39
39
  LIBHEIF_API
40
40
  void heif_context_set_max_decoding_threads(heif_context* ctx, int max_threads);
41
41
 
42
+ // Returns the current maximum number of background threads used for parallel tile decoding.
43
+ // This reflects either the library default or the value last passed to
44
+ // heif_context_set_max_decoding_threads().
45
+ // If 'ctx' is NULL, the library default is returned.
46
+ LIBHEIF_API
47
+ int heif_context_get_max_decoding_threads(const heif_context* ctx);
48
+
42
49
  // Quick check whether there is a decoder available for the given format.
43
50
  // Note that the decoder still may not be able to decode all variants of that format.
44
51
  // You will have to query that further (todo) or just try to decode and check the returned error.
45
52
  LIBHEIF_API
46
- int heif_have_decoder_for_format(enum heif_compression_format format);
53
+ int heif_have_decoder_for_format(heif_compression_format format);
47
54
 
48
55
 
49
- enum heif_progress_step
56
+ typedef enum heif_progress_step
50
57
  {
51
58
  heif_progress_step_total = 0,
52
59
  heif_progress_step_load_tile = 1
53
- };
60
+ } heif_progress_step;
54
61
 
55
62
 
56
63
  typedef struct heif_decoding_options
@@ -64,11 +71,11 @@ typedef struct heif_decoding_options
64
71
  uint8_t ignore_transformations;
65
72
 
66
73
  // Any of the progress functions may be called from background threads.
67
- void (* start_progress)(enum heif_progress_step step, int max_progress, void* progress_user_data);
74
+ void (* start_progress)(heif_progress_step step, int max_progress, void* progress_user_data);
68
75
 
69
- void (* on_progress)(enum heif_progress_step step, int progress, void* progress_user_data);
76
+ void (* on_progress)(heif_progress_step step, int progress, void* progress_user_data);
70
77
 
71
- void (* end_progress)(enum heif_progress_step step, void* progress_user_data);
78
+ void (* end_progress)(heif_progress_step step, void* progress_user_data);
72
79
 
73
80
  void* progress_user_data;
74
81
 
@@ -101,6 +108,53 @@ typedef struct heif_decoding_options
101
108
 
102
109
  // When set to NULL, default options will be used
103
110
  heif_color_conversion_options_ext* color_conversion_options_ext;
111
+
112
+ // version 8 options (v1.21.0)
113
+
114
+ // If enabled, it will decode the media timeline, ignoring the sequence tracks edit-list.
115
+ int ignore_sequence_editlist; // bool
116
+
117
+ // Requested NCLX color profile of the decoded output image. If the input
118
+ // image's NCLX differs, libheif will color-convert the pixels accordingly
119
+ // (e.g. YCbCr matrix, primaries, range) so the result matches what is
120
+ // requested here.
121
+ //
122
+ // When set to NULL, the behavior depends on the flag
123
+ // output_image_nclx_profile_passthrough below: by default NULL means
124
+ // "convert to sRGB"; with the passthrough flag enabled, NULL means
125
+ // "keep the input image's NCLX".
126
+ heif_color_profile_nclx* output_image_nclx_profile;
127
+
128
+ int num_library_threads; // 0 = let libheif decide (TODO, currently ignored)
129
+ int num_codec_threads; // 0 = use decoder default
130
+
131
+ // version 9 options
132
+
133
+ // If enabled, libheif will attempt to work around known broken-input quirks
134
+ // (e.g. Sony HIF files where the NCLX `colr` box disagrees with the HEVC VUI
135
+ // on the YCbCr range flag). Default: false (strict spec-conformant behavior).
136
+ uint8_t autocorrect_broken_input;
137
+
138
+ // version 10 options
139
+
140
+ // Controls the meaning of output_image_nclx_profile == NULL.
141
+ //
142
+ // When false (default), a NULL output_image_nclx_profile means "convert the
143
+ // decoded image to sRGB" (BT.709 primaries, sRGB transfer, BT.601 matrix,
144
+ // full-range). For HDR inputs (e.g. BT.2100 PQ) this silently discards the
145
+ // original color volume.
146
+ //
147
+ // When true, a NULL output_image_nclx_profile means "keep the input image's
148
+ // NCLX". The decoded image carries the input file's primaries / transfer /
149
+ // matrix / range, and no extra color-space conversion is performed solely
150
+ // because the output NCLX was unspecified. If a YCbCr<->RGB colorspace
151
+ // conversion fires for another reason, the input NCLX is used to drive that
152
+ // conversion (so the result is tagged consistently with the source).
153
+ //
154
+ // Although this flag is off by default to preserve historical behavior, new
155
+ // code that wants to preserve HDR through decode should generally enable it.
156
+ // Setting output_image_nclx_profile to a non-NULL value overrides this flag.
157
+ uint8_t output_image_nclx_profile_passthrough;
104
158
  } heif_decoding_options;
105
159
 
106
160
 
@@ -126,7 +180,7 @@ typedef struct heif_decoder_descriptor heif_decoder_descriptor;
126
180
  // The number of decoders is returned, which are not more than 'count' if (out_decoders != nullptr).
127
181
  // By setting out_decoders==nullptr, you can query the number of decoders, 'count' is ignored.
128
182
  LIBHEIF_API
129
- int heif_get_decoder_descriptors(enum heif_compression_format format_filter,
183
+ int heif_get_decoder_descriptors(heif_compression_format format_filter,
130
184
  const heif_decoder_descriptor** out_decoders,
131
185
  int count);
132
186
 
@@ -151,8 +205,8 @@ const char* heif_decoder_descriptor_get_id_name(const heif_decoder_descriptor*);
151
205
  LIBHEIF_API
152
206
  heif_error heif_decode_image(const heif_image_handle* in_handle,
153
207
  heif_image** out_img,
154
- enum heif_colorspace colorspace,
155
- enum heif_chroma chroma,
208
+ heif_colorspace colorspace,
209
+ heif_chroma chroma,
156
210
  const heif_decoding_options* options);
157
211
 
158
212
  #ifdef __cplusplus