digiKam
heif.h
Go to the documentation of this file.
1 /*
2  * HEIF codec.
3  * Copyright (c) 2017 struktur AG, Dirk Farin <farin@struktur.de>
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_H
22 #define LIBHEIF_HEIF_H
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 #include <stddef.h>
29 #include <stdint.h>
30 
31 #include <libheif/heif_version.h>
32 
33 
34 // API versions table
35 //
36 // release depth.rep dec.options enc.options heif_reader heif_writer col.profile
37 // -----------------------------------------------------------------------------------------
38 // 1.0 1 1 N/A N/A N/A N/A
39 // 1.1 1 1 N/A N/A 1 N/A
40 // 1.3 1 1 1 1 1 N/A
41 // 1.4 1 1 1 1 1 1
42 
43 /*
44 #if defined(_MSC_VER) && !defined(LIBHEIF_STATIC_BUILD)
45  #ifdef LIBHEIF_EXPORTS
46  #define LIBHEIF_API __declspec(dllexport)
47  #else
48  #define LIBHEIF_API __declspec(dllimport)
49  #endif
50 #elif defined(HAVE_VISIBILITY) && HAVE_VISIBILITY
51  #ifdef LIBHEIF_EXPORTS
52  #define LIBHEIF_API __attribute__((__visibility__("default")))
53  #else
54  #define LIBHEIF_API
55  #endif
56 #else
57  #define LIBHEIF_API
58 #endif
59 */
60 
61 #include "digikam_export.h"
62 
63 #define LIBHEIF_API DIGIKAM_EXPORT
64 
65 #define heif_fourcc(a,b,c,d) ((a<<24) | (b<<16) | (c<<8) | d)
66 
67 
68 /* === version numbers === */
69 
70 // Version string of linked libheif library.
71 LIBHEIF_API const char *heif_get_version(void);
72 // Numeric version of linked libheif library, encoded as 0xHHMMLL00 = HH.MM.LL.
74 
75 // Numeric part "HH" from above.
77 // Numeric part "MM" from above.
79 // Numeric part "LL" from above.
81 
82 // Helper macros to check for given versions of libheif at compile time.
83 #define LIBHEIF_MAKE_VERSION(h, m, l) ((h) << 24 | (m) << 16 | (l) << 8)
84 #define LIBHEIF_HAVE_VERSION(h, m, l) (LIBHEIF_NUMERIC_VERSION >= LIBHEIF_MAKE_VERSION(h, m, l))
85 
86 struct heif_context;
87 struct heif_image_handle;
88 struct heif_image;
89 
90 
92  // Everything ok, no error occurred.
94 
95  // Input file does not exist.
97 
98  // Error in input file. Corrupted or invalid content.
100 
101  // Input file type is not supported.
103 
104  // Image requires an unsupported decoder feature.
106 
107  // Library API has been used in an invalid way.
109 
110  // Could not allocate enough memory.
112 
113  // The decoder plugin generated an error
115 
116  // The encoder plugin generated an error
118 
119  // Error during encoding or when writing to the output
121 };
122 
123 
125  // no further information available
127 
128  // --- Invalid_input ---
129 
130  // End of data reached unexpectedly.
132 
133  // Size of box (defined in header) is wrong
135 
136  // Mandatory 'ftyp' box is missing
138 
140 
142 
144 
146 
148 
150 
152 
154 
156 
158 
160 
162 
163  // An item property referenced in the 'ipma' box is not existing in the 'ipco' container.
165 
166  // No properties have been assigned to an item.
168 
169  // Image has no (compressed) data
171 
172  // Invalid specification of image grid (tiled image)
174 
175  // Tile-images in a grid image are missing
177 
179 
180  // Invalid specification of overlay image
182 
183  // Overlay image completely outside of visible canvas area
185 
187 
189 
191 
193 
195 
197 
199 
201 
202 
203  // --- Memory_allocation_error ---
204 
205  // A security limit preventing unreasonable memory allocations was exceeded by the input file.
206  // Please check whether the file is valid. If it is, contact us so that we could increase the
207  // security limits further.
209 
210 
211  // --- Usage_error ---
212 
213  // An item ID was used that is not present in the file.
214  heif_suberror_Nonexisting_item_referenced = 2000, // also used for Invalid_input
215 
216  // An API argument was given a NULL pointer, which is not allowed for that function.
218 
219  // Image channel referenced that does not exist in the image
221 
222  // The version of the passed plugin is not supported.
224 
225  // The version of the passed writer is not supported.
227 
228  // The given (encoder) parameter name does not exist.
230 
231  // The value for the given parameter is not in the valid range.
233 
234 
235  // --- Unsupported_feature ---
236 
237  // Image was coded with an unsupported compression method.
239 
240  // Image is specified in an unknown way, e.g. as tiled grid image (which is supported)
242 
244 
245  // The conversion of the source image to the requested chroma / colorspace is not supported.
247 
249 
250 
251  // --- Encoder_plugin_error ---
252 
254 
255 
256  // --- Encoding_error ---
257 
259 };
260 
261 
262 
264 {
265  // main error category
266  enum heif_error_code code;
267 
268  // more detailed error code
270 
271  // textual error message (is always defined, you do not have to check for NULL)
272  const char* message;
273 };
274 
275 
276 typedef uint32_t heif_item_id;
277 
278 
279 
280 // ========================= file type check ======================
281 
284  heif_filetype_yes_supported, // it is heif and can be read by libheif
285  heif_filetype_yes_unsupported, // it is heif, but cannot be read by libheif
286  heif_filetype_maybe // not sure whether it is an heif, try detection with more input data
287 };
288 
289 // input data should be at least 12 bytes
291 enum heif_filetype_result heif_check_filetype(const uint8_t* data, int len);
292 
293 
296  heif_heic, // the usual HEIF images
297  heif_heix, // 10bit images, or anything that uses h265 with range extension
298  heif_hevc, heif_hevx, // brands for image sequences
299  heif_heim, // multiview
300  heif_heis, // scalable
301  heif_hevm, // multiview sequence
302  heif_hevs, // scalable sequence
303  heif_mif1, // image, any coding algorithm
304  heif_msf1 // sequence, any coding algorithm
305 };
306 
307 // input data should be at least 12 bytes
309 enum heif_brand heif_main_brand(const uint8_t* data, int len);
310 
311 
312 // Returns one of these MIME types:
313 // - image/heic HEIF file using h265 compression
314 // - image/heif HEIF file using any other compression
315 // - image/heic-sequence HEIF image sequence using h265 compression
316 // - image/heif-sequence HEIF image sequence using any other compression
317 // - image/jpeg JPEG image
318 // - image/png PNG image
319 // If the format could not be detected, an empty string is returned.
320 //
321 // Provide at least 12 bytes of input. With less input, its format might not
322 // be detected. You may also provide more input to increase detection accuracy.
323 //
324 // Note that JPEG and PNG images cannot be decoded by libheif even though the
325 // formats are detected by this function.
327 const char* heif_get_file_mime_type(const uint8_t* data, int len);
328 
329 
330 
331 // ========================= heif_context =========================
332 // A heif_context represents a HEIF file that has been read.
333 // In the future, you will also be able to add pictures to a heif_context
334 // and write it into a file again.
335 
336 
337 // Allocate a new context for reading HEIF files.
338 // Has to be freed again with heif_context_free().
341 
342 // Free a previously allocated HEIF context. You should not free a context twice.
345 
346 
347 struct heif_reading_options;
348 
350  heif_reader_grow_status_size_reached, // requested size has been reached, we can read until this point
351  heif_reader_grow_status_timeout, // size has not been reached yet, but it may still grow further
352  heif_reader_grow_status_size_beyond_eof // size has not been reached and never will. The file has grown to its full size
353 };
354 
355 struct heif_reader {
356  // API version supported by this reader
358 
359  // --- version 1 functions ---
360  int64_t (*get_position)(void* userdata);
361 
362  // The functions read(), and seek() return 0 on success.
363  // Generally, libheif will make sure that we do not read past the file size.
364  int (*read)(void* data,
365  size_t size,
366  void* userdata);
367  int (*seek)(int64_t position,
368  void* userdata);
369 
370  // When calling this function, libheif wants to make sure that it can read the file
371  // up to 'target_size'. This is useful when the file is currently downloaded and may
372  // grow with time. You may, for example, extract the image sizes even before the actual
373  // compressed image data has been completely downloaded.
374  //
375  // Even if your input files will not grow, you will have to implement at least
376  // detection whether the target_size is above the (fixed) file length
377  // (in this case, return 'size_beyond_eof').
378  enum heif_reader_grow_status (*wait_for_file_size)(int64_t target_size, void* userdata);
379 };
380 
381 
382 // Read a HEIF file from a named disk file.
383 // The heif_reading_options should currently be set to NULL.
385 struct heif_error heif_context_read_from_file(struct heif_context*, const char* filename,
386  const struct heif_reading_options*);
387 
388 // Read a HEIF file stored completely in memory.
389 // The heif_reading_options should currently be set to NULL.
390 // DEPRECATED: use heif_context_read_from_memory_without_copy() instead.
393  const void* mem, size_t size,
394  const struct heif_reading_options*);
395 
396 // Same as heif_context_read_from_memory() except that the provided memory is not copied.
397 // That means, you will have to keep the memory area alive as long as you use the heif_context.
400  const void* mem, size_t size,
401  const struct heif_reading_options*);
402 
405  const struct heif_reader* reader,
406  void* userdata,
407  const struct heif_reading_options*);
408 
409 // Number of top-level images in the HEIF file. This does not include the thumbnails or the
410 // tile images that are composed to an image grid. You can get access to the thumbnails via
411 // the main image handle.
414 
417 
418 // Fills in image IDs into the user-supplied int-array 'ID_array', preallocated with 'count' entries.
419 // Function returns the total number of IDs filled into the array.
422  heif_item_id* ID_array,
423  int count);
424 
427 
428 // Get a handle to the primary image of the HEIF file.
429 // This is the image that should be displayed primarily when there are several images in the file.
432  struct heif_image_handle**);
433 
434 // Get the handle for a specific top-level image from an image ID.
437  heif_item_id id,
438  struct heif_image_handle**);
439 
440 // Print information about the boxes of a HEIF file to file descriptor.
441 // This is for debugging and informational purposes only. You should not rely on
442 // the output having a specific format. At best, you should not use this at all.
445 
446 
448 void heif_context_set_maximum_image_size_limit(struct heif_context* ctx, int maximum_width);
449 
450 
451 // ========================= heif_image_handle =========================
452 
453 // An heif_image_handle is a handle to a logical image in the HEIF file.
454 // To get the actual pixel data, you have to decode the handle to an heif_image.
455 // An heif_image_handle also gives you access to the thumbnails and Exif data
456 // associated with an image.
457 
458 // Once you obtained an heif_image_handle, you can already release the heif_context,
459 // since it is internally ref-counted.
460 
461 // Release image handle.
464 
465 // Check whether the given image_handle is the primary image of the file.
468 
469 // Get the resolution of an image.
472 
475 
478 
481 
484 
485 // Get the image width from the 'ispe' box. This is the original image size without
486 // any transformations applied to it. Do not use this unless you know exactly what
487 // you are doing.
490 
493 
494 
495 // ------------------------- depth images -------------------------
496 
499 
502 
505  heif_item_id* ids, int count);
506 
509  heif_item_id depth_image_id,
510  struct heif_image_handle** out_depth_handle);
511 
512 
518 };
519 
521  uint8_t version;
522 
523  // version 1 fields
524 
525  uint8_t has_z_near;
526  uint8_t has_z_far;
527  uint8_t has_d_min;
528  uint8_t has_d_max;
529 
530  double z_near;
531  double z_far;
532  double d_min;
533  double d_max;
534 
537 
540 
541  // version 2 fields below
542 };
543 
544 
547 
548 // Returns true when there is depth_representation_info available
551  heif_item_id depth_image_id,
552  const struct heif_depth_representation_info** out);
553 
554 
555 
556 // ------------------------- thumbnails -------------------------
557 
558 // List the number of thumbnails assigned to this image handle. Usually 0 or 1.
561 
564  heif_item_id* ids, int count);
565 
566 // Get the image handle of a thumbnail image.
568 struct heif_error heif_image_handle_get_thumbnail(const struct heif_image_handle* main_image_handle,
569  heif_item_id thumbnail_id,
570  struct heif_image_handle** out_thumbnail_handle);
571 
572 
573 // ------------------------- metadata (Exif / XMP) -------------------------
574 
575 // How many metadata blocks are attached to an image. Usually, the only metadata is
576 // an "Exif" block.
579  const char* type_filter);
580 
581 // 'type_filter' can be used to get only metadata of specific types, like "Exif".
582 // If 'type_filter' is NULL, it will return all types of metadata IDs.
585  const char* type_filter,
586  heif_item_id* ids, int count);
587 
588 // Return a string indicating the type of the metadata, as specified in the HEIF file.
589 // Exif data will have the type string "Exif".
590 // This string will be valid until the next call to a libheif function.
591 // You do not have to free this string.
594  heif_item_id metadata_id);
595 
598  heif_item_id metadata_id);
599 
600 // Get the size of the raw metadata, as stored in the HEIF file.
603  heif_item_id metadata_id);
604 
605 // 'out_data' must point to a memory area of the size reported by heif_image_handle_get_metadata_size().
606 // The data is returned exactly as stored in the HEIF file.
607 // For Exif data, you probably have to skip the first four bytes of the data, since they
608 // indicate the offset to the start of the TIFF header of the Exif data.
611  heif_item_id metadata_id,
612  void* out_data);
613 
618  heif_color_profile_type_prof = heif_fourcc('p','r','o','f')
619 };
620 
621 
622 // Returns 'heif_color_profile_type_not_present' if there is no color profile.
625 
628 
631  void* out_data);
632 
633 
635  heif_color_primaries_ITU_R_BT_709_5 = 1, // g=0.3;0.6, b=0.15;0.06, r=0.64;0.33, w=0.3127,0.3290
641 };
642 
654 };
655 
665 };
666 
668  // version 1 fields
669 
670  uint8_t version;
671 
676 
677  // --- decoded values (not used when saving nclx)
678 
683 };
684 
687  struct heif_color_profile_nclx** out_data);
688 
689 
692 
695 
697 struct heif_error heif_image_get_raw_color_profile(const struct heif_image* image,
698  void* out_data);
699 
701 struct heif_error heif_image_get_nclx_color_profile(const struct heif_image* image,
702  struct heif_color_profile_nclx** out_data);
703 
704 
705 
706 // ========================= heif_image =========================
707 
708 // An heif_image contains a decoded pixel image in various colorspaces, chroma formats,
709 // and bit depths.
710 
711 // Note: when converting images to colorspace_RGB/chroma_interleaved_24bit, the resulting
712 // image contains only a single channel of type channel_interleaved with 3 bytes per pixel,
713 // containing the interleaved R,G,B values.
714 
720 };
721 
734 };
735 
736 // DEPRECATED ENUM NAMES
737 #define heif_chroma_interleaved_24bit heif_chroma_interleaved_RGB
738 #define heif_chroma_interleaved_32bit heif_chroma_interleaved_RGBA
739 
740 
746 };
747 
757 };
758 
759 
763 };
764 
765 
767 {
768  uint8_t version;
769 
770  // version 1 options
771 
772  // Ignore geometric transformations like cropping, rotation, mirroring.
773  // Default: false (do not ignore).
775 
776  void (*start_progress)(enum heif_progress_step step, int max_progress, void* progress_user_data);
777  void (*on_progress)(enum heif_progress_step step, int progress, void* progress_user_data);
780 };
781 
782 
783 // Allocate decoding options and fill with default values.
784 // Note: you should always get the decoding options through this function since the
785 // option structure may grow in size in future versions.
788 
791 
792 // Decode an heif_image_handle into the actual pixel image and also carry out
793 // all geometric transformations specified in the HEIF file (rotation, cropping, mirroring).
794 //
795 // If colorspace or chroma is set to heif_colorspace_undefined or heif_chroma_undefined,
796 // respectively, the original colorspace is taken.
797 // Decoding options may be NULL. If you want to supply options, always use
798 // heif_decoding_options_alloc() to get the structure.
800 struct heif_error heif_decode_image(const struct heif_image_handle* in_handle,
801  struct heif_image** out_img,
802  enum heif_colorspace colorspace,
803  enum heif_chroma chroma,
804  const struct heif_decoding_options* options);
805 
806 // Get the colorspace format of the image.
809 
810 // Get the chroma format of the image.
813 
814 // Get width of the given image channel in pixels. Returns -1 if a non-existing
815 // channel was given.
817 int heif_image_get_width(const struct heif_image*,enum heif_channel channel);
818 
819 // Get height of the given image channel in pixels. Returns -1 if a non-existing
820 // channel was given.
822 int heif_image_get_height(const struct heif_image*,enum heif_channel channel);
823 
824 // Get the number of bits per pixel in the given image channel. Returns -1 if
825 // a non-existing channel was given.
826 // Note that the number of bits per pixel may be different for each color channel.
827 // This function returns the number of bits used for storage of each pixel.
828 // Especially for HDR images, this is probably not what you want. Have a look at
829 // heif_image_get_bits_per_pixel_range() instead.
831 int heif_image_get_bits_per_pixel(const struct heif_image*,enum heif_channel channel);
832 
833 
834 // Get the number of bits per pixel in the given image channel. This function returns
835 // the number of bits used for representing the pixel value, which might be smaller
836 // than the number of bits used in memory.
837 // For example, in 12bit HDR images, this function returns '12', while still 16 bits
838 // are reserved for storage. For interleaved RGBA with 12 bit, this function also returns
839 // '12', not '48' or '64' (heif_image_get_bits_per_pixel returns 64 in this case).
842 
844 int heif_image_has_channel(const struct heif_image*, enum heif_channel channel);
845 
846 // Get a pointer to the actual pixel data.
847 // The 'out_stride' is returned as "bytes per line".
848 // When out_stride is NULL, no value will be written.
849 // Returns NULL if a non-existing channel was given.
851 const uint8_t* heif_image_get_plane_readonly(const struct heif_image*,
852  enum heif_channel channel,
853  int* out_stride);
854 
857  enum heif_channel channel,
858  int* out_stride);
859 
860 
861 struct heif_scaling_options;
862 
863 // Currently, heif_scaling_options is not defined yet. Pass a NULL pointer.
865 struct heif_error heif_image_scale_image(const struct heif_image* input,
866  struct heif_image** output,
867  int width, int height,
868  const struct heif_scaling_options* options);
869 
870 // The color profile is not attached to the image handle because we might need it
871 // for color space transform and encoding.
874  const char* profile_type_fourcc_string,
875  const void* profile_data,
876  const size_t profile_size);
877 
880  const struct heif_color_profile_nclx* color_profile);
881 
882 
883 // TODO: this function does not make any sense yet, since we currently cannot modify existing HEIF files.
884 //LIBHEIF_API
885 //void heif_image_remove_color_profile(struct heif_image* image);
886 
887 // Release heif_image.
889 void heif_image_release(const struct heif_image*);
890 
891 
892 // ====================================================================================================
893 // Encoding API
894 
897  const char* filename);
898 
899 struct heif_writer {
900  // API version supported by this writer
902 
903  // --- version 1 functions ---
904  struct heif_error (*write)(struct heif_context* ctx, // TODO: why do we need this parameter?
905  const void* data,
906  size_t size,
907  void* userdata);
908 };
909 
912  struct heif_writer* writer,
913  void* userdata);
914 
915 
916 // ----- encoder -----
917 
918 // The encoder used for actually encoding an image.
919 struct heif_encoder;
920 
921 // A description of the encoder's capabilities and name.
923 
924 // A configuration parameter of the encoder. Each encoder implementation may have a different
925 // set of parameters. For the most common settings (e.q. quality), special functions to set
926 // the parameters are provided.
928 
929 
930 // Get a list of available encoders. You can filter the encoders by compression format and name.
931 // Use format_filter==heif_compression_undefined and name_filter==NULL as wildcards.
932 // The returned list of encoders is sorted by their priority (which is a plugin property).
933 // Note: to get the actual encoder from the descriptors returned here, use heif_context_get_encoder().
935 int heif_context_get_encoder_descriptors(struct heif_context*, // TODO: why do we need this parameter?
936  enum heif_compression_format format_filter,
937  const char* name_filter,
938  const struct heif_encoder_descriptor** out_encoders,
939  int count);
940 
941 // Return a long, descriptive name of the encoder (including version information).
944 
945 // Return a short, symbolic name for identifying the encoder.
946 // This name should stay constant over different encoder versions.
949 
953 
956 
959 
960 
961 // Get an encoder instance that can be used to actually encode images from a descriptor.
962 // TODO: why do we need the context here? I think we should remove this. You may pass a NULL context.
964 struct heif_error heif_context_get_encoder(struct heif_context* context,
965  const struct heif_encoder_descriptor*,
966  struct heif_encoder** out_encoder);
967 
968 // Quick check whether there is a decoder available for the given format.
969 // Note that the decoder still may not be able to decode all variants of that format.
970 // You will have to query that further (todo) or just try to decode and check the returned error.
973 
974 // Quick check whether there is an enoder available for the given format.
975 // Note that the encoder may be limited to a certain subset of features (e.g. only 8 bit, only lossy).
976 // You will have to query the specific capabilities further.
979 
980 // Get an encoder for the given compression format. If there are several encoder plugins
981 // for this format, the encoder with the highest plugin priority will be returned.
982 // TODO: why do we need the context here? I think we should remove this. You may pass a NULL context.
985  enum heif_compression_format format,
986  struct heif_encoder**);
987 
988 // You have to release the encoder after use.
991 
992 // Get the encoder name from the encoder itself.
994 const char* heif_encoder_get_name(const struct heif_encoder*);
995 
996 
997 // --- Encoder Parameters ---
998 
999 // Libheif supports settings parameters through specialized functions and through
1000 // generic functions by parameter name. Sometimes, the same parameter can be set
1001 // in both ways.
1002 // We consider it best practice to use the generic parameter functions only in
1003 // dynamically generated user interfaces, as no guarantees are made that some specific
1004 // parameter names are supported by all plugins.
1005 
1006 
1007 // Set a 'quality' factor (0-100). How this is mapped to actual encoding parameters is
1008 // encoder dependent.
1010 struct heif_error heif_encoder_set_lossy_quality(struct heif_encoder*, int quality);
1011 
1013 struct heif_error heif_encoder_set_lossless(struct heif_encoder*, int enable);
1014 
1015 // level should be between 0 (= none) to 4 (= full)
1017 struct heif_error heif_encoder_set_logging_level(struct heif_encoder*, int level);
1018 
1019 // Get a generic list of encoder parameters.
1020 // Each encoder may define its own, additional set of parameters.
1021 // You do not have to free the returned list.
1024 
1025 // Return the parameter name.
1028 
1029 
1034 };
1035 
1036 // Return the parameter type.
1039 
1042  int* have_minimum_maximum,
1043  int* minimum, int* maximum);
1044 
1047  const char*const** out_stringarray);
1048 
1049 
1052  const char* parameter_name,
1053  int value);
1054 
1057  const char* parameter_name,
1058  int* value);
1059 
1060 // TODO: name should be changed to heif_encoder_get_valid_integer_parameter_range
1061 LIBHEIF_API // DEPRECATED.
1063  const char* parameter_name,
1064  int* have_minimum_maximum,
1065  int* minimum, int* maximum);
1066 
1069  const char* parameter_name,
1070  int value);
1071 
1074  const char* parameter_name,
1075  int* value);
1076 
1079  const char* parameter_name,
1080  const char* value);
1081 
1084  const char* parameter_name,
1085  char* value, int value_size);
1086 
1087 // returns a NULL-terminated list of valid strings or NULL if all values are allowed
1090  const char* parameter_name,
1091  const char*const** out_stringarray);
1092 
1093 // Set a parameter of any type to the string value.
1094 // Integer values are parsed from the string.
1095 // Boolean values can be "true"/"false"/"1"/"0"
1096 //
1097 // x265 encoder specific note:
1098 // When using the x265 encoder, you may pass any of its parameters by
1099 // prefixing the parameter name with 'x265:'. Hence, to set the 'ctu' parameter,
1100 // you will have to set 'x265:ctu' in libheif.
1101 // Note that there is no checking for valid parameters when using the prefix.
1104  const char* parameter_name,
1105  const char* value);
1106 
1107 // Get the current value of a parameter of any type as a human readable string.
1108 // The returned string is compatible with heif_encoder_set_parameter().
1111  const char* parameter_name,
1112  char* value_ptr, int value_size);
1113 
1114 // Query whether a specific parameter has a default value.
1117  const char* parameter_name);
1118 
1119 
1120 
1122  uint8_t version;
1123 
1124  // version 1 options
1125 
1126  uint8_t save_alpha_channel; // default: true
1127 };
1128 
1131 
1134 
1135 
1136 // Compress the input image.
1137 // Returns a handle to the coded image in 'out_image_handle' unless out_image_handle = NULL.
1138 // 'options' should be NULL for now.
1139 // The first image added to the context is also automatically set the primary image, but
1140 // you can change the primary image later with heif_context_set_primary_image().
1143  const struct heif_image* image,
1144  struct heif_encoder* encoder,
1145  const struct heif_encoding_options* options,
1146  struct heif_image_handle** out_image_handle);
1147 
1150  struct heif_image_handle* image_handle);
1151 
1152 // Encode the 'image' as a scaled down thumbnail image.
1153 // The image is scaled down to fit into a square area of width 'bbox_size'.
1154 // If the input image is already so small that it fits into this bounding box, no thumbnail
1155 // image is encoded and NULL is returned in 'out_thumb_image_handle'.
1156 // No error is returned in this case.
1157 // The encoded thumbnail is automatically assigned to the 'master_image_handle'. Hence, you
1158 // do not have to call heif_context_assign_thumbnail().
1161  const struct heif_image* image,
1162  const struct heif_image_handle* master_image_handle,
1163  struct heif_encoder* encoder,
1164  const struct heif_encoding_options* options,
1165  int bbox_size,
1166  struct heif_image_handle** out_thumb_image_handle);
1167 
1168 // Assign 'thumbnail_image' as the thumbnail image of 'master_image'.
1171  const struct heif_image_handle* master_image,
1172  const struct heif_image_handle* thumbnail_image);
1173 
1174 // Add EXIF metadata to an image.
1177  const struct heif_image_handle* image_handle,
1178  const void* data, int size);
1179 
1180 // Add XMP metadata to an image.
1183  const struct heif_image_handle* image_handle,
1184  const void* data, int size);
1185 
1186 // Add generic, proprietary metadata to an image. You have to specify an 'item_type' that will
1187 // identify your metadata. 'content_type' can be an additional type, or it can be NULL.
1188 // For example, this function can be used to add IPTC metadata (IIM stream, not XMP) to an image.
1189 // Even not standard, we propose to store IPTC data with item type="iptc", content_type=NULL.
1192  const struct heif_image_handle* image_handle,
1193  const void* data, int size,
1194  const char* item_type, const char* content_type);
1195 
1196 // --- heif_image allocation
1197 
1198 // Create a new image of the specified resolution and colorspace.
1199 // Note: no memory for the actual image data is reserved yet. You have to use
1200 // heif_image_add_plane() to add the image planes required by your colorspace/chroma.
1202 struct heif_error heif_image_create(int width, int height,
1203  enum heif_colorspace colorspace,
1204  enum heif_chroma chroma,
1205  struct heif_image** out_image);
1206 
1207 // The indicated bit_depth corresponds to the bit depth per channel.
1208 // I.e. for interleaved formats like RRGGBB, the bit_depth would be, e.g., 10 bit instead
1209 // of 30 bits or 3*16=48 bits.
1210 // For backward compatibility, one can also specify 24bits for RGB and 32bits for RGBA,
1211 // instead of the preferred 8 bits.
1213 struct heif_error heif_image_add_plane(struct heif_image* image,
1214  enum heif_channel channel,
1215  int width, int height, int bit_depth);
1216 
1217 
1218 
1219 
1220 // --- register plugins
1221 
1222 struct heif_decoder_plugin;
1223 struct heif_encoder_plugin;
1224 
1225 // DEPRECATED. Use heif_register_decoder_plugin(const struct heif_decoder_plugin*) instead.
1228 
1231 
1234 
1235 #ifdef __cplusplus
1236 }
1237 #endif
1238 
1239 #endif
Definition: vps.h:51
LIBHEIF_API int heif_context_get_encoder_descriptors(struct heif_context *, enum heif_compression_format format_filter, const char *name_filter, const struct heif_encoder_descriptor **out_encoders, int count)
LIBHEIF_API struct heif_error heif_encoder_set_parameter_string(struct heif_encoder *, const char *parameter_name, const char *value)
LIBHEIF_API int heif_image_handle_get_list_of_depth_image_IDs(const struct heif_image_handle *handle, heif_item_id *ids, int count)
LIBHEIF_API int heif_image_handle_get_ispe_height(const struct heif_image_handle *handle)
LIBHEIF_API void heif_context_set_maximum_image_size_limit(struct heif_context *ctx, int maximum_width)
LIBHEIF_API struct heif_error heif_context_read_from_memory_without_copy(struct heif_context *, const void *mem, size_t size, const struct heif_reading_options *)
LIBHEIF_API struct heif_error heif_image_handle_get_thumbnail(const struct heif_image_handle *main_image_handle, heif_item_id thumbnail_id, struct heif_image_handle **out_thumbnail_handle)
LIBHEIF_API size_t heif_image_handle_get_metadata_size(const struct heif_image_handle *handle, heif_item_id metadata_id)
LIBHEIF_API struct heif_error heif_encoder_parameter_integer_valid_range(struct heif_encoder *, const char *parameter_name, int *have_minimum_maximum, int *minimum, int *maximum)
LIBHEIF_API struct heif_error heif_context_get_primary_image_ID(struct heif_context *ctx, heif_item_id *id)
LIBHEIF_API struct heif_error heif_context_write(struct heif_context *, struct heif_writer *writer, void *userdata)
LIBHEIF_API int heif_context_is_top_level_image_ID(struct heif_context *ctx, heif_item_id id)
LIBHEIF_API struct heif_error heif_context_get_encoder(struct heif_context *context, const struct heif_encoder_descriptor *, struct heif_encoder **out_encoder)
LIBHEIF_API int heif_image_get_bits_per_pixel_range(const struct heif_image *, enum heif_channel channel)
LIBHEIF_API size_t heif_image_handle_get_raw_color_profile_size(const struct heif_image_handle *handle)
LIBHEIF_API struct heif_error heif_context_get_primary_image_handle(struct heif_context *ctx, struct heif_image_handle **)
LIBHEIF_API void heif_decoding_options_free(struct heif_decoding_options *)
heif_channel
Definition: heif.h:748
@ heif_channel_interleaved
Definition: heif.h:756
@ heif_channel_G
Definition: heif.h:753
@ heif_channel_Y
Definition: heif.h:749
@ heif_channel_Cb
Definition: heif.h:750
@ heif_channel_B
Definition: heif.h:754
@ heif_channel_R
Definition: heif.h:752
@ heif_channel_Alpha
Definition: heif.h:755
@ heif_channel_Cr
Definition: heif.h:751
LIBHEIF_API int heif_have_decoder_for_format(enum heif_compression_format format)
LIBHEIF_API uint8_t * heif_image_get_plane(struct heif_image *, enum heif_channel channel, int *out_stride)
heif_colorspace
Definition: heif.h:741
@ heif_colorspace_monochrome
Definition: heif.h:745
@ heif_colorspace_undefined
Definition: heif.h:742
@ heif_colorspace_YCbCr
Definition: heif.h:743
@ heif_colorspace_RGB
Definition: heif.h:744
heif_chroma
Definition: heif.h:722
@ heif_chroma_interleaved_RGB
Definition: heif.h:728
@ heif_chroma_444
Definition: heif.h:727
@ heif_chroma_monochrome
Definition: heif.h:724
@ heif_chroma_interleaved_RGBA
Definition: heif.h:729
@ heif_chroma_interleaved_RRGGBBAA_BE
Definition: heif.h:731
@ heif_chroma_422
Definition: heif.h:726
@ heif_chroma_interleaved_RRGGBB_BE
Definition: heif.h:730
@ heif_chroma_undefined
Definition: heif.h:723
@ heif_chroma_interleaved_RRGGBB_LE
Definition: heif.h:732
@ heif_chroma_interleaved_RRGGBBAA_LE
Definition: heif.h:733
@ heif_chroma_420
Definition: heif.h:725
LIBHEIF_API struct heif_error heif_image_handle_get_depth_image_handle(const struct heif_image_handle *handle, heif_item_id depth_image_id, struct heif_image_handle **out_depth_handle)
heif_brand
Definition: heif.h:294
@ heif_heic
Definition: heif.h:296
@ heif_hevs
Definition: heif.h:302
@ heif_mif1
Definition: heif.h:303
@ heif_heix
Definition: heif.h:297
@ heif_hevc
Definition: heif.h:298
@ heif_hevx
Definition: heif.h:298
@ heif_heis
Definition: heif.h:300
@ heif_msf1
Definition: heif.h:304
@ heif_hevm
Definition: heif.h:301
@ heif_unknown_brand
Definition: heif.h:295
@ heif_heim
Definition: heif.h:299
LIBHEIF_API int heif_image_handle_get_chroma_bits_per_pixel(const struct heif_image_handle *)
LIBHEIF_API struct heif_error heif_image_get_raw_color_profile(const struct heif_image *image, void *out_data)
LIBHEIF_API struct heif_error heif_image_set_nclx_color_profile(struct heif_image *image, const struct heif_color_profile_nclx *color_profile)
LIBHEIF_API struct heif_error heif_encoder_get_parameter_string(struct heif_encoder *, const char *parameter_name, char *value, int value_size)
LIBHEIF_API int heif_image_handle_get_number_of_depth_images(const struct heif_image_handle *handle)
LIBHEIF_API const uint8_t * heif_image_get_plane_readonly(const struct heif_image *, enum heif_channel channel, int *out_stride)
heif_progress_step
Definition: heif.h:760
@ heif_progress_step_total
Definition: heif.h:761
@ heif_progress_step_load_tile
Definition: heif.h:762
LIBHEIF_API struct heif_error heif_image_get_nclx_color_profile(const struct heif_image *image, struct heif_color_profile_nclx **out_data)
LIBHEIF_API int heif_image_handle_get_list_of_thumbnail_IDs(const struct heif_image_handle *handle, heif_item_id *ids, int count)
LIBHEIF_API struct heif_error heif_encoder_get_parameter_integer(struct heif_encoder *, const char *parameter_name, int *value)
LIBHEIF_API struct heif_error heif_context_encode_thumbnail(struct heif_context *, const struct heif_image *image, const struct heif_image_handle *master_image_handle, struct heif_encoder *encoder, const struct heif_encoding_options *options, int bbox_size, struct heif_image_handle **out_thumb_image_handle)
LIBHEIF_API struct heif_error heif_encoder_set_parameter(struct heif_encoder *, const char *parameter_name, const char *value)
LIBHEIF_API int heif_get_version_number_maintenance(void)
LIBHEIF_API struct heif_error heif_context_read_from_reader(struct heif_context *, const struct heif_reader *reader, void *userdata, const struct heif_reading_options *)
LIBHEIF_API void heif_context_free(struct heif_context *)
LIBHEIF_API struct heif_error heif_context_add_generic_metadata(struct heif_context *ctx, const struct heif_image_handle *image_handle, const void *data, int size, const char *item_type, const char *content_type)
LIBHEIF_API int heif_image_handle_get_width(const struct heif_image_handle *handle)
LIBHEIF_API struct heif_error heif_context_add_exif_metadata(struct heif_context *, const struct heif_image_handle *image_handle, const void *data, int size)
LIBHEIF_API void heif_context_debug_dump_boxes_to_file(struct heif_context *ctx, int fd)
LIBHEIF_API struct heif_error heif_context_add_XMP_metadata(struct heif_context *, const struct heif_image_handle *image_handle, const void *data, int size)
LIBHEIF_API enum heif_colorspace heif_image_get_colorspace(const struct heif_image *)
LIBHEIF_API size_t heif_image_get_raw_color_profile_size(const struct heif_image *image)
LIBHEIF_API struct heif_error heif_context_get_image_handle(struct heif_context *ctx, heif_item_id id, struct heif_image_handle **)
heif_suberror_code
Definition: heif.h:124
@ heif_suberror_No_ipma_box
Definition: heif.h:151
@ heif_suberror_Null_pointer_argument
Definition: heif.h:217
@ heif_suberror_Security_limit_exceeded
Definition: heif.h:208
@ heif_suberror_Unsupported_parameter
Definition: heif.h:229
@ heif_suberror_No_properties_assigned_to_item
Definition: heif.h:167
@ heif_suberror_Unspecified
Definition: heif.h:126
@ heif_suberror_No_pitm_box
Definition: heif.h:147
@ heif_suberror_Unsupported_plugin_version
Definition: heif.h:223
@ heif_suberror_Unsupported_color_conversion
Definition: heif.h:246
@ heif_suberror_No_item_data
Definition: heif.h:170
@ heif_suberror_Unknown_color_profile_type
Definition: heif.h:192
@ heif_suberror_No_infe_box
Definition: heif.h:190
@ heif_suberror_No_idat_box
Definition: heif.h:139
@ heif_suberror_Ipma_box_references_nonexisting_property
Definition: heif.h:164
@ heif_suberror_Missing_grid_images
Definition: heif.h:176
@ heif_suberror_Unsupported_bit_depth
Definition: heif.h:253
@ heif_suberror_No_iinf_box
Definition: heif.h:155
@ heif_suberror_Invalid_clean_aperture
Definition: heif.h:178
@ heif_suberror_Overlay_image_outside_of_canvas
Definition: heif.h:184
@ heif_suberror_No_ipco_box
Definition: heif.h:149
@ heif_suberror_Auxiliary_image_type_unspecified
Definition: heif.h:186
@ heif_suberror_No_iref_box
Definition: heif.h:159
@ heif_suberror_No_pict_handler
Definition: heif.h:161
@ heif_suberror_No_or_invalid_primary_item
Definition: heif.h:188
@ heif_suberror_Unsupported_writer_version
Definition: heif.h:226
@ heif_suberror_Nonexisting_item_referenced
Definition: heif.h:214
@ heif_suberror_Invalid_image_size
Definition: heif.h:198
@ heif_suberror_No_iloc_box
Definition: heif.h:153
@ heif_suberror_No_iprp_box
Definition: heif.h:157
@ heif_suberror_End_of_data
Definition: heif.h:131
@ heif_suberror_No_ftyp_box
Definition: heif.h:137
@ heif_suberror_Unsupported_codec
Definition: heif.h:238
@ heif_suberror_Invalid_grid_data
Definition: heif.h:173
@ heif_suberror_Invalid_overlay_data
Definition: heif.h:181
@ heif_suberror_Invalid_box_size
Definition: heif.h:134
@ heif_suberror_Unsupported_item_construction_method
Definition: heif.h:248
@ heif_suberror_No_hdlr_box
Definition: heif.h:143
@ heif_suberror_Nonexisting_image_channel_referenced
Definition: heif.h:220
@ heif_suberror_Wrong_tile_image_chroma_format
Definition: heif.h:194
@ heif_suberror_Unsupported_data_version
Definition: heif.h:243
@ heif_suberror_Invalid_pixi_box
Definition: heif.h:200
@ heif_suberror_Invalid_parameter_value
Definition: heif.h:232
@ heif_suberror_Invalid_fractional_number
Definition: heif.h:196
@ heif_suberror_Unsupported_image_type
Definition: heif.h:241
@ heif_suberror_No_hvcC_box
Definition: heif.h:145
@ heif_suberror_No_meta_box
Definition: heif.h:141
@ heif_suberror_Cannot_write_output_data
Definition: heif.h:258
LIBHEIF_API struct heif_error heif_encoder_set_lossless(struct heif_encoder *, int enable)
LIBHEIF_API struct heif_encoding_options * heif_encoding_options_alloc()
LIBHEIF_API struct heif_error heif_encoder_parameter_string_valid_values(struct heif_encoder *, const char *parameter_name, const char *const **out_stringarray)
LIBHEIF_API int heif_image_handle_get_height(const struct heif_image_handle *handle)
LIBHEIF_API int heif_image_get_bits_per_pixel(const struct heif_image *, enum heif_channel channel)
LIBHEIF_API struct heif_error heif_context_read_from_file(struct heif_context *, const char *filename, const struct heif_reading_options *)
LIBHEIF_API int heif_encoder_descriptor_supportes_lossy_compression(const struct heif_encoder_descriptor *)
LIBHEIF_API struct heif_error heif_image_set_raw_color_profile(struct heif_image *image, const char *profile_type_fourcc_string, const void *profile_data, const size_t profile_size)
LIBHEIF_API enum heif_encoder_parameter_type heif_encoder_parameter_get_type(const struct heif_encoder_parameter *)
heif_error_code
Definition: heif.h:91
@ heif_error_Encoding_error
Definition: heif.h:120
@ heif_error_Invalid_input
Definition: heif.h:99
@ heif_error_Memory_allocation_error
Definition: heif.h:111
@ heif_error_Input_does_not_exist
Definition: heif.h:96
@ heif_error_Decoder_plugin_error
Definition: heif.h:114
@ heif_error_Encoder_plugin_error
Definition: heif.h:117
@ heif_error_Unsupported_filetype
Definition: heif.h:102
@ heif_error_Ok
Definition: heif.h:93
@ heif_error_Unsupported_feature
Definition: heif.h:105
@ heif_error_Usage_error
Definition: heif.h:108
LIBHEIF_API const char * heif_encoder_descriptor_get_name(const struct heif_encoder_descriptor *)
heif_compression_format
Definition: heif.h:715
@ heif_compression_AVC
Definition: heif.h:718
@ heif_compression_undefined
Definition: heif.h:716
@ heif_compression_JPEG
Definition: heif.h:719
@ heif_compression_HEVC
Definition: heif.h:717
LIBHEIF_API int heif_image_get_height(const struct heif_image *, enum heif_channel channel)
LIBHEIF_API struct heif_error heif_encoder_get_parameter(struct heif_encoder *, const char *parameter_name, char *value_ptr, int value_size)
LIBHEIF_API struct heif_error heif_encoder_parameter_get_valid_string_values(const struct heif_encoder_parameter *, const char *const **out_stringarray)
LIBHEIF_API struct heif_error heif_encoder_set_lossy_quality(struct heif_encoder *, int quality)
LIBHEIF_API int heif_image_handle_get_depth_image_representation_info(const struct heif_image_handle *handle, heif_item_id depth_image_id, const struct heif_depth_representation_info **out)
LIBHEIF_API int heif_image_has_channel(const struct heif_image *, enum heif_channel channel)
LIBHEIF_API int heif_have_encoder_for_format(enum heif_compression_format format)
LIBHEIF_API const char * heif_encoder_parameter_get_name(const struct heif_encoder_parameter *)
LIBHEIF_API const char * heif_encoder_get_name(const struct heif_encoder *)
uint32_t heif_item_id
Definition: heif.h:276
LIBHEIF_API struct heif_error heif_context_set_primary_image(struct heif_context *, struct heif_image_handle *image_handle)
LIBHEIF_API enum heif_color_profile_type heif_image_handle_get_color_profile_type(const struct heif_image_handle *handle)
LIBHEIF_API int heif_image_handle_get_ispe_width(const struct heif_image_handle *handle)
LIBHEIF_API const char * heif_get_file_mime_type(const uint8_t *data, int len)
heif_reader_grow_status
Definition: heif.h:349
@ heif_reader_grow_status_timeout
Definition: heif.h:351
@ heif_reader_grow_status_size_beyond_eof
Definition: heif.h:352
@ heif_reader_grow_status_size_reached
Definition: heif.h:350
LIBHEIF_API struct heif_context * heif_context_alloc(void)
LIBHEIF_API int heif_encoder_descriptor_supportes_lossless_compression(const struct heif_encoder_descriptor *)
LIBHEIF_API struct heif_error heif_encoder_get_parameter_boolean(struct heif_encoder *, const char *parameter_name, int *value)
LIBHEIF_API enum heif_filetype_result heif_check_filetype(const uint8_t *data, int len)
LIBHEIF_API void heif_depth_representation_info_free(const struct heif_depth_representation_info *info)
LIBHEIF_API struct heif_error heif_encoder_set_logging_level(struct heif_encoder *, int level)
LIBHEIF_API uint32_t heif_get_version_number(void)
LIBHEIF_API int heif_image_handle_has_depth_image(const struct heif_image_handle *)
LIBHEIF_API int heif_get_version_number_minor(void)
LIBHEIF_API int heif_context_get_list_of_top_level_image_IDs(struct heif_context *ctx, heif_item_id *ID_array, int count)
LIBHEIF_API const char * heif_encoder_descriptor_get_id_name(const struct heif_encoder_descriptor *)
LIBHEIF_API struct heif_error heif_image_scale_image(const struct heif_image *input, struct heif_image **output, int width, int height, const struct heif_scaling_options *options)
LIBHEIF_API int heif_image_handle_has_alpha_channel(const struct heif_image_handle *)
LIBHEIF_API struct heif_error heif_image_create(int width, int height, enum heif_colorspace colorspace, enum heif_chroma chroma, struct heif_image **out_image)
LIBHEIF_API int heif_image_handle_get_list_of_metadata_block_IDs(const struct heif_image_handle *handle, const char *type_filter, heif_item_id *ids, int count)
LIBHEIF_API int heif_context_get_number_of_top_level_images(struct heif_context *ctx)
LIBHEIF_API struct heif_error heif_encoder_set_parameter_integer(struct heif_encoder *, const char *parameter_name, int value)
LIBHEIF_API struct heif_error heif_register_encoder_plugin(const struct heif_encoder_plugin *)
LIBHEIF_API void heif_encoder_release(struct heif_encoder *)
LIBHEIF_API const char * heif_get_version(void)
LIBHEIF_API int heif_image_handle_get_number_of_metadata_blocks(const struct heif_image_handle *handle, const char *type_filter)
LIBHEIF_API struct heif_error heif_encoder_parameter_get_valid_integer_range(const struct heif_encoder_parameter *, int *have_minimum_maximum, int *minimum, int *maximum)
LIBHEIF_API const char * heif_image_handle_get_metadata_type(const struct heif_image_handle *handle, heif_item_id metadata_id)
LIBHEIF_API struct heif_error heif_context_get_encoder_for_format(struct heif_context *context, enum heif_compression_format format, struct heif_encoder **)
LIBHEIF_API struct heif_error heif_encoder_set_parameter_boolean(struct heif_encoder *, const char *parameter_name, int value)
LIBHEIF_API struct heif_error heif_image_handle_get_raw_color_profile(const struct heif_image_handle *handle, void *out_data)
LIBHEIF_API const struct heif_encoder_parameter *const * heif_encoder_list_parameters(struct heif_encoder *)
LIBHEIF_API struct heif_error heif_image_handle_get_nclx_color_profile(const struct heif_image_handle *handle, struct heif_color_profile_nclx **out_data)
#define LIBHEIF_API
Definition: heif.h:63
#define heif_fourcc(a, b, c, d)
Definition: heif.h:65
LIBHEIF_API struct heif_error heif_register_decoder_plugin(const struct heif_decoder_plugin *)
LIBHEIF_API int heif_image_handle_is_primary_image(const struct heif_image_handle *handle)
LIBHEIF_API enum heif_chroma heif_image_get_chroma_format(const struct heif_image *)
LIBHEIF_API struct heif_error heif_image_handle_get_metadata(const struct heif_image_handle *handle, heif_item_id metadata_id, void *out_data)
LIBHEIF_API void heif_encoding_options_free(struct heif_encoding_options *)
LIBHEIF_API void heif_image_release(const struct heif_image *)
LIBHEIF_API struct heif_error heif_context_encode_image(struct heif_context *, const struct heif_image *image, struct heif_encoder *encoder, const struct heif_encoding_options *options, struct heif_image_handle **out_image_handle)
LIBHEIF_API struct heif_error heif_context_write_to_file(struct heif_context *, const char *filename)
heif_filetype_result
Definition: heif.h:282
@ heif_filetype_maybe
Definition: heif.h:286
@ heif_filetype_yes_unsupported
Definition: heif.h:285
@ heif_filetype_yes_supported
Definition: heif.h:284
@ heif_filetype_no
Definition: heif.h:283
LIBHEIF_API enum heif_compression_format heif_encoder_descriptor_get_compression_format(const struct heif_encoder_descriptor *)
heif_depth_representation_type
Definition: heif.h:513
@ heif_depth_representation_type_nonuniform_disparity
Definition: heif.h:517
@ heif_depth_representation_type_uniform_inverse_Z
Definition: heif.h:514
@ heif_depth_representation_type_uniform_disparity
Definition: heif.h:515
@ heif_depth_representation_type_uniform_Z
Definition: heif.h:516
LIBHEIF_API struct heif_decoding_options * heif_decoding_options_alloc()
LIBHEIF_API enum heif_color_profile_type heif_image_get_color_profile_type(const struct heif_image *image)
LIBHEIF_API int heif_encoder_has_default(struct heif_encoder *, const char *parameter_name)
heif_color_profile_type
Definition: heif.h:614
@ heif_color_profile_type_rICC
Definition: heif.h:617
@ heif_color_profile_type_prof
Definition: heif.h:618
@ heif_color_profile_type_nclx
Definition: heif.h:616
@ heif_color_profile_type_not_present
Definition: heif.h:615
LIBHEIF_API int heif_image_handle_get_luma_bits_per_pixel(const struct heif_image_handle *)
LIBHEIF_API int heif_image_get_width(const struct heif_image *, enum heif_channel channel)
LIBHEIF_API int heif_image_handle_get_number_of_thumbnails(const struct heif_image_handle *handle)
heif_transfer_characteristics
Definition: heif.h:643
@ heif_transfer_characteristic_linear
Definition: heif.h:650
@ heif_transfer_characteristic_unspecified
Definition: heif.h:645
@ heif_transfer_characteristic_ITU_R_BT_470_6_System_B_G
Definition: heif.h:647
@ heif_transfer_characteristic_ITU_R_BT_709_5
Definition: heif.h:644
@ heif_transfer_characteristic_ITU_R_BT_1361
Definition: heif.h:652
@ heif_transfer_characteristic_IEC_61966_2_1
Definition: heif.h:653
@ heif_transfer_characteristic_SMPTE_240M
Definition: heif.h:649
@ heif_transfer_characteristic_ITU_R_BT_601_6
Definition: heif.h:648
@ heif_transfer_characteristic_IEC_61966_2_4
Definition: heif.h:651
@ heif_transfer_characteristic_ITU_R_BT_470_6_System_M
Definition: heif.h:646
LIBHEIF_API struct heif_error heif_context_assign_thumbnail(struct heif_context *, const struct heif_image_handle *master_image, const struct heif_image_handle *thumbnail_image)
LIBHEIF_API struct heif_error heif_register_decoder(struct heif_context *heif, const struct heif_decoder_plugin *)
LIBHEIF_API int heif_get_version_number_major(void)
LIBHEIF_API void heif_image_handle_release(const struct heif_image_handle *)
LIBHEIF_API enum heif_brand heif_main_brand(const uint8_t *data, int len)
LIBHEIF_API const char * heif_image_handle_get_metadata_content_type(const struct heif_image_handle *handle, heif_item_id metadata_id)
LIBHEIF_API struct heif_error heif_context_read_from_memory(struct heif_context *, const void *mem, size_t size, const struct heif_reading_options *)
heif_encoder_parameter_type
Definition: heif.h:1030
@ heif_encoder_parameter_type_boolean
Definition: heif.h:1032
@ heif_encoder_parameter_type_integer
Definition: heif.h:1031
@ heif_encoder_parameter_type_string
Definition: heif.h:1033
heif_matrix_coefficients
Definition: heif.h:656
@ heif_matrix_coefficients_ITU_R_BT_601_6
Definition: heif.h:662
@ heif_matrix_coefficients_US_FCC_T47
Definition: heif.h:660
@ heif_matrix_coefficients_RGB_GBR
Definition: heif.h:657
@ heif_matrix_coefficients_ITU_R_BT_470_6_System_B_G
Definition: heif.h:661
@ heif_matrix_coefficients_unspecified
Definition: heif.h:659
@ heif_matrix_coefficients_YCgCo
Definition: heif.h:664
@ heif_matrix_coefficients_SMPTE_240M
Definition: heif.h:663
@ heif_matrix_coefficients_ITU_R_BT_709_5
Definition: heif.h:658
LIBHEIF_API struct heif_error heif_image_add_plane(struct heif_image *image, enum heif_channel channel, int width, int height, int bit_depth)
LIBHEIF_API struct heif_error heif_decode_image(const struct heif_image_handle *in_handle, struct heif_image **out_img, enum heif_colorspace colorspace, enum heif_chroma chroma, const struct heif_decoding_options *options)
heif_color_primaries
Definition: heif.h:634
@ heif_color_primaries_ITU_R_BT_709_5
Definition: heif.h:635
@ heif_color_primaries_ITU_R_BT_601_6
Definition: heif.h:639
@ heif_color_primaries_ITU_R_BT_470_6_System_M
Definition: heif.h:637
@ heif_color_primaries_unspecified
Definition: heif.h:636
@ heif_color_primaries_SMPTE_240M
Definition: heif.h:640
@ heif_color_primaries_ITU_R_BT_470_6_System_B_G
Definition: heif.h:638
qulonglong value
Definition: itemviewutilities.cpp:592
Definition: bitstream.h:41
Definition: heif.h:667
enum heif_transfer_characteristics transfer_characteristics
Definition: heif.h:673
float color_primary_green_x
Definition: heif.h:680
enum heif_matrix_coefficients matrix_coefficients
Definition: heif.h:674
float color_primary_blue_x
Definition: heif.h:681
float color_primary_white_y
Definition: heif.h:682
float color_primary_red_x
Definition: heif.h:679
float color_primary_red_y
Definition: heif.h:679
float color_primary_white_x
Definition: heif.h:682
enum heif_color_primaries color_primaries
Definition: heif.h:672
float color_primary_green_y
Definition: heif.h:680
uint8_t version
Definition: heif.h:670
float color_primary_blue_y
Definition: heif.h:681
uint8_t full_range_flag
Definition: heif.h:675
Definition: heif_api_structs.h:45
Definition: heif_plugin.h:51
Definition: heif.h:767
void(* start_progress)(enum heif_progress_step step, int max_progress, void *progress_user_data)
Definition: heif.h:776
void(* on_progress)(enum heif_progress_step step, int progress, void *progress_user_data)
Definition: heif.h:777
uint8_t ignore_transformations
Definition: heif.h:774
void * progress_user_data
Definition: heif.h:779
uint8_t version
Definition: heif.h:768
void(* end_progress)(enum heif_progress_step step, void *progress_user_data)
Definition: heif.h:778
Definition: heif.h:520
uint8_t * depth_nonlinear_representation_model
Definition: heif.h:539
double z_near
Definition: heif.h:530
double d_min
Definition: heif.h:532
double d_max
Definition: heif.h:533
enum heif_depth_representation_type depth_representation_type
Definition: heif.h:535
uint8_t has_z_far
Definition: heif.h:526
uint32_t disparity_reference_view
Definition: heif.h:536
double z_far
Definition: heif.h:531
uint32_t depth_nonlinear_representation_model_size
Definition: heif.h:538
uint8_t has_z_near
Definition: heif.h:525
uint8_t has_d_min
Definition: heif.h:527
uint8_t version
Definition: heif.h:521
uint8_t has_d_max
Definition: heif.h:528
Definition: heif_plugin_registry.h:37
Definition: heif_plugin.h:208
Definition: heif_plugin.h:120
Definition: heif_api_structs.h:51
void * encoder
Definition: heif_api_structs.h:62
Definition: heif.h:1121
uint8_t save_alpha_channel
Definition: heif.h:1126
uint8_t version
Definition: heif.h:1122
Definition: heif.h:264
const char * message
Definition: heif.h:272
enum heif_suberror_code subcode
Definition: heif.h:269
enum heif_error_code code
Definition: heif.h:266
Definition: heif_api_structs.h:30
Definition: heif_api_structs.h:39
std::shared_ptr< heif::HeifPixelImage > image
Definition: heif_api_structs.h:40
Definition: heif.h:355
int reader_api_version
Definition: heif.h:357
enum heif_reader_grow_status(* wait_for_file_size)(int64_t target_size, void *userdata)
Definition: heif.h:378
int64_t(* get_position)(void *userdata)
Definition: heif.h:360
int(* read)(void *data, size_t size, void *userdata)
Definition: heif.h:364
int(* seek)(int64_t position, void *userdata)
Definition: heif.h:367
Definition: heif.h:899
struct heif_error(* write)(struct heif_context *ctx, const void *data, size_t size, void *userdata)
Definition: heif.h:904
int writer_api_version
Definition: heif.h:901
Definition: scan.h:26