@revizly/sharp-libvips-dev 1.0.33 → 1.0.34
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/fcfreetype.h +14 -0
- package/include/fontconfig/fcprivate.h +8 -1
- package/include/fontconfig/fontconfig.h +45 -17
- package/include/glib-2.0/gio/gdbusconnection.h +2 -8
- package/include/glib-2.0/gio/gio-visibility.h +34 -0
- package/include/glib-2.0/gio/gioenums.h +5 -4
- package/include/glib-2.0/girepository/gi-visibility.h +34 -0
- package/include/glib-2.0/glib/glib-visibility.h +34 -0
- package/include/glib-2.0/glib/gmacros.h +3 -3
- package/include/glib-2.0/glib/gmarkup.h +10 -0
- package/include/glib-2.0/glib/gmem.h +4 -4
- package/include/glib-2.0/glib/gmessages.h +6 -8
- package/include/glib-2.0/glib/gsequence.h +2 -2
- package/include/glib-2.0/glib/gstrfuncs.h +190 -0
- package/include/glib-2.0/glib/gutils.h +9 -0
- package/include/glib-2.0/glib/gversionmacros.h +9 -0
- package/include/glib-2.0/gmodule/gmodule-visibility.h +34 -0
- package/include/glib-2.0/gobject/gobject-visibility.h +34 -0
- package/include/glib-2.0/gobject/gsignal.h +5 -5
- package/include/glib-2.0/gobject/gtype.h +14 -14
- package/include/libde265/de265-version.h +2 -2
- package/include/libde265/de265.h +13 -1
- package/include/libheif/heif.h +2 -0
- package/include/libheif/heif_color.h +8 -8
- package/include/libheif/heif_components.h +264 -0
- package/include/libheif/heif_context.h +2 -1
- package/include/libheif/heif_cxx.h +10 -10
- package/include/libheif/heif_decoding.h +14 -7
- package/include/libheif/heif_encoding.h +15 -9
- package/include/libheif/heif_error.h +7 -2
- package/include/libheif/heif_image.h +81 -66
- package/include/libheif/heif_image_handle.h +2 -2
- package/include/libheif/heif_items.h +1 -1
- package/include/libheif/heif_omaf.h +104 -0
- package/include/libheif/heif_plugin.h +16 -9
- package/include/libheif/heif_properties.h +247 -12
- package/include/libheif/heif_security.h +16 -4
- package/include/libheif/heif_sequences.h +74 -2
- package/include/libheif/heif_tiling.h +2 -2
- package/include/libheif/heif_uncompressed.h +44 -332
- package/include/libheif/heif_version.h +2 -2
- package/package.json +2 -2
- package/versions.json +6 -6
- package/include/libheif/heif_uncompressed_types.h +0 -143
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* HEIF codec.
|
|
3
|
+
* Copyright (c) 2026 Dirk Farin <dirk.farin@gmail.com>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of libheif.
|
|
6
|
+
*
|
|
7
|
+
* libheif is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as
|
|
9
|
+
* published by the Free Software Foundation, either version 3 of
|
|
10
|
+
* the License, or (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* libheif is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with libheif. If not, see <http://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
#ifndef LIBHEIF_HEIF_COMPONENTS_H
|
|
22
|
+
#define LIBHEIF_HEIF_COMPONENTS_H
|
|
23
|
+
|
|
24
|
+
#include "libheif/heif_library.h"
|
|
25
|
+
#include "libheif/heif_image.h"
|
|
26
|
+
#include "libheif/heif_image_handle.h"
|
|
27
|
+
|
|
28
|
+
#ifdef __cplusplus
|
|
29
|
+
extern "C" {
|
|
30
|
+
#endif
|
|
31
|
+
|
|
32
|
+
/* @file heif_components.h
|
|
33
|
+
* @brief Multi-component image API.
|
|
34
|
+
*
|
|
35
|
+
* The component model (id-addressed pixel planes with per-component type,
|
|
36
|
+
* datatype and bit-depth) is codec-agnostic. It was introduced for ISO 23001-17
|
|
37
|
+
* (uncompressed) images but is also expected to be reused by other codecs that
|
|
38
|
+
* carry multiple typed components (e.g. JPEG-2000).
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
// --- pixel datatype support
|
|
43
|
+
//
|
|
44
|
+
// The numeric values are aligned with the ISO/IEC 23001-17 Table 2
|
|
45
|
+
// component_format byte (used by the uncC box of the uncompressed codec).
|
|
46
|
+
// This is an internal convenience and should not be relied upon.
|
|
47
|
+
|
|
48
|
+
typedef enum heif_component_datatype
|
|
49
|
+
{
|
|
50
|
+
heif_component_datatype_unsigned_integer = 0,
|
|
51
|
+
heif_component_datatype_floating_point = 1,
|
|
52
|
+
heif_component_datatype_complex_number = 2,
|
|
53
|
+
heif_component_datatype_signed_integer = 3,
|
|
54
|
+
heif_component_datatype_undefined = 0xFF
|
|
55
|
+
} heif_component_datatype;
|
|
56
|
+
|
|
57
|
+
typedef struct heif_complex32
|
|
58
|
+
{
|
|
59
|
+
float real, imaginary;
|
|
60
|
+
} heif_complex32;
|
|
61
|
+
|
|
62
|
+
typedef struct heif_complex64
|
|
63
|
+
{
|
|
64
|
+
double real, imaginary;
|
|
65
|
+
} heif_complex64;
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
// --- component types (ISO/IEC 23001-17 Table 1, used in the cmpd box)
|
|
69
|
+
|
|
70
|
+
typedef enum heif_cmpd_component_type
|
|
71
|
+
{
|
|
72
|
+
heif_cmpd_component_type_monochrome = 0,
|
|
73
|
+
heif_cmpd_component_type_Y = 1,
|
|
74
|
+
heif_cmpd_component_type_Cb = 2,
|
|
75
|
+
heif_cmpd_component_type_Cr = 3,
|
|
76
|
+
heif_cmpd_component_type_red = 4,
|
|
77
|
+
heif_cmpd_component_type_green = 5,
|
|
78
|
+
heif_cmpd_component_type_blue = 6,
|
|
79
|
+
heif_cmpd_component_type_alpha = 7,
|
|
80
|
+
heif_cmpd_component_type_depth = 8,
|
|
81
|
+
heif_cmpd_component_type_disparity = 9,
|
|
82
|
+
heif_cmpd_component_type_palette = 10,
|
|
83
|
+
heif_cmpd_component_type_filter_array = 11,
|
|
84
|
+
heif_cmpd_component_type_padded = 12,
|
|
85
|
+
heif_cmpd_component_type_cyan = 13,
|
|
86
|
+
heif_cmpd_component_type_magenta = 14,
|
|
87
|
+
heif_cmpd_component_type_yellow = 15,
|
|
88
|
+
heif_cmpd_component_type_key_black = 16
|
|
89
|
+
} heif_cmpd_component_type;
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
// --- index-based component access (operates on a decoded heif_image)
|
|
93
|
+
|
|
94
|
+
// Returns the number of components that have pixel data (planes) in this image.
|
|
95
|
+
LIBHEIF_API
|
|
96
|
+
uint32_t heif_image_get_number_of_used_components(const heif_image*);
|
|
97
|
+
|
|
98
|
+
// Fills `out_component_indices` with the valid component indices.
|
|
99
|
+
// The caller must allocate an array of at least heif_image_get_number_of_used_components() elements.
|
|
100
|
+
LIBHEIF_API
|
|
101
|
+
void heif_image_get_used_component_ids(const heif_image*, uint32_t* out_component_ids);
|
|
102
|
+
|
|
103
|
+
LIBHEIF_API
|
|
104
|
+
heif_channel heif_image_get_component_channel(const heif_image*, uint32_t component_idx);
|
|
105
|
+
|
|
106
|
+
LIBHEIF_API
|
|
107
|
+
uint32_t heif_image_get_component_width(const heif_image*, uint32_t component_idx);
|
|
108
|
+
|
|
109
|
+
LIBHEIF_API
|
|
110
|
+
uint32_t heif_image_get_component_height(const heif_image*, uint32_t component_idx);
|
|
111
|
+
|
|
112
|
+
LIBHEIF_API
|
|
113
|
+
int heif_image_get_component_bits_per_pixel(const heif_image*, uint32_t component_idx);
|
|
114
|
+
|
|
115
|
+
LIBHEIF_API
|
|
116
|
+
uint16_t heif_image_get_component_type(const heif_image*, uint32_t component_idx);
|
|
117
|
+
|
|
118
|
+
// Returns the datatype (unsigned/signed integer, floating point, or complex
|
|
119
|
+
// number) of the given component.
|
|
120
|
+
LIBHEIF_API
|
|
121
|
+
heif_component_datatype heif_image_get_component_datatype(const heif_image*, uint32_t component_idx);
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
// --- ID-based component access via heif_image_handle (before decoding)
|
|
125
|
+
//
|
|
126
|
+
// These let the caller introspect a multi-component image's components without
|
|
127
|
+
// decoding any tile. They return 0 / -1 / heif_component_datatype_undefined for
|
|
128
|
+
// images that do not expose a component model or for unknown component IDs.
|
|
129
|
+
//
|
|
130
|
+
// The component IDs returned here match the IDs that
|
|
131
|
+
// heif_image_get_used_component_ids() will report after the same image is
|
|
132
|
+
// decoded, so the same numerical id can be used to address a component on
|
|
133
|
+
// either side of the API.
|
|
134
|
+
|
|
135
|
+
LIBHEIF_API
|
|
136
|
+
uint32_t heif_image_handle_get_number_of_components(const heif_image_handle*);
|
|
137
|
+
|
|
138
|
+
// Fills `out_component_ids` with the valid component IDs.
|
|
139
|
+
// The caller must allocate an array of at least
|
|
140
|
+
// heif_image_handle_get_number_of_components() elements.
|
|
141
|
+
LIBHEIF_API
|
|
142
|
+
void heif_image_handle_get_used_component_ids(const heif_image_handle*, uint32_t* out_component_ids);
|
|
143
|
+
|
|
144
|
+
LIBHEIF_API
|
|
145
|
+
uint16_t heif_image_handle_get_component_type(const heif_image_handle*, uint32_t component_id);
|
|
146
|
+
|
|
147
|
+
LIBHEIF_API
|
|
148
|
+
int heif_image_handle_get_component_bits_per_pixel(const heif_image_handle*, uint32_t component_id);
|
|
149
|
+
|
|
150
|
+
LIBHEIF_API
|
|
151
|
+
heif_component_datatype heif_image_handle_get_component_datatype(const heif_image_handle*, uint32_t component_id);
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
// --- adding components to a heif_image (encoder path)
|
|
155
|
+
|
|
156
|
+
LIBHEIF_API
|
|
157
|
+
heif_error heif_image_add_component(heif_image* image,
|
|
158
|
+
int width, int height,
|
|
159
|
+
uint16_t component_type,
|
|
160
|
+
heif_component_datatype datatype,
|
|
161
|
+
int bit_depth,
|
|
162
|
+
uint32_t* out_component_idx);
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
// --- untyped uint8 component data getters: stride is in BYTES per row.
|
|
166
|
+
|
|
167
|
+
LIBHEIF_API
|
|
168
|
+
const uint8_t* heif_image_get_component_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
|
|
169
|
+
|
|
170
|
+
LIBHEIF_API
|
|
171
|
+
uint8_t* heif_image_get_component(heif_image*, uint32_t component_idx, size_t* out_stride);
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
// --- typed component data getters: `out_row_elements` is the number of T
|
|
175
|
+
// elements per row, not bytes. Index with `data[y * row_elements + x]` (no
|
|
176
|
+
// casts, no sizeof). libheif allocates rows with element-aligned padding, so
|
|
177
|
+
// this count is always exact for the named type T.
|
|
178
|
+
|
|
179
|
+
LIBHEIF_API
|
|
180
|
+
const uint16_t* heif_image_get_component_uint16_readonly(const heif_image*, uint32_t component_idx, size_t* out_row_elements);
|
|
181
|
+
|
|
182
|
+
LIBHEIF_API
|
|
183
|
+
uint16_t* heif_image_get_component_uint16(heif_image*, uint32_t component_idx, size_t* out_row_elements);
|
|
184
|
+
|
|
185
|
+
LIBHEIF_API
|
|
186
|
+
const uint32_t* heif_image_get_component_uint32_readonly(const heif_image*, uint32_t component_idx, size_t* out_row_elements);
|
|
187
|
+
|
|
188
|
+
LIBHEIF_API
|
|
189
|
+
uint32_t* heif_image_get_component_uint32(heif_image*, uint32_t component_idx, size_t* out_row_elements);
|
|
190
|
+
|
|
191
|
+
LIBHEIF_API
|
|
192
|
+
const uint64_t* heif_image_get_component_uint64_readonly(const heif_image*, uint32_t component_idx, size_t* out_row_elements);
|
|
193
|
+
|
|
194
|
+
LIBHEIF_API
|
|
195
|
+
uint64_t* heif_image_get_component_uint64(heif_image*, uint32_t component_idx, size_t* out_row_elements);
|
|
196
|
+
|
|
197
|
+
LIBHEIF_API
|
|
198
|
+
const int8_t* heif_image_get_component_int8_readonly(const heif_image*, uint32_t component_idx, size_t* out_row_elements);
|
|
199
|
+
|
|
200
|
+
LIBHEIF_API
|
|
201
|
+
int8_t* heif_image_get_component_int8(heif_image*, uint32_t component_idx, size_t* out_row_elements);
|
|
202
|
+
|
|
203
|
+
LIBHEIF_API
|
|
204
|
+
const int16_t* heif_image_get_component_int16_readonly(const heif_image*, uint32_t component_idx, size_t* out_row_elements);
|
|
205
|
+
|
|
206
|
+
LIBHEIF_API
|
|
207
|
+
int16_t* heif_image_get_component_int16(heif_image*, uint32_t component_idx, size_t* out_row_elements);
|
|
208
|
+
|
|
209
|
+
LIBHEIF_API
|
|
210
|
+
const int32_t* heif_image_get_component_int32_readonly(const heif_image*, uint32_t component_idx, size_t* out_row_elements);
|
|
211
|
+
|
|
212
|
+
LIBHEIF_API
|
|
213
|
+
int32_t* heif_image_get_component_int32(heif_image*, uint32_t component_idx, size_t* out_row_elements);
|
|
214
|
+
|
|
215
|
+
LIBHEIF_API
|
|
216
|
+
const int64_t* heif_image_get_component_int64_readonly(const heif_image*, uint32_t component_idx, size_t* out_row_elements);
|
|
217
|
+
|
|
218
|
+
LIBHEIF_API
|
|
219
|
+
int64_t* heif_image_get_component_int64(heif_image*, uint32_t component_idx, size_t* out_row_elements);
|
|
220
|
+
|
|
221
|
+
LIBHEIF_API
|
|
222
|
+
const float* heif_image_get_component_float32_readonly(const heif_image*, uint32_t component_idx, size_t* out_row_elements);
|
|
223
|
+
|
|
224
|
+
LIBHEIF_API
|
|
225
|
+
float* heif_image_get_component_float32(heif_image*, uint32_t component_idx, size_t* out_row_elements);
|
|
226
|
+
|
|
227
|
+
LIBHEIF_API
|
|
228
|
+
const double* heif_image_get_component_float64_readonly(const heif_image*, uint32_t component_idx, size_t* out_row_elements);
|
|
229
|
+
|
|
230
|
+
LIBHEIF_API
|
|
231
|
+
double* heif_image_get_component_float64(heif_image*, uint32_t component_idx, size_t* out_row_elements);
|
|
232
|
+
|
|
233
|
+
LIBHEIF_API
|
|
234
|
+
const heif_complex32* heif_image_get_component_complex32_readonly(const heif_image*, uint32_t component_idx, size_t* out_row_elements);
|
|
235
|
+
|
|
236
|
+
LIBHEIF_API
|
|
237
|
+
heif_complex32* heif_image_get_component_complex32(heif_image*, uint32_t component_idx, size_t* out_row_elements);
|
|
238
|
+
|
|
239
|
+
LIBHEIF_API
|
|
240
|
+
const heif_complex64* heif_image_get_component_complex64_readonly(const heif_image*, uint32_t component_idx, size_t* out_row_elements);
|
|
241
|
+
|
|
242
|
+
LIBHEIF_API
|
|
243
|
+
heif_complex64* heif_image_get_component_complex64(heif_image*, uint32_t component_idx, size_t* out_row_elements);
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
// --- GIMI component content IDs (set before encoding)
|
|
247
|
+
|
|
248
|
+
// Set a GIMI component content ID for the component with the given
|
|
249
|
+
// component_id (as minted by heif_image_add_component / returned via the
|
|
250
|
+
// component access API). Pass an empty string to clear a previously set id.
|
|
251
|
+
// Returns an error if no component with this id exists on the image.
|
|
252
|
+
// The collected ids are written into an ItemComponentContentIDProperty box
|
|
253
|
+
// during encoding.
|
|
254
|
+
LIBHEIF_API
|
|
255
|
+
heif_error heif_image_set_gimi_component_content_id(heif_image*,
|
|
256
|
+
uint32_t component_id,
|
|
257
|
+
const char* content_id);
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
#ifdef __cplusplus
|
|
261
|
+
}
|
|
262
|
+
#endif
|
|
263
|
+
|
|
264
|
+
#endif
|
|
@@ -302,7 +302,8 @@ void heif_context_debug_dump_boxes_to_file(heif_context* ctx, int fd);
|
|
|
302
302
|
// When enabled, the output file will use a single 'mini' box instead of the standard
|
|
303
303
|
// meta+mdat box structure, if the file content is compatible with the mini format.
|
|
304
304
|
// If the content cannot be represented as a mini box, the standard format is used as fallback.
|
|
305
|
-
//
|
|
305
|
+
// Note: the mini box format is defined by a draft amendment to ISO/IEC 23008-12
|
|
306
|
+
// and may have reduced interoperability with other readers.
|
|
306
307
|
// Default: disabled.
|
|
307
308
|
LIBHEIF_API
|
|
308
309
|
void heif_context_set_write_mini_format(heif_context*, int enable);
|
|
@@ -323,8 +323,8 @@ namespace heif {
|
|
|
323
323
|
|
|
324
324
|
// throws Error
|
|
325
325
|
void create(int width, int height,
|
|
326
|
-
|
|
327
|
-
|
|
326
|
+
heif_colorspace colorspace,
|
|
327
|
+
heif_chroma chroma);
|
|
328
328
|
|
|
329
329
|
// throws Error
|
|
330
330
|
void add_plane(enum heif_channel channel,
|
|
@@ -391,14 +391,14 @@ namespace heif {
|
|
|
391
391
|
{
|
|
392
392
|
public:
|
|
393
393
|
static std::vector<EncoderDescriptor>
|
|
394
|
-
get_encoder_descriptors(
|
|
394
|
+
get_encoder_descriptors(heif_compression_format format_filter,
|
|
395
395
|
const char* name_filter) noexcept;
|
|
396
396
|
|
|
397
397
|
std::string get_name() const noexcept;
|
|
398
398
|
|
|
399
399
|
std::string get_id_name() const noexcept;
|
|
400
400
|
|
|
401
|
-
|
|
401
|
+
heif_compression_format get_compression_format() const noexcept;
|
|
402
402
|
|
|
403
403
|
// DEPRECATED: typo in function name
|
|
404
404
|
bool supportes_lossy_compression() const noexcept;
|
|
@@ -453,7 +453,7 @@ namespace heif {
|
|
|
453
453
|
{
|
|
454
454
|
public:
|
|
455
455
|
// throws Error
|
|
456
|
-
Encoder(
|
|
456
|
+
Encoder(heif_compression_format format);
|
|
457
457
|
|
|
458
458
|
// throws Error
|
|
459
459
|
void set_lossy_quality(int quality);
|
|
@@ -859,8 +859,8 @@ namespace heif {
|
|
|
859
859
|
|
|
860
860
|
|
|
861
861
|
inline void Image::create(int width, int height,
|
|
862
|
-
|
|
863
|
-
|
|
862
|
+
heif_colorspace colorspace,
|
|
863
|
+
heif_chroma chroma)
|
|
864
864
|
{
|
|
865
865
|
heif_image* image;
|
|
866
866
|
Error err = Error(heif_image_create(width, height, colorspace, chroma, &image));
|
|
@@ -1023,7 +1023,7 @@ namespace heif {
|
|
|
1023
1023
|
|
|
1024
1024
|
|
|
1025
1025
|
inline std::vector<EncoderDescriptor>
|
|
1026
|
-
EncoderDescriptor::get_encoder_descriptors(
|
|
1026
|
+
EncoderDescriptor::get_encoder_descriptors(heif_compression_format format_filter,
|
|
1027
1027
|
const char* name_filter) noexcept
|
|
1028
1028
|
{
|
|
1029
1029
|
int maxDescriptors = 10;
|
|
@@ -1066,7 +1066,7 @@ namespace heif {
|
|
|
1066
1066
|
return heif_encoder_descriptor_get_id_name(m_descriptor);
|
|
1067
1067
|
}
|
|
1068
1068
|
|
|
1069
|
-
inline
|
|
1069
|
+
inline heif_compression_format EncoderDescriptor::get_compression_format() const noexcept
|
|
1070
1070
|
{
|
|
1071
1071
|
return heif_encoder_descriptor_get_compression_format(m_descriptor);
|
|
1072
1072
|
}
|
|
@@ -1103,7 +1103,7 @@ namespace heif {
|
|
|
1103
1103
|
}
|
|
1104
1104
|
|
|
1105
1105
|
|
|
1106
|
-
inline Encoder::Encoder(
|
|
1106
|
+
inline Encoder::Encoder(heif_compression_format format)
|
|
1107
1107
|
{
|
|
1108
1108
|
heif_encoder* encoder;
|
|
1109
1109
|
Error err = Error(heif_context_get_encoder_for_format(nullptr, format, &encoder));
|
|
@@ -50,7 +50,7 @@ int heif_context_get_max_decoding_threads(const heif_context* ctx);
|
|
|
50
50
|
// Note that the decoder still may not be able to decode all variants of that format.
|
|
51
51
|
// You will have to query that further (todo) or just try to decode and check the returned error.
|
|
52
52
|
LIBHEIF_API
|
|
53
|
-
int heif_have_decoder_for_format(
|
|
53
|
+
int heif_have_decoder_for_format(heif_compression_format format);
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
typedef enum heif_progress_step
|
|
@@ -71,11 +71,11 @@ typedef struct heif_decoding_options
|
|
|
71
71
|
uint8_t ignore_transformations;
|
|
72
72
|
|
|
73
73
|
// Any of the progress functions may be called from background threads.
|
|
74
|
-
void (* start_progress)(
|
|
74
|
+
void (* start_progress)(heif_progress_step step, int max_progress, void* progress_user_data);
|
|
75
75
|
|
|
76
|
-
void (* on_progress)(
|
|
76
|
+
void (* on_progress)(heif_progress_step step, int progress, void* progress_user_data);
|
|
77
77
|
|
|
78
|
-
void (* end_progress)(
|
|
78
|
+
void (* end_progress)(heif_progress_step step, void* progress_user_data);
|
|
79
79
|
|
|
80
80
|
void* progress_user_data;
|
|
81
81
|
|
|
@@ -118,6 +118,13 @@ typedef struct heif_decoding_options
|
|
|
118
118
|
|
|
119
119
|
int num_library_threads; // 0 = let libheif decide (TODO, currently ignored)
|
|
120
120
|
int num_codec_threads; // 0 = use decoder default
|
|
121
|
+
|
|
122
|
+
// version 9 options
|
|
123
|
+
|
|
124
|
+
// If enabled, libheif will attempt to work around known broken-input quirks
|
|
125
|
+
// (e.g. Sony HIF files where the NCLX `colr` box disagrees with the HEVC VUI
|
|
126
|
+
// on the YCbCr range flag). Default: false (strict spec-conformant behavior).
|
|
127
|
+
uint8_t autocorrect_broken_input;
|
|
121
128
|
} heif_decoding_options;
|
|
122
129
|
|
|
123
130
|
|
|
@@ -143,7 +150,7 @@ typedef struct heif_decoder_descriptor heif_decoder_descriptor;
|
|
|
143
150
|
// The number of decoders is returned, which are not more than 'count' if (out_decoders != nullptr).
|
|
144
151
|
// By setting out_decoders==nullptr, you can query the number of decoders, 'count' is ignored.
|
|
145
152
|
LIBHEIF_API
|
|
146
|
-
int heif_get_decoder_descriptors(
|
|
153
|
+
int heif_get_decoder_descriptors(heif_compression_format format_filter,
|
|
147
154
|
const heif_decoder_descriptor** out_decoders,
|
|
148
155
|
int count);
|
|
149
156
|
|
|
@@ -168,8 +175,8 @@ const char* heif_decoder_descriptor_get_id_name(const heif_decoder_descriptor*);
|
|
|
168
175
|
LIBHEIF_API
|
|
169
176
|
heif_error heif_decode_image(const heif_image_handle* in_handle,
|
|
170
177
|
heif_image** out_img,
|
|
171
|
-
|
|
172
|
-
|
|
178
|
+
heif_colorspace colorspace,
|
|
179
|
+
heif_chroma chroma,
|
|
173
180
|
const heif_decoding_options* options);
|
|
174
181
|
|
|
175
182
|
#ifdef __cplusplus
|
|
@@ -33,7 +33,11 @@ extern "C" {
|
|
|
33
33
|
#include <libheif/heif_context.h>
|
|
34
34
|
#include <libheif/heif_brands.h>
|
|
35
35
|
#include <libheif/heif_color.h>
|
|
36
|
-
|
|
36
|
+
|
|
37
|
+
// Forward declaration. The full definition lives in heif_uncompressed.h.
|
|
38
|
+
// heif_encoding_options only stores a pointer, so a forward typedef is enough here
|
|
39
|
+
// and avoids a circular include (heif_uncompressed.h pulls in heif.h, which pulls in this header).
|
|
40
|
+
typedef struct heif_unci_image_parameters heif_unci_image_parameters;
|
|
37
41
|
|
|
38
42
|
|
|
39
43
|
// ----- encoder -----
|
|
@@ -56,7 +60,7 @@ typedef struct heif_encoder_parameter heif_encoder_parameter;
|
|
|
56
60
|
// Note that the encoder may be limited to a certain subset of features (e.g. only 8 bit, only lossy).
|
|
57
61
|
// You will have to query the specific capabilities further.
|
|
58
62
|
LIBHEIF_API
|
|
59
|
-
int heif_have_encoder_for_format(
|
|
63
|
+
int heif_have_encoder_for_format(heif_compression_format format);
|
|
60
64
|
|
|
61
65
|
// Get a list of available encoders. You can filter the encoders by compression format and name.
|
|
62
66
|
// Use format_filter==heif_compression_undefined and name_filter==NULL as wildcards.
|
|
@@ -65,7 +69,7 @@ int heif_have_encoder_for_format(enum heif_compression_format format);
|
|
|
65
69
|
// By setting out_encoders==nullptr, you can query the number of encoders, 'count' is ignored.
|
|
66
70
|
// Note: to get the actual encoder from the descriptors returned here, use heif_context_get_encoder().
|
|
67
71
|
LIBHEIF_API
|
|
68
|
-
int heif_get_encoder_descriptors(
|
|
72
|
+
int heif_get_encoder_descriptors(heif_compression_format format_filter,
|
|
69
73
|
const char* name_filter,
|
|
70
74
|
const heif_encoder_descriptor** out_encoders,
|
|
71
75
|
int count);
|
|
@@ -80,7 +84,7 @@ LIBHEIF_API
|
|
|
80
84
|
const char* heif_encoder_descriptor_get_id_name(const heif_encoder_descriptor*);
|
|
81
85
|
|
|
82
86
|
LIBHEIF_API
|
|
83
|
-
|
|
87
|
+
heif_compression_format
|
|
84
88
|
heif_encoder_descriptor_get_compression_format(const heif_encoder_descriptor*);
|
|
85
89
|
|
|
86
90
|
LIBHEIF_API
|
|
@@ -100,7 +104,7 @@ heif_error heif_context_get_encoder(heif_context* context,
|
|
|
100
104
|
// for this format, the encoder with the highest plugin priority will be returned.
|
|
101
105
|
LIBHEIF_API
|
|
102
106
|
heif_error heif_context_get_encoder_for_format(heif_context* context,
|
|
103
|
-
|
|
107
|
+
heif_compression_format format,
|
|
104
108
|
heif_encoder**);
|
|
105
109
|
|
|
106
110
|
/**
|
|
@@ -315,9 +319,11 @@ typedef struct heif_encoding_options
|
|
|
315
319
|
|
|
316
320
|
// version 8 options
|
|
317
321
|
|
|
318
|
-
//
|
|
319
|
-
//
|
|
320
|
-
|
|
322
|
+
// Optional 'unci'-specific encoding parameters (compression method, and future fields
|
|
323
|
+
// such as interleave type and padding).
|
|
324
|
+
//
|
|
325
|
+
// Default: nullptr
|
|
326
|
+
const heif_unci_image_parameters* unci_parameters;
|
|
321
327
|
|
|
322
328
|
// TODO: we should add a flag to force MIAF compatible outputs. E.g. this will put restrictions on grid tile sizes and
|
|
323
329
|
// might add a clap box when the grid output size does not match the color subsampling factors.
|
|
@@ -407,7 +413,7 @@ int heif_encoder_descriptor_supportes_lossless_compression(const heif_encoder_de
|
|
|
407
413
|
// Note: to get the actual encoder from the descriptors returned here, use heif_context_get_encoder().
|
|
408
414
|
LIBHEIF_API
|
|
409
415
|
int heif_context_get_encoder_descriptors(heif_context*, // TODO: why do we need this parameter?
|
|
410
|
-
|
|
416
|
+
heif_compression_format format_filter,
|
|
411
417
|
const char* name_filter,
|
|
412
418
|
const heif_encoder_descriptor** out_encoders,
|
|
413
419
|
int count);
|
|
@@ -191,6 +191,11 @@ typedef enum heif_suberror_code
|
|
|
191
191
|
|
|
192
192
|
heif_suberror_No_moov_box = 151,
|
|
193
193
|
|
|
194
|
+
// The colr (NCLX) box and the codec bitstream VUI/color signalling disagree.
|
|
195
|
+
// Per ISO/IEC 14496-12 and ISO/IEC 23000-22 (MIAF) the colr box takes precedence,
|
|
196
|
+
// but the conflict is reported as a warning.
|
|
197
|
+
heif_suberror_NCLX_colr_VUI_mismatch = 152,
|
|
198
|
+
|
|
194
199
|
// --- Memory_allocation_error ---
|
|
195
200
|
|
|
196
201
|
// A security limit preventing unreasonable memory allocations was exceeded by the input file.
|
|
@@ -284,10 +289,10 @@ typedef enum heif_suberror_code
|
|
|
284
289
|
typedef struct heif_error
|
|
285
290
|
{
|
|
286
291
|
// main error category
|
|
287
|
-
|
|
292
|
+
heif_error_code code;
|
|
288
293
|
|
|
289
294
|
// more detailed error code
|
|
290
|
-
|
|
295
|
+
heif_suberror_code subcode;
|
|
291
296
|
|
|
292
297
|
// textual error message (is always defined, you do not have to check for NULL)
|
|
293
298
|
const char* message;
|