pylibheif 1.21.2__cp312-cp312-macosx_14_0_arm64.whl

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.

Potentially problematic release.


This version of pylibheif might be problematic. Click here for more details.

Files changed (41) hide show
  1. include/libheif/heif.h +41 -0
  2. include/libheif/heif_aux_images.h +182 -0
  3. include/libheif/heif_brands.h +376 -0
  4. include/libheif/heif_color.h +363 -0
  5. include/libheif/heif_context.h +329 -0
  6. include/libheif/heif_cxx.h +1390 -0
  7. include/libheif/heif_decoding.h +172 -0
  8. include/libheif/heif_encoding.h +395 -0
  9. include/libheif/heif_entity_groups.h +60 -0
  10. include/libheif/heif_error.h +304 -0
  11. include/libheif/heif_image.h +355 -0
  12. include/libheif/heif_image_handle.h +129 -0
  13. include/libheif/heif_items.h +260 -0
  14. include/libheif/heif_library.h +219 -0
  15. include/libheif/heif_metadata.h +136 -0
  16. include/libheif/heif_plugin.h +378 -0
  17. include/libheif/heif_properties.h +235 -0
  18. include/libheif/heif_regions.h +868 -0
  19. include/libheif/heif_security.h +107 -0
  20. include/libheif/heif_sequences.h +644 -0
  21. include/libheif/heif_tai_timestamps.h +202 -0
  22. include/libheif/heif_text.h +161 -0
  23. include/libheif/heif_tiling.h +137 -0
  24. include/libheif/heif_uncompressed.h +109 -0
  25. include/libheif/heif_version.h +38 -0
  26. lib/cmake/libheif/libheif-config-release.cmake +19 -0
  27. lib/cmake/libheif/libheif-config-version.cmake +83 -0
  28. lib/cmake/libheif/libheif-config.cmake +108 -0
  29. lib/libheif.a +0 -0
  30. lib/pkgconfig/libheif.pc +15 -0
  31. pylibheif-1.21.2.dist-info/METADATA +409 -0
  32. pylibheif-1.21.2.dist-info/RECORD +41 -0
  33. pylibheif-1.21.2.dist-info/WHEEL +5 -0
  34. pylibheif-1.21.2.dist-info/licenses/LICENSE +165 -0
  35. pylibheif.cpython-312-darwin.so +0 -0
  36. pylibheif.dylibs/libaom.3.13.1.dylib +0 -0
  37. pylibheif.dylibs/libdav1d.7.dylib +0 -0
  38. pylibheif.dylibs/libde265.0.dylib +0 -0
  39. pylibheif.dylibs/libopenjp2.2.5.4.dylib +0 -0
  40. pylibheif.dylibs/libvmaf.3.dylib +0 -0
  41. pylibheif.dylibs/libx265.215.dylib +0 -0
@@ -0,0 +1,644 @@
1
+ /*
2
+ * HEIF codec.
3
+ * Copyright (c) 2025 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_SEQUENCES_H
22
+ #define LIBHEIF_HEIF_SEQUENCES_H
23
+
24
+ #include "libheif/heif.h"
25
+
26
+ #ifdef __cplusplus
27
+ extern "C" {
28
+ #endif
29
+
30
+ // forward declaration of structs defined in heif_tai_timestamps.h
31
+ typedef struct heif_tai_clock_info heif_tai_clock_info;
32
+ typedef struct heif_tai_timestamp_packet heif_tai_timestamp_packet;
33
+
34
+
35
+ // --- reading sequence tracks
36
+
37
+ /**
38
+ * Check whether there is an image sequence in the HEIF file.
39
+ *
40
+ * @return A boolean whether there is an image sequence in the HEIF file.
41
+ */
42
+ LIBHEIF_API
43
+ int heif_context_has_sequence(const heif_context*);
44
+
45
+ /**
46
+ * Get the timescale (clock ticks per second) for timing values in the sequence.
47
+ *
48
+ * @note Each track may have its independent timescale.
49
+ *
50
+ * @return Clock ticks per second. Returns 0 if there is no sequence in the file.
51
+ */
52
+ LIBHEIF_API
53
+ uint32_t heif_context_get_sequence_timescale(const heif_context*);
54
+
55
+ /**
56
+ * Get the total duration of the sequence in timescale clock ticks.
57
+ * Use `heif_context_get_sequence_timescale()` to get the clock ticks per second.
58
+ *
59
+ * @return Sequence duration in clock ticks. Returns 0 if there is no sequence in the file.
60
+ */
61
+ LIBHEIF_API
62
+ uint64_t heif_context_get_sequence_duration(const heif_context*);
63
+
64
+
65
+ // A track, which may be an image sequence, a video track or a metadata track.
66
+ typedef struct heif_track heif_track;
67
+
68
+ /**
69
+ * Free a `heif_track` object received from libheif.
70
+ * Passing NULL is ok.
71
+ */
72
+ LIBHEIF_API
73
+ void heif_track_release(heif_track*);
74
+
75
+ /**
76
+ * Get the number of tracks in the HEIF file.
77
+ *
78
+ * @return Number of tracks or 0 if there is no sequence in the HEIF file.
79
+ */
80
+ LIBHEIF_API
81
+ int heif_context_number_of_sequence_tracks(const heif_context*);
82
+
83
+ /**
84
+ * Returns the IDs for each of the tracks stored in the HEIF file.
85
+ * The output array must have heif_context_number_of_sequence_tracks() entries.
86
+ */
87
+ LIBHEIF_API
88
+ void heif_context_get_track_ids(const heif_context* ctx, uint32_t out_track_id_array[]);
89
+
90
+ /**
91
+ * Get the ID of the passed track.
92
+ * The track ID will never be 0.
93
+ */
94
+ LIBHEIF_API
95
+ uint32_t heif_track_get_id(const heif_track* track);
96
+
97
+ /**
98
+ * Get the heif_track object for the given track ID.
99
+ * If you pass `id=0`, the first visual track will be returned.
100
+ * If there is no track with the given ID or if 0 is passed and there is no visual track, NULL will be returned.
101
+ *
102
+ * @note Tracks never have a zero ID. This is why we can use this as a special value to find the first visual track.
103
+ *
104
+ * @param id Track id or 0 for the first visual track.
105
+ * @return heif_track object. You must free this after use.
106
+ */
107
+ // Use id=0 for the first visual track.
108
+ LIBHEIF_API
109
+ heif_track* heif_context_get_track(const heif_context*, uint32_t id);
110
+
111
+
112
+ typedef uint32_t heif_track_type;
113
+
114
+ typedef enum heif_track_type_4cc
115
+ {
116
+ heif_track_type_video = heif_fourcc('v', 'i', 'd', 'e'),
117
+ heif_track_type_image_sequence = heif_fourcc('p', 'i', 'c', 't'),
118
+ heif_track_type_auxiliary = heif_fourcc('a', 'u', 'x', 'v'),
119
+ heif_track_type_metadata = heif_fourcc('m', 'e', 't', 'a')
120
+ } heif_track_type_4cc;
121
+
122
+ /**
123
+ * Get the four-cc track handler type.
124
+ * Typical codes are "vide" for video sequences, "pict" for image sequences, "meta" for metadata tracks.
125
+ * These are defined in heif_track_type_4cc, but files may also contain other types.
126
+ *
127
+ * @return four-cc handler type
128
+ */
129
+ LIBHEIF_API
130
+ heif_track_type heif_track_get_track_handler_type(const heif_track*);
131
+
132
+
133
+ typedef enum heif_auxiliary_track_info_type
134
+ {
135
+ heif_auxiliary_track_info_type_unknown = 0,
136
+ heif_auxiliary_track_info_type_alpha = 1
137
+ } heif_auxiliary_track_info_type;
138
+
139
+ LIBHEIF_API
140
+ enum heif_auxiliary_track_info_type heif_track_get_auxiliary_info_type(const heif_track*);
141
+
142
+ LIBHEIF_API
143
+ const char* heif_track_get_auxiliary_info_type_urn(const heif_track*);
144
+
145
+ LIBHEIF_API
146
+ int heif_track_has_alpha_channel(const heif_track*);
147
+
148
+ /**
149
+ * Get the timescale (clock ticks per second) for this track.
150
+ * Note that this can be different from the timescale used at sequence level.
151
+ *
152
+ * @return clock ticks per second
153
+ */
154
+ LIBHEIF_API
155
+ uint32_t heif_track_get_timescale(const heif_track*);
156
+
157
+
158
+ // --- reading visual tracks
159
+
160
+ /**
161
+ * Get the image resolution of the track.
162
+ * If the passed track is no visual track, an error is returned.
163
+ */
164
+ LIBHEIF_API
165
+ heif_error heif_track_get_image_resolution(const heif_track*, uint16_t* out_width, uint16_t* out_height);
166
+
167
+ /**
168
+ * Decode the next image in the passed sequence track.
169
+ * If there is no more image in the sequence, `heif_error_End_of_sequence` is returned.
170
+ * The parameters `colorspace`, `chroma` and `options` are similar to heif_decode_image().
171
+ * If you want to let libheif decide the output colorspace and chroma, set these parameters
172
+ * to heif_colorspace_undefined / heif_chroma_undefined. Usually, libheif will return the
173
+ * image in the input colorspace, but it may also modify it for example when it has to rotate the image.
174
+ * If you want to get the image in a specific colorspace/chroma format, you can specify this
175
+ * and libheif will convert the image to match this format.
176
+ */
177
+ LIBHEIF_API
178
+ heif_error heif_track_decode_next_image(heif_track* track,
179
+ heif_image** out_img,
180
+ enum heif_colorspace colorspace,
181
+ enum heif_chroma chroma,
182
+ const heif_decoding_options* options);
183
+
184
+ /**
185
+ * Get the image display duration in clock ticks of this track.
186
+ * Make sure to use the timescale of the track and not the timescale of the total sequence.
187
+ */
188
+ LIBHEIF_API
189
+ uint32_t heif_image_get_duration(const heif_image*);
190
+
191
+
192
+ // --- reading metadata track samples
193
+
194
+ /**
195
+ * Get the "sample entry type" of the first sample sample cluster in the track.
196
+ * In the case of metadata tracks, this will usually be "urim" for "URI Meta Sample Entry".
197
+ * The exact URI can then be obtained with 'heif_track_get_urim_sample_entry_uri_of_first_cluster'.
198
+ */
199
+ LIBHEIF_API
200
+ uint32_t heif_track_get_sample_entry_type_of_first_cluster(const heif_track*);
201
+
202
+ /**
203
+ * Get the URI of the first sample cluster in an 'urim' track.
204
+ * Only call this for tracks with 'urim' sample entry types. It will return an error otherwise.
205
+ *
206
+ * @param out_uri A string with the URI will be returned. Free this string with `heif_string_release()`.
207
+ */
208
+ LIBHEIF_API
209
+ heif_error heif_track_get_urim_sample_entry_uri_of_first_cluster(const heif_track*,
210
+ const char** out_uri);
211
+
212
+
213
+ /** Sequence sample object that can hold any raw byte data.
214
+ * Use this to store and read raw metadata samples.
215
+ */
216
+ typedef struct heif_raw_sequence_sample heif_raw_sequence_sample;
217
+
218
+ /**
219
+ * Get the next raw sample from the (metadata) sequence track.
220
+ * You have to free the returned sample with heif_raw_sequence_sample_release().
221
+ */
222
+ LIBHEIF_API
223
+ heif_error heif_track_get_next_raw_sequence_sample(heif_track*,
224
+ heif_raw_sequence_sample** out_sample);
225
+
226
+ /**
227
+ * Release a heif_raw_sequence_sample object.
228
+ * You may pass NULL.
229
+ */
230
+ LIBHEIF_API
231
+ void heif_raw_sequence_sample_release(heif_raw_sequence_sample*);
232
+
233
+ /**
234
+ * Get a pointer to the data of the (metadata) sample.
235
+ * The data pointer stays valid until the heif_raw_sequence_sample object is released.
236
+ *
237
+ * @param out_array_size Size of the returned array (may be NULL).
238
+ */
239
+ LIBHEIF_API
240
+ const uint8_t* heif_raw_sequence_sample_get_data(const heif_raw_sequence_sample*, size_t* out_array_size);
241
+
242
+ /**
243
+ * Return the size of the raw data contained in the sample.
244
+ * This is the same as returned through the 'out_array_size' parameter of 'heif_raw_sequence_sample_get_data()'.
245
+ */
246
+ LIBHEIF_API
247
+ size_t heif_raw_sequence_sample_get_data_size(const heif_raw_sequence_sample*);
248
+
249
+ /**
250
+ * Get the sample duration in clock ticks of this track.
251
+ * Make sure to use the timescale of the track and not the timescale of the total sequence.
252
+ */
253
+ LIBHEIF_API
254
+ uint32_t heif_raw_sequence_sample_get_duration(const heif_raw_sequence_sample*);
255
+
256
+
257
+ // --- writing sequences
258
+
259
+ /**
260
+ * Set an independent global timescale for the sequence.
261
+ * If no timescale is set with this function, the timescale of the first track will be used.
262
+ */
263
+ LIBHEIF_API
264
+ void heif_context_set_sequence_timescale(heif_context*, uint32_t timescale);
265
+
266
+ // Number of times the sequence should be played in total (default = 1).
267
+ // Can be set to heif_sequence_maximum_number_of_repetitions.
268
+ LIBHEIF_API
269
+ void heif_context_set_number_of_sequence_repetitions(heif_context*, uint32_t number_of_repetitions);
270
+
271
+ #define heif_sequence_maximum_number_of_repetitions 0
272
+
273
+ /**
274
+ * Specifies whether a 'sample auxiliary info' is stored with the samples.
275
+ * The difference between `heif_sample_aux_info_presence_optional` and `heif_sample_aux_info_presence_mandatory`
276
+ * is that `heif_sample_aux_info_presence_mandatory` will throw an error if the data is missing when writing a sample.
277
+ */
278
+ typedef enum heif_sample_aux_info_presence
279
+ {
280
+ heif_sample_aux_info_presence_none = 0,
281
+ heif_sample_aux_info_presence_optional = 1,
282
+ heif_sample_aux_info_presence_mandatory = 2
283
+ } heif_sample_aux_info_presence;
284
+
285
+
286
+ typedef struct heif_track_options heif_track_options;
287
+
288
+ /**
289
+ * Allocate track options object that is required to set options for a new track.
290
+ * When you create a new track, you can also pass a NULL heif_track_options pointer, in which case the default options are used.
291
+ */
292
+ LIBHEIF_API
293
+ heif_track_options* heif_track_options_alloc(void);
294
+
295
+ LIBHEIF_API
296
+ void heif_track_options_release(heif_track_options*);
297
+
298
+ /**
299
+ * Set the track specific timescale. This is the number of clock ticks per second.
300
+ * The default is 90,000 Hz.
301
+ * @param timescale
302
+ */
303
+ LIBHEIF_API
304
+ void heif_track_options_set_timescale(heif_track_options*, uint32_t timescale);
305
+
306
+ /**
307
+ * Set whether the aux-info data should be stored interleaved with the sequence samples.
308
+ * Default is: false.
309
+ *
310
+ * If 'true', the aux_info data blocks will be interleaved with the compressed image.
311
+ * This has the advantage that the aux_info is localized near the image data.
312
+ *
313
+ * If 'false', all aux_info will be written as one block after the compressed image data.
314
+ * This has the advantage that no aux_info offsets have to be written.
315
+ *
316
+ * Note: currently ignored. Interleaved writing is disabled.
317
+ */
318
+ LIBHEIF_API
319
+ void heif_track_options_set_interleaved_sample_aux_infos(heif_track_options*, int interleaved_flag);
320
+
321
+ LIBHEIF_API
322
+ heif_error heif_track_options_enable_sample_tai_timestamps(heif_track_options*,
323
+ const heif_tai_clock_info*,
324
+ enum heif_sample_aux_info_presence);
325
+
326
+ LIBHEIF_API
327
+ void heif_track_options_enable_sample_gimi_content_ids(heif_track_options*,
328
+ enum heif_sample_aux_info_presence);
329
+
330
+ /**
331
+ * Set the GIMI format track ID string. If NULL is passed, no track ID is saved.
332
+ * @param track_id
333
+ */
334
+ LIBHEIF_API
335
+ void heif_track_options_set_gimi_track_id(heif_track_options*,
336
+ const char* track_id);
337
+
338
+
339
+ // --- writing visual tracks
340
+
341
+ typedef enum heif_sequence_gop_structure
342
+ {
343
+ // Only independently decodable keyframes.
344
+ heif_sequence_gop_structure_intra_only,
345
+
346
+ // No frame reordering, usually an IPPPP structure.
347
+ heif_sequence_gop_structure_lowdelay,
348
+
349
+ // All frame types are allowed, including frame reordering, to achieve
350
+ // the best compression ratio.
351
+ heif_sequence_gop_structure_unrestricted
352
+ } heif_sequence_gop_structure;
353
+
354
+
355
+ typedef struct heif_sequence_encoding_options
356
+ {
357
+ uint8_t version;
358
+
359
+ // version 1 options
360
+
361
+ // Set this to the NCLX parameters to be used in the output images or set to NULL
362
+ // when the same parameters as in the input images should be used.
363
+ const heif_color_profile_nclx* output_nclx_profile;
364
+
365
+ heif_color_conversion_options color_conversion_options;
366
+
367
+ // version 2 options
368
+
369
+ enum heif_sequence_gop_structure gop_structure;
370
+ int keyframe_distance_min; // 0 - undefined
371
+ int keyframe_distance_max; // 0 - undefined
372
+
373
+ int save_alpha_channel;
374
+ } heif_sequence_encoding_options;
375
+
376
+
377
+ LIBHEIF_API
378
+ heif_sequence_encoding_options* heif_sequence_encoding_options_alloc(void);
379
+
380
+ LIBHEIF_API
381
+ void heif_sequence_encoding_options_release(heif_sequence_encoding_options*);
382
+
383
+ /**
384
+ * Add a visual track to the sequence.
385
+ * The track ID is assigned automatically.
386
+ *
387
+ * @param width Image resolution width
388
+ * @param height Image resolution height
389
+ * @param track_type Has to be heif_track_type_video or heif_track_type_image_sequence
390
+ * @param track_options Optional track creation options. If NULL, default options will be used.
391
+ * @param encoding_options Options for sequence encoding. If NULL, default options will be used.
392
+ * @param out_track Output parameter to receive the track object for the just created track.
393
+ * @return
394
+ */
395
+ LIBHEIF_API
396
+ heif_error heif_context_add_visual_sequence_track(heif_context*,
397
+ uint16_t width, uint16_t height,
398
+ heif_track_type track_type,
399
+ const heif_track_options* track_options,
400
+ const heif_sequence_encoding_options* encoding_options,
401
+ heif_track** out_track);
402
+
403
+ /**
404
+ * Set the image display duration in the track's timescale units.
405
+ */
406
+ LIBHEIF_API
407
+ void heif_image_set_duration(heif_image*, uint32_t duration);
408
+
409
+ /**
410
+ * Encode the image into a visual track.
411
+ * If the passed track is no visual track, an error will be returned.
412
+ *
413
+ * @param image The input image to append to the sequence.
414
+ * @param encoder The encoder used for encoding the image.
415
+ * @param sequence_encoding_options Options for sequence encoding. If NULL, default options will be used.
416
+ */
417
+ LIBHEIF_API
418
+ heif_error heif_track_encode_sequence_image(heif_track*,
419
+ const heif_image* image,
420
+ heif_encoder* encoder,
421
+ const heif_sequence_encoding_options* sequence_encoding_options);
422
+
423
+ /**
424
+ * When all sequence frames have been sent, you can to call this function to let the
425
+ * library know that no more frames will follow. This is strongly recommended, but optional
426
+ * for backwards compatibility.
427
+ * If you do not end the sequence explicitly with this function, it will be closed
428
+ * automatically when the HEIF file is written. Using this function has the advantage
429
+ * that you can free the {@link heif_encoder} afterwards (with {@link heif_encoder_release}).
430
+ * If you do not use call function, you have to keep the {@link heif_encoder} alive
431
+ * until the HEIF file is written.
432
+ */
433
+ LIBHEIF_API
434
+ heif_error heif_track_encode_end_of_sequence(heif_track*,
435
+ heif_encoder* encoder);
436
+
437
+ // --- metadata tracks
438
+
439
+ /**
440
+ * Add a metadata track.
441
+ * The track is created as a 'urim' "URI Meta Sample Entry".
442
+ * The track content type is specified by the 'uri' parameter.
443
+ *
444
+ * @param uri Track content type.
445
+ * @param options Optional track creation options. If NULL, default options will be used.
446
+ * @param out_track Returns the created track object. If this is not NULL, you have to
447
+ * free the returned track with {@link heif_track_release}.
448
+ */
449
+ LIBHEIF_API
450
+ heif_error heif_context_add_uri_metadata_sequence_track(heif_context*,
451
+ const char* uri,
452
+ const heif_track_options* options,
453
+ heif_track** out_track);
454
+
455
+ /**
456
+ * Allocate a new heif_raw_sequence_sample object.
457
+ * Free with heif_raw_sequence_sample_release().
458
+ */
459
+ LIBHEIF_API
460
+ heif_raw_sequence_sample* heif_raw_sequence_sample_alloc(void);
461
+
462
+ /**
463
+ * Set the raw sequence sample data.
464
+ */
465
+ LIBHEIF_API
466
+ heif_error heif_raw_sequence_sample_set_data(heif_raw_sequence_sample*, const uint8_t* data, size_t size);
467
+
468
+ /**
469
+ * Set the sample duration in track timescale units.
470
+ */
471
+ LIBHEIF_API
472
+ void heif_raw_sequence_sample_set_duration(heif_raw_sequence_sample*, uint32_t duration);
473
+
474
+ /**
475
+ * Add a raw sequence sample (usually a metadata sample) to the (metadata) track.
476
+ */
477
+ LIBHEIF_API
478
+ heif_error heif_track_add_raw_sequence_sample(heif_track*,
479
+ const heif_raw_sequence_sample*);
480
+
481
+
482
+ // --- sample auxiliary data
483
+
484
+ /**
485
+ * Contains the type of sample auxiliary data assigned to the track samples.
486
+ */
487
+ typedef struct heif_sample_aux_info_type
488
+ {
489
+ uint32_t type;
490
+ uint32_t parameter;
491
+ } heif_sample_aux_info_type;
492
+
493
+ /**
494
+ * Returns how many different types of sample auxiliary data units are assigned to this track's samples.
495
+ */
496
+ LIBHEIF_API
497
+ int heif_track_get_number_of_sample_aux_infos(const heif_track*);
498
+
499
+ /**
500
+ * Get get the list of sample auxiliary data types used in the track.
501
+ * The passed array has to have heif_track_get_number_of_sample_aux_infos() entries.
502
+ */
503
+ LIBHEIF_API
504
+ void heif_track_get_sample_aux_info_types(const heif_track*, heif_sample_aux_info_type out_types[]);
505
+
506
+
507
+ // --- GIMI content IDs
508
+
509
+ /**
510
+ * Get the GIMI content ID for the track (as a whole).
511
+ * If there is no content ID, nullptr is returned.
512
+ *
513
+ * @return The returned string has to be released with `heif_string_release()`.
514
+ */
515
+ LIBHEIF_API
516
+ const char* heif_track_get_gimi_track_content_id(const heif_track*);
517
+
518
+ /**
519
+ * Get the GIMI content ID stored in the image sample.
520
+ * If there is no content ID, NULL is returned.
521
+ * @return
522
+ */
523
+ LIBHEIF_API
524
+ const char* heif_image_get_gimi_sample_content_id(const heif_image*);
525
+
526
+ /**
527
+ * Get the GIMI content ID stored in the metadata sample.
528
+ * If there is no content ID, NULL is returned.
529
+ * @return
530
+ */
531
+ LIBHEIF_API
532
+ const char* heif_raw_sequence_sample_get_gimi_sample_content_id(const heif_raw_sequence_sample*);
533
+
534
+ /**
535
+ * Set the GIMI content ID for an image sample. It will be stored as SAI.
536
+ * When passing NULL, a previously set ID will be removed.
537
+ */
538
+ LIBHEIF_API
539
+ void heif_image_set_gimi_sample_content_id(heif_image*, const char* contentID);
540
+
541
+ /**
542
+ * Set the GIMI content ID for a (metadata) sample. It will be stored as SAI.
543
+ * When passing NULL, a previously set ID will be removed.
544
+ */
545
+ LIBHEIF_API
546
+ void heif_raw_sequence_sample_set_gimi_sample_content_id(heif_raw_sequence_sample*, const char* contentID);
547
+
548
+
549
+ // --- TAI timestamps
550
+
551
+ // Note: functions for setting timestamps on images are in heif_tai_timestamps.h
552
+
553
+ /**
554
+ * Returns whether the raw (metadata) sample has a TAI timestamp attached to it (stored as SAI).
555
+ *
556
+ * @return boolean flag whether a TAI exists for this sample.
557
+ */
558
+ LIBHEIF_API
559
+ int heif_raw_sequence_sample_has_tai_timestamp(const heif_raw_sequence_sample*);
560
+
561
+ /**
562
+ * Get the TAI timestamp of the (metadata) sample.
563
+ * If there is no timestamp assigned to it, NULL will be returned.
564
+ *
565
+ * @note You should NOT free the returned timestamp with 'heif_tai_timestamp_packet_release()'.
566
+ * The returned struct stays valid until the heif_raw_sequence_sample is released.
567
+ */
568
+ LIBHEIF_API
569
+ const heif_tai_timestamp_packet* heif_raw_sequence_sample_get_tai_timestamp(const heif_raw_sequence_sample*);
570
+
571
+ /**
572
+ * Set the TAI timestamp for a raw sequence sample.
573
+ * The timestamp will be copied, you can release it after calling this function.
574
+ */
575
+ LIBHEIF_API
576
+ void heif_raw_sequence_sample_set_tai_timestamp(heif_raw_sequence_sample* sample,
577
+ const heif_tai_timestamp_packet* timestamp);
578
+
579
+ /**
580
+ * Returns the TAI clock info of the track.
581
+ * If there is no TAI clock info, NULL is returned.
582
+ * You should NOT free the returned heif_tai_clock_info.
583
+ * The structure stays valid until the heif_track object is released.
584
+ */
585
+ LIBHEIF_API
586
+ const heif_tai_clock_info* heif_track_get_tai_clock_info_of_first_cluster(heif_track*);
587
+
588
+
589
+ // --- track references
590
+
591
+ typedef enum heif_track_reference_type
592
+ {
593
+ heif_track_reference_type_description = heif_fourcc('c', 'd', 's', 'c'), // track_description
594
+ heif_track_reference_type_thumbnails = heif_fourcc('t', 'h', 'm', 'b'), // thumbnails
595
+ heif_track_reference_type_auxiliary = heif_fourcc('a', 'u', 'x', 'l') // auxiliary data (e.g. depth maps or alpha channel)
596
+ } heif_track_reference_type;
597
+
598
+ /**
599
+ * Add a reference between tracks.
600
+ * 'reference_type' can be one of the four-cc codes listed in heif_track_reference_type or any other type.
601
+ */
602
+ LIBHEIF_API
603
+ void heif_track_add_reference_to_track(heif_track*, uint32_t reference_type, const heif_track* to_track);
604
+
605
+ /**
606
+ * Return the number of different reference types used in this track's tref box.
607
+ */
608
+ LIBHEIF_API
609
+ size_t heif_track_get_number_of_track_reference_types(const heif_track*);
610
+
611
+ /**
612
+ * List the reference types used in this track.
613
+ * The passed array must have heif_track_get_number_of_track_reference_types() entries.
614
+ */
615
+ LIBHEIF_API
616
+ void heif_track_get_track_reference_types(const heif_track*, uint32_t out_reference_types[]);
617
+
618
+ /**
619
+ * Get the number of references of the passed type.
620
+ */
621
+ LIBHEIF_API
622
+ size_t heif_track_get_number_of_track_reference_of_type(const heif_track*, uint32_t reference_type);
623
+
624
+ /**
625
+ * List the track ids this track points to with the passed reference type.
626
+ * The passed array must have heif_track_get_number_of_track_reference_of_type() entries.
627
+ */
628
+ LIBHEIF_API
629
+ size_t heif_track_get_references_from_track(const heif_track*, uint32_t reference_type, uint32_t out_to_track_id[]);
630
+
631
+ /**
632
+ * Find tracks that are referring to the current track through the passed reference_type.
633
+ * The found track IDs will be filled into the passed array, but no more than `array_size` entries will be filled.
634
+ *
635
+ * @return number of tracks found. If this is equal to 'array_size', you should ask again with a larger array size to be sure you got all tracks.
636
+ */
637
+ LIBHEIF_API
638
+ size_t heif_track_find_referring_tracks(const heif_track*, uint32_t reference_type, uint32_t out_track_id[], size_t array_size);
639
+
640
+ #ifdef __cplusplus
641
+ }
642
+ #endif
643
+
644
+ #endif