@img/sharp-libvips-dev 1.2.0-rc.3 → 1.2.0-rc.4
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/fontconfig/fontconfig.h +12 -2
- package/include/glib-2.0/girepository/girepository.h +3 -0
- package/include/glib-2.0/glib/gmarkup.h +4 -0
- package/include/libheif/heif.h +16 -2603
- package/include/libheif/heif_aux_images.h +182 -0
- package/include/libheif/heif_brands.h +373 -0
- package/include/libheif/heif_color.h +357 -0
- package/include/libheif/heif_context.h +329 -0
- package/include/libheif/heif_cxx.h +6 -6
- package/include/libheif/heif_decoding.h +162 -0
- package/include/libheif/heif_encoding.h +391 -0
- package/include/libheif/heif_entity_groups.h +60 -0
- package/include/libheif/heif_error.h +302 -0
- package/include/libheif/heif_image.h +352 -0
- package/include/libheif/heif_image_handle.h +120 -0
- package/include/libheif/heif_items.h +45 -45
- package/include/libheif/heif_library.h +216 -0
- package/include/libheif/heif_metadata.h +133 -0
- package/include/libheif/heif_plugin.h +53 -41
- package/include/libheif/heif_properties.h +73 -36
- package/include/libheif/heif_regions.h +95 -95
- package/include/libheif/heif_security.h +102 -0
- package/include/libheif/heif_sequences.h +577 -0
- package/include/libheif/heif_tai_timestamps.h +202 -0
- package/include/libheif/heif_tiling.h +137 -0
- package/include/libheif/heif_uncompressed.h +109 -0
- package/include/libheif/heif_version.h +2 -2
- package/include/libpng16/png.h +7 -7
- package/include/libpng16/pngconf.h +1 -1
- package/include/libpng16/pnglibconf.h +1 -1
- package/include/pango-1.0/pango/pango-attributes.h +1 -1
- package/include/pango-1.0/pango/pango-features.h +2 -2
- package/include/png.h +7 -7
- package/include/pngconf.h +1 -1
- package/include/pnglibconf.h +1 -1
- package/include/vips/version.h +4 -4
- package/package.json +1 -1
- package/versions.json +5 -5
|
@@ -0,0 +1,577 @@
|
|
|
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
|
+
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_metadata = heif_fourcc('m', 'e', 't', 'a')
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Get the four-cc track handler type.
|
|
123
|
+
* Typical codes are "vide" for video sequences, "pict" for image sequences, "meta" for metadata tracks.
|
|
124
|
+
* These are defined in heif_track_type_4cc, but files may also contain other types.
|
|
125
|
+
*
|
|
126
|
+
* @return four-cc handler type
|
|
127
|
+
*/
|
|
128
|
+
LIBHEIF_API
|
|
129
|
+
heif_track_type heif_track_get_track_handler_type(const heif_track*);
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Get the timescale (clock ticks per second) for this track.
|
|
133
|
+
* Note that this can be different from the timescale used at sequence level.
|
|
134
|
+
*
|
|
135
|
+
* @return clock ticks per second
|
|
136
|
+
*/
|
|
137
|
+
LIBHEIF_API
|
|
138
|
+
uint32_t heif_track_get_timescale(const heif_track*);
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
// --- reading visual tracks
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Get the image resolution of the track.
|
|
145
|
+
* If the passed track is no visual track, an error is returned.
|
|
146
|
+
*/
|
|
147
|
+
LIBHEIF_API
|
|
148
|
+
heif_error heif_track_get_image_resolution(const heif_track*, uint16_t* out_width, uint16_t* out_height);
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Decode the next image in the passed sequence track.
|
|
152
|
+
* If there is no more image in the sequence, `heif_error_End_of_sequence` is returned.
|
|
153
|
+
* The parameters `colorspace`, `chroma` and `options` are similar to heif_decode_image().
|
|
154
|
+
* If you want to let libheif decide the output colorspace and chroma, set these parameters
|
|
155
|
+
* to heif_colorspace_undefined / heif_chroma_undefined. Usually, libheif will return the
|
|
156
|
+
* image in the input colorspace, but it may also modify it for example when it has to rotate the image.
|
|
157
|
+
* If you want to get the image in a specific colorspace/chroma format, you can specify this
|
|
158
|
+
* and libheif will convert the image to match this format.
|
|
159
|
+
*/
|
|
160
|
+
LIBHEIF_API
|
|
161
|
+
heif_error heif_track_decode_next_image(heif_track* track,
|
|
162
|
+
heif_image** out_img,
|
|
163
|
+
enum heif_colorspace colorspace,
|
|
164
|
+
enum heif_chroma chroma,
|
|
165
|
+
const heif_decoding_options* options);
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Get the image display duration in clock ticks of this track.
|
|
169
|
+
* Make sure to use the timescale of the track and not the timescale of the total sequence.
|
|
170
|
+
*/
|
|
171
|
+
LIBHEIF_API
|
|
172
|
+
uint32_t heif_image_get_duration(const heif_image*);
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
// --- reading metadata track samples
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Get the "sample entry type" of the first sample sample cluster in the track.
|
|
179
|
+
* In the case of metadata tracks, this will usually be "urim" for "URI Meta Sample Entry".
|
|
180
|
+
* The exact URI can then be obtained with 'heif_track_get_urim_sample_entry_uri_of_first_cluster'.
|
|
181
|
+
*/
|
|
182
|
+
LIBHEIF_API
|
|
183
|
+
uint32_t heif_track_get_sample_entry_type_of_first_cluster(const heif_track*);
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Get the URI of the first sample cluster in an 'urim' track.
|
|
187
|
+
* Only call this for tracks with 'urim' sample entry types. It will return an error otherwise.
|
|
188
|
+
*
|
|
189
|
+
* @param out_uri A string with the URI will be returned. Free this string with `heif_string_release()`.
|
|
190
|
+
*/
|
|
191
|
+
LIBHEIF_API
|
|
192
|
+
heif_error heif_track_get_urim_sample_entry_uri_of_first_cluster(const heif_track* track, const char** out_uri);
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
/** Sequence sample object that can hold any raw byte data.
|
|
196
|
+
* Use this to store and read raw metadata samples.
|
|
197
|
+
*/
|
|
198
|
+
typedef struct heif_raw_sequence_sample heif_raw_sequence_sample;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Get the next raw sample from the (metadata) sequence track.
|
|
202
|
+
* You have to free the returned sample with heif_raw_sequence_sample_release().
|
|
203
|
+
*/
|
|
204
|
+
LIBHEIF_API
|
|
205
|
+
heif_error heif_track_get_next_raw_sequence_sample(heif_track*,
|
|
206
|
+
heif_raw_sequence_sample** out_sample);
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Release a heif_raw_sequence_sample object.
|
|
210
|
+
* You may pass NULL.
|
|
211
|
+
*/
|
|
212
|
+
LIBHEIF_API
|
|
213
|
+
void heif_raw_sequence_sample_release(heif_raw_sequence_sample*);
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Get a pointer to the data of the (metadata) sample.
|
|
217
|
+
* The data pointer stays valid until the heif_raw_sequence_sample object is released.
|
|
218
|
+
*
|
|
219
|
+
* @param out_array_size Size of the returned array (may be NULL).
|
|
220
|
+
*/
|
|
221
|
+
LIBHEIF_API
|
|
222
|
+
const uint8_t* heif_raw_sequence_sample_get_data(const heif_raw_sequence_sample*, size_t* out_array_size);
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Return the size of the raw data contained in the sample.
|
|
226
|
+
* This is the same as returned through the 'out_array_size' parameter of 'heif_raw_sequence_sample_get_data()'.
|
|
227
|
+
*/
|
|
228
|
+
LIBHEIF_API
|
|
229
|
+
size_t heif_raw_sequence_sample_get_data_size(const heif_raw_sequence_sample*);
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Get the sample duration in clock ticks of this track.
|
|
233
|
+
* Make sure to use the timescale of the track and not the timescale of the total sequence.
|
|
234
|
+
*/
|
|
235
|
+
LIBHEIF_API
|
|
236
|
+
uint32_t heif_raw_sequence_sample_get_duration(const heif_raw_sequence_sample*);
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
// --- writing sequences
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Set an independent global timescale for the sequence.
|
|
243
|
+
* If no timescale is set with this function, the timescale of the first track will be used.
|
|
244
|
+
*/
|
|
245
|
+
LIBHEIF_API
|
|
246
|
+
void heif_context_set_sequence_timescale(heif_context*, uint32_t timescale);
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Specifies whether a 'sample auxiliary info' is stored with the samples.
|
|
251
|
+
* The difference between `heif_sample_aux_info_presence_optional` and `heif_sample_aux_info_presence_mandatory`
|
|
252
|
+
* is that `heif_sample_aux_info_presence_mandatory` will throw an error if the data is missing when writing a sample.
|
|
253
|
+
*/
|
|
254
|
+
enum heif_sample_aux_info_presence
|
|
255
|
+
{
|
|
256
|
+
heif_sample_aux_info_presence_none = 0,
|
|
257
|
+
heif_sample_aux_info_presence_optional = 1,
|
|
258
|
+
heif_sample_aux_info_presence_mandatory = 2
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
typedef struct heif_track_options heif_track_options;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Allocate track options object that is required to set options for a new track.
|
|
266
|
+
* When you create a new track, you can also pass a NULL heif_track_options pointer, in which case the default options are used.
|
|
267
|
+
*/
|
|
268
|
+
LIBHEIF_API
|
|
269
|
+
heif_track_options* heif_track_options_alloc(void);
|
|
270
|
+
|
|
271
|
+
LIBHEIF_API
|
|
272
|
+
void heif_track_options_release(heif_track_options*);
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Set the track specific timescale. This is the number of clock ticks per second.
|
|
276
|
+
* The default is 90,000 Hz.
|
|
277
|
+
* @param timescale
|
|
278
|
+
*/
|
|
279
|
+
LIBHEIF_API
|
|
280
|
+
void heif_track_options_set_timescale(heif_track_options*, uint32_t timescale);
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Set whether the aux-info data should be stored interleaved with the sequence samples.
|
|
284
|
+
* Default is: false.
|
|
285
|
+
*
|
|
286
|
+
* If 'true', the aux_info data blocks will be interleaved with the compressed image.
|
|
287
|
+
* This has the advantage that the aux_info is localized near the image data.
|
|
288
|
+
*
|
|
289
|
+
* If 'false', all aux_info will be written as one block after the compressed image data.
|
|
290
|
+
* This has the advantage that no aux_info offsets have to be written.
|
|
291
|
+
*/
|
|
292
|
+
LIBHEIF_API
|
|
293
|
+
void heif_track_options_set_interleaved_sample_aux_infos(heif_track_options*, int interleaved_flag);
|
|
294
|
+
|
|
295
|
+
LIBHEIF_API
|
|
296
|
+
heif_error heif_track_options_enable_sample_tai_timestamps(heif_track_options*,
|
|
297
|
+
const heif_tai_clock_info*,
|
|
298
|
+
enum heif_sample_aux_info_presence);
|
|
299
|
+
|
|
300
|
+
LIBHEIF_API
|
|
301
|
+
void heif_track_options_enable_sample_gimi_content_ids(heif_track_options*,
|
|
302
|
+
enum heif_sample_aux_info_presence);
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Set the GIMI format track ID string. If NULL is passed, no track ID is saved.
|
|
306
|
+
* @param track_id
|
|
307
|
+
*/
|
|
308
|
+
LIBHEIF_API
|
|
309
|
+
void heif_track_options_set_gimi_track_id(heif_track_options*,
|
|
310
|
+
const char* track_id);
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
// --- writing visual tracks
|
|
314
|
+
|
|
315
|
+
// This structure is for future use. It is not defined yet.
|
|
316
|
+
typedef struct heif_sequence_encoding_options
|
|
317
|
+
{
|
|
318
|
+
uint8_t version;
|
|
319
|
+
|
|
320
|
+
// version 1 options
|
|
321
|
+
|
|
322
|
+
// Set this to the NCLX parameters to be used in the output images or set to NULL
|
|
323
|
+
// when the same parameters as in the input images should be used.
|
|
324
|
+
const heif_color_profile_nclx* output_nclx_profile;
|
|
325
|
+
|
|
326
|
+
heif_color_conversion_options color_conversion_options;
|
|
327
|
+
} heif_sequence_encoding_options;
|
|
328
|
+
|
|
329
|
+
LIBHEIF_API
|
|
330
|
+
heif_sequence_encoding_options* heif_sequence_encoding_options_alloc(void);
|
|
331
|
+
|
|
332
|
+
LIBHEIF_API
|
|
333
|
+
void heif_sequence_encoding_options_release(heif_sequence_encoding_options*);
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* Add a visual track to the sequence.
|
|
337
|
+
* The track ID is assigned automatically.
|
|
338
|
+
*
|
|
339
|
+
* @param width Image resolution width
|
|
340
|
+
* @param height Image resolution height
|
|
341
|
+
* @param track_type Has to be heif_track_type_video or heif_track_type_image_sequence
|
|
342
|
+
* @param track_options Optional track creation options. If NULL, default options will be used.
|
|
343
|
+
* @param encoding_options Options for sequence encoding. If NULL, default options will be used.
|
|
344
|
+
* @param out_track Output parameter to receive the track object for the just created track.
|
|
345
|
+
* @return
|
|
346
|
+
*/
|
|
347
|
+
LIBHEIF_API
|
|
348
|
+
heif_error heif_context_add_visual_sequence_track(heif_context*,
|
|
349
|
+
uint16_t width, uint16_t height,
|
|
350
|
+
heif_track_type track_type,
|
|
351
|
+
const heif_track_options* track_options,
|
|
352
|
+
const heif_sequence_encoding_options* encoding_options,
|
|
353
|
+
heif_track** out_track);
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Set the image display duration in the track's timescale units.
|
|
357
|
+
*/
|
|
358
|
+
LIBHEIF_API
|
|
359
|
+
void heif_image_set_duration(heif_image*, uint32_t duration);
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* Encode the image into a visual track.
|
|
363
|
+
* If the passed track is no visual track, an error will be returned.
|
|
364
|
+
*
|
|
365
|
+
* @param sequence_encoding_options Options for sequence encoding. If NULL, default options will be used.
|
|
366
|
+
*/
|
|
367
|
+
LIBHEIF_API
|
|
368
|
+
heif_error heif_track_encode_sequence_image(heif_track*,
|
|
369
|
+
const heif_image* image,
|
|
370
|
+
heif_encoder* encoder,
|
|
371
|
+
const heif_sequence_encoding_options* sequence_encoding_options);
|
|
372
|
+
|
|
373
|
+
// --- metadata tracks
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Add a metadata track.
|
|
377
|
+
* The track content type is specified by the 'uri' parameter.
|
|
378
|
+
* This will be created as a 'urim' "URI Meta Sample Entry".
|
|
379
|
+
*
|
|
380
|
+
* @param options Optional track creation options. If NULL, default options will be used.
|
|
381
|
+
*/
|
|
382
|
+
LIBHEIF_API
|
|
383
|
+
heif_error heif_context_add_uri_metadata_sequence_track(heif_context*,
|
|
384
|
+
const char* uri,
|
|
385
|
+
const heif_track_options* options,
|
|
386
|
+
heif_track** out_track);
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Allocate a new heif_raw_sequence_sample object.
|
|
390
|
+
* Free with heif_raw_sequence_sample_release().
|
|
391
|
+
*/
|
|
392
|
+
LIBHEIF_API
|
|
393
|
+
heif_raw_sequence_sample* heif_raw_sequence_sample_alloc(void);
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Set the raw sequence sample data.
|
|
397
|
+
*/
|
|
398
|
+
LIBHEIF_API
|
|
399
|
+
heif_error heif_raw_sequence_sample_set_data(heif_raw_sequence_sample*, const uint8_t* data, size_t size);
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* Set the sample duration in track timescale units.
|
|
403
|
+
*/
|
|
404
|
+
LIBHEIF_API
|
|
405
|
+
void heif_raw_sequence_sample_set_duration(heif_raw_sequence_sample*, uint32_t duration);
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* Add a raw sequence sample (usually a metadata sample) to the (metadata) track.
|
|
409
|
+
*/
|
|
410
|
+
LIBHEIF_API
|
|
411
|
+
heif_error heif_track_add_raw_sequence_sample(heif_track*,
|
|
412
|
+
const heif_raw_sequence_sample*);
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
// --- sample auxiliary data
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* Contains the type of sample auxiliary data assigned to the track samples.
|
|
419
|
+
*/
|
|
420
|
+
typedef struct heif_sample_aux_info_type
|
|
421
|
+
{
|
|
422
|
+
uint32_t type;
|
|
423
|
+
uint32_t parameter;
|
|
424
|
+
} heif_sample_aux_info_type;
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* Returns how many different types of sample auxiliary data units are assigned to this track's samples.
|
|
428
|
+
*/
|
|
429
|
+
LIBHEIF_API
|
|
430
|
+
int heif_track_get_number_of_sample_aux_infos(const heif_track*);
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* Get get the list of sample auxiliary data types used in the track.
|
|
434
|
+
* The passed array has to have heif_track_get_number_of_sample_aux_infos() entries.
|
|
435
|
+
*/
|
|
436
|
+
LIBHEIF_API
|
|
437
|
+
void heif_track_get_sample_aux_info_types(const heif_track*, heif_sample_aux_info_type out_types[]);
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
// --- GIMI content IDs
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* Get the GIMI content ID for the track (as a whole).
|
|
444
|
+
* If there is no content ID, nullptr is returned.
|
|
445
|
+
*
|
|
446
|
+
* @return The returned string has to be released with `heif_string_release()`.
|
|
447
|
+
*/
|
|
448
|
+
LIBHEIF_API
|
|
449
|
+
const char* heif_track_get_gimi_track_content_id(const heif_track*);
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* Get the GIMI content ID stored in the image sample.
|
|
453
|
+
* If there is no content ID, NULL is returned.
|
|
454
|
+
* @return
|
|
455
|
+
*/
|
|
456
|
+
LIBHEIF_API
|
|
457
|
+
const char* heif_image_get_gimi_sample_content_id(const heif_image*);
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* Get the GIMI content ID stored in the metadata sample.
|
|
461
|
+
* If there is no content ID, NULL is returned.
|
|
462
|
+
* @return
|
|
463
|
+
*/
|
|
464
|
+
LIBHEIF_API
|
|
465
|
+
const char* heif_raw_sequence_sample_get_gimi_sample_content_id(const heif_raw_sequence_sample*);
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* Set the GIMI content ID for an image sample. It will be stored as SAI.
|
|
469
|
+
* When passing NULL, a previously set ID will be removed.
|
|
470
|
+
*/
|
|
471
|
+
LIBHEIF_API
|
|
472
|
+
void heif_image_set_gimi_sample_content_id(heif_image*, const char* contentID);
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* Set the GIMI content ID for a (metadata) sample. It will be stored as SAI.
|
|
476
|
+
* When passing NULL, a previously set ID will be removed.
|
|
477
|
+
*/
|
|
478
|
+
LIBHEIF_API
|
|
479
|
+
void heif_raw_sequence_sample_set_gimi_sample_content_id(heif_raw_sequence_sample*, const char* contentID);
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
// --- TAI timestamps
|
|
483
|
+
|
|
484
|
+
// Note: functions for setting timestamps on images are in heif_tai_timestamps.h
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* Returns whether the raw (metadata) sample has a TAI timestamp attached to it (stored as SAI).
|
|
488
|
+
*
|
|
489
|
+
* @return boolean flag whether a TAI exists for this sample.
|
|
490
|
+
*/
|
|
491
|
+
LIBHEIF_API
|
|
492
|
+
int heif_raw_sequence_sample_has_tai_timestamp(const heif_raw_sequence_sample*);
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* Get the TAI timestamp of the (metadata) sample.
|
|
496
|
+
* If there is no timestamp assigned to it, NULL will be returned.
|
|
497
|
+
*
|
|
498
|
+
* @note You should NOT free the returned timestamp with 'heif_tai_timestamp_packet_release()'.
|
|
499
|
+
* The returned struct stays valid until the heif_raw_sequence_sample is released.
|
|
500
|
+
*/
|
|
501
|
+
LIBHEIF_API
|
|
502
|
+
const heif_tai_timestamp_packet* heif_raw_sequence_sample_get_tai_timestamp(const heif_raw_sequence_sample*);
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* Set the TAI timestamp for a raw sequence sample.
|
|
506
|
+
* The timestamp will be copied, you can release it after calling this function.
|
|
507
|
+
*/
|
|
508
|
+
LIBHEIF_API
|
|
509
|
+
void heif_raw_sequence_sample_set_tai_timestamp(heif_raw_sequence_sample* sample,
|
|
510
|
+
const heif_tai_timestamp_packet* timestamp);
|
|
511
|
+
|
|
512
|
+
/**
|
|
513
|
+
* Returns the TAI clock info of the track.
|
|
514
|
+
* If there is no TAI clock info, NULL is returned.
|
|
515
|
+
* You should NOT free the returned heif_tai_clock_info.
|
|
516
|
+
* The structure stays valid until the heif_track object is released.
|
|
517
|
+
*/
|
|
518
|
+
LIBHEIF_API
|
|
519
|
+
const heif_tai_clock_info* heif_track_get_tai_clock_info_of_first_cluster(heif_track*);
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
// --- track references
|
|
523
|
+
|
|
524
|
+
enum heif_track_reference_type
|
|
525
|
+
{
|
|
526
|
+
heif_track_reference_type_description = heif_fourcc('c', 'd', 's', 'c'), // track_description
|
|
527
|
+
heif_track_reference_type_thumbnails = heif_fourcc('t', 'h', 'm', 'b'), // thumbnails
|
|
528
|
+
heif_track_reference_type_auxiliary = heif_fourcc('a', 'u', 'x', 'l') // auxiliary data (e.g. depth maps or alpha channel)
|
|
529
|
+
};
|
|
530
|
+
|
|
531
|
+
/**
|
|
532
|
+
* Add a reference between tracks.
|
|
533
|
+
* 'reference_type' can be one of the four-cc codes listed in heif_track_reference_type or any other type.
|
|
534
|
+
*/
|
|
535
|
+
LIBHEIF_API
|
|
536
|
+
void heif_track_add_reference_to_track(heif_track*, uint32_t reference_type, const heif_track* to_track);
|
|
537
|
+
|
|
538
|
+
/**
|
|
539
|
+
* Return the number of different reference types used in this track's tref box.
|
|
540
|
+
*/
|
|
541
|
+
LIBHEIF_API
|
|
542
|
+
size_t heif_track_get_number_of_track_reference_types(const heif_track*);
|
|
543
|
+
|
|
544
|
+
/**
|
|
545
|
+
* List the reference types used in this track.
|
|
546
|
+
* The passed array must have heif_track_get_number_of_track_reference_types() entries.
|
|
547
|
+
*/
|
|
548
|
+
LIBHEIF_API
|
|
549
|
+
void heif_track_get_track_reference_types(const heif_track*, uint32_t out_reference_types[]);
|
|
550
|
+
|
|
551
|
+
/**
|
|
552
|
+
* Get the number of references of the passed type.
|
|
553
|
+
*/
|
|
554
|
+
LIBHEIF_API
|
|
555
|
+
size_t heif_track_get_number_of_track_reference_of_type(const heif_track*, uint32_t reference_type);
|
|
556
|
+
|
|
557
|
+
/**
|
|
558
|
+
* List the track ids this track points to with the passed reference type.
|
|
559
|
+
* The passed array must have heif_track_get_number_of_track_reference_of_type() entries.
|
|
560
|
+
*/
|
|
561
|
+
LIBHEIF_API
|
|
562
|
+
size_t heif_track_get_references_from_track(const heif_track*, uint32_t reference_type, uint32_t out_to_track_id[]);
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* Find tracks that are referring to the current track through the passed reference_type.
|
|
566
|
+
* The found track IDs will be filled into the passed array, but no more than `array_size` entries will be filled.
|
|
567
|
+
*
|
|
568
|
+
* @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.
|
|
569
|
+
*/
|
|
570
|
+
LIBHEIF_API
|
|
571
|
+
size_t heif_track_find_referring_tracks(const heif_track*, uint32_t reference_type, uint32_t out_track_id[], size_t array_size);
|
|
572
|
+
|
|
573
|
+
#ifdef __cplusplus
|
|
574
|
+
}
|
|
575
|
+
#endif
|
|
576
|
+
|
|
577
|
+
#endif
|