@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.
- package/README.md +23 -23
- 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 +15 -3
- package/include/expat_config.h +6 -6
- package/include/expat_external.h +4 -4
- package/include/glib-2.0/gio/gdbusconnection.h +2 -8
- package/include/glib-2.0/gio/gfileattribute.h +1 -1
- package/include/glib-2.0/gio/gfileinfo.h +5 -0
- package/include/glib-2.0/gio/gicon.h +1 -1
- package/include/glib-2.0/gio/gio-autocleanups.h +0 -1
- package/include/glib-2.0/gio/gio-visibility.h +34 -0
- package/include/glib-2.0/gio/gio.h +2 -0
- package/include/glib-2.0/gio/gioenums.h +66 -44
- package/include/glib-2.0/gio/gioenumtypes.h +2 -0
- package/include/glib-2.0/gio/giptosmessage.h +46 -0
- package/include/glib-2.0/gio/gipv6tclassmessage.h +46 -0
- package/include/glib-2.0/gio/gresolver.h +1 -1
- package/include/glib-2.0/gio/gsettings.h +1 -1
- package/include/glib-2.0/gio/gsocketcontrolmessage.h +2 -0
- package/include/glib-2.0/glib/gatomic.h +26 -2
- package/include/glib-2.0/glib/gfileutils.h +2 -2
- package/include/glib-2.0/glib/ghook.h +3 -1
- package/include/glib-2.0/glib/giochannel.h +1 -1
- package/include/glib-2.0/glib/gkeyfile.h +1 -1
- package/include/glib-2.0/glib/glib-visibility.h +34 -0
- package/include/glib-2.0/glib/gmacros.h +32 -0
- package/include/glib-2.0/glib/gmain.h +4 -0
- package/include/glib-2.0/glib/gmarkup.h +18 -1
- package/include/glib-2.0/glib/gmem.h +4 -4
- package/include/glib-2.0/glib/gmessages.h +7 -9
- package/include/glib-2.0/glib/gnode.h +1 -1
- package/include/glib-2.0/glib/goption.h +1 -1
- package/include/glib-2.0/glib/gsequence.h +2 -2
- package/include/glib-2.0/glib/gslice.h +12 -4
- package/include/glib-2.0/glib/gspawn.h +1 -1
- package/include/glib-2.0/glib/gstrfuncs.h +191 -1
- package/include/glib-2.0/glib/gtestutils.h +6 -3
- package/include/glib-2.0/glib/gtimer.h +1 -0
- package/include/glib-2.0/glib/guri.h +3 -3
- package/include/glib-2.0/glib/gutils.h +10 -1
- package/include/glib-2.0/glib/gvarianttype.h +16 -16
- package/include/glib-2.0/glib/gversionmacros.h +22 -0
- package/include/glib-2.0/gmodule/gmodule-visibility.h +34 -0
- package/include/glib-2.0/gmodule.h +1 -1
- package/include/glib-2.0/gobject/gbinding.h +1 -1
- package/include/glib-2.0/gobject/gobject-visibility.h +34 -0
- package/include/glib-2.0/gobject/gobject.h +1 -1
- package/include/glib-2.0/gobject/gparam.h +1 -1
- package/include/glib-2.0/gobject/gsignal.h +8 -8
- package/include/glib-2.0/gobject/gtype.h +17 -17
- package/include/hwy/aligned_allocator.h +44 -2
- package/include/hwy/auto_tune.h +22 -6
- package/include/hwy/base.h +60 -90
- package/include/hwy/bit_set.h +410 -0
- package/include/hwy/cache_control.h +3 -2
- package/include/hwy/detect_compiler_arch.h +134 -14
- package/include/hwy/detect_targets.h +82 -36
- package/include/hwy/highway.h +15 -0
- package/include/hwy/nanobenchmark.h +12 -3
- package/include/hwy/ops/arm_neon-inl.h +96 -25
- package/include/hwy/ops/arm_sve-inl.h +250 -95
- package/include/hwy/ops/emu128-inl.h +12 -7
- package/include/hwy/ops/generic_ops-inl.h +271 -131
- package/include/hwy/ops/loongarch_lasx-inl.h +31 -9
- package/include/hwy/ops/loongarch_lsx-inl.h +33 -12
- package/include/hwy/ops/ppc_vsx-inl.h +99 -19
- package/include/hwy/ops/rvv-inl.h +239 -130
- package/include/hwy/ops/scalar-inl.h +22 -7
- package/include/hwy/ops/set_macros-inl.h +163 -107
- package/include/hwy/ops/wasm_128-inl.h +13 -22
- package/include/hwy/ops/x86_128-inl.h +223 -120
- package/include/hwy/ops/x86_256-inl.h +70 -134
- package/include/hwy/ops/x86_512-inl.h +130 -134
- package/include/hwy/print-inl.h +2 -0
- package/include/hwy/profiler.h +355 -264
- package/include/hwy/robust_statistics.h +3 -1
- package/include/hwy/timer.h +44 -0
- package/include/lcms2.h +35 -5
- package/include/lcms2_plugin.h +1 -1
- package/include/libexif/exif-utils.h +1 -1
- package/include/libheif/heif.h +2 -0
- package/include/libheif/heif_aux_images.h +2 -2
- package/include/libheif/heif_brands.h +16 -4
- package/include/libheif/heif_color.h +147 -25
- package/include/libheif/heif_components.h +264 -0
- package/include/libheif/heif_context.h +18 -4
- package/include/libheif/heif_cxx.h +20 -18
- package/include/libheif/heif_decoding.h +63 -9
- package/include/libheif/heif_encoding.h +46 -12
- package/include/libheif/heif_error.h +15 -6
- package/include/libheif/heif_export.h +48 -0
- package/include/libheif/heif_image.h +94 -32
- package/include/libheif/heif_image_handle.h +54 -3
- package/include/libheif/heif_items.h +25 -2
- package/include/libheif/heif_library.h +13 -18
- package/include/libheif/heif_metadata.h +5 -2
- package/include/libheif/heif_omaf.h +104 -0
- package/include/libheif/heif_plugin.h +80 -13
- package/include/libheif/heif_properties.h +259 -5
- package/include/libheif/heif_regions.h +5 -3
- package/include/libheif/heif_security.h +24 -2
- package/include/libheif/heif_sequences.h +163 -14
- package/include/libheif/heif_text.h +161 -0
- package/include/libheif/heif_tiling.h +2 -2
- package/include/libheif/heif_uncompressed.h +29 -5
- package/include/libheif/heif_version.h +2 -2
- package/include/libpng16/png.h +637 -488
- package/include/libpng16/pngconf.h +2 -2
- package/include/libpng16/pnglibconf.h +2 -2
- package/include/png.h +637 -488
- package/include/pngconf.h +2 -2
- package/include/pnglibconf.h +2 -2
- package/include/resvg.h +3 -3
- package/include/tiffconf.h +9 -10
- package/include/tiffio.h +10 -9
- package/include/tiffvers.h +1 -1
- package/include/ultrahdr_api.h +5 -11
- package/include/vips/colour.h +2 -2
- package/include/vips/memory.h +1 -1
- package/include/vips/version.h +4 -4
- package/include/zlib.h +3 -3
- package/lib/glib-2.0/include/glibconfig.h +1 -3
- package/lib/libaom.a +0 -0
- package/lib/libcgif.a +0 -0
- package/lib/libexif.a +0 -0
- package/lib/libexif.la +1 -1
- package/lib/libexpat.a +0 -0
- package/lib/libexpat.la +2 -2
- 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/libpng.la +2 -2
- package/lib/libpng16.a +0 -0
- package/lib/libpng16.la +2 -2
- 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/cgif.pc +1 -1
- 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/lcms2.pc +1 -1
- package/lib/pkgconfig/libexif.pc +1 -1
- package/lib/pkgconfig/libheif.pc +1 -1
- package/lib/pkgconfig/libhwy.pc +3 -4
- package/lib/pkgconfig/libpng.pc +1 -1
- package/lib/pkgconfig/libpng16.pc +1 -1
- package/lib/pkgconfig/libsharpyuv.pc +1 -1
- package/lib/pkgconfig/libtiff-4.pc +2 -2
- package/lib/pkgconfig/libwebp.pc +1 -1
- package/lib/pkgconfig/libwebpdecoder.pc +11 -0
- package/lib/pkgconfig/libwebpmux.pc +1 -1
- package/lib/pkgconfig/vips-cpp.pc +1 -1
- package/lib/pkgconfig/vips.pc +1 -1
- package/package.json +1 -1
- package/versions.json +15 -15
- package/lib/libsharpyuv.la +0 -41
- package/lib/libtiff.la +0 -41
- package/lib/libwebp.la +0 -41
- package/lib/libwebpdemux.la +0 -41
- package/lib/libwebpmux.la +0 -41
|
@@ -22,7 +22,9 @@
|
|
|
22
22
|
#ifndef LIBHEIF_HEIF_REGIONS_H
|
|
23
23
|
#define LIBHEIF_HEIF_REGIONS_H
|
|
24
24
|
|
|
25
|
-
#include "
|
|
25
|
+
#include "heif_image_handle.h"
|
|
26
|
+
#include "heif_library.h"
|
|
27
|
+
#include "heif_error.h"
|
|
26
28
|
|
|
27
29
|
#ifdef __cplusplus
|
|
28
30
|
extern "C" {
|
|
@@ -40,7 +42,7 @@ typedef struct heif_region_item heif_region_item;
|
|
|
40
42
|
* Each region item will contain zero or more regions, which may have different geometry or
|
|
41
43
|
* mask representations.
|
|
42
44
|
*/
|
|
43
|
-
enum heif_region_type
|
|
45
|
+
typedef enum heif_region_type
|
|
44
46
|
{
|
|
45
47
|
/**
|
|
46
48
|
* Point geometry.
|
|
@@ -119,7 +121,7 @@ enum heif_region_type
|
|
|
119
121
|
* considered to form a closed surface. Only the edge is part of the region.
|
|
120
122
|
*/
|
|
121
123
|
heif_region_type_polyline = 6
|
|
122
|
-
};
|
|
124
|
+
} heif_region_type;
|
|
123
125
|
|
|
124
126
|
typedef struct heif_region heif_region;
|
|
125
127
|
|
|
@@ -38,13 +38,14 @@ 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
|
|
45
45
|
// in 1.5 GB memory need for YUV-4:2:0 or 4 GB for RGB32.
|
|
46
46
|
uint64_t max_image_size_pixels;
|
|
47
47
|
uint64_t max_number_of_tiles;
|
|
48
|
+
// Also used for polarization pattern (splz) size limit.
|
|
48
49
|
uint32_t max_bayer_pattern_pixels;
|
|
49
50
|
uint32_t max_items;
|
|
50
51
|
|
|
@@ -58,11 +59,32 @@ typedef struct heif_security_limits
|
|
|
58
59
|
|
|
59
60
|
uint32_t max_children_per_box; // for all boxes that are not covered by other limits
|
|
60
61
|
|
|
61
|
-
// --- version 2
|
|
62
|
+
// --- version 2 (v1.20.0)
|
|
62
63
|
|
|
63
64
|
uint64_t max_total_memory;
|
|
64
65
|
uint32_t max_sample_description_box_entries;
|
|
65
66
|
uint32_t max_sample_group_description_box_entries;
|
|
67
|
+
|
|
68
|
+
// --- version 3 (v1.21.0)
|
|
69
|
+
|
|
70
|
+
uint32_t max_sequence_frames;
|
|
71
|
+
uint32_t max_number_of_file_brands;
|
|
72
|
+
|
|
73
|
+
// --- version 4 (v1.22.0)
|
|
74
|
+
|
|
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;
|
|
66
88
|
} heif_security_limits;
|
|
67
89
|
|
|
68
90
|
|
|
@@ -82,7 +82,12 @@ int heif_context_number_of_sequence_tracks(const heif_context*);
|
|
|
82
82
|
|
|
83
83
|
/**
|
|
84
84
|
* Returns the IDs for each of the tracks stored in the HEIF file.
|
|
85
|
-
*
|
|
85
|
+
*
|
|
86
|
+
* The caller MUST allocate `out_track_id_array` with exactly
|
|
87
|
+
* heif_context_number_of_sequence_tracks() entries. The function writes
|
|
88
|
+
* that many IDs unconditionally. Passing a smaller array results in a
|
|
89
|
+
* buffer overflow (undefined behavior); there is no capacity parameter
|
|
90
|
+
* and no truncation.
|
|
86
91
|
*/
|
|
87
92
|
LIBHEIF_API
|
|
88
93
|
void heif_context_get_track_ids(const heif_context* ctx, uint32_t out_track_id_array[]);
|
|
@@ -111,12 +116,13 @@ heif_track* heif_context_get_track(const heif_context*, uint32_t id);
|
|
|
111
116
|
|
|
112
117
|
typedef uint32_t heif_track_type;
|
|
113
118
|
|
|
114
|
-
enum heif_track_type_4cc
|
|
119
|
+
typedef enum heif_track_type_4cc
|
|
115
120
|
{
|
|
116
121
|
heif_track_type_video = heif_fourcc('v', 'i', 'd', 'e'),
|
|
117
122
|
heif_track_type_image_sequence = heif_fourcc('p', 'i', 'c', 't'),
|
|
123
|
+
heif_track_type_auxiliary = heif_fourcc('a', 'u', 'x', 'v'),
|
|
118
124
|
heif_track_type_metadata = heif_fourcc('m', 'e', 't', 'a')
|
|
119
|
-
};
|
|
125
|
+
} heif_track_type_4cc;
|
|
120
126
|
|
|
121
127
|
/**
|
|
122
128
|
* Get the four-cc track handler type.
|
|
@@ -128,6 +134,22 @@ enum heif_track_type_4cc
|
|
|
128
134
|
LIBHEIF_API
|
|
129
135
|
heif_track_type heif_track_get_track_handler_type(const heif_track*);
|
|
130
136
|
|
|
137
|
+
|
|
138
|
+
typedef enum heif_auxiliary_track_info_type
|
|
139
|
+
{
|
|
140
|
+
heif_auxiliary_track_info_type_unknown = 0,
|
|
141
|
+
heif_auxiliary_track_info_type_alpha = 1
|
|
142
|
+
} heif_auxiliary_track_info_type;
|
|
143
|
+
|
|
144
|
+
LIBHEIF_API
|
|
145
|
+
enum heif_auxiliary_track_info_type heif_track_get_auxiliary_info_type(const heif_track*);
|
|
146
|
+
|
|
147
|
+
LIBHEIF_API
|
|
148
|
+
const char* heif_track_get_auxiliary_info_type_urn(const heif_track*);
|
|
149
|
+
|
|
150
|
+
LIBHEIF_API
|
|
151
|
+
int heif_track_has_alpha_channel(const heif_track*);
|
|
152
|
+
|
|
131
153
|
/**
|
|
132
154
|
* Get the timescale (clock ticks per second) for this track.
|
|
133
155
|
* Note that this can be different from the timescale used at sequence level.
|
|
@@ -137,6 +159,41 @@ heif_track_type heif_track_get_track_handler_type(const heif_track*);
|
|
|
137
159
|
LIBHEIF_API
|
|
138
160
|
uint32_t heif_track_get_timescale(const heif_track*);
|
|
139
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
|
+
|
|
140
197
|
|
|
141
198
|
// --- reading visual tracks
|
|
142
199
|
|
|
@@ -160,8 +217,8 @@ heif_error heif_track_get_image_resolution(const heif_track*, uint16_t* out_widt
|
|
|
160
217
|
LIBHEIF_API
|
|
161
218
|
heif_error heif_track_decode_next_image(heif_track* track,
|
|
162
219
|
heif_image** out_img,
|
|
163
|
-
|
|
164
|
-
|
|
220
|
+
heif_colorspace colorspace,
|
|
221
|
+
heif_chroma chroma,
|
|
165
222
|
const heif_decoding_options* options);
|
|
166
223
|
|
|
167
224
|
/**
|
|
@@ -189,7 +246,8 @@ uint32_t heif_track_get_sample_entry_type_of_first_cluster(const heif_track*);
|
|
|
189
246
|
* @param out_uri A string with the URI will be returned. Free this string with `heif_string_release()`.
|
|
190
247
|
*/
|
|
191
248
|
LIBHEIF_API
|
|
192
|
-
heif_error heif_track_get_urim_sample_entry_uri_of_first_cluster(const heif_track
|
|
249
|
+
heif_error heif_track_get_urim_sample_entry_uri_of_first_cluster(const heif_track*,
|
|
250
|
+
const char** out_uri);
|
|
193
251
|
|
|
194
252
|
|
|
195
253
|
/** Sequence sample object that can hold any raw byte data.
|
|
@@ -245,18 +303,24 @@ uint32_t heif_raw_sequence_sample_get_duration(const heif_raw_sequence_sample*);
|
|
|
245
303
|
LIBHEIF_API
|
|
246
304
|
void heif_context_set_sequence_timescale(heif_context*, uint32_t timescale);
|
|
247
305
|
|
|
306
|
+
// Number of times the sequence should be played in total (default = 1).
|
|
307
|
+
// Can be set to heif_sequence_maximum_number_of_repetitions.
|
|
308
|
+
LIBHEIF_API
|
|
309
|
+
void heif_context_set_number_of_sequence_repetitions(heif_context*, uint32_t number_of_repetitions);
|
|
310
|
+
|
|
311
|
+
#define heif_sequence_maximum_number_of_repetitions 0
|
|
248
312
|
|
|
249
313
|
/**
|
|
250
314
|
* Specifies whether a 'sample auxiliary info' is stored with the samples.
|
|
251
315
|
* The difference between `heif_sample_aux_info_presence_optional` and `heif_sample_aux_info_presence_mandatory`
|
|
252
316
|
* is that `heif_sample_aux_info_presence_mandatory` will throw an error if the data is missing when writing a sample.
|
|
253
317
|
*/
|
|
254
|
-
enum heif_sample_aux_info_presence
|
|
318
|
+
typedef enum heif_sample_aux_info_presence
|
|
255
319
|
{
|
|
256
320
|
heif_sample_aux_info_presence_none = 0,
|
|
257
321
|
heif_sample_aux_info_presence_optional = 1,
|
|
258
322
|
heif_sample_aux_info_presence_mandatory = 2
|
|
259
|
-
};
|
|
323
|
+
} heif_sample_aux_info_presence;
|
|
260
324
|
|
|
261
325
|
|
|
262
326
|
typedef struct heif_track_options heif_track_options;
|
|
@@ -288,6 +352,8 @@ void heif_track_options_set_timescale(heif_track_options*, uint32_t timescale);
|
|
|
288
352
|
*
|
|
289
353
|
* If 'false', all aux_info will be written as one block after the compressed image data.
|
|
290
354
|
* This has the advantage that no aux_info offsets have to be written.
|
|
355
|
+
*
|
|
356
|
+
* Note: currently ignored. Interleaved writing is disabled.
|
|
291
357
|
*/
|
|
292
358
|
LIBHEIF_API
|
|
293
359
|
void heif_track_options_set_interleaved_sample_aux_infos(heif_track_options*, int interleaved_flag);
|
|
@@ -312,7 +378,37 @@ void heif_track_options_set_gimi_track_id(heif_track_options*,
|
|
|
312
378
|
|
|
313
379
|
// --- writing visual tracks
|
|
314
380
|
|
|
315
|
-
|
|
381
|
+
typedef enum heif_sequence_gop_structure
|
|
382
|
+
{
|
|
383
|
+
// Only independently decodable keyframes.
|
|
384
|
+
heif_sequence_gop_structure_intra_only,
|
|
385
|
+
|
|
386
|
+
// No frame reordering, usually an IPPPP structure.
|
|
387
|
+
heif_sequence_gop_structure_lowdelay,
|
|
388
|
+
|
|
389
|
+
// All frame types are allowed, including frame reordering, to achieve
|
|
390
|
+
// the best compression ratio.
|
|
391
|
+
heif_sequence_gop_structure_unrestricted
|
|
392
|
+
} heif_sequence_gop_structure;
|
|
393
|
+
|
|
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
|
+
|
|
316
412
|
typedef struct heif_sequence_encoding_options
|
|
317
413
|
{
|
|
318
414
|
uint8_t version;
|
|
@@ -324,11 +420,40 @@ typedef struct heif_sequence_encoding_options
|
|
|
324
420
|
const heif_color_profile_nclx* output_nclx_profile;
|
|
325
421
|
|
|
326
422
|
heif_color_conversion_options color_conversion_options;
|
|
423
|
+
|
|
424
|
+
// version 2 options
|
|
425
|
+
|
|
426
|
+
enum heif_sequence_gop_structure gop_structure;
|
|
427
|
+
int keyframe_distance_min; // 0 - undefined
|
|
428
|
+
int keyframe_distance_max; // 0 - undefined
|
|
429
|
+
|
|
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;
|
|
327
440
|
} heif_sequence_encoding_options;
|
|
328
441
|
|
|
442
|
+
|
|
329
443
|
LIBHEIF_API
|
|
330
444
|
heif_sequence_encoding_options* heif_sequence_encoding_options_alloc(void);
|
|
331
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
|
+
|
|
332
457
|
LIBHEIF_API
|
|
333
458
|
void heif_sequence_encoding_options_release(heif_sequence_encoding_options*);
|
|
334
459
|
|
|
@@ -362,6 +487,8 @@ void heif_image_set_duration(heif_image*, uint32_t duration);
|
|
|
362
487
|
* Encode the image into a visual track.
|
|
363
488
|
* If the passed track is no visual track, an error will be returned.
|
|
364
489
|
*
|
|
490
|
+
* @param image The input image to append to the sequence.
|
|
491
|
+
* @param encoder The encoder used for encoding the image.
|
|
365
492
|
* @param sequence_encoding_options Options for sequence encoding. If NULL, default options will be used.
|
|
366
493
|
*/
|
|
367
494
|
LIBHEIF_API
|
|
@@ -370,14 +497,31 @@ heif_error heif_track_encode_sequence_image(heif_track*,
|
|
|
370
497
|
heif_encoder* encoder,
|
|
371
498
|
const heif_sequence_encoding_options* sequence_encoding_options);
|
|
372
499
|
|
|
500
|
+
/**
|
|
501
|
+
* When all sequence frames have been sent, you can to call this function to let the
|
|
502
|
+
* library know that no more frames will follow. This is strongly recommended, but optional
|
|
503
|
+
* for backwards compatibility.
|
|
504
|
+
* If you do not end the sequence explicitly with this function, it will be closed
|
|
505
|
+
* automatically when the HEIF file is written. Using this function has the advantage
|
|
506
|
+
* that you can free the {@link heif_encoder} afterwards (with {@link heif_encoder_release}).
|
|
507
|
+
* If you do not use call function, you have to keep the {@link heif_encoder} alive
|
|
508
|
+
* until the HEIF file is written.
|
|
509
|
+
*/
|
|
510
|
+
LIBHEIF_API
|
|
511
|
+
heif_error heif_track_encode_end_of_sequence(heif_track*,
|
|
512
|
+
heif_encoder* encoder);
|
|
513
|
+
|
|
373
514
|
// --- metadata tracks
|
|
374
515
|
|
|
375
516
|
/**
|
|
376
517
|
* Add a metadata track.
|
|
518
|
+
* The track is created as a 'urim' "URI Meta Sample Entry".
|
|
377
519
|
* The track content type is specified by the 'uri' parameter.
|
|
378
|
-
* This will be created as a 'urim' "URI Meta Sample Entry".
|
|
379
520
|
*
|
|
380
|
-
* @param
|
|
521
|
+
* @param uri Track content type.
|
|
522
|
+
* @param options Optional track creation options. If NULL, default options will be used.
|
|
523
|
+
* @param out_track Returns the created track object. If this is not NULL, you have to
|
|
524
|
+
* free the returned track with {@link heif_track_release}.
|
|
381
525
|
*/
|
|
382
526
|
LIBHEIF_API
|
|
383
527
|
heif_error heif_context_add_uri_metadata_sequence_track(heif_context*,
|
|
@@ -521,12 +665,12 @@ const heif_tai_clock_info* heif_track_get_tai_clock_info_of_first_cluster(heif_t
|
|
|
521
665
|
|
|
522
666
|
// --- track references
|
|
523
667
|
|
|
524
|
-
enum heif_track_reference_type
|
|
668
|
+
typedef enum heif_track_reference_type
|
|
525
669
|
{
|
|
526
670
|
heif_track_reference_type_description = heif_fourcc('c', 'd', 's', 'c'), // track_description
|
|
527
671
|
heif_track_reference_type_thumbnails = heif_fourcc('t', 'h', 'm', 'b'), // thumbnails
|
|
528
672
|
heif_track_reference_type_auxiliary = heif_fourcc('a', 'u', 'x', 'l') // auxiliary data (e.g. depth maps or alpha channel)
|
|
529
|
-
};
|
|
673
|
+
} heif_track_reference_type;
|
|
530
674
|
|
|
531
675
|
/**
|
|
532
676
|
* Add a reference between tracks.
|
|
@@ -543,7 +687,12 @@ size_t heif_track_get_number_of_track_reference_types(const heif_track*);
|
|
|
543
687
|
|
|
544
688
|
/**
|
|
545
689
|
* List the reference types used in this track.
|
|
546
|
-
*
|
|
690
|
+
*
|
|
691
|
+
* The caller MUST allocate `out_reference_types` with exactly
|
|
692
|
+
* heif_track_get_number_of_track_reference_types() entries. The function
|
|
693
|
+
* writes that many values unconditionally. Passing a smaller array
|
|
694
|
+
* results in a buffer overflow (undefined behavior); there is no
|
|
695
|
+
* capacity parameter and no truncation.
|
|
547
696
|
*/
|
|
548
697
|
LIBHEIF_API
|
|
549
698
|
void heif_track_get_track_reference_types(const heif_track*, uint32_t out_reference_types[]);
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* HEIF codec.
|
|
3
|
+
* Copyright (c) 2023 Dirk Farin <dirk.farin@gmail.com>
|
|
4
|
+
* Copyright (c) 2025 Brad Hards <bradh@frogmouth.net>
|
|
5
|
+
*
|
|
6
|
+
* This file is part of libheif.
|
|
7
|
+
*
|
|
8
|
+
* libheif is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU Lesser General Public License as
|
|
10
|
+
* published by the Free Software Foundation, either version 3 of
|
|
11
|
+
* the License, or (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* libheif is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU Lesser General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
19
|
+
* along with libheif. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
#ifndef LIBHEIF_HEIF_TEXT_H
|
|
23
|
+
#define LIBHEIF_HEIF_TEXT_H
|
|
24
|
+
|
|
25
|
+
#include "heif_image_handle.h"
|
|
26
|
+
#include "heif_library.h"
|
|
27
|
+
#include "heif_error.h"
|
|
28
|
+
|
|
29
|
+
#ifdef __cplusplus
|
|
30
|
+
extern "C" {
|
|
31
|
+
#endif
|
|
32
|
+
|
|
33
|
+
// --- text items and fonts
|
|
34
|
+
|
|
35
|
+
// See ISO/IEC 23008-12:2025 Section 6.10 "Text and font items"
|
|
36
|
+
|
|
37
|
+
typedef struct heif_text_item heif_text_item;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Get the number of text items that are attached to an image.
|
|
41
|
+
*
|
|
42
|
+
* @param image_handle the image handle for the image to query.
|
|
43
|
+
* @return the number of text items, which can be zero.
|
|
44
|
+
*/
|
|
45
|
+
LIBHEIF_API
|
|
46
|
+
int heif_image_handle_get_number_of_text_items(const heif_image_handle* image_handle);
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Get the text item identifiers for the text items attached to an image.
|
|
50
|
+
*
|
|
51
|
+
* Possible usage (in C++):
|
|
52
|
+
* @code
|
|
53
|
+
* int numTextItems = heif_image_handle_get_number_of_text_items(handle);
|
|
54
|
+
* if (numTextItems > 0) {
|
|
55
|
+
* std::vector<heif_item_id> text_item_ids(numTextItems);
|
|
56
|
+
* heif_image_handle_get_list_of_text_item_ids(handle, text_item_ids.data(), numTextItems);
|
|
57
|
+
* // use text item ids
|
|
58
|
+
* }
|
|
59
|
+
* @endcode
|
|
60
|
+
*
|
|
61
|
+
* @param image_handle the image handle for the parent image to query
|
|
62
|
+
* @param text_item_ids_array array to put the item identifiers into
|
|
63
|
+
* @param max_count the maximum number of text identifiers
|
|
64
|
+
* @return the number of text item identifiers that were returned.
|
|
65
|
+
*/
|
|
66
|
+
LIBHEIF_API
|
|
67
|
+
int heif_image_handle_get_list_of_text_item_ids(const heif_image_handle* image_handle,
|
|
68
|
+
heif_item_id* text_item_ids_array,
|
|
69
|
+
int max_count);
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Get the text item.
|
|
74
|
+
*
|
|
75
|
+
* Caller is responsible for release of the output heif_text_item with heif_text_item_release().
|
|
76
|
+
*
|
|
77
|
+
* @param context the context to get the text item from, usually from a file operation
|
|
78
|
+
* @param text_item_id the identifier for the text item
|
|
79
|
+
* @param out pointer to pointer to the resulting text item
|
|
80
|
+
* @return heif_error_ok on success, or an error value indicating the problem
|
|
81
|
+
*/
|
|
82
|
+
LIBHEIF_API
|
|
83
|
+
heif_error heif_context_get_text_item(const heif_context* context,
|
|
84
|
+
heif_item_id text_item_id,
|
|
85
|
+
heif_text_item** out);
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Get the item identifier for a text item.
|
|
89
|
+
*
|
|
90
|
+
* @param text_item the text item to query
|
|
91
|
+
* @return the text item identifier (or 0 if the text_item is null)
|
|
92
|
+
*/
|
|
93
|
+
LIBHEIF_API
|
|
94
|
+
heif_item_id heif_text_item_get_id(heif_text_item* text_item);
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Get the item content for a text item.
|
|
98
|
+
*
|
|
99
|
+
* This is the payload text, in the format given by the associated content_type.
|
|
100
|
+
*
|
|
101
|
+
* @param text_item the text item to query
|
|
102
|
+
* @return the text item content (or null if the text_item is null). The returned string shall be released
|
|
103
|
+
* with heif_string_release().
|
|
104
|
+
*/
|
|
105
|
+
LIBHEIF_API
|
|
106
|
+
const char* heif_text_item_get_content(heif_text_item* text_item);
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* This function is similar to heif_item_get_property_extended_language(), but
|
|
110
|
+
* takes a `heif_text_item` as parameter.
|
|
111
|
+
*
|
|
112
|
+
* @param text_item The text item for which we are requesting the language.
|
|
113
|
+
* @param out_language Output parameter for the text language. Free with heif_string_release().
|
|
114
|
+
* @return
|
|
115
|
+
*/
|
|
116
|
+
LIBHEIF_API
|
|
117
|
+
heif_error heif_text_item_get_property_extended_language(const heif_text_item* text_item,
|
|
118
|
+
char** out_language);
|
|
119
|
+
|
|
120
|
+
// --- adding text items
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Add a text item to an image.
|
|
124
|
+
*/
|
|
125
|
+
LIBHEIF_API
|
|
126
|
+
heif_error heif_image_handle_add_text_item(heif_image_handle *image_handle,
|
|
127
|
+
const char *content_type,
|
|
128
|
+
const char *text,
|
|
129
|
+
heif_text_item** out_text_item);
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Release a text item.
|
|
133
|
+
*
|
|
134
|
+
* This should be called on items from heif_context_add_text_item().
|
|
135
|
+
*
|
|
136
|
+
* @param text_item the item to release.
|
|
137
|
+
*/
|
|
138
|
+
LIBHEIF_API
|
|
139
|
+
void heif_text_item_release(heif_text_item* text_item);
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Set the extended language property to the text item.
|
|
143
|
+
*
|
|
144
|
+
* This adds an RFC 5346 (IETF BCP 47) extended language tag, such as "en-AU".
|
|
145
|
+
*
|
|
146
|
+
* @param text_item the text item to query
|
|
147
|
+
* @param language the language to set
|
|
148
|
+
* @param out_optional_propertyId Output parameter for the property ID of the language property.
|
|
149
|
+
* This parameter may be NULL if the info is not required.
|
|
150
|
+
* @return heif_error_ok on success, or an error value indicating the problem
|
|
151
|
+
*/
|
|
152
|
+
LIBHEIF_API
|
|
153
|
+
heif_error heif_text_item_set_extended_language(heif_text_item* text_item,
|
|
154
|
+
const char *language,
|
|
155
|
+
heif_property_id* out_optional_propertyId);
|
|
156
|
+
|
|
157
|
+
#ifdef __cplusplus
|
|
158
|
+
}
|
|
159
|
+
#endif
|
|
160
|
+
|
|
161
|
+
#endif
|
|
@@ -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
|
|
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
#ifndef LIBHEIF_HEIF_UNCOMPRESSED_H
|
|
22
22
|
#define LIBHEIF_HEIF_UNCOMPRESSED_H
|
|
23
23
|
|
|
24
|
+
#include "libheif/heif_components.h"
|
|
25
|
+
#include "libheif/heif_properties.h"
|
|
24
26
|
#include "libheif/heif.h"
|
|
25
27
|
|
|
26
28
|
#ifdef __cplusplus
|
|
@@ -32,13 +34,19 @@ extern "C" {
|
|
|
32
34
|
* Despite its name, this is not limited to uncompressed images.
|
|
33
35
|
* It is also possible to add images with lossless compression methods.
|
|
34
36
|
* See heif_metadata_compression for more information.
|
|
37
|
+
*
|
|
38
|
+
* ISO/IEC 23001-17 metadata properties (Bayer / polarization / sensor bad
|
|
39
|
+
* pixels / NUC / chroma sample location) live in heif_properties.h, which is
|
|
40
|
+
* included above for back-compat.
|
|
35
41
|
*/
|
|
36
42
|
|
|
43
|
+
|
|
37
44
|
// --- 'unci' images
|
|
38
45
|
|
|
46
|
+
// Compression methods for 'unci' (ISO 23001-17) images.
|
|
39
47
|
// This is similar to heif_metadata_compression. We should try to keep the integers compatible, but each enum will just
|
|
40
48
|
// contain the allowed values.
|
|
41
|
-
enum heif_unci_compression
|
|
49
|
+
typedef enum heif_unci_compression
|
|
42
50
|
{
|
|
43
51
|
heif_unci_compression_off = 0,
|
|
44
52
|
//heif_unci_compression_auto = 1,
|
|
@@ -46,9 +54,11 @@ enum heif_unci_compression
|
|
|
46
54
|
heif_unci_compression_deflate = 3,
|
|
47
55
|
heif_unci_compression_zlib = 4,
|
|
48
56
|
heif_unci_compression_brotli = 5
|
|
49
|
-
};
|
|
57
|
+
} heif_unci_compression;
|
|
50
58
|
|
|
51
59
|
|
|
60
|
+
// --- 'unci' image parameters
|
|
61
|
+
|
|
52
62
|
typedef struct heif_unci_image_parameters
|
|
53
63
|
{
|
|
54
64
|
int version;
|
|
@@ -61,11 +71,12 @@ typedef struct heif_unci_image_parameters
|
|
|
61
71
|
uint32_t tile_width;
|
|
62
72
|
uint32_t tile_height;
|
|
63
73
|
|
|
64
|
-
|
|
74
|
+
heif_unci_compression compression;
|
|
65
75
|
|
|
66
76
|
// TODO: interleave type, padding
|
|
67
77
|
} heif_unci_image_parameters;
|
|
68
78
|
|
|
79
|
+
|
|
69
80
|
LIBHEIF_API
|
|
70
81
|
heif_unci_image_parameters* heif_unci_image_parameters_alloc(void);
|
|
71
82
|
|
|
@@ -84,9 +95,17 @@ void heif_unci_image_parameters_release(heif_unci_image_parameters*);
|
|
|
84
95
|
* However, this will by default disable any compression and any control about
|
|
85
96
|
* the data layout.
|
|
86
97
|
*
|
|
98
|
+
* The function also accepts a direct heif_unci_image_parameters argument and
|
|
99
|
+
* indirectly through encoding_options. At least one of the two must be non-null.
|
|
100
|
+
* If both are non-null and differ, the direct argument takes precedence.
|
|
101
|
+
*
|
|
87
102
|
* @param ctx The file context
|
|
88
|
-
* @param parameters The parameters for the image
|
|
89
|
-
*
|
|
103
|
+
* @param parameters The parameters for the image. May be NULL if
|
|
104
|
+
* heif_encoding_options::unci_parameters is set instead. If both this
|
|
105
|
+
* argument and encoding_options->unci_parameters are non-null and
|
|
106
|
+
* differ, this argument takes precedence.
|
|
107
|
+
* @param encoding_options Optional, may be NULL. If non-null and unci_parameters is set,
|
|
108
|
+
* it may carry the unci parameters in place of the direct argument.
|
|
90
109
|
* @param prototype An image with the same channel configuration as the image data
|
|
91
110
|
* that will be later inserted. The image size need not match this.
|
|
92
111
|
* Must not be NULL.
|
|
@@ -102,6 +121,11 @@ heif_error heif_context_add_empty_unci_image(heif_context* ctx,
|
|
|
102
121
|
const heif_image* prototype,
|
|
103
122
|
heif_image_handle** out_unci_image_handle);
|
|
104
123
|
|
|
124
|
+
// Multi-component access functions (heif_image_get/add_component_*,
|
|
125
|
+
// heif_image_handle_get_component_*, heif_image_set_gimi_component_content_id)
|
|
126
|
+
// live in heif_components.h, which is included above.
|
|
127
|
+
|
|
128
|
+
|
|
105
129
|
#ifdef __cplusplus
|
|
106
130
|
}
|
|
107
131
|
#endif
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
#define LIBHEIF_HEIF_VERSION_H
|
|
29
29
|
|
|
30
30
|
/* Numeric representation of the version */
|
|
31
|
-
#define LIBHEIF_NUMERIC_VERSION ((1<<24) | (
|
|
31
|
+
#define LIBHEIF_NUMERIC_VERSION ((1<<24) | (23<<16) | (0<<8) | 0)
|
|
32
32
|
|
|
33
33
|
/* Version string */
|
|
34
|
-
#define LIBHEIF_VERSION "1.
|
|
34
|
+
#define LIBHEIF_VERSION "1.23.0"
|
|
35
35
|
|
|
36
36
|
#define LIBHEIF_PLUGIN_DIRECTORY "/src/build/target/lib/libheif"
|
|
37
37
|
|