@img/sharp-libvips-dev 0.0.1 → 0.0.3

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.
Files changed (109) hide show
  1. package/README.md +3 -3
  2. package/cplusplus/VConnection.cpp +54 -54
  3. package/cplusplus/VError.cpp +20 -18
  4. package/cplusplus/VImage.cpp +636 -589
  5. package/cplusplus/VInterpolate.cpp +22 -22
  6. package/cplusplus/VRegion.cpp +4 -4
  7. package/cplusplus/vips-operators.cpp +2326 -2301
  8. package/include/aom/aom_codec.h +10 -6
  9. package/include/aom/aom_decoder.h +1 -1
  10. package/include/aom/aom_encoder.h +9 -2
  11. package/include/aom/aomcx.h +72 -3
  12. package/include/cairo/cairo-ft.h +1 -1
  13. package/include/cairo/cairo-gobject.h +8 -0
  14. package/include/cairo/cairo-svg.h +3 -3
  15. package/include/cairo/cairo-version.h +2 -2
  16. package/include/cairo/cairo.h +91 -24
  17. package/include/glib-2.0/glib/gmacros.h +1 -1
  18. package/include/glib-2.0/glib/gtestutils.h +1 -1
  19. package/include/glib-2.0/gobject/gtype.h +7 -7
  20. package/include/harfbuzz/hb-version.h +2 -2
  21. package/include/hwy/aligned_allocator.h +211 -0
  22. package/include/hwy/base.h +1517 -0
  23. package/include/hwy/cache_control.h +108 -0
  24. package/include/hwy/detect_compiler_arch.h +281 -0
  25. package/include/hwy/detect_targets.h +644 -0
  26. package/include/hwy/foreach_target.h +340 -0
  27. package/include/hwy/highway.h +435 -0
  28. package/include/hwy/highway_export.h +74 -0
  29. package/include/hwy/nanobenchmark.h +171 -0
  30. package/include/hwy/ops/arm_neon-inl.h +8913 -0
  31. package/include/hwy/ops/arm_sve-inl.h +5105 -0
  32. package/include/hwy/ops/emu128-inl.h +2811 -0
  33. package/include/hwy/ops/generic_ops-inl.h +4745 -0
  34. package/include/hwy/ops/ppc_vsx-inl.h +5716 -0
  35. package/include/hwy/ops/rvv-inl.h +5070 -0
  36. package/include/hwy/ops/scalar-inl.h +1995 -0
  37. package/include/hwy/ops/set_macros-inl.h +578 -0
  38. package/include/hwy/ops/shared-inl.h +539 -0
  39. package/include/hwy/ops/tuple-inl.h +125 -0
  40. package/include/hwy/ops/wasm_128-inl.h +5917 -0
  41. package/include/hwy/ops/x86_128-inl.h +11173 -0
  42. package/include/hwy/ops/x86_256-inl.h +7529 -0
  43. package/include/hwy/ops/x86_512-inl.h +6849 -0
  44. package/include/hwy/per_target.h +44 -0
  45. package/include/hwy/print-inl.h +62 -0
  46. package/include/hwy/print.h +75 -0
  47. package/include/hwy/robust_statistics.h +148 -0
  48. package/include/hwy/targets.h +338 -0
  49. package/include/hwy/timer-inl.h +200 -0
  50. package/include/hwy/timer.h +55 -0
  51. package/include/jconfig.h +2 -2
  52. package/include/jpeglib.h +3 -2
  53. package/include/libheif/heif.h +461 -384
  54. package/include/libheif/heif_cxx.h +4 -1
  55. package/include/libheif/heif_plugin.h +1 -1
  56. package/include/libheif/heif_properties.h +138 -0
  57. package/include/libheif/heif_regions.h +866 -0
  58. package/include/libheif/heif_version.h +3 -3
  59. package/include/libpng16/pnglibconf.h +1 -1
  60. package/include/pnglibconf.h +1 -1
  61. package/include/vips/VConnection8.h +43 -49
  62. package/include/vips/VError8.h +27 -24
  63. package/include/vips/VImage8.h +4861 -4597
  64. package/include/vips/VInterpolate8.h +24 -27
  65. package/include/vips/VRegion8.h +32 -33
  66. package/include/vips/arithmetic.h +169 -169
  67. package/include/vips/basic.h +33 -33
  68. package/include/vips/buf.h +56 -54
  69. package/include/vips/colour.h +95 -95
  70. package/include/vips/connection.h +190 -193
  71. package/include/vips/conversion.h +91 -91
  72. package/include/vips/convolution.h +36 -30
  73. package/include/vips/create.h +63 -63
  74. package/include/vips/dbuf.h +35 -37
  75. package/include/vips/debug.h +65 -33
  76. package/include/vips/draw.h +41 -41
  77. package/include/vips/enumtypes.h +54 -51
  78. package/include/vips/error.h +63 -63
  79. package/include/vips/foreign.h +263 -223
  80. package/include/vips/format.h +48 -48
  81. package/include/vips/freqfilt.h +22 -22
  82. package/include/vips/gate.h +55 -47
  83. package/include/vips/generate.h +34 -34
  84. package/include/vips/header.h +111 -101
  85. package/include/vips/histogram.h +28 -28
  86. package/include/vips/image.h +213 -213
  87. package/include/vips/interpolate.h +40 -41
  88. package/include/vips/memory.h +61 -52
  89. package/include/vips/morphology.h +24 -24
  90. package/include/vips/mosaicing.h +32 -33
  91. package/include/vips/object.h +371 -357
  92. package/include/vips/operation.h +68 -67
  93. package/include/vips/private.h +76 -76
  94. package/include/vips/rect.h +26 -26
  95. package/include/vips/region.h +92 -92
  96. package/include/vips/resample.h +38 -38
  97. package/include/vips/sbuf.h +53 -54
  98. package/include/vips/semaphore.h +24 -24
  99. package/include/vips/thread.h +30 -27
  100. package/include/vips/threadpool.h +48 -49
  101. package/include/vips/transform.h +39 -39
  102. package/include/vips/type.h +90 -85
  103. package/include/vips/util.h +274 -229
  104. package/include/vips/vector.h +24 -144
  105. package/include/vips/version.h +9 -9
  106. package/include/vips/vips.h +41 -40
  107. package/include/zlib.h +23 -19
  108. package/package.json +1 -1
  109. package/versions.json +9 -9
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * HEIF codec.
3
- * Copyright (c) 2017 struktur AG, Dirk Farin <farin@struktur.de>
3
+ * Copyright (c) 2017-2023 Dirk Farin <dirk.farin@gmail.com>
4
4
  *
5
5
  * This file is part of libheif.
6
6
  *
@@ -25,6 +25,11 @@
25
25
  extern "C" {
26
26
  #endif
27
27
 
28
+ /*! \file heif.h
29
+ *
30
+ * Public API for libheif.
31
+ */
32
+
28
33
  #include <stddef.h>
29
34
  #include <stdint.h>
30
35
 
@@ -72,19 +77,18 @@ extern "C" {
72
77
  // Version string of linked libheif library.
73
78
  LIBHEIF_API const char* heif_get_version(void);
74
79
 
75
- // Numeric version of linked libheif library, encoded as BCD 0xHHMMLL00 = HH.MM.LL.
76
- // For example: 0x02143000 is version 2.14.30
80
+ // Numeric version of linked libheif library, encoded as 0xHHMMLL00 = hh.mm.ll, where hh, mm, ll is the decimal representation of HH, MM, LL.
81
+ // For example: 0x02150300 is version 2.21.3
77
82
  LIBHEIF_API uint32_t heif_get_version_number(void);
78
83
 
79
- // Numeric part "HH" from above. Returned as a decimal number (not BCD).
84
+ // Numeric part "HH" from above. Returned as a decimal number.
80
85
  LIBHEIF_API int heif_get_version_number_major(void);
81
- // Numeric part "MM" from above. Returned as a decimal number (not BCD).
86
+ // Numeric part "MM" from above. Returned as a decimal number.
82
87
  LIBHEIF_API int heif_get_version_number_minor(void);
83
- // Numeric part "LL" from above. Returned as a decimal number (not BCD).
88
+ // Numeric part "LL" from above. Returned as a decimal number.
84
89
  LIBHEIF_API int heif_get_version_number_maintenance(void);
85
90
 
86
91
  // Helper macros to check for given versions of libheif at compile time.
87
- // Note: h, m, l should be 2-digit BCD numbers. I.e., decimal 17 = 0x17 (BCD)
88
92
  #define LIBHEIF_MAKE_VERSION(h, m, l) ((h) << 24 | (m) << 16 | (l) << 8)
89
93
  #define LIBHEIF_HAVE_VERSION(h, m, l) (LIBHEIF_NUMERIC_VERSION >= LIBHEIF_MAKE_VERSION(h, m, l))
90
94
 
@@ -318,20 +322,153 @@ struct heif_error
318
322
  const char* message;
319
323
  };
320
324
 
325
+ // Default success return value. Intended for use in user-supplied callback functions.
326
+ LIBHEIF_API extern const struct heif_error heif_error_success;
327
+
321
328
 
322
329
  typedef uint32_t heif_item_id;
323
330
  typedef uint32_t heif_property_id;
324
331
 
325
332
 
326
333
 
327
- // ========================= library initialization ======================
334
+ // ========================= enum types ======================
328
335
 
329
- // You should call heif_init() when you start using libheif and heif_deinit() when you are finished.
330
- // These calls are reference counted. Each call to heif_init() should be matched by one call to heif_deinit().
331
- // For backwards compatibility, it is not really necessary to call heif_init(), but if you don't, the plugins
332
- // registered by default may not be freed correctly.
333
- // However, this should not be mixed, i.e. one part of your program does use heif_init()/heif_deinit() and another doesn't.
334
- // If in doubt, enclose everything with init/deinit.
336
+ /**
337
+ * libheif known compression formats.
338
+ */
339
+ enum heif_compression_format
340
+ {
341
+ /**
342
+ * Unspecified / undefined compression format.
343
+ *
344
+ * This is used to mean "no match" or "any decoder" for some parts of the
345
+ * API. It does not indicate a specific compression format.
346
+ */
347
+ heif_compression_undefined = 0,
348
+ /**
349
+ * HEVC compression, used for HEIC images.
350
+ *
351
+ * This is equivalent to H.265.
352
+ */
353
+ heif_compression_HEVC = 1,
354
+ /**
355
+ * AVC compression. (Currently unused in libheif.)
356
+ *
357
+ * The compression is defined in ISO/IEC 14496-10. This is equivalent to H.264.
358
+ *
359
+ * The encapsulation is defined in ISO/IEC 23008-12:2022 Annex E.
360
+ */
361
+ heif_compression_AVC = 2,
362
+ /**
363
+ * JPEG compression.
364
+ *
365
+ * The compression format is defined in ISO/IEC 10918-1. The encapsulation
366
+ * of JPEG is specified in ISO/IEC 23008-12:2022 Annex H.
367
+ */
368
+ heif_compression_JPEG = 3,
369
+ /**
370
+ * AV1 compression, used for AVIF images.
371
+ *
372
+ * The compression format is provided at https://aomediacodec.github.io/av1-spec/
373
+ *
374
+ * The encapsulation is defined in https://aomediacodec.github.io/av1-avif/
375
+ */
376
+ heif_compression_AV1 = 4,
377
+ /**
378
+ * VVC compression. (Currently unused in libheif.)
379
+ *
380
+ * The compression format is defined in ISO/IEC 23090-3. This is equivalent to H.266.
381
+ *
382
+ * The encapsulation is defined in ISO/IEC 23008-12:2022 Annex L.
383
+ */
384
+ heif_compression_VVC = 5,
385
+ /**
386
+ * EVC compression. (Currently unused in libheif.)
387
+ *
388
+ * The compression format is defined in ISO/IEC 23094-1. This is equivalent to H.266.
389
+ *
390
+ * The encapsulation is defined in ISO/IEC 23008-12:2022 Annex M.
391
+ */
392
+ heif_compression_EVC = 6,
393
+ /**
394
+ * JPEG 2000 compression.
395
+ *
396
+ * The encapsulation of JPEG 2000 is specified in ISO/IEC 15444-16:2021.
397
+ * The core encoding is defined in ISO/IEC 15444-1, or ITU-T T.800.
398
+ */
399
+ heif_compression_JPEG2000 = 7,
400
+ /**
401
+ * Uncompressed encoding.
402
+ *
403
+ * This is defined in ISO/IEC 23001-17:2023 (Final Draft International Standard).
404
+ */
405
+ heif_compression_uncompressed = 8,
406
+ /**
407
+ * Mask image encoding.
408
+ *
409
+ * See ISO/IEC 23008-12:2022 Section 6.10.2
410
+ */
411
+ heif_compression_mask = 9
412
+ };
413
+
414
+ enum heif_chroma
415
+ {
416
+ heif_chroma_undefined = 99,
417
+ heif_chroma_monochrome = 0,
418
+ heif_chroma_420 = 1,
419
+ heif_chroma_422 = 2,
420
+ heif_chroma_444 = 3,
421
+ heif_chroma_interleaved_RGB = 10,
422
+ heif_chroma_interleaved_RGBA = 11,
423
+ heif_chroma_interleaved_RRGGBB_BE = 12, // HDR, big endian.
424
+ heif_chroma_interleaved_RRGGBBAA_BE = 13, // HDR, big endian.
425
+ heif_chroma_interleaved_RRGGBB_LE = 14, // HDR, little endian.
426
+ heif_chroma_interleaved_RRGGBBAA_LE = 15 // HDR, little endian.
427
+ };
428
+
429
+ // DEPRECATED ENUM NAMES
430
+ #define heif_chroma_interleaved_24bit heif_chroma_interleaved_RGB
431
+ #define heif_chroma_interleaved_32bit heif_chroma_interleaved_RGBA
432
+
433
+
434
+ enum heif_colorspace
435
+ {
436
+ heif_colorspace_undefined = 99,
437
+
438
+ // heif_colorspace_YCbCr should be used with one of these heif_chroma values:
439
+ // * heif_chroma_444
440
+ // * heif_chroma_422
441
+ // * heif_chroma_420
442
+ heif_colorspace_YCbCr = 0,
443
+
444
+ // heif_colorspace_RGB should be used with one of these heif_chroma values:
445
+ // * heif_chroma_444 (for planar RGB)
446
+ // * heif_chroma_interleaved_RGB
447
+ // * heif_chroma_interleaved_RGBA
448
+ // * heif_chroma_interleaved_RRGGBB_BE
449
+ // * heif_chroma_interleaved_RRGGBBAA_BE
450
+ // * heif_chroma_interleaved_RRGGBB_LE
451
+ // * heif_chroma_interleaved_RRGGBBAA_LE
452
+ heif_colorspace_RGB = 1,
453
+
454
+ // heif_colorspace_monochrome should only be used with heif_chroma = heif_chroma_monochrome
455
+ heif_colorspace_monochrome = 2
456
+ };
457
+
458
+ enum heif_channel
459
+ {
460
+ heif_channel_Y = 0,
461
+ heif_channel_Cb = 1,
462
+ heif_channel_Cr = 2,
463
+ heif_channel_R = 3,
464
+ heif_channel_G = 4,
465
+ heif_channel_B = 5,
466
+ heif_channel_Alpha = 6,
467
+ heif_channel_interleaved = 10
468
+ };
469
+
470
+
471
+ // ========================= library initialization ======================
335
472
 
336
473
  struct heif_init_params
337
474
  {
@@ -341,12 +478,38 @@ struct heif_init_params
341
478
  };
342
479
 
343
480
 
344
- // You may pass nullptr to get default parameters. Currently, no parameters are supported.
481
+ /**
482
+ * Initialise library.
483
+ *
484
+ * You should call heif_init() when you start using libheif and heif_deinit() when you are finished.
485
+ * These calls are reference counted. Each call to heif_init() should be matched by one call to heif_deinit().
486
+ *
487
+ * For backwards compatibility, it is not really necessary to call heif_init(), but some library memory objects
488
+ * will never be freed if you do not call heif_init()/heif_deinit().
489
+ *
490
+ * heif_init() will load the external modules installed in the default plugin path. Thus, you need it when you
491
+ * want to load external plugins from the default path.
492
+ * Codec plugins that are compiled into the library directly (selected by the compile-time parameters of libheif)
493
+ * will be available even without heif_init().
494
+ *
495
+ * Make sure that you do not have one part of your program use heif_init()/heif_deinit() and another part that does
496
+ * not use it as the latter may try to use an uninitialized library. If in doubt, enclose everything with init/deinit.
497
+ *
498
+ * You may pass nullptr to get default parameters. Currently, no parameters are supported.
499
+ */
345
500
  LIBHEIF_API
346
501
  struct heif_error heif_init(struct heif_init_params*);
347
502
 
503
+ /**
504
+ * Deinitialise and clean up library.
505
+ *
506
+ * You should call heif_init() when you start using libheif and heif_deinit() when you are finished.
507
+ * These calls are reference counted. Each call to heif_init() should be matched by one call to heif_deinit().
508
+ *
509
+ * \sa heif_init()
510
+ */
348
511
  LIBHEIF_API
349
- void heif_deinit();
512
+ void heif_deinit(void);
350
513
 
351
514
 
352
515
  // --- Plugins are currently only supported on Unix platforms.
@@ -377,6 +540,15 @@ struct heif_error heif_load_plugins(const char* directory,
377
540
  LIBHEIF_API
378
541
  struct heif_error heif_unload_plugin(const struct heif_plugin_info* plugin);
379
542
 
543
+ // Get a NULL terminated array of the plugin directories that are searched by libheif.
544
+ // This includes the paths specified in the environment variable LIBHEIF_PLUGIN_PATHS and the built-in path
545
+ // (if not overridden by the environment variable).
546
+ LIBHEIF_API
547
+ const char*const* heif_get_plugin_directories(void);
548
+
549
+ LIBHEIF_API
550
+ void heif_free_plugin_directories(const char*const*);
551
+
380
552
 
381
553
  // ========================= file type check ======================
382
554
 
@@ -415,6 +587,8 @@ enum heif_brand
415
587
  heif_vvis, // VVC sequence
416
588
  heif_evbi, // EVC image
417
589
  heif_evbs, // EVC sequence
590
+ heif_j2ki, // JPEG2000 image
591
+ heif_j2is, // JPEG2000 image sequence
418
592
  };
419
593
 
420
594
  // input data should be at least 12 bytes
@@ -425,24 +599,210 @@ enum heif_brand heif_main_brand(const uint8_t* data, int len);
425
599
 
426
600
  typedef uint32_t heif_brand2;
427
601
 
428
- #define heif_brand2_heic heif_fourcc('h','e','i','c') // HEIF image with h265
429
- #define heif_brand2_heix heif_fourcc('h','e','i','x') // 10bit images, or anything that uses h265 with range extension
430
- #define heif_brand2_hevc heif_fourcc('h','e','v','c') // image sequences
431
- #define heif_brand2_hevx heif_fourcc('h','e','v','x') // HDR image sequence
432
- #define heif_brand2_heim heif_fourcc('h','e','i','m') // multiview
433
- #define heif_brand2_heis heif_fourcc('h','e','i','s') // scalable
434
- #define heif_brand2_hevm heif_fourcc('h','e','v','m') // multiview sequence
435
- #define heif_brand2_hevs heif_fourcc('h','e','v','s') // scalable sequence
436
- #define heif_brand2_avif heif_fourcc('a','v','i','f') // AVIF image (AV1)
602
+ /**
603
+ * HEVC image (`heic`) brand.
604
+ *
605
+ * Image conforms to HEVC (H.265) Main or Main Still profile.
606
+ *
607
+ * See ISO/IEC 23008-12:2022 Section B.4.1.
608
+ */
609
+ #define heif_brand2_heic heif_fourcc('h','e','i','c')
610
+
611
+ /**
612
+ * HEVC image (`heix`) brand.
613
+ *
614
+ * Image conforms to HEVC (H.265) Main 10 profile.
615
+ *
616
+ * See ISO/IEC 23008-12:2022 Section B.4.1.
617
+ */
618
+ #define heif_brand2_heix heif_fourcc('h','e','i','x')
619
+
620
+ /**
621
+ * HEVC image sequence (`hevc`) brand.
622
+ *
623
+ * Image sequence conforms to HEVC (H.265) Main profile.
624
+ *
625
+ * See ISO/IEC 23008-12:2022 Section B.4.2.
626
+ */
627
+ #define heif_brand2_hevc heif_fourcc('h','e','v','c')
628
+
629
+ /**
630
+ * HEVC image sequence (`hevx`) brand.
631
+ *
632
+ * Image sequence conforms to HEVC (H.265) Main 10 profile.
633
+ *
634
+ * See ISO/IEC 23008-12:2022 Section B.4.2.
635
+ */
636
+ #define heif_brand2_hevx heif_fourcc('h','e','v','x')
637
+
638
+ /**
639
+ * HEVC layered image (`heim`) brand.
640
+ *
641
+ * Image layers conform to HEVC (H.265) Main or Multiview Main profile.
642
+ *
643
+ * See ISO/IEC 23008-12:2022 Section B.4.3.
644
+ */
645
+ #define heif_brand2_heim heif_fourcc('h','e','i','m')
646
+
647
+ /**
648
+ * HEVC layered image (`heis`) brand.
649
+ *
650
+ * Image layers conform to HEVC (H.265) Main, Main 10, Scalable Main
651
+ * or Scalable Main 10 profile.
652
+ *
653
+ * See ISO/IEC 23008-12:2022 Section B.4.3.
654
+ */
655
+ #define heif_brand2_heis heif_fourcc('h','e','i','s')
656
+
657
+ /**
658
+ * HEVC layered image sequence (`hevm`) brand.
659
+ *
660
+ * Image sequence layers conform to HEVC (H.265) Main or Multiview Main profile.
661
+ *
662
+ * See ISO/IEC 23008-12:2022 Section B.4.4.
663
+ */
664
+ #define heif_brand2_hevm heif_fourcc('h','e','v','m')
665
+
666
+ /**
667
+ * HEVC layered image sequence (`hevs`) brand.
668
+ *
669
+ * Image sequence layers conform to HEVC (H.265) Main, Main 10, Scalable Main
670
+ * or Scalable Main 10 profile.
671
+ *
672
+ * See ISO/IEC 23008-12:2022 Section B.4.4.
673
+ */
674
+ #define heif_brand2_hevs heif_fourcc('h','e','v','s')
675
+
676
+ /**
677
+ * AV1 image (`avif`) brand.
678
+ *
679
+ * See https://aomediacodec.github.io/av1-avif/#image-and-image-collection-brand
680
+ */
681
+ #define heif_brand2_avif heif_fourcc('a','v','i','f')
682
+
683
+ /**
684
+ * AV1 image sequence (`avis`) brand.
685
+ *
686
+ * See https://aomediacodec.github.io/av1-avif/#image-sequence-brand
687
+ */
437
688
  #define heif_brand2_avis heif_fourcc('a','v','i','s') // AVIF sequence
438
- #define heif_brand2_mif1 heif_fourcc('m','i','f','1') // image, any coding algorithm
439
- #define heif_brand2_mif2 heif_fourcc('m','i','f','2') // image, any coding algorithm
440
- #define heif_brand2_msf1 heif_fourcc('m','s','f','1') // sequence, any coding algorithm
441
- #define heif_brand2_vvic heif_fourcc('v','v','i','c') // VVC image
442
- #define heif_brand2_vvis heif_fourcc('v','v','i','s') // VVC sequence
443
- #define heif_brand2_evbi heif_fourcc('e','v','b','i') // EVC image
444
- #define heif_brand2_evbs heif_fourcc('e','v','b','s') // EVC sequence
445
689
 
690
+ /**
691
+ * HEIF image structural brand (`mif1`).
692
+ *
693
+ * This does not imply a specific coding algorithm.
694
+ *
695
+ * See ISO/IEC 23008-12:2022 Section 10.2.2.
696
+ */
697
+ #define heif_brand2_mif1 heif_fourcc('m','i','f','1')
698
+
699
+ /**
700
+ * HEIF image structural brand (`mif2`).
701
+ *
702
+ * This does not imply a specific coding algorithm. `mif2` extends
703
+ * the requirements of `mif1` to include the `rref` and `iscl` item
704
+ * properties.
705
+ *
706
+ * See ISO/IEC 23008-12:2022 Section 10.2.3.
707
+ */
708
+ #define heif_brand2_mif2 heif_fourcc('m','i','f','2')
709
+
710
+ /**
711
+ * HEIF image sequence structural brand (`msf1`).
712
+ *
713
+ * This does not imply a specific coding algorithm.
714
+ *
715
+ * See ISO/IEC 23008-12:2022 Section 10.3.1.
716
+ */
717
+ #define heif_brand2_msf1 heif_fourcc('m','s','f','1')
718
+
719
+ /**
720
+ * VVC image (`vvic`) brand.
721
+ *
722
+ * See ISO/IEC 23008-12:2022 Section L.4.1.
723
+ */
724
+ #define heif_brand2_vvic heif_fourcc('v','v','i','c')
725
+
726
+ /**
727
+ * VVC image sequence (`vvis`) brand.
728
+ *
729
+ * See ISO/IEC 23008-12:2022 Section L.4.2.
730
+ */
731
+ #define heif_brand2_vvis heif_fourcc('v','v','i','s')
732
+
733
+ /**
734
+ * EVC baseline image (`evbi`) brand.
735
+ *
736
+ * See ISO/IEC 23008-12:2022 Section M.4.1.
737
+ */
738
+ #define heif_brand2_evbi heif_fourcc('e','v','b','i')
739
+
740
+ /**
741
+ * EVC main profile image (`evmi`) brand.
742
+ *
743
+ * See ISO/IEC 23008-12:2022 Section M.4.2.
744
+ */
745
+ #define heif_brand2_evmi heif_fourcc('e','v','m','i')
746
+
747
+ /**
748
+ * EVC baseline image sequence (`evbs`) brand.
749
+ *
750
+ * See ISO/IEC 23008-12:2022 Section M.4.3.
751
+ */
752
+ #define heif_brand2_evbs heif_fourcc('e','v','b','s')
753
+
754
+ /**
755
+ * EVC main profile image sequence (`evms`) brand.
756
+ *
757
+ * See ISO/IEC 23008-12:2022 Section M.4.4.
758
+ */
759
+ #define heif_brand2_evms heif_fourcc('e','v','m','s')
760
+
761
+ /**
762
+ * JPEG image (`jpeg`) brand.
763
+ *
764
+ * See ISO/IEC 23008-12:2022 Annex H.4
765
+ */
766
+ #define heif_brand2_jpeg heif_fourcc('j','p','e','g')
767
+
768
+ /**
769
+ * JPEG image sequence (`jpgs`) brand.
770
+ *
771
+ * See ISO/IEC 23008-12:2022 Annex H.5
772
+ */
773
+ #define heif_brand2_jpgs heif_fourcc('j','p','g','s')
774
+
775
+ /**
776
+ * JPEG 2000 image (`j2ki`) brand.
777
+ *
778
+ * See ISO/IEC 15444-16:2021 Section 6.5
779
+ */
780
+ #define heif_brand2_j2ki heif_fourcc('j','2','k','i')
781
+
782
+ /**
783
+ * JPEG 2000 image sequence (`j2is`) brand.
784
+ *
785
+ * See ISO/IEC 15444-16:2021 Section 7.6
786
+ */
787
+ #define heif_brand2_j2is heif_fourcc('j','2','i','s')
788
+
789
+ /**
790
+ * Multi-image application format (MIAF) brand.
791
+ *
792
+ * This is HEIF with additional constraints for interoperability.
793
+ *
794
+ * See ISO/IEC 23000-22.
795
+ */
796
+ #define heif_brand2_miaf heif_fourcc('m','i','a','f')
797
+
798
+ /**
799
+ * Single picture file brand.
800
+ *
801
+ * This is a compatible brand indicating the file contains a single intra-coded picture.
802
+ *
803
+ * See ISO/IEC 23008-12:2022 Section 10.2.5.
804
+ */
805
+ #define heif_brand2_1pic heif_fourcc('1','p','i','c')
446
806
 
447
807
  // input data should be at least 12 bytes
448
808
  LIBHEIF_API
@@ -527,7 +887,7 @@ struct heif_reader
527
887
  // --- version 1 functions ---
528
888
  int64_t (* get_position)(void* userdata);
529
889
 
530
- // The functions read(), and seek() return 0 on success.
890
+ // The functions read(), and seek() return heif_error_ok on success.
531
891
  // Generally, libheif will make sure that we do not read past the file size.
532
892
  int (* read)(void* data,
533
893
  size_t size,
@@ -600,7 +960,7 @@ LIBHEIF_API
600
960
  struct heif_error heif_context_get_primary_image_handle(struct heif_context* ctx,
601
961
  struct heif_image_handle**);
602
962
 
603
- // Get the handle for a specific top-level image from an image ID.
963
+ // Get the image handle for a known image ID.
604
964
  LIBHEIF_API
605
965
  struct heif_error heif_context_get_image_handle(struct heif_context* ctx,
606
966
  heif_item_id id,
@@ -667,6 +1027,15 @@ int heif_image_handle_get_luma_bits_per_pixel(const struct heif_image_handle*);
667
1027
  LIBHEIF_API
668
1028
  int heif_image_handle_get_chroma_bits_per_pixel(const struct heif_image_handle*);
669
1029
 
1030
+ // Return the colorspace that libheif proposes to use for decoding.
1031
+ // Usually, these will be either YCbCr or Monochrome, but it may also propose RGB for images
1032
+ // encoded with matrix_coefficients=0.
1033
+ // It may also return *_undefined if the file misses relevant information to determine this without decoding.
1034
+ LIBHEIF_API
1035
+ struct heif_error heif_image_handle_get_preferred_decoding_colorspace(const struct heif_image_handle* image_handle,
1036
+ enum heif_colorspace* out_colorspace,
1037
+ enum heif_chroma* out_chroma);
1038
+
670
1039
  // Get the image width from the 'ispe' box. This is the original image size without
671
1040
  // any transformations applied to it. Do not use this unless you know exactly what
672
1041
  // you are doing.
@@ -676,6 +1045,17 @@ int heif_image_handle_get_ispe_width(const struct heif_image_handle* handle);
676
1045
  LIBHEIF_API
677
1046
  int heif_image_handle_get_ispe_height(const struct heif_image_handle* handle);
678
1047
 
1048
+ // This gets the context associated with the image handle.
1049
+ // Note that you have to release the returned context with heif_context_free() in any case.
1050
+ //
1051
+ // This means: when you have several image-handles that originate from the same file and you get the
1052
+ // context of each of them, the returned pointer may be different even though it refers to the same
1053
+ // logical context. You have to call heif_context_free() on all those context pointers.
1054
+ // After you freed a context pointer, you can still use the context through a different pointer that you
1055
+ // might have acquired from elsewhere.
1056
+ LIBHEIF_API
1057
+ struct heif_context* heif_image_handle_get_context(const struct heif_image_handle* handle);
1058
+
679
1059
 
680
1060
  // ------------------------- depth images -------------------------
681
1061
 
@@ -840,6 +1220,10 @@ struct heif_error heif_image_handle_get_metadata(const struct heif_image_handle*
840
1220
  heif_item_id metadata_id,
841
1221
  void* out_data);
842
1222
 
1223
+ // Only valid for item type == "uri ", an absolute URI
1224
+ LIBHEIF_API
1225
+ const char* heif_image_handle_get_metadata_item_uri_type(const struct heif_image_handle* handle,
1226
+ heif_item_id metadata_id);
843
1227
 
844
1228
  // ------------------------- color profiles -------------------------
845
1229
 
@@ -963,7 +1347,7 @@ struct heif_error heif_image_handle_get_nclx_color_profile(const struct heif_ima
963
1347
  // Do not fill values for higher versions as these might be outside the allocated structure size.
964
1348
  // May return NULL.
965
1349
  LIBHEIF_API
966
- struct heif_color_profile_nclx* heif_nclx_color_profile_alloc();
1350
+ struct heif_color_profile_nclx* heif_nclx_color_profile_alloc(void);
967
1351
 
968
1352
  LIBHEIF_API
969
1353
  void heif_nclx_color_profile_free(struct heif_color_profile_nclx* nclx_profile);
@@ -984,109 +1368,6 @@ struct heif_error heif_image_get_nclx_color_profile(const struct heif_image* ima
984
1368
  struct heif_color_profile_nclx** out_data);
985
1369
 
986
1370
 
987
- // ------------------------- item properties -------------------------
988
-
989
- enum heif_item_property_type
990
- {
991
- // heif_item_property_unknown = -1,
992
- heif_item_property_type_invalid = 0,
993
- heif_item_property_type_user_description = heif_fourcc('u', 'd', 'e', 's'),
994
- heif_item_property_type_transform_mirror = heif_fourcc('i', 'm', 'i', 'r'),
995
- heif_item_property_type_transform_rotation = heif_fourcc('i', 'r', 'o', 't'),
996
- heif_item_property_type_transform_crop = heif_fourcc('c', 'l', 'a', 'p'),
997
- heif_item_property_type_image_size = heif_fourcc('i', 's', 'p', 'e')
998
- };
999
-
1000
- // Get the heif_property_id for a heif_item_id.
1001
- // You may specify which property 'type' you want to receive.
1002
- // If you specify 'heif_item_property_type_invalid', all properties associated to that item are returned.
1003
- // The number of properties is returned, which are not more than 'count' if (out_list != nullptr).
1004
- // By setting out_list==nullptr, you can query the number of properties, 'count' is ignored.
1005
- LIBHEIF_API
1006
- int heif_item_get_properties_of_type(const struct heif_context* context,
1007
- heif_item_id id,
1008
- enum heif_item_property_type type,
1009
- heif_property_id* out_list,
1010
- int count);
1011
-
1012
- // Returns all transformative properties in the correct order.
1013
- // This includes "irot", "imir", "clap".
1014
- // The number of properties is returned, which are not more than 'count' if (out_list != nullptr).
1015
- // By setting out_list==nullptr, you can query the number of properties, 'count' is ignored.
1016
- LIBHEIF_API
1017
- int heif_item_get_transformation_properties(const struct heif_context* context,
1018
- heif_item_id id,
1019
- heif_property_id* out_list,
1020
- int count);
1021
-
1022
- LIBHEIF_API
1023
- enum heif_item_property_type heif_item_get_property_type(const struct heif_context* context,
1024
- heif_item_id id,
1025
- heif_property_id property_id);
1026
-
1027
- // The strings are managed by libheif. They will be deleted in heif_property_user_description_release().
1028
- struct heif_property_user_description
1029
- {
1030
- int version;
1031
-
1032
- // version 1
1033
-
1034
- const char* lang;
1035
- const char* name;
1036
- const char* description;
1037
- const char* tags;
1038
- };
1039
-
1040
- // Get the "udes" user description property content.
1041
- // Undefined strings are returned as empty strings.
1042
- LIBHEIF_API
1043
- struct heif_error heif_item_get_property_user_description(const struct heif_context* context,
1044
- heif_item_id itemId,
1045
- heif_property_id propertyId,
1046
- struct heif_property_user_description** out);
1047
-
1048
- // Add a "udes" user description property to the item.
1049
- // If any string pointers are NULL, an empty string will be used instead.
1050
- LIBHEIF_API
1051
- struct heif_error heif_item_add_property_user_description(const struct heif_context* context,
1052
- heif_item_id itemId,
1053
- const struct heif_property_user_description* description,
1054
- heif_property_id* out_propertyId);
1055
-
1056
- // Release all strings and the object itself.
1057
- // Only call for objects that you received from heif_item_get_property_user_description().
1058
- LIBHEIF_API
1059
- void heif_property_user_description_release(struct heif_property_user_description*);
1060
-
1061
- enum heif_transform_mirror_direction
1062
- {
1063
- heif_transform_mirror_direction_vertical = 0, // flip image vertically
1064
- heif_transform_mirror_direction_horizontal = 1 // flip image horizontally
1065
- };
1066
-
1067
- LIBHEIF_API
1068
- enum heif_transform_mirror_direction heif_item_get_property_transform_mirror(const struct heif_context* context,
1069
- heif_item_id itemId,
1070
- heif_property_id propertyId);
1071
-
1072
- // Returns only 0, 90, 180, or 270 angle values.
1073
- // Returns -1 in case of error (but it will only return an error in case of wrong usage).
1074
- LIBHEIF_API
1075
- int heif_item_get_property_transform_rotation_ccw(const struct heif_context* context,
1076
- heif_item_id itemId,
1077
- heif_property_id propertyId);
1078
-
1079
- // Returns the number of pixels that should be removed from the four edges.
1080
- // Because of the way this data is stored, you have to pass the image size at the moment of the crop operation
1081
- // to compute the cropped border sizes.
1082
- LIBHEIF_API
1083
- void heif_item_get_property_transform_crop_borders(const struct heif_context* context,
1084
- heif_item_id itemId,
1085
- heif_property_id propertyId,
1086
- int image_width, int image_height,
1087
- int* left, int* top, int* right, int* bottom);
1088
-
1089
-
1090
1371
  // ========================= heif_image =========================
1091
1372
 
1092
1373
  // An heif_image contains a decoded pixel image in various colorspaces, chroma formats,
@@ -1098,76 +1379,6 @@ void heif_item_get_property_transform_crop_borders(const struct heif_context* co
1098
1379
 
1099
1380
  // Planar RGB images are specified as heif_colorspace_RGB / heif_chroma_444.
1100
1381
 
1101
- enum heif_compression_format
1102
- {
1103
- heif_compression_undefined = 0,
1104
- heif_compression_HEVC = 1,
1105
- heif_compression_AVC = 2,
1106
- heif_compression_JPEG = 3,
1107
- heif_compression_AV1 = 4,
1108
- heif_compression_VVC = 5,
1109
- heif_compression_EVC = 6,
1110
- heif_compression_JPEG2000 = 7, // ISO/IEC 15444-16:2021
1111
- heif_compression_uncompressed = 8 // ISO/IEC 23001-17:2023
1112
- };
1113
-
1114
- enum heif_chroma
1115
- {
1116
- heif_chroma_undefined = 99,
1117
- heif_chroma_monochrome = 0,
1118
- heif_chroma_420 = 1,
1119
- heif_chroma_422 = 2,
1120
- heif_chroma_444 = 3,
1121
- heif_chroma_interleaved_RGB = 10,
1122
- heif_chroma_interleaved_RGBA = 11,
1123
- heif_chroma_interleaved_RRGGBB_BE = 12, // HDR, big endian.
1124
- heif_chroma_interleaved_RRGGBBAA_BE = 13, // HDR, big endian.
1125
- heif_chroma_interleaved_RRGGBB_LE = 14, // HDR, little endian.
1126
- heif_chroma_interleaved_RRGGBBAA_LE = 15 // HDR, little endian.
1127
- };
1128
-
1129
- // DEPRECATED ENUM NAMES
1130
- #define heif_chroma_interleaved_24bit heif_chroma_interleaved_RGB
1131
- #define heif_chroma_interleaved_32bit heif_chroma_interleaved_RGBA
1132
-
1133
-
1134
- enum heif_colorspace
1135
- {
1136
- heif_colorspace_undefined = 99,
1137
-
1138
- // heif_colorspace_YCbCr should be used with one of these heif_chroma values:
1139
- // * heif_chroma_444
1140
- // * heif_chroma_422
1141
- // * heif_chroma_420
1142
- heif_colorspace_YCbCr = 0,
1143
-
1144
- // heif_colorspace_RGB should be used with one of these heif_chroma values:
1145
- // * heif_chroma_444 (for planar RGB)
1146
- // * heif_chroma_interleaved_RGB
1147
- // * heif_chroma_interleaved_RGBA
1148
- // * heif_chroma_interleaved_RRGGBB_BE
1149
- // * heif_chroma_interleaved_RRGGBBAA_BE
1150
- // * heif_chroma_interleaved_RRGGBB_LE
1151
- // * heif_chroma_interleaved_RRGGBBAA_LE
1152
- heif_colorspace_RGB = 1,
1153
-
1154
- // heif_colorspace_monochrome should only be used with heif_chroma = heif_chroma_monochrome
1155
- heif_colorspace_monochrome = 2
1156
- };
1157
-
1158
- enum heif_channel
1159
- {
1160
- heif_channel_Y = 0,
1161
- heif_channel_Cb = 1,
1162
- heif_channel_Cr = 2,
1163
- heif_channel_R = 3,
1164
- heif_channel_G = 4,
1165
- heif_channel_B = 5,
1166
- heif_channel_Alpha = 6,
1167
- heif_channel_interleaved = 10
1168
- };
1169
-
1170
-
1171
1382
  enum heif_progress_step
1172
1383
  {
1173
1384
  heif_progress_step_total = 0,
@@ -1200,7 +1411,12 @@ struct heif_color_conversion_options
1200
1411
  enum heif_chroma_downsampling_algorithm preferred_chroma_downsampling_algorithm;
1201
1412
  enum heif_chroma_upsampling_algorithm preferred_chroma_upsampling_algorithm;
1202
1413
 
1203
- // When set to 'false', libheif may also use a different algorithm if the preferred one is not available.
1414
+ // When set to 'false' libheif may also use a different algorithm if the preferred one is not available
1415
+ // or using a different algorithm is computationally less complex. Note that currently (v1.17.0) this
1416
+ // means that for RGB input it will usually choose nearest-neighbor sampling because this is computationally
1417
+ // the simplest.
1418
+ // Set this field to 'true' if you want to make sure that the specified algorithm is used even
1419
+ // at the cost of slightly higher computation times.
1204
1420
  uint8_t only_use_preferred_chroma_algorithm;
1205
1421
  };
1206
1422
 
@@ -1251,7 +1467,7 @@ struct heif_decoding_options
1251
1467
  // Note: you should always get the decoding options through this function since the
1252
1468
  // option structure may grow in size in future versions.
1253
1469
  LIBHEIF_API
1254
- struct heif_decoding_options* heif_decoding_options_alloc();
1470
+ struct heif_decoding_options* heif_decoding_options_alloc(void);
1255
1471
 
1256
1472
  LIBHEIF_API
1257
1473
  void heif_decoding_options_free(struct heif_decoding_options*);
@@ -1278,22 +1494,47 @@ enum heif_colorspace heif_image_get_colorspace(const struct heif_image*);
1278
1494
  LIBHEIF_API
1279
1495
  enum heif_chroma heif_image_get_chroma_format(const struct heif_image*);
1280
1496
 
1281
- // Get width of the given image channel in pixels. Returns -1 if a non-existing
1282
- // channel was given.
1497
+ /**
1498
+ * Get the width of a specified image channel.
1499
+ *
1500
+ * @param img the image to get the width for
1501
+ * @param channel the channel to select
1502
+ * @return the width of the channel in pixels, or -1 the channel does not exist in the image
1503
+ */
1283
1504
  LIBHEIF_API
1284
- int heif_image_get_width(const struct heif_image*, enum heif_channel channel);
1505
+ int heif_image_get_width(const struct heif_image* img, enum heif_channel channel);
1285
1506
 
1286
- // Get height of the given image channel in pixels. Returns -1 if a non-existing
1287
- // channel was given.
1507
+ /**
1508
+ * Get the height of a specified image channel.
1509
+ *
1510
+ * @param img the image to get the height for
1511
+ * @param channel the channel to select
1512
+ * @return the height of the channel in pixels, or -1 the channel does not exist in the image
1513
+ */
1288
1514
  LIBHEIF_API
1289
- int heif_image_get_height(const struct heif_image*, enum heif_channel channel);
1515
+ int heif_image_get_height(const struct heif_image* img, enum heif_channel channel);
1290
1516
 
1291
- // Get the width of the main channel (Y in YCbCr, or any in RGB).
1517
+ /**
1518
+ * Get the width of the main channel.
1519
+ *
1520
+ * This is the Y channel in YCbCr or mono, or any in RGB.
1521
+ *
1522
+ * @param img the image to get the primary width for
1523
+ * @return the width in pixels
1524
+ */
1292
1525
  LIBHEIF_API
1293
- int heif_image_get_primary_width(const struct heif_image*);
1526
+ int heif_image_get_primary_width(const struct heif_image* img);
1294
1527
 
1528
+ /**
1529
+ * Get the height of the main channel.
1530
+ *
1531
+ * This is the Y channel in YCbCr or mono, or any in RGB.
1532
+ *
1533
+ * @param img the image to get the primary height for
1534
+ * @return the height in pixels
1535
+ */
1295
1536
  LIBHEIF_API
1296
- int heif_image_get_primary_height(const struct heif_image*);
1537
+ int heif_image_get_primary_height(const struct heif_image* img);
1297
1538
 
1298
1539
  LIBHEIF_API
1299
1540
  struct heif_error heif_image_crop(struct heif_image* img,
@@ -1778,7 +2019,7 @@ struct heif_encoding_options
1778
2019
  };
1779
2020
 
1780
2021
  LIBHEIF_API
1781
- struct heif_encoding_options* heif_encoding_options_alloc();
2022
+ struct heif_encoding_options* heif_encoding_options_alloc(void);
1782
2023
 
1783
2024
  LIBHEIF_API
1784
2025
  void heif_encoding_options_free(struct heif_encoding_options*);
@@ -1921,170 +2162,6 @@ LIBHEIF_API
1921
2162
  int heif_encoder_descriptor_supportes_lossless_compression(const struct heif_encoder_descriptor*);
1922
2163
 
1923
2164
 
1924
- // --- region items and annotations
1925
-
1926
- // See ISO/IEC 23008-12:2022 Section 6.10 "Region items and region annotations"
1927
-
1928
- struct heif_region_item;
1929
-
1930
- enum heif_region_type
1931
- {
1932
- heif_region_type_point = 0,
1933
- heif_region_type_rectangle = 1,
1934
- heif_region_type_ellipse = 2,
1935
- heif_region_type_polygon = 3,
1936
- heif_region_type_referenced_mask = 4, // TODO
1937
- heif_region_type_inline_mask = 5, // TODO
1938
- heif_region_type_polyline = 6
1939
- };
1940
-
1941
- struct heif_region;
1942
-
1943
- // How many region items are attached to an image.
1944
- LIBHEIF_API
1945
- int heif_image_handle_get_number_of_region_items(const struct heif_image_handle* image_handle);
1946
-
1947
- // Get the region_item IDs assigned to an image.
1948
- // Returns the number of region items outputted.
1949
- LIBHEIF_API
1950
- int heif_image_handle_get_list_of_region_item_ids(const struct heif_image_handle* image_handle,
1951
- heif_item_id* region_item_ids_array,
1952
- int max_count);
1953
-
1954
- // You have to release the output heif_region_item with heif_region_item_release().
1955
- LIBHEIF_API
1956
- struct heif_error heif_context_get_region_item(const struct heif_context* context,
1957
- heif_item_id region_item_id,
1958
- struct heif_region_item** out);
1959
-
1960
- LIBHEIF_API
1961
- heif_item_id heif_region_item_get_id(struct heif_region_item*);
1962
-
1963
- LIBHEIF_API
1964
- void heif_region_item_release(struct heif_region_item*);
1965
-
1966
- // The reference size specifies the coordinate space using for the region items.
1967
- // It is the size of the area of the encoded image prior to any transformations.
1968
- LIBHEIF_API
1969
- void heif_region_item_get_reference_size(struct heif_region_item*, uint32_t* width, uint32_t* height);
1970
-
1971
- LIBHEIF_API
1972
- int heif_region_item_get_number_of_regions(const struct heif_region_item* region_item);
1973
-
1974
- // You will have to release all returned heif_region objects with heif_region_release() or heif_region_release_many().
1975
- // 'out_regions' should point to an array of size 'max_count'.
1976
- // The function returns the number of regions filled into the 'out_regions' array.
1977
- LIBHEIF_API
1978
- int heif_region_item_get_list_of_regions(const struct heif_region_item* region_item,
1979
- struct heif_region** out_regions_array,
1980
- int max_count);
1981
-
1982
- LIBHEIF_API
1983
- void heif_region_release(const struct heif_region* region);
1984
-
1985
- LIBHEIF_API
1986
- void heif_region_release_many(const struct heif_region* const* regions_array, int num);
1987
-
1988
- LIBHEIF_API
1989
- enum heif_region_type heif_region_get_type(const struct heif_region* region);
1990
-
1991
- // When querying the region geometry, there is a version without and a version with "_transformed" suffix.
1992
- // The version without returns the coordinates in the reference coordinate space.
1993
- // The version with "_transformed" suffix give the coordinates in pixels after all transformative properties have been applied.
1994
-
1995
- LIBHEIF_API
1996
- struct heif_error heif_region_get_point(const struct heif_region* region, int32_t* x, int32_t* y);
1997
-
1998
- LIBHEIF_API
1999
- struct heif_error heif_region_get_point_transformed(const struct heif_region* region, double* x, double* y,
2000
- heif_item_id image_id);
2001
-
2002
- LIBHEIF_API
2003
- struct heif_error heif_region_get_rectangle(const struct heif_region* region,
2004
- int32_t* x, int32_t* y,
2005
- uint32_t* width, uint32_t* height);
2006
-
2007
- LIBHEIF_API
2008
- struct heif_error heif_region_get_rectangle_transformed(const struct heif_region* region,
2009
- double* x, double* y,
2010
- double* width, double* height,
2011
- heif_item_id image_id);
2012
-
2013
- LIBHEIF_API
2014
- struct heif_error heif_region_get_ellipse(const struct heif_region* region,
2015
- int32_t* x, int32_t* y,
2016
- uint32_t* radius_x, uint32_t* radius_y);
2017
-
2018
- LIBHEIF_API
2019
- struct heif_error heif_region_get_ellipse_transformed(const struct heif_region* region,
2020
- double* x, double* y,
2021
- double* radius_x, double* radius_y,
2022
- heif_item_id image_id);
2023
-
2024
- LIBHEIF_API
2025
- int heif_region_get_polygon_num_points(const struct heif_region* region);
2026
-
2027
- // Point coordinates are stored in the output array 'pts'. This must have twice as many entries as there are points.
2028
- // Each point is stored as consecutive x and y positions.
2029
- LIBHEIF_API
2030
- struct heif_error heif_region_get_polygon_points(const struct heif_region* region,
2031
- int32_t* out_pts_array);
2032
-
2033
- LIBHEIF_API
2034
- struct heif_error heif_region_get_polygon_points_transformed(const struct heif_region* region,
2035
- double* out_pts_array,
2036
- heif_item_id image_id);
2037
-
2038
- LIBHEIF_API
2039
- int heif_region_get_polyline_num_points(const struct heif_region* region);
2040
-
2041
- LIBHEIF_API
2042
- struct heif_error heif_region_get_polyline_points(const struct heif_region* region,
2043
- int32_t* out_pts_array);
2044
-
2045
- LIBHEIF_API
2046
- struct heif_error heif_region_get_polyline_points_transformed(const struct heif_region* region,
2047
- double* out_pts_array,
2048
- heif_item_id image_id);
2049
-
2050
- // --- adding region items
2051
-
2052
- LIBHEIF_API
2053
- struct heif_error heif_image_handle_add_region_item(struct heif_image_handle* image_handle,
2054
- uint32_t reference_width, uint32_t reference_height,
2055
- struct heif_region_item** out_region_item);
2056
-
2057
- // When adding regions, there is an optional 'out_region' parameter.
2058
- // This is usually not needed. You may set it to NULL.
2059
-
2060
- LIBHEIF_API
2061
- struct heif_error heif_region_item_add_region_point(struct heif_region_item*,
2062
- int32_t x, int32_t y,
2063
- struct heif_region** out_region);
2064
-
2065
- LIBHEIF_API
2066
- struct heif_error heif_region_item_add_region_rectangle(struct heif_region_item*,
2067
- int32_t x, int32_t y,
2068
- uint32_t width, uint32_t height,
2069
- struct heif_region** out_region);
2070
-
2071
- LIBHEIF_API
2072
- struct heif_error heif_region_item_add_region_ellipse(struct heif_region_item*,
2073
- int32_t x, int32_t y,
2074
- uint32_t radius_x, uint32_t radius_y,
2075
- struct heif_region** out_region);
2076
-
2077
- // pts[] is an array of 2*nPoints, each pair representing x and y.
2078
- LIBHEIF_API
2079
- struct heif_error heif_region_item_add_region_polygon(struct heif_region_item*,
2080
- const int32_t* pts_array, int nPoints,
2081
- struct heif_region** out_region);
2082
-
2083
- LIBHEIF_API
2084
- struct heif_error heif_region_item_add_region_polyline(struct heif_region_item*,
2085
- const int32_t* pts_array, int nPoints,
2086
- struct heif_region** out_region);
2087
-
2088
2165
  #ifdef __cplusplus
2089
2166
  }
2090
2167
  #endif