@img/sharp-libvips-dev-wasm32 1.3.0-rc.7 → 1.3.0-rc.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/include/aom/aom_codec.h +1 -1
- package/include/aom/aom_decoder.h +4 -0
- package/include/aom/aom_encoder.h +19 -8
- package/include/aom/aom_ext_ratectrl.h +664 -0
- package/include/aom/aom_image.h +93 -30
- package/include/aom/aom_tpl.h +99 -0
- package/include/aom/aomcx.h +89 -16
- package/include/aom/aomdx.h +12 -0
- package/include/expat.h +1 -1
- package/include/expat_config.h +3 -3
- package/include/glib-2.0/gio/gdbusconnection.h +2 -8
- package/include/glib-2.0/gio/gio-visibility.h +34 -0
- package/include/glib-2.0/gio/gioenums.h +5 -4
- package/include/glib-2.0/glib/glib-visibility.h +34 -0
- package/include/glib-2.0/glib/gmacros.h +3 -3
- package/include/glib-2.0/glib/gmarkup.h +10 -0
- package/include/glib-2.0/glib/gmem.h +4 -4
- package/include/glib-2.0/glib/gmessages.h +6 -8
- package/include/glib-2.0/glib/gsequence.h +2 -2
- package/include/glib-2.0/glib/gstrfuncs.h +190 -0
- package/include/glib-2.0/glib/gutils.h +9 -0
- package/include/glib-2.0/glib/gversionmacros.h +9 -0
- package/include/glib-2.0/gmodule/gmodule-visibility.h +34 -0
- package/include/glib-2.0/gobject/gobject-visibility.h +34 -0
- package/include/glib-2.0/gobject/gsignal.h +5 -5
- package/include/glib-2.0/gobject/gtype.h +14 -14
- package/include/libheif/heif.h +2 -0
- package/include/libheif/heif_color.h +127 -11
- package/include/libheif/heif_components.h +264 -0
- package/include/libheif/heif_context.h +2 -1
- package/include/libheif/heif_cxx.h +10 -10
- package/include/libheif/heif_decoding.h +51 -7
- package/include/libheif/heif_encoding.h +15 -9
- package/include/libheif/heif_error.h +9 -2
- package/include/libheif/heif_export.h +48 -0
- package/include/libheif/heif_image.h +81 -66
- package/include/libheif/heif_image_handle.h +2 -2
- package/include/libheif/heif_items.h +1 -1
- package/include/libheif/heif_library.h +8 -16
- package/include/libheif/heif_omaf.h +104 -0
- package/include/libheif/heif_plugin.h +16 -9
- package/include/libheif/heif_properties.h +250 -12
- package/include/libheif/heif_security.h +16 -4
- package/include/libheif/heif_sequences.h +74 -2
- package/include/libheif/heif_tiling.h +2 -2
- package/include/libheif/heif_uncompressed.h +44 -332
- package/include/libheif/heif_version.h +2 -2
- package/include/vips/version.h +4 -4
- package/lib/glib-2.0/include/glibconfig.h +2 -4
- package/lib/libaom.a +0 -0
- package/lib/libcgif.a +0 -0
- package/lib/libexif.a +0 -0
- package/lib/libexpat.a +0 -0
- package/lib/libexpat.la +1 -1
- package/lib/libffi.a +0 -0
- package/lib/libgio-2.0.a +0 -0
- package/lib/libglib-2.0.a +0 -0
- package/lib/libgmodule-2.0.a +0 -0
- package/lib/libgobject-2.0.a +0 -0
- package/lib/libgthread-2.0.a +0 -0
- package/lib/libheif.a +0 -0
- package/lib/libhwy.a +0 -0
- package/lib/libimagequant.a +0 -0
- package/lib/libjpeg.a +0 -0
- package/lib/liblcms2.a +0 -0
- package/lib/libpng.a +0 -0
- package/lib/libpng16.a +0 -0
- package/lib/libresvg.a +0 -0
- package/lib/libsharpyuv.a +0 -0
- package/lib/libtiff.a +0 -0
- package/lib/libuhdr.a +0 -0
- package/lib/libvips-cpp.a +0 -0
- package/lib/libvips.a +0 -0
- package/lib/libwebp.a +0 -0
- package/lib/libwebpdecoder.a +0 -0
- package/lib/libwebpdemux.a +0 -0
- package/lib/libwebpmux.a +0 -0
- package/lib/libz.a +0 -0
- package/lib/pkgconfig/aom.pc +2 -2
- package/lib/pkgconfig/expat.pc +1 -1
- package/lib/pkgconfig/gio-2.0.pc +1 -1
- package/lib/pkgconfig/glib-2.0.pc +1 -1
- package/lib/pkgconfig/gmodule-2.0.pc +1 -1
- package/lib/pkgconfig/gmodule-export-2.0.pc +1 -1
- package/lib/pkgconfig/gmodule-no-export-2.0.pc +1 -1
- package/lib/pkgconfig/gobject-2.0.pc +1 -1
- package/lib/pkgconfig/gthread-2.0.pc +1 -1
- package/lib/pkgconfig/libheif.pc +2 -2
- package/lib/pkgconfig/vips-cpp.pc +1 -1
- package/lib/pkgconfig/vips.pc +1 -1
- package/package.json +1 -1
- package/versions.json +8 -8
- package/include/libheif/heif_uncompressed_types.h +0 -143
|
@@ -55,8 +55,8 @@ typedef struct heif_color_conversion_options
|
|
|
55
55
|
|
|
56
56
|
// --- version 1 options
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
heif_chroma_downsampling_algorithm preferred_chroma_downsampling_algorithm;
|
|
59
|
+
heif_chroma_upsampling_algorithm preferred_chroma_upsampling_algorithm;
|
|
60
60
|
|
|
61
61
|
// When set to 'false' libheif may also use a different algorithm if the preferred one is not available
|
|
62
62
|
// or using a different algorithm is computationally less complex. Note that currently (v1.17.0) this
|
|
@@ -85,7 +85,7 @@ typedef struct heif_color_conversion_options_ext
|
|
|
85
85
|
|
|
86
86
|
// --- version 1 options
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
heif_alpha_composition_mode alpha_composition_mode;
|
|
89
89
|
|
|
90
90
|
// color values should be specified in the range [0, 65535]
|
|
91
91
|
uint16_t background_red, background_green, background_blue;
|
|
@@ -126,7 +126,7 @@ typedef enum heif_color_profile_type
|
|
|
126
126
|
// However, you can still use heif_image_handle_get_raw_color_profile() and
|
|
127
127
|
// heif_image_handle_get_nclx_color_profile() to access both profiles.
|
|
128
128
|
LIBHEIF_API
|
|
129
|
-
|
|
129
|
+
heif_color_profile_type heif_image_handle_get_color_profile_type(const heif_image_handle* handle);
|
|
130
130
|
|
|
131
131
|
LIBHEIF_API
|
|
132
132
|
size_t heif_image_handle_get_raw_color_profile_size(const heif_image_handle* handle);
|
|
@@ -198,9 +198,9 @@ typedef struct heif_color_profile_nclx
|
|
|
198
198
|
|
|
199
199
|
uint8_t version;
|
|
200
200
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
201
|
+
heif_color_primaries color_primaries;
|
|
202
|
+
heif_transfer_characteristics transfer_characteristics;
|
|
203
|
+
heif_matrix_coefficients matrix_coefficients;
|
|
204
204
|
uint8_t full_range_flag;
|
|
205
205
|
|
|
206
206
|
// --- decoded values (not used when saving nclx)
|
|
@@ -240,7 +240,7 @@ void heif_nclx_color_profile_free(heif_color_profile_nclx* nclx_profile);
|
|
|
240
240
|
// This function will now return ICC if one is present and NCLX only if there is no ICC.
|
|
241
241
|
// You may better avoid this function and simply query for NCLX and ICC directly.
|
|
242
242
|
LIBHEIF_API
|
|
243
|
-
|
|
243
|
+
heif_color_profile_type heif_image_get_color_profile_type(const heif_image* image);
|
|
244
244
|
|
|
245
245
|
// Returns the size of the ICC profile if one is assigned to the image. Otherwise, it returns 0.
|
|
246
246
|
LIBHEIF_API
|
|
@@ -276,17 +276,34 @@ heif_error heif_image_set_nclx_color_profile(heif_image* image,
|
|
|
276
276
|
|
|
277
277
|
// --- content light level ---
|
|
278
278
|
|
|
279
|
-
//
|
|
280
|
-
//
|
|
279
|
+
// Semantics follow the H.265 'Content light level information' SEI message
|
|
280
|
+
// (ITU-T H.265 Annex D.3.35). Identifies upper bounds for the nominal
|
|
281
|
+
// target brightness light level of the pictures. The bounds are defined
|
|
282
|
+
// against samples in a 4:4:4 RGB representation in the linear light domain,
|
|
283
|
+
// in units of candelas per square metre (cd/m^2 = nits). A field value
|
|
284
|
+
// of 0 means "no upper bound indicated" (i.e. undefined).
|
|
281
285
|
typedef struct heif_content_light_level
|
|
282
286
|
{
|
|
287
|
+
// Upper bound on the maximum light level among all individual linear-light
|
|
288
|
+
// 4:4:4 RGB samples across the sequence, in cd/m^2 (= field).
|
|
289
|
+
// Also called MaxCLL.
|
|
283
290
|
uint16_t max_content_light_level;
|
|
291
|
+
|
|
292
|
+
// Upper bound on the maximum per-picture average light level among the
|
|
293
|
+
// linear-light 4:4:4 RGB samples (averaged over any individual picture),
|
|
294
|
+
// in cd/m^2 (= field). Also called MaxFALL (or MaxPALL).
|
|
295
|
+
// For letterboxed content the average is expected to be taken only over
|
|
296
|
+
// the visually relevant region (H.265 D.3.35 NOTE 3).
|
|
284
297
|
uint16_t max_pic_average_light_level;
|
|
285
298
|
} heif_content_light_level;
|
|
286
299
|
|
|
287
300
|
LIBHEIF_API
|
|
288
301
|
int heif_image_has_content_light_level(const heif_image*);
|
|
289
302
|
|
|
303
|
+
LIBHEIF_API
|
|
304
|
+
int heif_image_handle_has_content_light_level(const heif_image_handle*);
|
|
305
|
+
|
|
306
|
+
// TODO: this function should also return 'int' to be consistent to heif_image_handle_get_content_light_level.
|
|
290
307
|
LIBHEIF_API
|
|
291
308
|
void heif_image_get_content_light_level(const heif_image*, heif_content_light_level* out);
|
|
292
309
|
|
|
@@ -303,13 +320,43 @@ void heif_image_handle_set_content_light_level(const heif_image_handle*, const h
|
|
|
303
320
|
|
|
304
321
|
// --- mastering display colour volume ---
|
|
305
322
|
|
|
306
|
-
//
|
|
323
|
+
// Semantics follow the H.265 'Mastering display colour volume' SEI message
|
|
324
|
+
// (ITU-T H.265 Annex D.3.28) and SMPTE ST 2086. Identifies the colour
|
|
325
|
+
// volume (primaries, white point, luminance range) of the mastering display
|
|
326
|
+
// for the associated content. CIE 1931 chromaticity coordinates are defined
|
|
327
|
+
// by ISO 11664-1 (see also ISO 11664-3 and CIE 15).
|
|
328
|
+
//
|
|
329
|
+
// For RGB mastering displays, H.265 suggests the index order
|
|
330
|
+
// [0]=green, [1]=blue, [2]=red
|
|
331
|
+
// (see H.265 Annex E, Table E.3).
|
|
307
332
|
typedef struct heif_mastering_display_colour_volume
|
|
308
333
|
{
|
|
334
|
+
// CIE 1931 chromaticity coordinates of the three colour primaries, in
|
|
335
|
+
// normalized increments of 0.00002 (CIE value = field / 50000).
|
|
336
|
+
// Valid ranges per H.265: x in 5..37000, y in 5..42000 inclusive; values
|
|
337
|
+
// outside indicate "unknown / unspecified".
|
|
338
|
+
// Note: SMPTE ST 2086 uses four-decimal-place coordinates, i.e. multiples
|
|
339
|
+
// of 5 in this encoding.
|
|
309
340
|
uint16_t display_primaries_x[3];
|
|
310
341
|
uint16_t display_primaries_y[3];
|
|
342
|
+
|
|
343
|
+
// CIE 1931 chromaticity coordinates of the mastering display's white
|
|
344
|
+
// point, in normalized increments of 0.00002. Valid ranges as for the
|
|
345
|
+
// primaries (x in 5..37000, y in 5..42000).
|
|
346
|
+
// Note: ANSI/CTA 861-G uses (0,0) to indicate that the white point
|
|
347
|
+
// chromaticity is unknown.
|
|
311
348
|
uint16_t white_point_x;
|
|
312
349
|
uint16_t white_point_y;
|
|
350
|
+
|
|
351
|
+
// Nominal maximum / minimum display luminance of the mastering display,
|
|
352
|
+
// in units of 0.0001 candelas per square metre (cd/m^2 = field / 10000).
|
|
353
|
+
// Valid ranges per H.265:
|
|
354
|
+
// max in 50000..100000000 (5..10000 cd/m^2)
|
|
355
|
+
// min in 1..50000 (0.0001..5 cd/m^2)
|
|
356
|
+
// When max == 50000, min shall not equal 50000.
|
|
357
|
+
// Note: ANSI/CTA 861-G uses 0 to indicate "unknown".
|
|
358
|
+
// Note: SMPTE ST 2086 (2018) specifies max as a multiple of 1 cd/m^2, i.e.
|
|
359
|
+
// a multiple of 10000 in this encoding.
|
|
313
360
|
uint32_t max_display_mastering_luminance;
|
|
314
361
|
uint32_t min_display_mastering_luminance;
|
|
315
362
|
} heif_mastering_display_colour_volume;
|
|
@@ -325,9 +372,24 @@ typedef struct heif_decoded_mastering_display_colour_volume
|
|
|
325
372
|
double min_display_mastering_luminance;
|
|
326
373
|
} heif_decoded_mastering_display_colour_volume;
|
|
327
374
|
|
|
375
|
+
// Semantics follow the H.265 'Ambient viewing environment' SEI message
|
|
376
|
+
// (ITU-T H.265 Annex D.3.39). Identifies the nominal ambient viewing
|
|
377
|
+
// environment intended for display of the associated content.
|
|
328
378
|
typedef struct heif_ambient_viewing_environment
|
|
329
379
|
{
|
|
380
|
+
// Environmental illuminance of the ambient viewing environment, in units
|
|
381
|
+
// of 0.0001 lux (i.e. lux = value / 10000). In H.265 this field is called
|
|
382
|
+
// 'ambient_illuminance' and is required to be non-zero; 0 is treated here
|
|
383
|
+
// as "undefined".
|
|
330
384
|
uint32_t ambient_illumination;
|
|
385
|
+
|
|
386
|
+
// Normalized CIE 1931 chromaticity coordinates of the environmental
|
|
387
|
+
// ambient light, in units of 0.00002 (i.e. CIE x = value / 50000).
|
|
388
|
+
// Valid range per H.265 is 0..50000 inclusive. CIE 1931 x/y are defined
|
|
389
|
+
// by ISO 11664-1 (see also ISO 11664-3 and CIE 15).
|
|
390
|
+
//
|
|
391
|
+
// Example (Rec. ITU-R BT.2035, D65 background): ambient_illumination=100000,
|
|
392
|
+
// ambient_light_x=15635, ambient_light_y=16450.
|
|
331
393
|
uint16_t ambient_light_x;
|
|
332
394
|
uint16_t ambient_light_y;
|
|
333
395
|
} heif_ambient_viewing_environment;
|
|
@@ -335,6 +397,9 @@ typedef struct heif_ambient_viewing_environment
|
|
|
335
397
|
LIBHEIF_API
|
|
336
398
|
int heif_image_has_mastering_display_colour_volume(const heif_image*);
|
|
337
399
|
|
|
400
|
+
LIBHEIF_API
|
|
401
|
+
int heif_image_handle_has_mastering_display_colour_volume(const heif_image_handle*);
|
|
402
|
+
|
|
338
403
|
LIBHEIF_API
|
|
339
404
|
void heif_image_get_mastering_display_colour_volume(const heif_image*, heif_mastering_display_colour_volume* out);
|
|
340
405
|
|
|
@@ -349,6 +414,57 @@ LIBHEIF_API
|
|
|
349
414
|
void heif_image_handle_set_mastering_display_colour_volume(const heif_image_handle*, const heif_mastering_display_colour_volume* in);
|
|
350
415
|
|
|
351
416
|
|
|
417
|
+
// --- ambient viewing environment ---
|
|
418
|
+
|
|
419
|
+
LIBHEIF_API
|
|
420
|
+
int heif_image_has_ambient_viewing_environment(const heif_image*);
|
|
421
|
+
|
|
422
|
+
LIBHEIF_API
|
|
423
|
+
int heif_image_handle_has_ambient_viewing_environment(const heif_image_handle*);
|
|
424
|
+
|
|
425
|
+
// Returns whether the image has 'ambient viewing environment' information. If 0 is returned, the output is not filled.
|
|
426
|
+
LIBHEIF_API
|
|
427
|
+
int heif_image_get_ambient_viewing_environment(const heif_image*, heif_ambient_viewing_environment* out);
|
|
428
|
+
|
|
429
|
+
// Returns whether the image has 'ambient viewing environment' information. If 0 is returned, the output is not filled.
|
|
430
|
+
LIBHEIF_API
|
|
431
|
+
int heif_image_handle_get_ambient_viewing_environment(const heif_image_handle*, heif_ambient_viewing_environment* out);
|
|
432
|
+
|
|
433
|
+
LIBHEIF_API
|
|
434
|
+
void heif_image_set_ambient_viewing_environment(const heif_image*, const heif_ambient_viewing_environment* in);
|
|
435
|
+
|
|
436
|
+
LIBHEIF_API
|
|
437
|
+
void heif_image_handle_set_ambient_viewing_environment(const heif_image_handle*, const heif_ambient_viewing_environment* in);
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
// --- nominal diffuse white ---
|
|
441
|
+
|
|
442
|
+
// Nominal diffuse white luminance (ISO/IEC 23008-12 'ndwt' box). The luminance
|
|
443
|
+
// is given in units of 0.0001 candelas per square metre. A value of 0 is valid
|
|
444
|
+
// and selects the default definition of ISO/TS 22028-5.
|
|
445
|
+
|
|
446
|
+
// If the image has no 'nominal diffuse white' information, the getter returns 0,
|
|
447
|
+
// which is indistinguishable from a stored luminance of 0. Use the has_ function
|
|
448
|
+
// to disambiguate.
|
|
449
|
+
LIBHEIF_API
|
|
450
|
+
int heif_image_has_nominal_diffuse_white_luminance(const heif_image*);
|
|
451
|
+
|
|
452
|
+
LIBHEIF_API
|
|
453
|
+
uint32_t heif_image_get_nominal_diffuse_white_luminance(const heif_image*);
|
|
454
|
+
|
|
455
|
+
LIBHEIF_API
|
|
456
|
+
void heif_image_set_nominal_diffuse_white_luminance(const heif_image*, uint32_t luminance);
|
|
457
|
+
|
|
458
|
+
LIBHEIF_API
|
|
459
|
+
int heif_image_handle_has_nominal_diffuse_white_luminance(const heif_image_handle*);
|
|
460
|
+
|
|
461
|
+
LIBHEIF_API
|
|
462
|
+
uint32_t heif_image_handle_get_nominal_diffuse_white_luminance(const heif_image_handle*);
|
|
463
|
+
|
|
464
|
+
LIBHEIF_API
|
|
465
|
+
void heif_image_handle_set_nominal_diffuse_white_luminance(const heif_image_handle*, uint32_t luminance);
|
|
466
|
+
|
|
467
|
+
|
|
352
468
|
// Converts the internal numeric representation of heif_mastering_display_colour_volume to the
|
|
353
469
|
// normalized values, collected in heif_decoded_mastering_display_colour_volume.
|
|
354
470
|
// Values that are out-of-range are decoded to 0, indicating an undefined value (as specified in ISO/IEC 23008-2).
|
|
@@ -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
|
+
// --- ID-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_ids` with the valid component IDs.
|
|
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_id);
|
|
105
|
+
|
|
106
|
+
LIBHEIF_API
|
|
107
|
+
uint32_t heif_image_get_component_width(const heif_image*, uint32_t component_id);
|
|
108
|
+
|
|
109
|
+
LIBHEIF_API
|
|
110
|
+
uint32_t heif_image_get_component_height(const heif_image*, uint32_t component_id);
|
|
111
|
+
|
|
112
|
+
LIBHEIF_API
|
|
113
|
+
int heif_image_get_component_bits_per_pixel(const heif_image*, uint32_t component_id);
|
|
114
|
+
|
|
115
|
+
LIBHEIF_API
|
|
116
|
+
uint16_t heif_image_get_component_type(const heif_image*, uint32_t component_id);
|
|
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_id);
|
|
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_id);
|
|
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_id, size_t* out_stride);
|
|
169
|
+
|
|
170
|
+
LIBHEIF_API
|
|
171
|
+
uint8_t* heif_image_get_component(heif_image*, uint32_t component_id, 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_id, size_t* out_row_elements);
|
|
181
|
+
|
|
182
|
+
LIBHEIF_API
|
|
183
|
+
uint16_t* heif_image_get_component_uint16(heif_image*, uint32_t component_id, 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_id, size_t* out_row_elements);
|
|
187
|
+
|
|
188
|
+
LIBHEIF_API
|
|
189
|
+
uint32_t* heif_image_get_component_uint32(heif_image*, uint32_t component_id, 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_id, size_t* out_row_elements);
|
|
193
|
+
|
|
194
|
+
LIBHEIF_API
|
|
195
|
+
uint64_t* heif_image_get_component_uint64(heif_image*, uint32_t component_id, 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_id, size_t* out_row_elements);
|
|
199
|
+
|
|
200
|
+
LIBHEIF_API
|
|
201
|
+
int8_t* heif_image_get_component_int8(heif_image*, uint32_t component_id, 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_id, size_t* out_row_elements);
|
|
205
|
+
|
|
206
|
+
LIBHEIF_API
|
|
207
|
+
int16_t* heif_image_get_component_int16(heif_image*, uint32_t component_id, 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_id, size_t* out_row_elements);
|
|
211
|
+
|
|
212
|
+
LIBHEIF_API
|
|
213
|
+
int32_t* heif_image_get_component_int32(heif_image*, uint32_t component_id, 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_id, size_t* out_row_elements);
|
|
217
|
+
|
|
218
|
+
LIBHEIF_API
|
|
219
|
+
int64_t* heif_image_get_component_int64(heif_image*, uint32_t component_id, size_t* out_row_elements);
|
|
220
|
+
|
|
221
|
+
LIBHEIF_API
|
|
222
|
+
const float* heif_image_get_component_float32_readonly(const heif_image*, uint32_t component_id, size_t* out_row_elements);
|
|
223
|
+
|
|
224
|
+
LIBHEIF_API
|
|
225
|
+
float* heif_image_get_component_float32(heif_image*, uint32_t component_id, size_t* out_row_elements);
|
|
226
|
+
|
|
227
|
+
LIBHEIF_API
|
|
228
|
+
const double* heif_image_get_component_float64_readonly(const heif_image*, uint32_t component_id, size_t* out_row_elements);
|
|
229
|
+
|
|
230
|
+
LIBHEIF_API
|
|
231
|
+
double* heif_image_get_component_float64(heif_image*, uint32_t component_id, 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_id, size_t* out_row_elements);
|
|
235
|
+
|
|
236
|
+
LIBHEIF_API
|
|
237
|
+
heif_complex32* heif_image_get_component_complex32(heif_image*, uint32_t component_id, 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_id, size_t* out_row_elements);
|
|
241
|
+
|
|
242
|
+
LIBHEIF_API
|
|
243
|
+
heif_complex64* heif_image_get_component_complex64(heif_image*, uint32_t component_id, 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));
|
|
@@ -39,11 +39,18 @@ extern "C" {
|
|
|
39
39
|
LIBHEIF_API
|
|
40
40
|
void heif_context_set_max_decoding_threads(heif_context* ctx, int max_threads);
|
|
41
41
|
|
|
42
|
+
// Returns the current maximum number of background threads used for parallel tile decoding.
|
|
43
|
+
// This reflects either the library default or the value last passed to
|
|
44
|
+
// heif_context_set_max_decoding_threads().
|
|
45
|
+
// If 'ctx' is NULL, the library default is returned.
|
|
46
|
+
LIBHEIF_API
|
|
47
|
+
int heif_context_get_max_decoding_threads(const heif_context* ctx);
|
|
48
|
+
|
|
42
49
|
// Quick check whether there is a decoder available for the given format.
|
|
43
50
|
// Note that the decoder still may not be able to decode all variants of that format.
|
|
44
51
|
// You will have to query that further (todo) or just try to decode and check the returned error.
|
|
45
52
|
LIBHEIF_API
|
|
46
|
-
int heif_have_decoder_for_format(
|
|
53
|
+
int heif_have_decoder_for_format(heif_compression_format format);
|
|
47
54
|
|
|
48
55
|
|
|
49
56
|
typedef enum heif_progress_step
|
|
@@ -64,11 +71,11 @@ typedef struct heif_decoding_options
|
|
|
64
71
|
uint8_t ignore_transformations;
|
|
65
72
|
|
|
66
73
|
// Any of the progress functions may be called from background threads.
|
|
67
|
-
void (* start_progress)(
|
|
74
|
+
void (* start_progress)(heif_progress_step step, int max_progress, void* progress_user_data);
|
|
68
75
|
|
|
69
|
-
void (* on_progress)(
|
|
76
|
+
void (* on_progress)(heif_progress_step step, int progress, void* progress_user_data);
|
|
70
77
|
|
|
71
|
-
void (* end_progress)(
|
|
78
|
+
void (* end_progress)(heif_progress_step step, void* progress_user_data);
|
|
72
79
|
|
|
73
80
|
void* progress_user_data;
|
|
74
81
|
|
|
@@ -107,10 +114,47 @@ typedef struct heif_decoding_options
|
|
|
107
114
|
// If enabled, it will decode the media timeline, ignoring the sequence tracks edit-list.
|
|
108
115
|
int ignore_sequence_editlist; // bool
|
|
109
116
|
|
|
117
|
+
// Requested NCLX color profile of the decoded output image. If the input
|
|
118
|
+
// image's NCLX differs, libheif will color-convert the pixels accordingly
|
|
119
|
+
// (e.g. YCbCr matrix, primaries, range) so the result matches what is
|
|
120
|
+
// requested here.
|
|
121
|
+
//
|
|
122
|
+
// When set to NULL, the behavior depends on the flag
|
|
123
|
+
// output_image_nclx_profile_passthrough below: by default NULL means
|
|
124
|
+
// "convert to sRGB"; with the passthrough flag enabled, NULL means
|
|
125
|
+
// "keep the input image's NCLX".
|
|
110
126
|
heif_color_profile_nclx* output_image_nclx_profile;
|
|
111
127
|
|
|
112
128
|
int num_library_threads; // 0 = let libheif decide (TODO, currently ignored)
|
|
113
129
|
int num_codec_threads; // 0 = use decoder default
|
|
130
|
+
|
|
131
|
+
// version 9 options
|
|
132
|
+
|
|
133
|
+
// If enabled, libheif will attempt to work around known broken-input quirks
|
|
134
|
+
// (e.g. Sony HIF files where the NCLX `colr` box disagrees with the HEVC VUI
|
|
135
|
+
// on the YCbCr range flag). Default: false (strict spec-conformant behavior).
|
|
136
|
+
uint8_t autocorrect_broken_input;
|
|
137
|
+
|
|
138
|
+
// version 10 options
|
|
139
|
+
|
|
140
|
+
// Controls the meaning of output_image_nclx_profile == NULL.
|
|
141
|
+
//
|
|
142
|
+
// When false (default), a NULL output_image_nclx_profile means "convert the
|
|
143
|
+
// decoded image to sRGB" (BT.709 primaries, sRGB transfer, BT.601 matrix,
|
|
144
|
+
// full-range). For HDR inputs (e.g. BT.2100 PQ) this silently discards the
|
|
145
|
+
// original color volume.
|
|
146
|
+
//
|
|
147
|
+
// When true, a NULL output_image_nclx_profile means "keep the input image's
|
|
148
|
+
// NCLX". The decoded image carries the input file's primaries / transfer /
|
|
149
|
+
// matrix / range, and no extra color-space conversion is performed solely
|
|
150
|
+
// because the output NCLX was unspecified. If a YCbCr<->RGB colorspace
|
|
151
|
+
// conversion fires for another reason, the input NCLX is used to drive that
|
|
152
|
+
// conversion (so the result is tagged consistently with the source).
|
|
153
|
+
//
|
|
154
|
+
// Although this flag is off by default to preserve historical behavior, new
|
|
155
|
+
// code that wants to preserve HDR through decode should generally enable it.
|
|
156
|
+
// Setting output_image_nclx_profile to a non-NULL value overrides this flag.
|
|
157
|
+
uint8_t output_image_nclx_profile_passthrough;
|
|
114
158
|
} heif_decoding_options;
|
|
115
159
|
|
|
116
160
|
|
|
@@ -136,7 +180,7 @@ typedef struct heif_decoder_descriptor heif_decoder_descriptor;
|
|
|
136
180
|
// The number of decoders is returned, which are not more than 'count' if (out_decoders != nullptr).
|
|
137
181
|
// By setting out_decoders==nullptr, you can query the number of decoders, 'count' is ignored.
|
|
138
182
|
LIBHEIF_API
|
|
139
|
-
int heif_get_decoder_descriptors(
|
|
183
|
+
int heif_get_decoder_descriptors(heif_compression_format format_filter,
|
|
140
184
|
const heif_decoder_descriptor** out_decoders,
|
|
141
185
|
int count);
|
|
142
186
|
|
|
@@ -161,8 +205,8 @@ const char* heif_decoder_descriptor_get_id_name(const heif_decoder_descriptor*);
|
|
|
161
205
|
LIBHEIF_API
|
|
162
206
|
heif_error heif_decode_image(const heif_image_handle* in_handle,
|
|
163
207
|
heif_image** out_img,
|
|
164
|
-
|
|
165
|
-
|
|
208
|
+
heif_colorspace colorspace,
|
|
209
|
+
heif_chroma chroma,
|
|
166
210
|
const heif_decoding_options* options);
|
|
167
211
|
|
|
168
212
|
#ifdef __cplusplus
|