@img/sharp-libvips-dev-wasm32 1.3.0-rc.7 → 1.3.0-rc.8
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.
- package/include/aom/aom_codec.h +1 -1
- package/include/aom/aom_decoder.h +4 -0
- package/include/aom/aom_encoder.h +19 -8
- package/include/aom/aom_ext_ratectrl.h +664 -0
- package/include/aom/aom_image.h +93 -30
- package/include/aom/aom_tpl.h +99 -0
- package/include/aom/aomcx.h +89 -16
- package/include/aom/aomdx.h +12 -0
- package/include/expat.h +1 -1
- package/include/expat_config.h +3 -3
- package/include/glib-2.0/gio/gdbusconnection.h +2 -8
- package/include/glib-2.0/gio/gio-visibility.h +34 -0
- package/include/glib-2.0/gio/gioenums.h +5 -4
- package/include/glib-2.0/glib/glib-visibility.h +34 -0
- package/include/glib-2.0/glib/gmacros.h +3 -3
- package/include/glib-2.0/glib/gmarkup.h +10 -0
- package/include/glib-2.0/glib/gmem.h +4 -4
- package/include/glib-2.0/glib/gmessages.h +6 -8
- package/include/glib-2.0/glib/gsequence.h +2 -2
- package/include/glib-2.0/glib/gstrfuncs.h +190 -0
- package/include/glib-2.0/glib/gutils.h +9 -0
- package/include/glib-2.0/glib/gversionmacros.h +9 -0
- package/include/glib-2.0/gmodule/gmodule-visibility.h +34 -0
- package/include/glib-2.0/gobject/gobject-visibility.h +34 -0
- package/include/glib-2.0/gobject/gsignal.h +5 -5
- package/include/glib-2.0/gobject/gtype.h +14 -14
- package/include/libheif/heif.h +2 -0
- package/include/libheif/heif_color.h +127 -11
- package/include/libheif/heif_components.h +264 -0
- package/include/libheif/heif_context.h +2 -1
- package/include/libheif/heif_cxx.h +10 -10
- package/include/libheif/heif_decoding.h +51 -7
- package/include/libheif/heif_encoding.h +15 -9
- package/include/libheif/heif_error.h +9 -2
- package/include/libheif/heif_export.h +48 -0
- package/include/libheif/heif_image.h +81 -66
- package/include/libheif/heif_image_handle.h +2 -2
- package/include/libheif/heif_items.h +1 -1
- package/include/libheif/heif_library.h +8 -16
- package/include/libheif/heif_omaf.h +104 -0
- package/include/libheif/heif_plugin.h +16 -9
- package/include/libheif/heif_properties.h +250 -12
- package/include/libheif/heif_security.h +16 -4
- package/include/libheif/heif_sequences.h +74 -2
- package/include/libheif/heif_tiling.h +2 -2
- package/include/libheif/heif_uncompressed.h +44 -332
- package/include/libheif/heif_version.h +2 -2
- package/include/vips/version.h +4 -4
- package/lib/glib-2.0/include/glibconfig.h +2 -4
- package/lib/libaom.a +0 -0
- package/lib/libcgif.a +0 -0
- package/lib/libexif.a +0 -0
- package/lib/libexpat.a +0 -0
- package/lib/libexpat.la +1 -1
- package/lib/libffi.a +0 -0
- package/lib/libgio-2.0.a +0 -0
- package/lib/libglib-2.0.a +0 -0
- package/lib/libgmodule-2.0.a +0 -0
- package/lib/libgobject-2.0.a +0 -0
- package/lib/libgthread-2.0.a +0 -0
- package/lib/libheif.a +0 -0
- package/lib/libhwy.a +0 -0
- package/lib/libimagequant.a +0 -0
- package/lib/libjpeg.a +0 -0
- package/lib/liblcms2.a +0 -0
- package/lib/libpng.a +0 -0
- package/lib/libpng16.a +0 -0
- package/lib/libresvg.a +0 -0
- package/lib/libsharpyuv.a +0 -0
- package/lib/libtiff.a +0 -0
- package/lib/libuhdr.a +0 -0
- package/lib/libvips-cpp.a +0 -0
- package/lib/libvips.a +0 -0
- package/lib/libwebp.a +0 -0
- package/lib/libwebpdecoder.a +0 -0
- package/lib/libwebpdemux.a +0 -0
- package/lib/libwebpmux.a +0 -0
- package/lib/libz.a +0 -0
- package/lib/pkgconfig/aom.pc +2 -2
- package/lib/pkgconfig/expat.pc +1 -1
- package/lib/pkgconfig/gio-2.0.pc +1 -1
- package/lib/pkgconfig/glib-2.0.pc +1 -1
- package/lib/pkgconfig/gmodule-2.0.pc +1 -1
- package/lib/pkgconfig/gmodule-export-2.0.pc +1 -1
- package/lib/pkgconfig/gmodule-no-export-2.0.pc +1 -1
- package/lib/pkgconfig/gobject-2.0.pc +1 -1
- package/lib/pkgconfig/gthread-2.0.pc +1 -1
- package/lib/pkgconfig/libheif.pc +2 -2
- package/lib/pkgconfig/vips-cpp.pc +1 -1
- package/lib/pkgconfig/vips.pc +1 -1
- package/package.json +1 -1
- package/versions.json +8 -8
- package/include/libheif/heif_uncompressed_types.h +0 -143
|
@@ -45,8 +45,9 @@ extern "C" {
|
|
|
45
45
|
// 1.15 3 3 2
|
|
46
46
|
// 1.20 4 3 2
|
|
47
47
|
// 1.21 5 4 2
|
|
48
|
+
// 1.22 6 4 2
|
|
48
49
|
|
|
49
|
-
#define heif_decoder_plugin_latest_version
|
|
50
|
+
#define heif_decoder_plugin_latest_version 6
|
|
50
51
|
#define heif_encoder_plugin_latest_version 4
|
|
51
52
|
|
|
52
53
|
// The minimum plugin versions that can be used with this libheif version.
|
|
@@ -61,17 +62,23 @@ extern "C" {
|
|
|
61
62
|
|
|
62
63
|
typedef struct heif_decoder_plugin_compressed_format_description
|
|
63
64
|
{
|
|
64
|
-
|
|
65
|
+
heif_compression_format format;
|
|
65
66
|
|
|
66
67
|
} heif_decoder_plugin_compressed_format_description;
|
|
67
68
|
|
|
68
69
|
|
|
69
70
|
typedef struct heif_decoder_plugin_options
|
|
70
71
|
{
|
|
71
|
-
|
|
72
|
+
heif_compression_format format;
|
|
72
73
|
int strict_decoding; // bool
|
|
73
74
|
int num_threads; // 0 - undefined, use decoder default
|
|
74
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
|
+
|
|
75
82
|
} heif_decoder_plugin_options;
|
|
76
83
|
|
|
77
84
|
|
|
@@ -95,7 +102,7 @@ typedef struct heif_decoder_plugin
|
|
|
95
102
|
// Query whether the plugin supports decoding of the given format
|
|
96
103
|
// Result is a priority value. The plugin with the largest value wins.
|
|
97
104
|
// Default priority is 100. Returning 0 indicates that the plugin cannot decode this format.
|
|
98
|
-
int (* does_support_format)(
|
|
105
|
+
int (* does_support_format)(heif_compression_format format);
|
|
99
106
|
|
|
100
107
|
// Create a new decoder context for decoding an image
|
|
101
108
|
heif_error (* new_decoder)(void** decoder);
|
|
@@ -191,7 +198,7 @@ typedef struct heif_encoder_plugin
|
|
|
191
198
|
// --- version 1 functions ---
|
|
192
199
|
|
|
193
200
|
// The compression format generated by this plugin.
|
|
194
|
-
|
|
201
|
+
heif_compression_format compression_format;
|
|
195
202
|
|
|
196
203
|
// Short name of the encoder that can be used as command line parameter when selecting an encoder.
|
|
197
204
|
// Hence, it should stay stable and not contain any version numbers that will change.
|
|
@@ -250,8 +257,8 @@ typedef struct heif_encoder_plugin
|
|
|
250
257
|
|
|
251
258
|
// Replace the input colorspace/chroma with the one that is supported by the encoder and that
|
|
252
259
|
// comes as close to the input colorspace/chroma as possible.
|
|
253
|
-
void (* query_input_colorspace)(
|
|
254
|
-
|
|
260
|
+
void (* query_input_colorspace)(heif_colorspace* inout_colorspace,
|
|
261
|
+
heif_chroma* inout_chroma);
|
|
255
262
|
|
|
256
263
|
// Encode an image.
|
|
257
264
|
// After pushing an image into the encoder, you should call get_compressed_data() to
|
|
@@ -268,8 +275,8 @@ typedef struct heif_encoder_plugin
|
|
|
268
275
|
// --- version 2 ---
|
|
269
276
|
|
|
270
277
|
void (* query_input_colorspace2)(void* encoder,
|
|
271
|
-
|
|
272
|
-
|
|
278
|
+
heif_colorspace* inout_colorspace,
|
|
279
|
+
heif_chroma* inout_chroma);
|
|
273
280
|
|
|
274
281
|
// --- version 3 ---
|
|
275
282
|
|
|
@@ -192,6 +192,256 @@ heif_error heif_item_get_property_uuid_type(const heif_context* context,
|
|
|
192
192
|
uint8_t out_extended_type[16]);
|
|
193
193
|
|
|
194
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
|
+
|
|
195
445
|
// ------------------------- intrinsic and extrinsic matrices -------------------------
|
|
196
446
|
|
|
197
447
|
typedef struct heif_camera_intrinsic_matrix
|
|
@@ -228,18 +478,6 @@ LIBHEIF_API
|
|
|
228
478
|
heif_error heif_camera_extrinsic_matrix_get_rotation_matrix(const heif_camera_extrinsic_matrix*,
|
|
229
479
|
double* out_matrix_row_major);
|
|
230
480
|
|
|
231
|
-
#if HEIF_WITH_OMAF
|
|
232
|
-
// ------------------------- OMAF projection information -------------------------
|
|
233
|
-
LIBHEIF_API
|
|
234
|
-
int heif_image_handle_has_omaf_image_projection(const heif_image_handle* handle);
|
|
235
|
-
|
|
236
|
-
LIBHEIF_API
|
|
237
|
-
heif_omaf_image_projection heif_image_handle_get_omaf_image_projection(const heif_image_handle* handle);
|
|
238
|
-
|
|
239
|
-
LIBHEIF_API
|
|
240
|
-
void heif_image_handle_set_omaf_image_projection(const heif_image_handle* handle, heif_omaf_image_projection image_projection);
|
|
241
|
-
#endif
|
|
242
|
-
|
|
243
481
|
#ifdef __cplusplus
|
|
244
482
|
}
|
|
245
483
|
#endif
|
|
@@ -38,7 +38,7 @@ typedef struct heif_security_limits
|
|
|
38
38
|
{
|
|
39
39
|
uint8_t version;
|
|
40
40
|
|
|
41
|
-
// --- version 1
|
|
41
|
+
// --- version 1 (v1.19.0)
|
|
42
42
|
|
|
43
43
|
// Limit on the maximum image size to avoid allocating too much memory.
|
|
44
44
|
// For example, setting this to 32768^2 pixels = 1 Gigapixels results
|
|
@@ -59,20 +59,32 @@ typedef struct heif_security_limits
|
|
|
59
59
|
|
|
60
60
|
uint32_t max_children_per_box; // for all boxes that are not covered by other limits
|
|
61
61
|
|
|
62
|
-
// --- version 2
|
|
62
|
+
// --- version 2 (v1.20.0)
|
|
63
63
|
|
|
64
64
|
uint64_t max_total_memory;
|
|
65
65
|
uint32_t max_sample_description_box_entries;
|
|
66
66
|
uint32_t max_sample_group_description_box_entries;
|
|
67
67
|
|
|
68
|
-
// --- version 3
|
|
68
|
+
// --- version 3 (v1.21.0)
|
|
69
69
|
|
|
70
70
|
uint32_t max_sequence_frames;
|
|
71
71
|
uint32_t max_number_of_file_brands;
|
|
72
72
|
|
|
73
|
-
// --- version 4
|
|
73
|
+
// --- version 4 (v1.22.0)
|
|
74
74
|
|
|
75
75
|
uint32_t max_bad_pixels;
|
|
76
|
+
|
|
77
|
+
// Upper bound (in bytes) on the pixel_size field of an uncompressed (ISO 23001-17)
|
|
78
|
+
// uncC box. Caps the byte stride between adjacent pixels and prevents pathological
|
|
79
|
+
// padding values from blowing up tile-size arithmetic.
|
|
80
|
+
uint32_t max_iso23001_17_pixel_size_bytes;
|
|
81
|
+
|
|
82
|
+
// Internal: when libheif derives a limits struct from another one (e.g. to
|
|
83
|
+
// tighten the maximum image size for a specific decode), this points back to
|
|
84
|
+
// the registered context whose total-memory budget the allocation should be
|
|
85
|
+
// accounted against. nullptr means "this is a root context" (the registered
|
|
86
|
+
// one). User code should leave this as nullptr; the field is set internally.
|
|
87
|
+
const struct heif_security_limits* parent;
|
|
76
88
|
} heif_security_limits;
|
|
77
89
|
|
|
78
90
|
|
|
@@ -159,6 +159,41 @@ int heif_track_has_alpha_channel(const heif_track*);
|
|
|
159
159
|
LIBHEIF_API
|
|
160
160
|
uint32_t heif_track_get_timescale(const heif_track*);
|
|
161
161
|
|
|
162
|
+
/**
|
|
163
|
+
* Special return value of `heif_track_get_number_of_repetitions()` indicating that
|
|
164
|
+
* the editlist requests indefinite repetition (the mvhd duration is the ISOBMFF
|
|
165
|
+
* "duration unknown" sentinel and the editlist is in repeat mode).
|
|
166
|
+
*/
|
|
167
|
+
#define heif_sequence_track_number_of_repetitions_infinite 0xFFFFFFFFu
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* How many times the media segment should be played according to the track's edit list.
|
|
171
|
+
*
|
|
172
|
+
* Returns:
|
|
173
|
+
* - 0 if an edit list box is present but follows a pattern libheif does not interpret
|
|
174
|
+
* as a loop count. Callers should fall back to a single playback in that case.
|
|
175
|
+
* - 1 when no edit list is present. The media plays exactly once.
|
|
176
|
+
* - `heif_sequence_track_number_of_repetitions_infinite` (= UINT32_MAX) when the file
|
|
177
|
+
* signals indefinite playback (mvhd duration is the all-1s sentinel together with an
|
|
178
|
+
* editlist in repeat mode), or when the repetition count does not fit in uint32_t.
|
|
179
|
+
* - Otherwise the number of times the media segment is played.
|
|
180
|
+
*
|
|
181
|
+
* The reported value is informational; it does not change how
|
|
182
|
+
* `heif_track_decode_next_image()` walks samples. By default, that function applies
|
|
183
|
+
* the edit list and (for repeated playback) returns samples for every requested
|
|
184
|
+
* repetition; iterating until end-of-sequence on an infinite-loop file therefore
|
|
185
|
+
* never terminates.
|
|
186
|
+
*
|
|
187
|
+
* Clients that want to handle repetition themselves (e.g. to honor an "infinite"
|
|
188
|
+
* value with their own looping policy or to enforce an application-level cap) should
|
|
189
|
+
* set `heif_decoding_options::ignore_sequence_editlist` when calling
|
|
190
|
+
* `heif_track_decode_next_image()`. With that flag set, libheif plays the media
|
|
191
|
+
* timeline exactly once. Use the value returned by this function to decide how often
|
|
192
|
+
* to replay the track at the application level.
|
|
193
|
+
*/
|
|
194
|
+
LIBHEIF_API
|
|
195
|
+
uint32_t heif_track_get_number_of_repetitions(const heif_track*);
|
|
196
|
+
|
|
162
197
|
|
|
163
198
|
// --- reading visual tracks
|
|
164
199
|
|
|
@@ -182,8 +217,8 @@ heif_error heif_track_get_image_resolution(const heif_track*, uint16_t* out_widt
|
|
|
182
217
|
LIBHEIF_API
|
|
183
218
|
heif_error heif_track_decode_next_image(heif_track* track,
|
|
184
219
|
heif_image** out_img,
|
|
185
|
-
|
|
186
|
-
|
|
220
|
+
heif_colorspace colorspace,
|
|
221
|
+
heif_chroma chroma,
|
|
187
222
|
const heif_decoding_options* options);
|
|
188
223
|
|
|
189
224
|
/**
|
|
@@ -357,6 +392,23 @@ typedef enum heif_sequence_gop_structure
|
|
|
357
392
|
} heif_sequence_gop_structure;
|
|
358
393
|
|
|
359
394
|
|
|
395
|
+
// Describes the intent of the encoded sequence content. Encoder plugins may
|
|
396
|
+
// use this to choose different default tunings (e.g. perceptual quality vs.
|
|
397
|
+
// rate-distortion) for slide-show-style image sequences vs. video.
|
|
398
|
+
//
|
|
399
|
+
// Pass `_auto` to let libheif pick a value. Today libheif derives the kind
|
|
400
|
+
// from the track's handler type (`pict` -> image_sequence, `vide` -> video);
|
|
401
|
+
// in the future it may use additional input signals (e.g. frame rate or
|
|
402
|
+
// frame-to-frame similarity). Plugins never see `_auto`: libheif resolves it
|
|
403
|
+
// to a concrete kind before passing the options to the encoder plugin.
|
|
404
|
+
typedef enum heif_sequence_content_kind
|
|
405
|
+
{
|
|
406
|
+
heif_sequence_content_kind_auto = 0,
|
|
407
|
+
heif_sequence_content_kind_image_sequence = 1,
|
|
408
|
+
heif_sequence_content_kind_video = 2
|
|
409
|
+
} heif_sequence_content_kind;
|
|
410
|
+
|
|
411
|
+
|
|
360
412
|
typedef struct heif_sequence_encoding_options
|
|
361
413
|
{
|
|
362
414
|
uint8_t version;
|
|
@@ -376,12 +428,32 @@ typedef struct heif_sequence_encoding_options
|
|
|
376
428
|
int keyframe_distance_max; // 0 - undefined
|
|
377
429
|
|
|
378
430
|
int save_alpha_channel;
|
|
431
|
+
|
|
432
|
+
// version 3 options
|
|
433
|
+
|
|
434
|
+
// Intent of the encoded content. Encoder plugins may use this to choose
|
|
435
|
+
// different tunings for slide-show-style image sequences vs. video.
|
|
436
|
+
// Set to `_auto` (the default) to let libheif pick. libheif resolves the
|
|
437
|
+
// value to a concrete kind before passing the options to the encoder
|
|
438
|
+
// plugin, so plugins never see `_auto`.
|
|
439
|
+
enum heif_sequence_content_kind content_kind;
|
|
379
440
|
} heif_sequence_encoding_options;
|
|
380
441
|
|
|
381
442
|
|
|
382
443
|
LIBHEIF_API
|
|
383
444
|
heif_sequence_encoding_options* heif_sequence_encoding_options_alloc(void);
|
|
384
445
|
|
|
446
|
+
/**
|
|
447
|
+
* Copy fields from `src` into `dst`, respecting both structs' version numbers.
|
|
448
|
+
* Only fields present in `min(dst->version, src->version)` are copied, so this
|
|
449
|
+
* is safe when libheif and the caller were built against different header
|
|
450
|
+
* versions of `heif_sequence_encoding_options`. Pass NULL `src` to leave `dst`
|
|
451
|
+
* unchanged.
|
|
452
|
+
*/
|
|
453
|
+
LIBHEIF_API
|
|
454
|
+
void heif_sequence_encoding_options_copy(heif_sequence_encoding_options* dst,
|
|
455
|
+
const heif_sequence_encoding_options* src);
|
|
456
|
+
|
|
385
457
|
LIBHEIF_API
|
|
386
458
|
void heif_sequence_encoding_options_release(heif_sequence_encoding_options*);
|
|
387
459
|
|
|
@@ -85,8 +85,8 @@ typedef struct heif_decoding_options heif_decoding_options;
|
|
|
85
85
|
LIBHEIF_API
|
|
86
86
|
heif_error heif_image_handle_decode_image_tile(const heif_image_handle* in_handle,
|
|
87
87
|
heif_image** out_img,
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
heif_colorspace colorspace,
|
|
89
|
+
heif_chroma chroma,
|
|
90
90
|
const heif_decoding_options* options,
|
|
91
91
|
uint32_t tile_x, uint32_t tile_y);
|
|
92
92
|
|