@img/sharp-libvips-dev 0.0.1 → 0.0.2

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 (103) hide show
  1. package/README.md +2 -2
  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/harfbuzz/hb-version.h +2 -2
  18. package/include/hwy/aligned_allocator.h +211 -0
  19. package/include/hwy/base.h +1517 -0
  20. package/include/hwy/cache_control.h +108 -0
  21. package/include/hwy/detect_compiler_arch.h +281 -0
  22. package/include/hwy/detect_targets.h +644 -0
  23. package/include/hwy/foreach_target.h +340 -0
  24. package/include/hwy/highway.h +435 -0
  25. package/include/hwy/highway_export.h +74 -0
  26. package/include/hwy/nanobenchmark.h +171 -0
  27. package/include/hwy/ops/arm_neon-inl.h +8913 -0
  28. package/include/hwy/ops/arm_sve-inl.h +5105 -0
  29. package/include/hwy/ops/emu128-inl.h +2811 -0
  30. package/include/hwy/ops/generic_ops-inl.h +4745 -0
  31. package/include/hwy/ops/ppc_vsx-inl.h +5716 -0
  32. package/include/hwy/ops/rvv-inl.h +5070 -0
  33. package/include/hwy/ops/scalar-inl.h +1995 -0
  34. package/include/hwy/ops/set_macros-inl.h +578 -0
  35. package/include/hwy/ops/shared-inl.h +539 -0
  36. package/include/hwy/ops/tuple-inl.h +125 -0
  37. package/include/hwy/ops/wasm_128-inl.h +5917 -0
  38. package/include/hwy/ops/x86_128-inl.h +11173 -0
  39. package/include/hwy/ops/x86_256-inl.h +7529 -0
  40. package/include/hwy/ops/x86_512-inl.h +6849 -0
  41. package/include/hwy/per_target.h +44 -0
  42. package/include/hwy/print-inl.h +62 -0
  43. package/include/hwy/print.h +75 -0
  44. package/include/hwy/robust_statistics.h +148 -0
  45. package/include/hwy/targets.h +338 -0
  46. package/include/hwy/timer-inl.h +200 -0
  47. package/include/hwy/timer.h +55 -0
  48. package/include/jconfig.h +2 -2
  49. package/include/jpeglib.h +3 -2
  50. package/include/libheif/heif.h +443 -377
  51. package/include/libheif/heif_cxx.h +4 -1
  52. package/include/libheif/heif_plugin.h +1 -1
  53. package/include/libheif/heif_properties.h +138 -0
  54. package/include/libheif/heif_regions.h +866 -0
  55. package/include/libheif/heif_version.h +3 -3
  56. package/include/vips/VConnection8.h +43 -49
  57. package/include/vips/VError8.h +27 -24
  58. package/include/vips/VImage8.h +4861 -4597
  59. package/include/vips/VInterpolate8.h +24 -27
  60. package/include/vips/VRegion8.h +32 -33
  61. package/include/vips/arithmetic.h +169 -169
  62. package/include/vips/basic.h +33 -33
  63. package/include/vips/buf.h +56 -54
  64. package/include/vips/colour.h +95 -95
  65. package/include/vips/connection.h +190 -193
  66. package/include/vips/conversion.h +91 -91
  67. package/include/vips/convolution.h +36 -30
  68. package/include/vips/create.h +63 -63
  69. package/include/vips/dbuf.h +35 -37
  70. package/include/vips/debug.h +65 -33
  71. package/include/vips/draw.h +41 -41
  72. package/include/vips/enumtypes.h +54 -51
  73. package/include/vips/error.h +63 -63
  74. package/include/vips/foreign.h +263 -223
  75. package/include/vips/format.h +48 -48
  76. package/include/vips/freqfilt.h +22 -22
  77. package/include/vips/gate.h +55 -47
  78. package/include/vips/generate.h +34 -34
  79. package/include/vips/header.h +111 -101
  80. package/include/vips/histogram.h +28 -28
  81. package/include/vips/image.h +213 -213
  82. package/include/vips/interpolate.h +40 -41
  83. package/include/vips/memory.h +61 -52
  84. package/include/vips/morphology.h +24 -24
  85. package/include/vips/mosaicing.h +32 -33
  86. package/include/vips/object.h +371 -357
  87. package/include/vips/operation.h +68 -67
  88. package/include/vips/private.h +76 -76
  89. package/include/vips/rect.h +26 -26
  90. package/include/vips/region.h +92 -92
  91. package/include/vips/resample.h +38 -38
  92. package/include/vips/sbuf.h +53 -54
  93. package/include/vips/semaphore.h +24 -24
  94. package/include/vips/thread.h +30 -27
  95. package/include/vips/threadpool.h +48 -49
  96. package/include/vips/transform.h +39 -39
  97. package/include/vips/type.h +90 -85
  98. package/include/vips/util.h +274 -229
  99. package/include/vips/vector.h +24 -144
  100. package/include/vips/version.h +9 -9
  101. package/include/vips/vips.h +41 -40
  102. package/package.json +1 -1
  103. package/versions.json +7 -7
@@ -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
 
@@ -318,20 +323,153 @@ struct heif_error
318
323
  const char* message;
319
324
  };
320
325
 
326
+ // Default success return value. Intended for use in user-supplied callback functions.
327
+ LIBHEIF_API extern const struct heif_error heif_error_success;
328
+
321
329
 
322
330
  typedef uint32_t heif_item_id;
323
331
  typedef uint32_t heif_property_id;
324
332
 
325
333
 
326
334
 
327
- // ========================= library initialization ======================
335
+ // ========================= enum types ======================
328
336
 
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.
337
+ /**
338
+ * libheif known compression formats.
339
+ */
340
+ enum heif_compression_format
341
+ {
342
+ /**
343
+ * Unspecified / undefined compression format.
344
+ *
345
+ * This is used to mean "no match" or "any decoder" for some parts of the
346
+ * API. It does not indicate a specific compression format.
347
+ */
348
+ heif_compression_undefined = 0,
349
+ /**
350
+ * HEVC compression, used for HEIC images.
351
+ *
352
+ * This is equivalent to H.265.
353
+ */
354
+ heif_compression_HEVC = 1,
355
+ /**
356
+ * AVC compression. (Currently unused in libheif.)
357
+ *
358
+ * The compression is defined in ISO/IEC 14496-10. This is equivalent to H.264.
359
+ *
360
+ * The encapsulation is defined in ISO/IEC 23008-12:2022 Annex E.
361
+ */
362
+ heif_compression_AVC = 2,
363
+ /**
364
+ * JPEG compression.
365
+ *
366
+ * The compression format is defined in ISO/IEC 10918-1. The encapsulation
367
+ * of JPEG is specified in ISO/IEC 23008-12:2022 Annex H.
368
+ */
369
+ heif_compression_JPEG = 3,
370
+ /**
371
+ * AV1 compression, used for AVIF images.
372
+ *
373
+ * The compression format is provided at https://aomediacodec.github.io/av1-spec/
374
+ *
375
+ * The encapsulation is defined in https://aomediacodec.github.io/av1-avif/
376
+ */
377
+ heif_compression_AV1 = 4,
378
+ /**
379
+ * VVC compression. (Currently unused in libheif.)
380
+ *
381
+ * The compression format is defined in ISO/IEC 23090-3. This is equivalent to H.266.
382
+ *
383
+ * The encapsulation is defined in ISO/IEC 23008-12:2022 Annex L.
384
+ */
385
+ heif_compression_VVC = 5,
386
+ /**
387
+ * EVC compression. (Currently unused in libheif.)
388
+ *
389
+ * The compression format is defined in ISO/IEC 23094-1. This is equivalent to H.266.
390
+ *
391
+ * The encapsulation is defined in ISO/IEC 23008-12:2022 Annex M.
392
+ */
393
+ heif_compression_EVC = 6,
394
+ /**
395
+ * JPEG 2000 compression. (Currently unused in libheif.)
396
+ *
397
+ * The encapsulation of JPEG 2000 is specified in ISO/IEC 15444-16:2021.
398
+ * The core encoding is defined in ISO/IEC 15444-1, or ITU-T T.800.
399
+ */
400
+ heif_compression_JPEG2000 = 7,
401
+ /**
402
+ * Uncompressed encoding.
403
+ *
404
+ * This is defined in ISO/IEC 23001-17:2023 (Draft International Standard).
405
+ */
406
+ heif_compression_uncompressed = 8,
407
+ /**
408
+ * Mask image encoding.
409
+ *
410
+ * See ISO/IEC 23008-12:2022 Section 6.10.2
411
+ */
412
+ heif_compression_mask = 9
413
+ };
414
+
415
+ enum heif_chroma
416
+ {
417
+ heif_chroma_undefined = 99,
418
+ heif_chroma_monochrome = 0,
419
+ heif_chroma_420 = 1,
420
+ heif_chroma_422 = 2,
421
+ heif_chroma_444 = 3,
422
+ heif_chroma_interleaved_RGB = 10,
423
+ heif_chroma_interleaved_RGBA = 11,
424
+ heif_chroma_interleaved_RRGGBB_BE = 12, // HDR, big endian.
425
+ heif_chroma_interleaved_RRGGBBAA_BE = 13, // HDR, big endian.
426
+ heif_chroma_interleaved_RRGGBB_LE = 14, // HDR, little endian.
427
+ heif_chroma_interleaved_RRGGBBAA_LE = 15 // HDR, little endian.
428
+ };
429
+
430
+ // DEPRECATED ENUM NAMES
431
+ #define heif_chroma_interleaved_24bit heif_chroma_interleaved_RGB
432
+ #define heif_chroma_interleaved_32bit heif_chroma_interleaved_RGBA
433
+
434
+
435
+ enum heif_colorspace
436
+ {
437
+ heif_colorspace_undefined = 99,
438
+
439
+ // heif_colorspace_YCbCr should be used with one of these heif_chroma values:
440
+ // * heif_chroma_444
441
+ // * heif_chroma_422
442
+ // * heif_chroma_420
443
+ heif_colorspace_YCbCr = 0,
444
+
445
+ // heif_colorspace_RGB should be used with one of these heif_chroma values:
446
+ // * heif_chroma_444 (for planar RGB)
447
+ // * heif_chroma_interleaved_RGB
448
+ // * heif_chroma_interleaved_RGBA
449
+ // * heif_chroma_interleaved_RRGGBB_BE
450
+ // * heif_chroma_interleaved_RRGGBBAA_BE
451
+ // * heif_chroma_interleaved_RRGGBB_LE
452
+ // * heif_chroma_interleaved_RRGGBBAA_LE
453
+ heif_colorspace_RGB = 1,
454
+
455
+ // heif_colorspace_monochrome should only be used with heif_chroma = heif_chroma_monochrome
456
+ heif_colorspace_monochrome = 2
457
+ };
458
+
459
+ enum heif_channel
460
+ {
461
+ heif_channel_Y = 0,
462
+ heif_channel_Cb = 1,
463
+ heif_channel_Cr = 2,
464
+ heif_channel_R = 3,
465
+ heif_channel_G = 4,
466
+ heif_channel_B = 5,
467
+ heif_channel_Alpha = 6,
468
+ heif_channel_interleaved = 10
469
+ };
470
+
471
+
472
+ // ========================= library initialization ======================
335
473
 
336
474
  struct heif_init_params
337
475
  {
@@ -341,12 +479,26 @@ struct heif_init_params
341
479
  };
342
480
 
343
481
 
482
+ // You should call heif_init() when you start using libheif and heif_deinit() when you are finished.
483
+ // These calls are reference counted. Each call to heif_init() should be matched by one call to heif_deinit().
484
+ //
485
+ // For backwards compatibility, it is not really necessary to call heif_init(), but some library memory objects
486
+ // will never be freed if you do not call heif_init()/heif_deinit().
487
+ //
488
+ // heif_init() will load the external modules installed in the default plugin path. Thus, you need it when you
489
+ // want to load external plugins from the default path.
490
+ // Codec plugins that are compiled into the library directly (selected by the compile-time parameters of libheif)
491
+ // will be available even without heif_init().
492
+ //
493
+ // Make sure that you don't have one part of your program use heif_init()/heif_deinit() and another part that doesn't
494
+ // use it as the latter may try to use an uninitialized library. If in doubt, enclose everything with init/deinit.
495
+
344
496
  // You may pass nullptr to get default parameters. Currently, no parameters are supported.
345
497
  LIBHEIF_API
346
498
  struct heif_error heif_init(struct heif_init_params*);
347
499
 
348
500
  LIBHEIF_API
349
- void heif_deinit();
501
+ void heif_deinit(void);
350
502
 
351
503
 
352
504
  // --- Plugins are currently only supported on Unix platforms.
@@ -377,6 +529,15 @@ struct heif_error heif_load_plugins(const char* directory,
377
529
  LIBHEIF_API
378
530
  struct heif_error heif_unload_plugin(const struct heif_plugin_info* plugin);
379
531
 
532
+ // Get a NULL terminated array of the plugin directories that are searched by libheif.
533
+ // This includes the paths specified in the environment variable LIBHEIF_PLUGIN_PATHS and the built-in path
534
+ // (if not overridden by the environment variable).
535
+ LIBHEIF_API
536
+ const char*const* heif_get_plugin_directories(void);
537
+
538
+ LIBHEIF_API
539
+ void heif_free_plugin_directories(const char*const*);
540
+
380
541
 
381
542
  // ========================= file type check ======================
382
543
 
@@ -415,6 +576,8 @@ enum heif_brand
415
576
  heif_vvis, // VVC sequence
416
577
  heif_evbi, // EVC image
417
578
  heif_evbs, // EVC sequence
579
+ heif_j2ki, // JPEG2000 image
580
+ heif_j2is, // JPEG2000 image sequence
418
581
  };
419
582
 
420
583
  // input data should be at least 12 bytes
@@ -425,24 +588,210 @@ enum heif_brand heif_main_brand(const uint8_t* data, int len);
425
588
 
426
589
  typedef uint32_t heif_brand2;
427
590
 
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)
591
+ /**
592
+ * HEVC image (`heic`) brand.
593
+ *
594
+ * Image conforms to HEVC (H.265) Main or Main Still profile.
595
+ *
596
+ * See ISO/IEC 23008-12:2022 Section B.4.1.
597
+ */
598
+ #define heif_brand2_heic heif_fourcc('h','e','i','c')
599
+
600
+ /**
601
+ * HEVC image (`heix`) brand.
602
+ *
603
+ * Image conforms to HEVC (H.265) Main 10 profile.
604
+ *
605
+ * See ISO/IEC 23008-12:2022 Section B.4.1.
606
+ */
607
+ #define heif_brand2_heix heif_fourcc('h','e','i','x')
608
+
609
+ /**
610
+ * HEVC image sequence (`hevc`) brand.
611
+ *
612
+ * Image sequence conforms to HEVC (H.265) Main profile.
613
+ *
614
+ * See ISO/IEC 23008-12:2022 Section B.4.2.
615
+ */
616
+ #define heif_brand2_hevc heif_fourcc('h','e','v','c')
617
+
618
+ /**
619
+ * HEVC image sequence (`hevx`) brand.
620
+ *
621
+ * Image sequence conforms to HEVC (H.265) Main 10 profile.
622
+ *
623
+ * See ISO/IEC 23008-12:2022 Section B.4.2.
624
+ */
625
+ #define heif_brand2_hevx heif_fourcc('h','e','v','x')
626
+
627
+ /**
628
+ * HEVC layered image (`heim`) brand.
629
+ *
630
+ * Image layers conform to HEVC (H.265) Main or Multiview Main profile.
631
+ *
632
+ * See ISO/IEC 23008-12:2022 Section B.4.3.
633
+ */
634
+ #define heif_brand2_heim heif_fourcc('h','e','i','m')
635
+
636
+ /**
637
+ * HEVC layered image (`heis`) brand.
638
+ *
639
+ * Image layers conform to HEVC (H.265) Main, Main 10, Scalable Main
640
+ * or Scalable Main 10 profile.
641
+ *
642
+ * See ISO/IEC 23008-12:2022 Section B.4.3.
643
+ */
644
+ #define heif_brand2_heis heif_fourcc('h','e','i','s')
645
+
646
+ /**
647
+ * HEVC layered image sequence (`hevm`) brand.
648
+ *
649
+ * Image sequence layers conform to HEVC (H.265) Main or Multiview Main profile.
650
+ *
651
+ * See ISO/IEC 23008-12:2022 Section B.4.4.
652
+ */
653
+ #define heif_brand2_hevm heif_fourcc('h','e','v','m')
654
+
655
+ /**
656
+ * HEVC layered image sequence (`hevs`) brand.
657
+ *
658
+ * Image sequence layers conform to HEVC (H.265) Main, Main 10, Scalable Main
659
+ * or Scalable Main 10 profile.
660
+ *
661
+ * See ISO/IEC 23008-12:2022 Section B.4.4.
662
+ */
663
+ #define heif_brand2_hevs heif_fourcc('h','e','v','s')
664
+
665
+ /**
666
+ * AV1 image (`avif`) brand.
667
+ *
668
+ * See https://aomediacodec.github.io/av1-avif/#image-and-image-collection-brand
669
+ */
670
+ #define heif_brand2_avif heif_fourcc('a','v','i','f')
671
+
672
+ /**
673
+ * AV1 image sequence (`avis`) brand.
674
+ *
675
+ * See https://aomediacodec.github.io/av1-avif/#image-sequence-brand
676
+ */
437
677
  #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
678
 
679
+ /**
680
+ * HEIF image structural brand (`mif1`).
681
+ *
682
+ * This does not imply a specific coding algorithm.
683
+ *
684
+ * See ISO/IEC 23008-12:2022 Section 10.2.2.
685
+ */
686
+ #define heif_brand2_mif1 heif_fourcc('m','i','f','1')
687
+
688
+ /**
689
+ * HEIF image structural brand (`mif2`).
690
+ *
691
+ * This does not imply a specific coding algorithm. `mif2` extends
692
+ * the requirements of `mif1` to include the `rref` and `iscl` item
693
+ * properties.
694
+ *
695
+ * See ISO/IEC 23008-12:2022 Section 10.2.3.
696
+ */
697
+ #define heif_brand2_mif2 heif_fourcc('m','i','f','2')
698
+
699
+ /**
700
+ * HEIF image sequence structural brand (`msf1`).
701
+ *
702
+ * This does not imply a specific coding algorithm.
703
+ *
704
+ * See ISO/IEC 23008-12:2022 Section 10.3.1.
705
+ */
706
+ #define heif_brand2_msf1 heif_fourcc('m','s','f','1')
707
+
708
+ /**
709
+ * VVC image (`vvic`) brand.
710
+ *
711
+ * See ISO/IEC 23008-12:2022 Section L.4.1.
712
+ */
713
+ #define heif_brand2_vvic heif_fourcc('v','v','i','c')
714
+
715
+ /**
716
+ * VVC image sequence (`vvis`) brand.
717
+ *
718
+ * See ISO/IEC 23008-12:2022 Section L.4.2.
719
+ */
720
+ #define heif_brand2_vvis heif_fourcc('v','v','i','s')
721
+
722
+ /**
723
+ * EVC baseline image (`evbi`) brand.
724
+ *
725
+ * See ISO/IEC 23008-12:2022 Section M.4.1.
726
+ */
727
+ #define heif_brand2_evbi heif_fourcc('e','v','b','i')
728
+
729
+ /**
730
+ * EVC main profile image (`evmi`) brand.
731
+ *
732
+ * See ISO/IEC 23008-12:2022 Section M.4.2.
733
+ */
734
+ #define heif_brand2_evmi heif_fourcc('e','v','m','i')
735
+
736
+ /**
737
+ * EVC baseline image sequence (`evbs`) brand.
738
+ *
739
+ * See ISO/IEC 23008-12:2022 Section M.4.3.
740
+ */
741
+ #define heif_brand2_evbs heif_fourcc('e','v','b','s')
742
+
743
+ /**
744
+ * EVC main profile image sequence (`evms`) brand.
745
+ *
746
+ * See ISO/IEC 23008-12:2022 Section M.4.4.
747
+ */
748
+ #define heif_brand2_evms heif_fourcc('e','v','m','s')
749
+
750
+ /**
751
+ * JPEG image (`jpeg`) brand.
752
+ *
753
+ * See ISO/IEC 23008-12:2022 Annex H.4
754
+ */
755
+ #define heif_brand2_jpeg heif_fourcc('j','p','e','g')
756
+
757
+ /**
758
+ * JPEG image sequence (`jpgs`) brand.
759
+ *
760
+ * See ISO/IEC 23008-12:2022 Annex H.5
761
+ */
762
+ #define heif_brand2_jpgs heif_fourcc('j','p','g','s')
763
+
764
+ /**
765
+ * JPEG 2000 image (`j2ki`) brand.
766
+ *
767
+ * See ISO/IEC 15444-16:2021 Section 6.5
768
+ */
769
+ #define heif_brand2_j2ki heif_fourcc('j','2','k','i')
770
+
771
+ /**
772
+ * JPEG 2000 image sequence (`j2is`) brand.
773
+ *
774
+ * See ISO/IEC 15444-16:2021 Section 7.6
775
+ */
776
+ #define heif_brand2_j2is heif_fourcc('j','2','i','s')
777
+
778
+ /**
779
+ * Multi-image application format (MIAF) brand.
780
+ *
781
+ * This is HEIF with additional constraints for interoperability.
782
+ *
783
+ * See ISO/IEC 23000-22.
784
+ */
785
+ #define heif_brand2_miaf heif_fourcc('m','i','a','f')
786
+
787
+ /**
788
+ * Single picture file brand.
789
+ *
790
+ * This is a compatible brand indicating the file contains a single intra-coded picture.
791
+ *
792
+ * See ISO/IEC 23008-12:2022 Section 10.2.5.
793
+ */
794
+ #define heif_brand2_1pic heif_fourcc('1','p','i','c')
446
795
 
447
796
  // input data should be at least 12 bytes
448
797
  LIBHEIF_API
@@ -527,7 +876,7 @@ struct heif_reader
527
876
  // --- version 1 functions ---
528
877
  int64_t (* get_position)(void* userdata);
529
878
 
530
- // The functions read(), and seek() return 0 on success.
879
+ // The functions read(), and seek() return heif_error_ok on success.
531
880
  // Generally, libheif will make sure that we do not read past the file size.
532
881
  int (* read)(void* data,
533
882
  size_t size,
@@ -600,7 +949,7 @@ LIBHEIF_API
600
949
  struct heif_error heif_context_get_primary_image_handle(struct heif_context* ctx,
601
950
  struct heif_image_handle**);
602
951
 
603
- // Get the handle for a specific top-level image from an image ID.
952
+ // Get the image handle for a known image ID.
604
953
  LIBHEIF_API
605
954
  struct heif_error heif_context_get_image_handle(struct heif_context* ctx,
606
955
  heif_item_id id,
@@ -667,6 +1016,15 @@ int heif_image_handle_get_luma_bits_per_pixel(const struct heif_image_handle*);
667
1016
  LIBHEIF_API
668
1017
  int heif_image_handle_get_chroma_bits_per_pixel(const struct heif_image_handle*);
669
1018
 
1019
+ // Return the colorspace that libheif proposes to use for decoding.
1020
+ // Usually, these will be either YCbCr or Monochrome, but it may also propose RGB for images
1021
+ // encoded with matrix_coefficients=0.
1022
+ // It may also return *_undefined if the file misses relevant information to determine this without decoding.
1023
+ LIBHEIF_API
1024
+ struct heif_error heif_image_handle_get_preferred_decoding_colorspace(const struct heif_image_handle* image_handle,
1025
+ enum heif_colorspace* out_colorspace,
1026
+ enum heif_chroma* out_chroma);
1027
+
670
1028
  // Get the image width from the 'ispe' box. This is the original image size without
671
1029
  // any transformations applied to it. Do not use this unless you know exactly what
672
1030
  // you are doing.
@@ -676,6 +1034,17 @@ int heif_image_handle_get_ispe_width(const struct heif_image_handle* handle);
676
1034
  LIBHEIF_API
677
1035
  int heif_image_handle_get_ispe_height(const struct heif_image_handle* handle);
678
1036
 
1037
+ // This gets the context associated with the image handle.
1038
+ // Note that you have to release the returned context with heif_context_free() in any case.
1039
+ //
1040
+ // This means: when you have several image-handles that originate from the same file and you get the
1041
+ // context of each of them, the returned pointer may be different even though it refers to the same
1042
+ // logical context. You have to call heif_context_free() on all those context pointers.
1043
+ // After you freed a context pointer, you can still use the context through a different pointer that you
1044
+ // might have acquired from elsewhere.
1045
+ LIBHEIF_API
1046
+ struct heif_context* heif_image_handle_get_context(const struct heif_image_handle* handle);
1047
+
679
1048
 
680
1049
  // ------------------------- depth images -------------------------
681
1050
 
@@ -840,6 +1209,10 @@ struct heif_error heif_image_handle_get_metadata(const struct heif_image_handle*
840
1209
  heif_item_id metadata_id,
841
1210
  void* out_data);
842
1211
 
1212
+ // Only valid for item type == "uri ", an absolute URI
1213
+ LIBHEIF_API
1214
+ const char* heif_image_handle_get_metadata_item_uri_type(const struct heif_image_handle* handle,
1215
+ heif_item_id metadata_id);
843
1216
 
844
1217
  // ------------------------- color profiles -------------------------
845
1218
 
@@ -963,7 +1336,7 @@ struct heif_error heif_image_handle_get_nclx_color_profile(const struct heif_ima
963
1336
  // Do not fill values for higher versions as these might be outside the allocated structure size.
964
1337
  // May return NULL.
965
1338
  LIBHEIF_API
966
- struct heif_color_profile_nclx* heif_nclx_color_profile_alloc();
1339
+ struct heif_color_profile_nclx* heif_nclx_color_profile_alloc(void);
967
1340
 
968
1341
  LIBHEIF_API
969
1342
  void heif_nclx_color_profile_free(struct heif_color_profile_nclx* nclx_profile);
@@ -984,109 +1357,6 @@ struct heif_error heif_image_get_nclx_color_profile(const struct heif_image* ima
984
1357
  struct heif_color_profile_nclx** out_data);
985
1358
 
986
1359
 
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
1360
  // ========================= heif_image =========================
1091
1361
 
1092
1362
  // An heif_image contains a decoded pixel image in various colorspaces, chroma formats,
@@ -1098,76 +1368,6 @@ void heif_item_get_property_transform_crop_borders(const struct heif_context* co
1098
1368
 
1099
1369
  // Planar RGB images are specified as heif_colorspace_RGB / heif_chroma_444.
1100
1370
 
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
1371
  enum heif_progress_step
1172
1372
  {
1173
1373
  heif_progress_step_total = 0,
@@ -1200,7 +1400,12 @@ struct heif_color_conversion_options
1200
1400
  enum heif_chroma_downsampling_algorithm preferred_chroma_downsampling_algorithm;
1201
1401
  enum heif_chroma_upsampling_algorithm preferred_chroma_upsampling_algorithm;
1202
1402
 
1203
- // When set to 'false', libheif may also use a different algorithm if the preferred one is not available.
1403
+ // When set to 'false' libheif may also use a different algorithm if the preferred one is not available
1404
+ // or using a different algorithm is computationally less complex. Note that currently (v1.17.0) this
1405
+ // means that for RGB input it will usually choose nearest-neighbor sampling because this is computationally
1406
+ // the simplest.
1407
+ // Set this field to 'true' if you want to make sure that the specified algorithm is used even
1408
+ // at the cost of slightly higher computation times.
1204
1409
  uint8_t only_use_preferred_chroma_algorithm;
1205
1410
  };
1206
1411
 
@@ -1251,7 +1456,7 @@ struct heif_decoding_options
1251
1456
  // Note: you should always get the decoding options through this function since the
1252
1457
  // option structure may grow in size in future versions.
1253
1458
  LIBHEIF_API
1254
- struct heif_decoding_options* heif_decoding_options_alloc();
1459
+ struct heif_decoding_options* heif_decoding_options_alloc(void);
1255
1460
 
1256
1461
  LIBHEIF_API
1257
1462
  void heif_decoding_options_free(struct heif_decoding_options*);
@@ -1278,22 +1483,47 @@ enum heif_colorspace heif_image_get_colorspace(const struct heif_image*);
1278
1483
  LIBHEIF_API
1279
1484
  enum heif_chroma heif_image_get_chroma_format(const struct heif_image*);
1280
1485
 
1281
- // Get width of the given image channel in pixels. Returns -1 if a non-existing
1282
- // channel was given.
1486
+ /**
1487
+ * Get the width of a specified image channel.
1488
+ *
1489
+ * @param img the image to get the width for
1490
+ * @param channel the channel to select
1491
+ * @return the width of the channel in pixels, or -1 the channel does not exist in the image
1492
+ */
1283
1493
  LIBHEIF_API
1284
- int heif_image_get_width(const struct heif_image*, enum heif_channel channel);
1494
+ int heif_image_get_width(const struct heif_image* img, enum heif_channel channel);
1285
1495
 
1286
- // Get height of the given image channel in pixels. Returns -1 if a non-existing
1287
- // channel was given.
1496
+ /**
1497
+ * Get the height of a specified image channel.
1498
+ *
1499
+ * @param img the image to get the height for
1500
+ * @param channel the channel to select
1501
+ * @return the height of the channel in pixels, or -1 the channel does not exist in the image
1502
+ */
1288
1503
  LIBHEIF_API
1289
- int heif_image_get_height(const struct heif_image*, enum heif_channel channel);
1504
+ int heif_image_get_height(const struct heif_image* img, enum heif_channel channel);
1290
1505
 
1291
- // Get the width of the main channel (Y in YCbCr, or any in RGB).
1506
+ /**
1507
+ * Get the width of the main channel.
1508
+ *
1509
+ * This is the Y channel in YCbCr or mono, or any in RGB.
1510
+ *
1511
+ * @param img the image to get the primary width for
1512
+ * @return the width in pixels
1513
+ */
1292
1514
  LIBHEIF_API
1293
- int heif_image_get_primary_width(const struct heif_image*);
1515
+ int heif_image_get_primary_width(const struct heif_image* img);
1294
1516
 
1517
+ /**
1518
+ * Get the height 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 height for
1523
+ * @return the height in pixels
1524
+ */
1295
1525
  LIBHEIF_API
1296
- int heif_image_get_primary_height(const struct heif_image*);
1526
+ int heif_image_get_primary_height(const struct heif_image* img);
1297
1527
 
1298
1528
  LIBHEIF_API
1299
1529
  struct heif_error heif_image_crop(struct heif_image* img,
@@ -1778,7 +2008,7 @@ struct heif_encoding_options
1778
2008
  };
1779
2009
 
1780
2010
  LIBHEIF_API
1781
- struct heif_encoding_options* heif_encoding_options_alloc();
2011
+ struct heif_encoding_options* heif_encoding_options_alloc(void);
1782
2012
 
1783
2013
  LIBHEIF_API
1784
2014
  void heif_encoding_options_free(struct heif_encoding_options*);
@@ -1921,170 +2151,6 @@ LIBHEIF_API
1921
2151
  int heif_encoder_descriptor_supportes_lossless_compression(const struct heif_encoder_descriptor*);
1922
2152
 
1923
2153
 
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
2154
  #ifdef __cplusplus
2089
2155
  }
2090
2156
  #endif