Expand description
§libheif-sys
libheif-sys
is a binding to libheif.
A high-level wrapper libheif-rs is also available.
§System dependencies
libheif-dev
>= 1.17.0.
§Minimal supported API version
This crate supports libheif
versions 1.17, 1.18, 1.19 and 1.20.
You MUST specify a minimal version of libheif
that is required for you.
To do this, enable the corresponding feature: v1_17
, v1_18
, v1_19
or v1_20
.
Example:
[dependencies]
libheif-sys = { version = "4.0", features = ["v1_18"] }
There is also the latest
feature. It always corresponds to
the maximal supported by the crate version of libheif
.
§Linux
The crate uses pkg-confing
to find installed libheif
(with
help of system-deps
crate).
You can also enable embedded-libheif
feature to compile
libheif v1.20.2
from embedded sources and then link it statically.
Note: Static linked version of libheif
doesn’t have statically linked
it dependencies, such as libde256
, libaom
and other.
§Windows
The crate uses vcpkg crate
to find libheif
installed with help of vcpkg
.
You can use cargo-vcpkg
to install libheif
with help of cargo
command:
cargo vcpkg -v build
cargo-vcpkg
can fetch and build a vcpkg
installation of required
packages from scratch. It merges package requirements specified in
the Cargo.toml
of all crates in the dependency tree.
§Example of reading and decoding HEIF-image
use std::ffi;
use std::ptr;
use libheif_sys as lh;
#[test]
fn read_and_decode_heif_file() {
unsafe {
lh::heif_init(ptr::null_mut());
let ctx = lh::heif_context_alloc();
assert!(!ctx.is_null());
let c_name = ffi::CString::new("data/test.heif").unwrap();
let err = lh::heif_context_read_from_file(
ctx,
c_name.as_ptr(),
ptr::null()
);
assert_eq!(err.code, lh::heif_error_code_heif_error_Ok);
let mut handle = ptr::null_mut();
let err = lh::heif_context_get_primary_image_handle(
ctx,
&mut handle
);
assert_eq!(err.code, lh::heif_error_code_heif_error_Ok);
assert!(!handle.is_null());
let width = lh::heif_image_handle_get_width(handle);
assert_eq!(width, 4032);
let height = lh::heif_image_handle_get_height(handle);
assert_eq!(height, 3024);
let mut image = ptr::null_mut();
let options = lh::heif_decoding_options_alloc();
let err = lh::heif_decode_image(
handle,
&mut image,
lh::heif_colorspace_heif_colorspace_RGB,
lh::heif_chroma_heif_chroma_interleaved_RGB,
options,
);
lh::heif_decoding_options_free(options);
assert_eq!(err.code, lh::heif_error_code_heif_error_Ok);
assert!(!image.is_null());
let colorspace = lh::heif_image_get_colorspace(image);
assert_eq!(
colorspace,
lh::heif_colorspace_heif_colorspace_RGB
);
let chroma_format = lh::heif_image_get_chroma_format(image);
assert_eq!(
chroma_format,
lh::heif_chroma_heif_chroma_interleaved_RGB
);
let width = lh::heif_image_get_width(
image,
lh::heif_channel_heif_channel_interleaved
);
assert_eq!(width, 4032);
let height = lh::heif_image_get_height(
image,
lh::heif_channel_heif_channel_interleaved
);
assert_eq!(height, 3024);
lh::heif_context_free(ctx);
lh::heif_deinit();
};
}
Structs§
- heif_
ambient_ viewing_ environment - heif_
camera_ extrinsic_ matrix - heif_
camera_ intrinsic_ matrix - ———————–– intrinsic and extrinsic matrices ———————––
- heif_
color_ conversion_ options - heif_
color_ conversion_ options_ ext - heif_
color_ profile_ nclx - heif_
content_ light_ level - Note: a value of 0 for any of these values indicates that the value is undefined. The unit of these values is Candelas per square meter.
- heif_
context - heif_
decoded_ mastering_ display_ colour_ volume - The units for max_display_mastering_luminance and min_display_mastering_luminance is Candelas per square meter.
- heif_
decoder_ descriptor - heif_
decoder_ plugin - heif_
decoding_ options - heif_
depth_ representation_ info - heif_
encoder - heif_
encoder_ descriptor - heif_
encoder_ parameter - heif_
encoder_ plugin - heif_
encoding_ options - heif_
entity_ group - heif_
error - heif_
image - heif_
image_ handle - heif_
image_ tiling - heif_
init_ params - ========================= library initialization ======================
- heif_
mastering_ display_ colour_ volume - Note: color coordinates are defined according to the CIE 1931 definition of x as specified in ISO 11664-1 (see also ISO 11664-3 and CIE 15).
- heif_
plugin_ info - heif_
property_ user_ description - The strings are managed by libheif. They will be deleted in heif_property_user_description_release().
- heif_
raw_ sequence_ sample - heif_
reader - heif_
reader_ range_ request_ result - heif_
reading_ options - heif_
region - heif_
region_ item - heif_
sample_ aux_ info_ type - Contains the type of sample auxiliary data assigned to the track samples.
- heif_
scaling_ options - heif_
security_ limits - If you set a limit to 0, the limit is disabled.
- heif_
sequence_ encoding_ options - This structure is for future use. It is not defined yet.
- heif_
tai_ clock_ info - heif_
tai_ timestamp_ packet - heif_
track - heif_
track_ options - heif_
writer
Constants§
- heif_
alpha_ composition_ mode_ heif_ alpha_ composition_ mode_ checkerboard - heif_
alpha_ composition_ mode_ heif_ alpha_ composition_ mode_ none - heif_
alpha_ composition_ mode_ heif_ alpha_ composition_ mode_ solid_ color - heif_
brand_ heif_ avif - HEIF image with AV1
- heif_
brand_ heif_ avis - heif_
brand_ heif_ evbi - EVC image
- heif_
brand_ heif_ evbs - EVC sequence
- heif_
brand_ heif_ heic - HEIF image with h265
- heif_
brand_ heif_ heim - multiview
- heif_
brand_ heif_ heis - scalable
- heif_
brand_ heif_ heix - 10bit images, or anything that uses h265 with range extension
- heif_
brand_ heif_ hevc - brands for image sequences
- heif_
brand_ heif_ hevm - multiview sequence
- heif_
brand_ heif_ hevs - scalable sequence
- heif_
brand_ heif_ hevx - brands for image sequences
- heif_
brand_ heif_ j2is - JPEG2000 image sequence
- heif_
brand_ heif_ j2ki - JPEG2000 image
- heif_
brand_ heif_ mif1 - image, any coding algorithm
- heif_
brand_ heif_ msf1 - sequence, any coding algorithm
- heif_
brand_ heif_ unknown_ brand - heif_
brand_ heif_ vvic - VVC image
- heif_
brand_ heif_ vvis - VVC sequence
- heif_
channel_ heif_ channel_ Alpha - heif_
channel_ heif_ channel_ B - heif_
channel_ heif_ channel_ Cb - heif_
channel_ heif_ channel_ Cr - heif_
channel_ heif_ channel_ G - heif_
channel_ heif_ channel_ R - heif_
channel_ heif_ channel_ Y - heif_
channel_ heif_ channel_ depth - heif_
channel_ heif_ channel_ disparity - heif_
channel_ heif_ channel_ filter_ array - heif_
channel_ heif_ channel_ interleaved - heif_
chroma_ downsampling_ algorithm_ heif_ chroma_ downsampling_ average - heif_
chroma_ downsampling_ algorithm_ heif_ chroma_ downsampling_ nearest_ neighbor - heif_
chroma_ downsampling_ algorithm_ heif_ chroma_ downsampling_ sharp_ yuv - Combine with ‘heif_chroma_upsampling_bilinear’ for best quality. Makes edges look sharper when using YUV 420 with bilinear chroma upsampling.
- heif_
chroma_ heif_ chroma_ 420 - heif_
chroma_ heif_ chroma_ 422 - heif_
chroma_ heif_ chroma_ 444 - heif_
chroma_ heif_ chroma_ interleaved_ RGB - heif_
chroma_ heif_ chroma_ interleaved_ RGBA - heif_
chroma_ heif_ chroma_ interleaved_ RRGGBBAA_ BE - HDR, big endian.
- heif_
chroma_ heif_ chroma_ interleaved_ RRGGBBAA_ LE - HDR, little endian.
- heif_
chroma_ heif_ chroma_ interleaved_ RRGGBB_ BE - HDR, big endian.
- heif_
chroma_ heif_ chroma_ interleaved_ RRGGBB_ LE - HDR, little endian.
- heif_
chroma_ heif_ chroma_ monochrome - heif_
chroma_ heif_ chroma_ undefined - heif_
chroma_ upsampling_ algorithm_ heif_ chroma_ upsampling_ bilinear - heif_
chroma_ upsampling_ algorithm_ heif_ chroma_ upsampling_ nearest_ neighbor - heif_
color_ primaries_ heif_ color_ primaries_ EBU_ Tech_ 3213_ E - heif_
color_ primaries_ heif_ color_ primaries_ ITU_ R_ BT_ 470_ 6_ System_ B_ G - heif_
color_ primaries_ heif_ color_ primaries_ ITU_ R_ BT_ 470_ 6_ System_ M - heif_
color_ primaries_ heif_ color_ primaries_ ITU_ R_ BT_ 601_ 6 - heif_
color_ primaries_ heif_ color_ primaries_ ITU_ R_ BT_ 709_ 5 - g=0.3;0.6, b=0.15;0.06, r=0.64;0.33, w=0.3127,0.3290
- heif_
color_ primaries_ heif_ color_ primaries_ ITU_ R_ BT_ 2020_ 2_ and_ 2100_ 0 - heif_
color_ primaries_ heif_ color_ primaries_ SMPTE_ 240M - heif_
color_ primaries_ heif_ color_ primaries_ SMPTE_ EG_ 432_ 1 - heif_
color_ primaries_ heif_ color_ primaries_ SMPTE_ RP_ 431_ 2 - heif_
color_ primaries_ heif_ color_ primaries_ SMPTE_ ST_ 428_ 1 - heif_
color_ primaries_ heif_ color_ primaries_ generic_ film - heif_
color_ primaries_ heif_ color_ primaries_ unspecified - heif_
color_ profile_ type_ heif_ color_ profile_ type_ nclx - heif_
color_ profile_ type_ heif_ color_ profile_ type_ not_ present - heif_
color_ profile_ type_ heif_ color_ profile_ type_ prof - heif_
color_ profile_ type_ heif_ color_ profile_ type_ rICC - heif_
colorspace_ heif_ colorspace_ RGB - heif_colorspace_RGB should be used with one of these heif_chroma values:
- heif_
colorspace_ heif_ colorspace_ YCbCr - heif_colorspace_YCbCr should be used with one of these heif_chroma values:
- heif_
colorspace_ heif_ colorspace_ monochrome - heif_colorspace_monochrome should only be used with heif_chroma = heif_chroma_monochrome
- heif_
colorspace_ heif_ colorspace_ nonvisual - Indicates that this image has no visual channels.
- heif_
colorspace_ heif_ colorspace_ undefined - heif_
compression_ format_ heif_ compression_ AV1 - AV1 compression, used for AVIF images.
- heif_
compression_ format_ heif_ compression_ AVC - AVC compression. (Currently unused in libheif.)
- heif_
compression_ format_ heif_ compression_ EVC - EVC compression. (Currently unused in libheif.)
- heif_
compression_ format_ heif_ compression_ HEVC - HEVC compression, used for HEIC images.
- heif_
compression_ format_ heif_ compression_ HTJ2K - High Throughput JPEG 2000 (HT-J2K) compression.
- heif_
compression_ format_ heif_ compression_ JPEG - JPEG compression.
- heif_
compression_ format_ heif_ compression_ JPEG2000 - JPEG 2000 compression.
- heif_
compression_ format_ heif_ compression_ VVC - VVC compression.
- heif_
compression_ format_ heif_ compression_ mask - Mask image encoding.
- heif_
compression_ format_ heif_ compression_ uncompressed - Uncompressed encoding.
- heif_
compression_ format_ heif_ compression_ undefined - Unspecified / undefined compression format.
- heif_
depth_ representation_ type_ heif_ depth_ representation_ type_ nonuniform_ disparity - heif_
depth_ representation_ type_ heif_ depth_ representation_ type_ uniform_ Z - heif_
depth_ representation_ type_ heif_ depth_ representation_ type_ uniform_ disparity - heif_
depth_ representation_ type_ heif_ depth_ representation_ type_ uniform_ inverse_ Z - heif_
encoder_ parameter_ type_ heif_ encoder_ parameter_ type_ boolean - heif_
encoder_ parameter_ type_ heif_ encoder_ parameter_ type_ integer - heif_
encoder_ parameter_ type_ heif_ encoder_ parameter_ type_ string - heif_
error_ code_ heif_ error_ Canceled - Operation has been canceled
- heif_
error_ code_ heif_ error_ Color_ profile_ does_ not_ exist - Application has asked for a color profile type that does not exist
- heif_
error_ code_ heif_ error_ Decoder_ plugin_ error - The decoder plugin generated an error
- heif_
error_ code_ heif_ error_ Encoder_ plugin_ error - The encoder plugin generated an error
- heif_
error_ code_ heif_ error_ Encoding_ error - Error during encoding or when writing to the output
- heif_
error_ code_ heif_ error_ End_ of_ sequence - Operation has been canceled
- heif_
error_ code_ heif_ error_ Input_ does_ not_ exist - Input file does not exist.
- heif_
error_ code_ heif_ error_ Invalid_ input - Error in input file. Corrupted or invalid content.
- heif_
error_ code_ heif_ error_ Memory_ allocation_ error - Could not allocate enough memory.
- heif_
error_ code_ heif_ error_ Ok - Everything ok, no error occurred.
- heif_
error_ code_ heif_ error_ Plugin_ loading_ error - Error loading a dynamic plugin
- heif_
error_ code_ heif_ error_ Unsupported_ feature - Image requires an unsupported decoder feature.
- heif_
error_ code_ heif_ error_ Unsupported_ filetype - Input file type is not supported.
- heif_
error_ code_ heif_ error_ Usage_ error - Library API has been used in an invalid way.
- heif_
filetype_ result_ heif_ filetype_ maybe - not sure whether it is an heif, try detection with more input data
- heif_
filetype_ result_ heif_ filetype_ no - heif_
filetype_ result_ heif_ filetype_ yes_ supported - it is heif and can be read by libheif
- heif_
filetype_ result_ heif_ filetype_ yes_ unsupported - it is heif, but cannot be read by libheif
- heif_
item_ property_ type_ heif_ item_ property_ type_ image_ size - heif_item_property_unknown = -1,
- heif_
item_ property_ type_ heif_ item_ property_ type_ invalid - heif_item_property_unknown = -1,
- heif_
item_ property_ type_ heif_ item_ property_ type_ tai_ clock_ info - heif_item_property_unknown = -1,
- heif_
item_ property_ type_ heif_ item_ property_ type_ tai_ timestamp - heif_item_property_unknown = -1,
- heif_
item_ property_ type_ heif_ item_ property_ type_ transform_ crop - heif_item_property_unknown = -1,
- heif_
item_ property_ type_ heif_ item_ property_ type_ transform_ mirror - heif_item_property_unknown = -1,
- heif_
item_ property_ type_ heif_ item_ property_ type_ transform_ rotation - heif_item_property_unknown = -1,
- heif_
item_ property_ type_ heif_ item_ property_ type_ user_ description - heif_item_property_unknown = -1,
- heif_
item_ property_ type_ heif_ item_ property_ type_ uuid - heif_item_property_unknown = -1,
- heif_
matrix_ coefficients_ heif_ matrix_ coefficients_ ICtCp - heif_
matrix_ coefficients_ heif_ matrix_ coefficients_ ITU_ R_ BT_ 470_ 6_ System_ B_ G - heif_
matrix_ coefficients_ heif_ matrix_ coefficients_ ITU_ R_ BT_ 601_ 6 - TODO: or 601-7 according to h.273
- heif_
matrix_ coefficients_ heif_ matrix_ coefficients_ ITU_ R_ BT_ 709_ 5 - TODO: or 709-6 according to h.273
- heif_
matrix_ coefficients_ heif_ matrix_ coefficients_ ITU_ R_ BT_ 2020_ 2_ constant_ luminance - heif_
matrix_ coefficients_ heif_ matrix_ coefficients_ ITU_ R_ BT_ 2020_ 2_ non_ constant_ luminance - heif_
matrix_ coefficients_ heif_ matrix_ coefficients_ RGB_ GBR - heif_
matrix_ coefficients_ heif_ matrix_ coefficients_ SMPTE_ 240M - heif_
matrix_ coefficients_ heif_ matrix_ coefficients_ SMPTE_ ST_ 2085 - heif_
matrix_ coefficients_ heif_ matrix_ coefficients_ US_ FCC_ T47 - heif_
matrix_ coefficients_ heif_ matrix_ coefficients_ YCgCo - heif_
matrix_ coefficients_ heif_ matrix_ coefficients_ chromaticity_ derived_ constant_ luminance - heif_
matrix_ coefficients_ heif_ matrix_ coefficients_ chromaticity_ derived_ non_ constant_ luminance - heif_
matrix_ coefficients_ heif_ matrix_ coefficients_ unspecified - heif_
metadata_ compression_ heif_ metadata_ compression_ auto - heif_
metadata_ compression_ heif_ metadata_ compression_ brotli - heif_
metadata_ compression_ heif_ metadata_ compression_ deflate - heif_
metadata_ compression_ heif_ metadata_ compression_ off - heif_
metadata_ compression_ heif_ metadata_ compression_ unknown - only used when reading unknown method from input file
- heif_
metadata_ compression_ heif_ metadata_ compression_ zlib - do not use for header data
- heif_
orientation_ heif_ orientation_ flip_ horizontally - heif_
orientation_ heif_ orientation_ flip_ vertically - heif_
orientation_ heif_ orientation_ normal - heif_
orientation_ heif_ orientation_ rotate_ 90_ cw - heif_
orientation_ heif_ orientation_ rotate_ 90_ cw_ then_ flip_ horizontally - heif_
orientation_ heif_ orientation_ rotate_ 90_ cw_ then_ flip_ vertically - heif_
orientation_ heif_ orientation_ rotate_ 180 - heif_
orientation_ heif_ orientation_ rotate_ 270_ cw - heif_
plugin_ type_ heif_ plugin_ type_ decoder - heif_
plugin_ type_ heif_ plugin_ type_ encoder - heif_
progress_ step_ heif_ progress_ step_ load_ tile - heif_
progress_ step_ heif_ progress_ step_ total - heif_
reader_ grow_ status_ heif_ reader_ grow_ status_ error - an error has occurred
- heif_
reader_ grow_ status_ heif_ reader_ grow_ status_ size_ beyond_ eof - size has not been reached and never will. The file has grown to its full size
- heif_
reader_ grow_ status_ heif_ reader_ grow_ status_ size_ reached - requested size has been reached, we can read until this point
- heif_
reader_ grow_ status_ heif_ reader_ grow_ status_ timeout - size has not been reached yet, but it may still grow further (deprecated)
- heif_
region_ type_ heif_ region_ type_ ellipse - Ellipse geometry.
- heif_
region_ type_ heif_ region_ type_ inline_ mask - Inline mask.
- heif_
region_ type_ heif_ region_ type_ point - Point gemetry.
- heif_
region_ type_ heif_ region_ type_ polygon - Polygon geometry.
- heif_
region_ type_ heif_ region_ type_ polyline - Polyline geometry.
- heif_
region_ type_ heif_ region_ type_ rectangle - Rectangle geometry.
- heif_
region_ type_ heif_ region_ type_ referenced_ mask - Reference mask.
- heif_
sample_ aux_ info_ presence_ heif_ sample_ aux_ info_ presence_ mandatory - heif_
sample_ aux_ info_ presence_ heif_ sample_ aux_ info_ presence_ none - heif_
sample_ aux_ info_ presence_ heif_ sample_ aux_ info_ presence_ optional - heif_
suberror_ code_ heif_ suberror_ Auxiliary_ image_ type_ unspecified - Overlay image completely outside of visible canvas area
- heif_
suberror_ code_ heif_ suberror_ Camera_ extrinsic_ matrix_ undefined - Image has no ispe property
- heif_
suberror_ code_ heif_ suberror_ Camera_ intrinsic_ matrix_ undefined - Image has no ispe property
- heif_
suberror_ code_ heif_ suberror_ Cannot_ read_ plugin_ directory - error while scanning the directory for plugins
- heif_
suberror_ code_ heif_ suberror_ Cannot_ write_ output_ data - — Encoding_error —
- heif_
suberror_ code_ heif_ suberror_ Compression_ initialisation_ error - There was an error from the underlying compression / decompression library. One possibility is lack of resources (e.g. memory).
- heif_
suberror_ code_ heif_ suberror_ Decompression_ invalid_ data - Decompressing generic compression or header compression data failed (e.g. bitstream corruption)
- heif_
suberror_ code_ heif_ suberror_ Encoder_ cleanup - — Encoding_error —
- heif_
suberror_ code_ heif_ suberror_ Encoder_ encoding - — Encoding_error —
- heif_
suberror_ code_ heif_ suberror_ Encoder_ initialization - — Encoding_error —
- heif_
suberror_ code_ heif_ suberror_ End_ of_ data - End of data reached unexpectedly.
- heif_
suberror_ code_ heif_ suberror_ Invalid_ J2K_ codestream - Invalid JPEG 2000 codestream - usually a missing marker
- heif_
suberror_ code_ heif_ suberror_ Invalid_ box_ size - Size of box (defined in header) is wrong
- heif_
suberror_ code_ heif_ suberror_ Invalid_ clean_ aperture - Tile-images in a grid image are missing
- heif_
suberror_ code_ heif_ suberror_ Invalid_ fractional_ number - Overlay image completely outside of visible canvas area
- heif_
suberror_ code_ heif_ suberror_ Invalid_ grid_ data - Invalid specification of image grid (tiled image)
- heif_
suberror_ code_ heif_ suberror_ Invalid_ image_ size - Overlay image completely outside of visible canvas area
- heif_
suberror_ code_ heif_ suberror_ Invalid_ mini_ box - we got a mini box, but could not read it properly
- heif_
suberror_ code_ heif_ suberror_ Invalid_ overlay_ data - Invalid specification of overlay image
- heif_
suberror_ code_ heif_ suberror_ Invalid_ parameter_ value - The value for the given parameter is not in the valid range.
- heif_
suberror_ code_ heif_ suberror_ Invalid_ pixi_ box - Overlay image completely outside of visible canvas area
- heif_
suberror_ code_ heif_ suberror_ Invalid_ property - Error in property specification
- heif_
suberror_ code_ heif_ suberror_ Invalid_ region_ data - Invalid specification of region item
- heif_
suberror_ code_ heif_ suberror_ Ipma_ box_ references_ nonexisting_ property - An item property referenced in the ‘ipma’ box is not existing in the ‘ipco’ container.
- heif_
suberror_ code_ heif_ suberror_ Item_ reference_ cycle - Image reference cycle found in iref
- heif_
suberror_ code_ heif_ suberror_ Missing_ grid_ images - Tile-images in a grid image are missing
- heif_
suberror_ code_ heif_ suberror_ No_ av1C_ box - Overlay image completely outside of visible canvas area
- heif_
suberror_ code_ heif_ suberror_ No_ avcC_ box - icbr is only needed in some situations, this error is for those cases
- heif_
suberror_ code_ heif_ suberror_ No_ ftyp_ box - Mandatory ‘ftyp’ box is missing
- heif_
suberror_ code_ heif_ suberror_ No_ hdlr_ box - Mandatory ‘ftyp’ box is missing
- heif_
suberror_ code_ heif_ suberror_ No_ hvcC_ box - Mandatory ‘ftyp’ box is missing
- heif_
suberror_ code_ heif_ suberror_ No_ icbr_ box - icbr is only needed in some situations, this error is for those cases
- heif_
suberror_ code_ heif_ suberror_ No_ idat_ box - Mandatory ‘ftyp’ box is missing
- heif_
suberror_ code_ heif_ suberror_ No_ iinf_ box - Mandatory ‘ftyp’ box is missing
- heif_
suberror_ code_ heif_ suberror_ No_ iloc_ box - Mandatory ‘ftyp’ box is missing
- heif_
suberror_ code_ heif_ suberror_ No_ infe_ box - Overlay image completely outside of visible canvas area
- heif_
suberror_ code_ heif_ suberror_ No_ ipco_ box - Mandatory ‘ftyp’ box is missing
- heif_
suberror_ code_ heif_ suberror_ No_ ipma_ box - Mandatory ‘ftyp’ box is missing
- heif_
suberror_ code_ heif_ suberror_ No_ iprp_ box - Mandatory ‘ftyp’ box is missing
- heif_
suberror_ code_ heif_ suberror_ No_ iref_ box - Mandatory ‘ftyp’ box is missing
- heif_
suberror_ code_ heif_ suberror_ No_ ispe_ property - Image has no ispe property
- heif_
suberror_ code_ heif_ suberror_ No_ item_ data - Image has no (compressed) data
- heif_
suberror_ code_ heif_ suberror_ No_ matching_ decoder_ installed - no decoder found for that compression format
- heif_
suberror_ code_ heif_ suberror_ No_ meta_ box - Mandatory ‘ftyp’ box is missing
- heif_
suberror_ code_ heif_ suberror_ No_ moov_ box - Decompressing generic compression or header compression data failed (e.g. bitstream corruption)
- heif_
suberror_ code_ heif_ suberror_ No_ or_ invalid_ primary_ item - Overlay image completely outside of visible canvas area
- heif_
suberror_ code_ heif_ suberror_ No_ pict_ handler - Mandatory ‘ftyp’ box is missing
- heif_
suberror_ code_ heif_ suberror_ No_ pitm_ box - Mandatory ‘ftyp’ box is missing
- heif_
suberror_ code_ heif_ suberror_ No_ properties_ assigned_ to_ item - No properties have been assigned to an item.
- heif_
suberror_ code_ heif_ suberror_ No_ vvcC_ box - Invalid JPEG 2000 codestream - usually a missing marker
- heif_
suberror_ code_ heif_ suberror_ Nonexisting_ image_ channel_ referenced - Image channel referenced that does not exist in the image
- heif_
suberror_ code_ heif_ suberror_ Nonexisting_ item_ referenced - also used for Invalid_input
- heif_
suberror_ code_ heif_ suberror_ Null_ pointer_ argument - An API argument was given a NULL pointer, which is not allowed for that function.
- heif_
suberror_ code_ heif_ suberror_ Overlay_ image_ outside_ of_ canvas - Overlay image completely outside of visible canvas area
- heif_
suberror_ code_ heif_ suberror_ Plugin_ is_ not_ loaded - trying to remove a plugin that is not loaded
- heif_
suberror_ code_ heif_ suberror_ Plugin_ loading_ error - a specific plugin file cannot be loaded
- heif_
suberror_ code_ heif_ suberror_ Security_ limit_ exceeded - A security limit preventing unreasonable memory allocations was exceeded by the input file. Please check whether the file is valid. If it is, contact us so that we could increase the security limits further.
- heif_
suberror_ code_ heif_ suberror_ Too_ many_ regions - — Encoding_error —
- heif_
suberror_ code_ heif_ suberror_ Unknown_ NCLX_ color_ primaries - Overlay image completely outside of visible canvas area
- heif_
suberror_ code_ heif_ suberror_ Unknown_ NCLX_ matrix_ coefficients - Overlay image completely outside of visible canvas area
- heif_
suberror_ code_ heif_ suberror_ Unknown_ NCLX_ transfer_ characteristics - Overlay image completely outside of visible canvas area
- heif_
suberror_ code_ heif_ suberror_ Unknown_ color_ profile_ type - Overlay image completely outside of visible canvas area
- heif_
suberror_ code_ heif_ suberror_ Unspecified - no further information available
- heif_
suberror_ code_ heif_ suberror_ Unsupported_ bit_ depth - — Encoder_plugin_error —
- heif_
suberror_ code_ heif_ suberror_ Unsupported_ codec - Image was coded with an unsupported compression method.
- heif_
suberror_ code_ heif_ suberror_ Unsupported_ color_ conversion - The conversion of the source image to the requested chroma / colorspace is not supported.
- heif_
suberror_ code_ heif_ suberror_ Unsupported_ data_ version - Image is specified in an unknown way, e.g. as tiled grid image (which is supported)
- heif_
suberror_ code_ heif_ suberror_ Unsupported_ essential_ property - Generically compressed data used an unsupported compression method
- heif_
suberror_ code_ heif_ suberror_ Unsupported_ generic_ compression_ method - Generically compressed data used an unsupported compression method
- heif_
suberror_ code_ heif_ suberror_ Unsupported_ header_ compression_ method - The conversion of the source image to the requested chroma / colorspace is not supported.
- heif_
suberror_ code_ heif_ suberror_ Unsupported_ image_ type - Image is specified in an unknown way, e.g. as tiled grid image (which is supported)
- heif_
suberror_ code_ heif_ suberror_ Unsupported_ item_ construction_ method - The conversion of the source image to the requested chroma / colorspace is not supported.
- heif_
suberror_ code_ heif_ suberror_ Unsupported_ parameter - The given (encoder) parameter name does not exist.
- heif_
suberror_ code_ heif_ suberror_ Unsupported_ plugin_ version - The version of the passed plugin is not supported.
- heif_
suberror_ code_ heif_ suberror_ Unsupported_ writer_ version - The version of the passed writer is not supported.
- heif_
suberror_ code_ heif_ suberror_ Wrong_ tile_ image_ chroma_ format - Overlay image completely outside of visible canvas area
- heif_
suberror_ code_ heif_ suberror_ Wrong_ tile_ image_ pixel_ depth - Overlay image completely outside of visible canvas area
- heif_
track_ reference_ type_ heif_ track_ reference_ type_ auxiliary - auxiliary data (e.g. depth maps or alpha channel)
- heif_
track_ reference_ type_ heif_ track_ reference_ type_ description - track_description
- heif_
track_ reference_ type_ heif_ track_ reference_ type_ thumbnails - thumbnails
- heif_
track_ type_ 4cc_ heif_ track_ type_ image_ sequence - heif_
track_ type_ 4cc_ heif_ track_ type_ metadata - heif_
track_ type_ 4cc_ heif_ track_ type_ video - heif_
transfer_ characteristics_ heif_ transfer_ characteristic_ IEC_ 61966_ 2_ 1 - heif_
transfer_ characteristics_ heif_ transfer_ characteristic_ IEC_ 61966_ 2_ 4 - heif_
transfer_ characteristics_ heif_ transfer_ characteristic_ ITU_ R_ BT_ 470_ 6_ System_ B_ G - heif_
transfer_ characteristics_ heif_ transfer_ characteristic_ ITU_ R_ BT_ 470_ 6_ System_ M - heif_
transfer_ characteristics_ heif_ transfer_ characteristic_ ITU_ R_ BT_ 601_ 6 - heif_
transfer_ characteristics_ heif_ transfer_ characteristic_ ITU_ R_ BT_ 709_ 5 - heif_
transfer_ characteristics_ heif_ transfer_ characteristic_ ITU_ R_ BT_ 1361 - heif_
transfer_ characteristics_ heif_ transfer_ characteristic_ ITU_ R_ BT_ 2020_ 2_ 10bit - heif_
transfer_ characteristics_ heif_ transfer_ characteristic_ ITU_ R_ BT_ 2020_ 2_ 12bit - heif_
transfer_ characteristics_ heif_ transfer_ characteristic_ ITU_ R_ BT_ 2100_ 0_ HLG - heif_
transfer_ characteristics_ heif_ transfer_ characteristic_ ITU_ R_ BT_ 2100_ 0_ PQ - heif_
transfer_ characteristics_ heif_ transfer_ characteristic_ SMPTE_ 240M - heif_
transfer_ characteristics_ heif_ transfer_ characteristic_ SMPTE_ ST_ 428_ 1 - heif_
transfer_ characteristics_ heif_ transfer_ characteristic_ linear - heif_
transfer_ characteristics_ heif_ transfer_ characteristic_ logarithmic_ 100 - heif_
transfer_ characteristics_ heif_ transfer_ characteristic_ logarithmic_ 100_ sqrt10 - heif_
transfer_ characteristics_ heif_ transfer_ characteristic_ unspecified - heif_
transform_ mirror_ direction_ heif_ transform_ mirror_ direction_ horizontal - flip image horizontally
- heif_
transform_ mirror_ direction_ heif_ transform_ mirror_ direction_ invalid - heif_
transform_ mirror_ direction_ heif_ transform_ mirror_ direction_ vertical - flip image vertically
Functions§
- heif_
brand_ ⚠to_ fourcc - the output buffer must be at least 4 bytes long
- heif_
camera_ ⚠extrinsic_ matrix_ get_ rotation_ matrix - heif_
camera_ ⚠extrinsic_ matrix_ release - heif_
check_ ⚠filetype - input data should be at least 12 bytes
- heif_
check_ ⚠jpeg_ filetype - heif_
color_ ⚠conversion_ options_ ext_ alloc - heif_
color_ ⚠conversion_ options_ ext_ copy - heif_
color_ ⚠conversion_ options_ ext_ free - heif_
color_ ⚠conversion_ options_ set_ defaults - Assumes that it is a version=1 struct.
- heif_
context_ ⚠add_ XMP_ metadata - Add XMP metadata to an image.
- heif_
context_ ⚠add_ XMP_ metadata2 - New version of heif_context_add_XMP_metadata() with data compression (experimental).
- heif_
context_ ⚠add_ compatible_ brand - Add a compatible brand that is now added automatically by libheif when encoding images (e.g. some application brands like ‘geo1’).
- heif_
context_ ⚠add_ exif_ metadata - Add EXIF metadata to an image.
- heif_
context_ ⚠add_ generic_ metadata - Add generic, proprietary metadata to an image. You have to specify an ‘item_type’ that will identify your metadata. ‘content_type’ can be an additional type, or it can be NULL. For example, this function can be used to add IPTC metadata (IIM stream, not XMP) to an image. Although not standard, we propose to store IPTC data with item type=“iptc”, content_type=NULL.
- heif_
context_ ⚠add_ generic_ uri_ metadata - Add generic metadata with item_type “uri “. Items with this type do not have a content_type, but an item_uri_type and they have no content_encoding (they are always stored uncompressed).
- heif_
context_ ⚠add_ grid_ image - heif_
context_ ⚠add_ image_ tile - heif_
context_ ⚠add_ item - ———————–– adding new items ———————––
- heif_
context_ ⚠add_ item_ reference - heif_
context_ ⚠add_ item_ references - heif_
context_ ⚠add_ mime_ item - heif_
context_ ⚠add_ overlay_ image - offsets[] should either be NULL (all offsets==0) or an array of size 2*nImages with x;y offset pairs. If background_rgba is NULL, the background is transparent.
- heif_
context_ ⚠add_ precompressed_ mime_ item - heif_
context_ ⚠add_ uri_ item - heif_
context_ ⚠add_ uri_ metadata_ sequence_ track - Add a metadata track. The track content type is specified by the ‘uri’ parameter. This will be created as a ‘urim’ “URI Meta Sample Entry”.
- heif_
context_ ⚠add_ visual_ sequence_ track - Add a visual track to the sequence. The track ID is assigned automatically.
- heif_
context_ ⚠alloc - Allocate a new context for reading HEIF files. Has to be freed again with heif_context_free().
- heif_
context_ ⚠assign_ thumbnail - Assign ‘thumbnail_image’ as the thumbnail image of ‘master_image’.
- heif_
context_ ⚠debug_ dump_ boxes_ to_ file - Print information about the boxes of a HEIF file to file descriptor. This is for debugging and informational purposes only. You should not rely on the output having a specific format. At best, you should not use this at all.
- heif_
context_ ⚠encode_ grid - @brief Encodes an array of images into a grid.
- heif_
context_ ⚠encode_ image - Compress the input image. Returns a handle to the coded image in ‘out_image_handle’ unless out_image_handle = NULL. ‘options’ should be NULL for now. The first image added to the context is also automatically set the primary image, but you can change the primary image later with heif_context_set_primary_image().
- heif_
context_ ⚠encode_ thumbnail - Encode the ‘image’ as a scaled down thumbnail image. The image is scaled down to fit into a square area of width ‘bbox_size’. If the input image is already so small that it fits into this bounding box, no thumbnail image is encoded and NULL is returned in ‘out_thumb_image_handle’. No error is returned in this case. The encoded thumbnail is automatically assigned to the ‘master_image_handle’. Hence, you do not have to call heif_context_assign_thumbnail().
- heif_
context_ ⚠free - Free a previously allocated HEIF context. You should not free a context twice.
- heif_
context_ ⚠get_ encoder - Get an encoder instance that can be used to actually encode images from a descriptor.
- heif_
context_ ⚠get_ encoder_ descriptors - DEPRECATED: use heif_get_encoder_descriptors() instead. Get a list of available encoders. You can filter the encoders by compression format and name. Use format_filter==heif_compression_undefined and name_filter==NULL as wildcards. The returned list of encoders is sorted by their priority (which is a plugin property). The number of encoders is returned, which are not more than ‘count’ if (out_encoders != nullptr). By setting out_encoders==nullptr, you can query the number of encoders, ‘count’ is ignored. Note: to get the actual encoder from the descriptors returned here, use heif_context_get_encoder().
- heif_
context_ ⚠get_ encoder_ for_ format - Get an encoder for the given compression format. If there are several encoder plugins for this format, the encoder with the highest plugin priority will be returned.
- heif_
context_ ⚠get_ entity_ groups - Use 0 for
type_filter
oritem_filter
to disable the filter. Returns an array of heif_entity_group structs with *out_num_groups entries. - heif_
context_ ⚠get_ image_ handle - Get the image handle for a known image ID.
- heif_
context_ ⚠get_ item_ references - Get the item ids that reference the given item.
- heif_
context_ ⚠get_ list_ of_ item_ IDs - Get the item identifiers.
- heif_
context_ ⚠get_ list_ of_ top_ level_ image_ IDs - Fills in image IDs into the user-supplied int-array ‘ID_array’, preallocated with ‘count’ entries. Function returns the total number of IDs filled into the array.
- heif_
context_ ⚠get_ number_ of_ items - Gets the number of items.
- heif_
context_ ⚠get_ number_ of_ top_ level_ images - Number of top-level images in the HEIF file. This does not include the thumbnails or the tile images that are composed to an image grid. You can get access to the thumbnails via the main image handle.
- heif_
context_ ⚠get_ primary_ image_ ID - heif_
context_ ⚠get_ primary_ image_ handle - Get a handle to the primary image of the HEIF file. This is the image that should be displayed primarily when there are several images in the file.
- heif_
context_ ⚠get_ region_ item - Get the region item.
- heif_
context_ ⚠get_ security_ limits - Returns the security limits for a heif_context. By default, the limits are set to the global limits, but you can change them in the returned object.
- heif_
context_ ⚠get_ sequence_ duration - Get the total duration of the sequence in timescale clock ticks.
Use
heif_context_get_sequence_timescale()
to get the clock ticks per second. - heif_
context_ ⚠get_ sequence_ timescale - Get the timescale (clock ticks per second) for timing values in the sequence.
- heif_
context_ ⚠get_ track - Get the heif_track object for the given track ID.
If you pass
id=0
, the first visual track will be returned. If there is no track with the given ID or if 0 is passed and there is no visual track, NULL will be returned. - heif_
context_ ⚠get_ track_ ids - Returns the IDs for each of the tracks stored in the HEIF file. The output array must have heif_context_number_of_sequence_tracks() entries.
- heif_
context_ ⚠has_ sequence - Check whether there is an image sequence in the HEIF file.
- heif_
context_ ⚠is_ top_ level_ image_ ID - heif_
context_ ⚠number_ of_ sequence_ tracks - Get the number of tracks in the HEIF file.
- heif_
context_ ⚠read_ from_ file - Read a HEIF file from a named disk file. The heif_reading_options should currently be set to NULL.
- heif_
context_ ⚠read_ from_ memory - Read a HEIF file stored completely in memory. The heif_reading_options should currently be set to NULL. DEPRECATED: use heif_context_read_from_memory_without_copy() instead.
- heif_
context_ ⚠read_ from_ memory_ without_ copy - Same as heif_context_read_from_memory() except that the provided memory is not copied. That means, you will have to keep the memory area alive as long as you use the heif_context.
- heif_
context_ ⚠read_ from_ reader - heif_
context_ ⚠set_ major_ brand - Set the major brand of the file. If this function is not called, the major brand is determined automatically from the image or sequence content.
- heif_
context_ ⚠set_ max_ decoding_ threads - If the maximum threads number is set to 0, the image tiles are decoded in the main thread. This is different from setting it to 1, which will generate a single background thread to decode the tiles. Note that this setting only affects libheif itself. The codecs itself may still use multi-threaded decoding. You can use it, for example, in cases where you are decoding several images in parallel anyway you thus want to minimize parallelism in each decoder.
- heif_
context_ ⚠set_ maximum_ image_ size_ limit - Set the maximum image size security limit. This function will set the maximum image area (number of pixels) to maximum_width ^ 2. Alternatively to using this function, you can also set the maximum image area in the security limits structure returned by heif_context_get_security_limits().
- heif_
context_ ⚠set_ primary_ image - heif_
context_ ⚠set_ security_ limits - Overwrites the security limits of a heif_context. This is a convenience function to easily copy limits.
- heif_
context_ ⚠set_ sequence_ timescale - Set an independent global timescale for the sequence. If no timescale is set with this function, the timescale of the first track will be used.
- heif_
context_ ⚠write - heif_
context_ ⚠write_ to_ file - ==================================================================================================== Write the heif_context to a HEIF file
- heif_
decode_ ⚠image - Decode an heif_image_handle into the actual pixel image and also carry out all geometric transformations specified in the HEIF file (rotation, cropping, mirroring).
- heif_
decoder_ ⚠descriptor_ get_ id_ name - Return a short, symbolic name for identifying the decoder. This name should stay constant over different decoder versions. Note: the returned ID may be NULL for old plugins that don’t support this yet.
- heif_
decoder_ ⚠descriptor_ get_ name - Return a long, descriptive name of the decoder (including version information).
- heif_
decoding_ ⚠options_ alloc - Allocate decoding options and fill with default values. Note: you should always get the decoding options through this function since the option structure may grow in size in future versions.
- heif_
decoding_ ⚠options_ copy - heif_
decoding_ ⚠options_ free - heif_
deinit ⚠ - Deinitialise and clean up library.
- heif_
depth_ ⚠representation_ info_ free - heif_
encoder_ ⚠descriptor_ get_ compression_ format - heif_
encoder_ ⚠descriptor_ get_ id_ name - Return a short, symbolic name for identifying the encoder. This name should stay constant over different encoder versions.
- heif_
encoder_ ⚠descriptor_ get_ name - Return a long, descriptive name of the encoder (including version information).
- heif_
encoder_ ⚠descriptor_ supportes_ lossless_ compression - DEPRECATED, typo in function name
- heif_
encoder_ ⚠descriptor_ supportes_ lossy_ compression - DEPRECATED, typo in function name
- heif_
encoder_ ⚠descriptor_ supports_ lossless_ compression - heif_
encoder_ ⚠descriptor_ supports_ lossy_ compression - heif_
encoder_ ⚠get_ name - Get the encoder name from the encoder itself.
- heif_
encoder_ ⚠get_ parameter - Get the current value of a parameter of any type as a human readable string. The returned string is compatible with heif_encoder_set_parameter().
- heif_
encoder_ ⚠get_ parameter_ boolean - heif_
encoder_ ⚠get_ parameter_ integer - heif_
encoder_ ⚠get_ parameter_ string - heif_
encoder_ ⚠has_ default - Query whether a specific parameter has a default value.
- heif_
encoder_ ⚠list_ parameters - Get a generic list of encoder parameters. Each encoder may define its own, additional set of parameters. You do not have to free the returned list.
- heif_
encoder_ ⚠parameter_ get_ name - Return the parameter name.
- heif_
encoder_ ⚠parameter_ get_ type - Return the parameter type.
- heif_
encoder_ ⚠parameter_ get_ valid_ integer_ range - DEPRECATED. Use heif_encoder_parameter_get_valid_integer_values() instead.
- heif_
encoder_ ⚠parameter_ get_ valid_ integer_ values - If integer is limited by a range, have_minimum and/or have_maximum will be != 0 and *minimum, *maximum is set. If integer is limited by a fixed set of values, *num_valid_values will be >0 and *out_integer_array is set.
- heif_
encoder_ ⚠parameter_ get_ valid_ string_ values - heif_
encoder_ ⚠parameter_ integer_ valid_ range - heif_
encoder_ ⚠parameter_ integer_ valid_ values - heif_
encoder_ ⚠parameter_ string_ valid_ values - returns a NULL-terminated list of valid strings or NULL if all values are allowed
- heif_
encoder_ ⚠release - You have to release the encoder after use.
- heif_
encoder_ ⚠set_ logging_ level - level should be between 0 (= none) to 4 (= full)
- heif_
encoder_ ⚠set_ lossless - heif_
encoder_ ⚠set_ lossy_ quality - Set a ‘quality’ factor (0-100). How this is mapped to actual encoding parameters is encoder dependent.
- heif_
encoder_ ⚠set_ parameter - Set a parameter of any type to the string value. Integer values are parsed from the string. Boolean values can be “true”/“false”/“1”/“0”
- heif_
encoder_ ⚠set_ parameter_ boolean - heif_
encoder_ ⚠set_ parameter_ integer - heif_
encoder_ ⚠set_ parameter_ string - heif_
encoding_ ⚠options_ alloc - heif_
encoding_ ⚠options_ copy - heif_
encoding_ ⚠options_ free - heif_
entity_ ⚠groups_ release - Release an array of entity groups returned by heif_context_get_entity_groups().
- heif_
fourcc_ ⚠to_ brand - ‘brand_fourcc’ must be 4 character long, but need not be 0-terminated
- heif_
free_ ⚠list_ of_ compatible_ brands - heif_
free_ ⚠plugin_ directories - heif_
get_ ⚠decoder_ descriptors - Get a list of available decoders. You can filter the encoders by compression format. Use format_filter==heif_compression_undefined to get all available decoders. The returned list of decoders is sorted by their priority (which is a plugin property). The number of decoders is returned, which are not more than ‘count’ if (out_decoders != nullptr). By setting out_decoders==nullptr, you can query the number of decoders, ‘count’ is ignored.
- heif_
get_ ⚠disabled_ security_ limits - Returns a set of fully disabled security limits. Use with care and only after user confirmation.
- heif_
get_ ⚠encoder_ descriptors - Get a list of available encoders. You can filter the encoders by compression format and name. Use format_filter==heif_compression_undefined and name_filter==NULL as wildcards. The returned list of encoders is sorted by their priority (which is a plugin property). The number of encoders is returned, which are not more than ‘count’ if (out_encoders != nullptr). By setting out_encoders==nullptr, you can query the number of encoders, ‘count’ is ignored. Note: to get the actual encoder from the descriptors returned here, use heif_context_get_encoder().
- heif_
get_ ⚠file_ mime_ type - Returns one of these MIME types:
- heif_
get_ ⚠global_ security_ limits - The global security limits are the default for new heif_contexts. These global limits cannot be changed, but you can override the limits for a specific heif_context.
- heif_
get_ ⚠plugin_ directories - Get a NULL terminated array of the plugin directories that are searched by libheif. This includes the paths specified in the environment variable LIBHEIF_PLUGIN_PATHS and the built-in path (if not overridden by the environment variable).
- heif_
get_ ⚠version - Version string of linked libheif library.
- heif_
get_ ⚠version_ number - Numeric version of linked libheif library, encoded as 0xHHMMLL00 = hh.mm.ll, where hh, mm, ll is the decimal representation of HH, MM, LL. For example: 0x02150300 is version 2.21.3
- heif_
get_ ⚠version_ number_ maintenance - Numeric part “LL” from above. Returned as a decimal number.
- heif_
get_ ⚠version_ number_ major - Numeric part “HH” from above. Returned as a decimal number.
- heif_
get_ ⚠version_ number_ minor - Numeric part “MM” from above. Returned as a decimal number.
- heif_
has_ ⚠compatible_ brand - ‘brand_fourcc’ must be 4 character long, but need not be 0-terminated returns 1 if file includes the brand, and 0 if it does not returns -1 if the provided data is not sufficient (you should input at least as many bytes as indicated in the first 4 bytes of the file, usually ~50 bytes will do) returns -2 on other errors
- heif_
has_ ⚠compatible_ filetype - Check the filetype box content for a supported file type.
- heif_
have_ ⚠decoder_ for_ format - Quick check whether there is a decoder available for the given format. Note that the decoder still may not be able to decode all variants of that format. You will have to query that further (todo) or just try to decode and check the returned error.
- heif_
have_ ⚠encoder_ for_ format - Quick check whether there is an enoder available for the given format. Note that the encoder may be limited to a certain subset of features (e.g. only 8 bit, only lossy). You will have to query the specific capabilities further.
- heif_
image_ ⚠add_ decoding_ warning - This function is only for decoder plugin implementors.
- heif_
image_ ⚠add_ plane - Add an image plane to the image.
- heif_
image_ ⚠add_ plane_ safe - The security limits should preferably be the limits from a heif_context. The memory allocated will then be registered in the memory budget of that context.
- heif_
image_ ⚠create - Create a new image of the specified resolution and colorspace.
- heif_
image_ ⚠crop - heif_
image_ ⚠extend_ padding_ to_ size - This function extends the padding of the image so that it has at least the given physical size. The padding border is filled with the pixels along the right/bottom border. This function may be useful if you want to process the image, but have some external padding requirements. The image size will not be modified if it is already larger/equal than the given physical size. I.e. you cannot assume that after calling this function, the stride will be equal to min_physical_width.
- heif_
image_ ⚠extend_ to_ size_ fill_ with_ zero - Extends the image size to match the given size by extending the right and bottom borders. The border areas are filled with zero.
- heif_
image_ ⚠extract_ area - heif_
image_ ⚠get_ bits_ per_ pixel - Get the number of bits per pixel in the given image channel. Returns -1 if a non-existing channel was given. Note that the number of bits per pixel may be different for each color channel. This function returns the number of bits used for storage of each pixel. Especially for HDR images, this is probably not what you want. Have a look at heif_image_get_bits_per_pixel_range() instead.
- heif_
image_ ⚠get_ bits_ per_ pixel_ range - Get the number of bits per pixel in the given image channel. This function returns the number of bits used for representing the pixel value, which might be smaller than the number of bits used in memory. For example, in 12bit HDR images, this function returns ‘12’, while still 16 bits are reserved for storage. For interleaved RGBA with 12 bit, this function also returns ‘12’, not ‘48’ or ‘64’ (heif_image_get_bits_per_pixel returns 64 in this case).
- heif_
image_ ⚠get_ chroma_ format - Get the chroma format of the image.
- heif_
image_ ⚠get_ color_ profile_ type - Note: in early versions of HEIF, there could only be one color profile per image. However, this has been changed. This function will now return ICC if one is present and NCLX only if there is no ICC. You may better avoid this function and simply query for NCLX and ICC directly.
- heif_
image_ ⚠get_ colorspace - Get the colorspace format of the image.
- heif_
image_ ⚠get_ content_ light_ level - heif_
image_ ⚠get_ decoding_ warnings - Fills the image decoding warnings into the provided ‘out_warnings’ array. The size of the array has to be provided in max_output_buffer_entries. If max_output_buffer_entries==0, the number of decoder warnings is returned. The function fills the warnings into the provided buffer, starting with ‘first_warning_idx’. It returns the number of warnings filled into the buffer. Note: you can iterate through all warnings by using ‘max_output_buffer_entries=1’ and iterate ‘first_warning_idx’.
- heif_
image_ ⚠get_ duration - Get the image display duration in clock ticks of this track. Make sure to use the timescale of the track and not the timescale of the total sequence.
- heif_
image_ ⚠get_ gimi_ sample_ content_ id - Get the GIMI content ID stored in the image sample. If there is no content ID, NULL is returned. @return
- heif_
image_ ⚠get_ height - Get the height of a specified image channel.
- heif_
image_ ⚠get_ mastering_ display_ colour_ volume - heif_
image_ ⚠get_ nclx_ color_ profile - heif_
image_ ⚠get_ pixel_ aspect_ ratio - heif_
image_ ⚠get_ plane - Deprecated, use the safer version heif_image_get_plane2() instead.
- heif_
image_ ⚠get_ plane2 - heif_
image_ ⚠get_ plane_ readonly - Get a pointer to the actual pixel data. The ‘out_stride’ is returned as “bytes per line”. When out_stride is NULL, no value will be written. Returns NULL if a non-existing channel was given. Deprecated, use the safer version heif_image_get_plane_readonly2() instead.
- heif_
image_ ⚠get_ plane_ readonly2 - These are safer variants of the two functions above. The ‘stride’ parameter is often multiplied by the image height in the client application. For very large images, this can lead to integer overflows and, consequently, illegal memory accesses. The changed ‘stride’ parameter types eliminates this common error.
- heif_
image_ ⚠get_ primary_ height - Get the height of the main channel.
- heif_
image_ ⚠get_ primary_ width - Get the width of the main channel.
- heif_
image_ ⚠get_ raw_ color_ profile - Returns the ICC profile if one is assigned to the image. Otherwise, it returns an error.
- heif_
image_ ⚠get_ raw_ color_ profile_ size - Returns the size of the ICC profile if one is assigned to the image. Otherwise, it returns 0.
- heif_
image_ ⚠get_ tai_ timestamp - Get the heif_tai_timestamp_packet attached to the image. The main use of this function is for image sequences, but it can also be used for still images. This function allocates a new heif_tai_timestamp_packet and returns it through out_timestamp.
- heif_
image_ ⚠get_ width - Get the width of a specified image channel.
- heif_
image_ ⚠handle_ add_ region_ item - Add a region item to an image.
- heif_
image_ ⚠handle_ decode_ image_ tile - The tile position is given in tile indices, not in pixel coordinates. If the image transformations are processed (option->ignore_image_transformations==false), the tile position is given in the transformed coordinates.
- heif_
image_ ⚠handle_ free_ auxiliary_ types - DEPRECATED (because typo in function name). Use heif_image_handle_release_auxiliary_type() instead.
- heif_
image_ ⚠handle_ get_ auxiliary_ image_ handle - Get the image handle of an auxiliary image.
- heif_
image_ ⚠handle_ get_ auxiliary_ type - You are responsible to deallocate the returned buffer with heif_image_handle_release_auxiliary_type().
- heif_
image_ ⚠handle_ get_ camera_ extrinsic_ matrix - heif_
image_ ⚠handle_ get_ camera_ intrinsic_ matrix - heif_
image_ ⚠handle_ get_ chroma_ bits_ per_ pixel - Returns -1 on error, e.g. if this information is not present in the image. Only defined for images coded in the YCbCr colorspace.
- heif_
image_ ⚠handle_ get_ color_ profile_ type - Returns ‘heif_color_profile_type_not_present’ if there is no color profile. If there is an ICC profile and an NCLX profile, the ICC profile is returned. TODO: we need a new API for this function as images can contain both NCLX and ICC at the same time. However, you can still use heif_image_handle_get_raw_color_profile() and heif_image_handle_get_nclx_color_profile() to access both profiles.
- heif_
image_ ⚠handle_ get_ content_ light_ level - Returns whether the image has ‘content light level’ information. If 0 is returned, the output is not filled.
- heif_
image_ ⚠handle_ get_ context - This gets the context associated with the image handle. Note that you have to release the returned context with heif_context_free() in any case.
- heif_
image_ ⚠handle_ get_ depth_ image_ handle - heif_
image_ ⚠handle_ get_ depth_ image_ representation_ info - Returns true when there is depth_representation_info available Note 1: depth_image_id is currently unused because we support only one depth channel per image, but you should still provide the correct ID for future compatibility. Note 2: Because of an API bug before v1.11.0, the function also works when ‘handle’ is the handle of the depth image. However, you should pass the handle of the main image. Please adapt your code if needed.
- heif_
image_ ⚠handle_ get_ grid_ image_ tile_ id - For grid images, return the image item ID of a specific grid tile. If ‘process_image_transformations’ is true, the tile positions are given in the transformed image coordinate system and are internally mapped to the original image tile positions.
- heif_
image_ ⚠handle_ get_ height - heif_
image_ ⚠handle_ get_ image_ tiling - If ‘process_image_transformations’ is true, this returns modified sizes. If it is false, the top_offset and left_offset will always be (0;0).
- heif_
image_ ⚠handle_ get_ ispe_ height - heif_
image_ ⚠handle_ get_ ispe_ width - Get the image width from the ‘ispe’ box. This is the original image size without any transformations applied to it. Do not use this unless you know exactly what you are doing.
- heif_
image_ ⚠handle_ get_ item_ id - heif_
image_ ⚠handle_ get_ list_ of_ auxiliary_ image_ IDs - heif_
image_ ⚠handle_ get_ list_ of_ depth_ image_ IDs - heif_
image_ ⚠handle_ get_ list_ of_ metadata_ block_ IDs - ‘type_filter’ can be used to get only metadata of specific types, like “Exif”. If ‘type_filter’ is NULL, it will return all types of metadata IDs.
- heif_
image_ ⚠handle_ get_ list_ of_ region_ item_ ids - Get the region item identifiers for the region items attached to an image.
- heif_
image_ ⚠handle_ get_ list_ of_ thumbnail_ IDs - heif_
image_ ⚠handle_ get_ luma_ bits_ per_ pixel - Returns -1 on error, e.g. if this information is not present in the image. Only defined for images coded in the YCbCr or monochrome colorspace.
- heif_
image_ ⚠handle_ get_ mastering_ display_ colour_ volume - Returns whether the image has ‘mastering display colour volume’ information. If 0 is returned, the output is not filled.
- heif_
image_ ⚠handle_ get_ metadata - ‘out_data’ must point to a memory area of the size reported by heif_image_handle_get_metadata_size(). The data is returned exactly as stored in the HEIF file. For Exif data, you probably have to skip the first four bytes of the data, since they indicate the offset to the start of the TIFF header of the Exif data.
- heif_
image_ ⚠handle_ get_ metadata_ content_ type - For EXIF, the content type is empty. For XMP, the content type is “application/rdf+xml”.
- heif_
image_ ⚠handle_ get_ metadata_ item_ uri_ type - Only valid for item type == “uri “, an absolute URI
- heif_
image_ ⚠handle_ get_ metadata_ size - Get the size of the raw metadata, as stored in the HEIF file.
- heif_
image_ ⚠handle_ get_ metadata_ type - Return a string indicating the type of the metadata, as specified in the HEIF file. Exif data will have the type string “Exif”. This string will be valid until the next call to a libheif function. You do not have to free this string.
- heif_
image_ ⚠handle_ get_ nclx_ color_ profile - Returns ‘heif_error_Color_profile_does_not_exist’ when there is no NCLX profile. TODO: This function does currently not return an NCLX profile if it is stored in the image bitstream. Only NCLX profiles stored as colr boxes are returned. This may change in the future.
- heif_
image_ ⚠handle_ get_ number_ of_ auxiliary_ images - List the number of auxiliary images assigned to this image handle.
- heif_
image_ ⚠handle_ get_ number_ of_ depth_ images - heif_
image_ ⚠handle_ get_ number_ of_ metadata_ blocks - How many metadata blocks are attached to an image. If you only want to get EXIF data, set the type_filter to “Exif”. Otherwise, set the type_filter to NULL.
- heif_
image_ ⚠handle_ get_ number_ of_ region_ items - Get the number of region items that are attached to an image.
- heif_
image_ ⚠handle_ get_ number_ of_ thumbnails - List the number of thumbnails assigned to this image handle. Usually 0 or 1.
- heif_
image_ ⚠handle_ get_ pixel_ aspect_ ratio - Returns whether the image has ‘pixel aspect ratio information’ information. If 0 is returned, the output is filled with the 1:1 default.
- heif_
image_ ⚠handle_ get_ preferred_ decoding_ colorspace - Return the colorspace that libheif proposes to use for decoding. Usually, these will be either YCbCr or Monochrome, but it may also propose RGB for images encoded with matrix_coefficients=0 or for images coded natively in RGB. It may also return *_undefined if the file misses relevant information to determine this without decoding. These are only proposed values that avoid colorspace conversions as much as possible. You can still request the output in your preferred colorspace, but this may involve an internal conversion.
- heif_
image_ ⚠handle_ get_ raw_ color_ profile - Returns ‘heif_error_Color_profile_does_not_exist’ when there is no ICC profile.
- heif_
image_ ⚠handle_ get_ raw_ color_ profile_ size - heif_
image_ ⚠handle_ get_ thumbnail - Get the image handle of a thumbnail image.
- heif_
image_ ⚠handle_ get_ width - Get the resolution of an image.
- heif_
image_ ⚠handle_ has_ alpha_ channel - heif_
image_ ⚠handle_ has_ camera_ extrinsic_ matrix - heif_
image_ ⚠handle_ has_ camera_ intrinsic_ matrix - heif_
image_ ⚠handle_ has_ depth_ image - ———————–– depth images ———————––
- heif_
image_ ⚠handle_ is_ premultiplied_ alpha - heif_
image_ ⚠handle_ is_ primary_ image - Check whether the given image_handle is the primary image of the file.
- heif_
image_ ⚠handle_ release - Release image handle.
- heif_
image_ ⚠handle_ release_ auxiliary_ type - heif_
image_ ⚠has_ channel - heif_
image_ ⚠has_ content_ light_ level - heif_
image_ ⚠has_ mastering_ display_ colour_ volume - heif_
image_ ⚠is_ premultiplied_ alpha - heif_
image_ ⚠release - Release heif_image.
- heif_
image_ ⚠scale_ image - Currently, heif_scaling_options is not defined yet. Pass a NULL pointer.
- heif_
image_ ⚠set_ content_ light_ level - heif_
image_ ⚠set_ duration - Set the image display duration in the track’s timescale units.
- heif_
image_ ⚠set_ gimi_ sample_ content_ id - Set the GIMI content ID for an image sample. It will be stored as SAI. When passing NULL, a previously set ID will be removed.
- heif_
image_ ⚠set_ mastering_ display_ colour_ volume - heif_
image_ ⚠set_ nclx_ color_ profile - heif_
image_ ⚠set_ pixel_ aspect_ ratio - heif_
image_ ⚠set_ premultiplied_ alpha - Signal that the image is premultiplied by the alpha pixel values.
- heif_
image_ ⚠set_ raw_ color_ profile - The color profile is not attached to the image handle because we might need it for color space transform and encoding.
- heif_
image_ ⚠set_ tai_ timestamp - Attach a TAI timestamp to the image. The main use of this function is for image sequences, but it can also be used for still images. If used for still images, note that you also have to set the heif_tai_clock_info to the image item through heif_item_set_property_tai_clock_info().
- heif_
init ⚠ - Initialise library.
- heif_
item_ ⚠add_ property_ user_ description - Add a “udes” user description property to the item. If any string pointers are NULL, an empty string will be used instead.
- heif_
item_ ⚠add_ raw_ property - @param context The heif_context for the file @param itemId The image item id to which this property belongs. @param fourcc_type The short four-cc type of the property to add. @param uuid_type If fourcc_type==‘uuid’, this should point to a 16-byte UUID type. It is ignored otherwise and can be NULL. @param data Data to insert for this property (including a full-box header, if required for this box). @param size Length of data in bytes. @param is_essential Whether this property is essential (boolean). @param out_propertyId Outputs the id of the inserted property. Can be NULL.
- heif_
item_ ⚠get_ item_ data - Gets the raw metadata, as stored in the HEIF file.
- heif_
item_ ⚠get_ item_ name - heif_
item_ ⚠get_ item_ type - Gets the item type.
- heif_
item_ ⚠get_ mime_ item_ content_ encoding - Gets the content_encoding for a MIME item.
- heif_
item_ ⚠get_ mime_ item_ content_ type - Gets the MIME content_type for an item.
- heif_
item_ ⚠get_ properties_ of_ type - Get the heif_property_id for a heif_item_id. You may specify which property ‘type’ you want to receive. If you specify ‘heif_item_property_type_invalid’, all properties associated to that item are returned. The number of properties is returned, which are not more than ‘count’ if (out_list != nullptr). By setting out_list==nullptr, you can query the number of properties, ‘count’ is ignored.
- heif_
item_ ⚠get_ property_ raw_ data - @param out_data User-supplied array to write the property data to. The required size of the output array is given by heif_item_get_property_raw_size().
- heif_
item_ ⚠get_ property_ raw_ size - heif_
item_ ⚠get_ property_ tai_ clock_ info - Get the heif_tai_clock_info attached to the item. This function allocates a new heif_tai_clock_info and returns it through out_clock.
- heif_
item_ ⚠get_ property_ tai_ timestamp - Get the heif_tai_timestamp_packet attached to the item. This function allocates a new heif_tai_timestamp_packet and returns it through out_timestamp.
- heif_
item_ ⚠get_ property_ transform_ crop_ borders - Returns the number of pixels that should be removed from the four edges. Because of the way this data is stored, you have to pass the image size at the moment of the crop operation to compute the cropped border sizes.
- heif_
item_ ⚠get_ property_ transform_ mirror - Will return ‘heif_transform_mirror_direction_invalid’ in case of error.
- heif_
item_ ⚠get_ property_ transform_ rotation_ ccw - Returns only 0, 90, 180, or 270 angle values. Returns -1 in case of error (but it will only return an error in case of wrong usage).
- heif_
item_ ⚠get_ property_ type - heif_
item_ ⚠get_ property_ user_ description - Get the “udes” user description property content. Undefined strings are returned as empty strings.
- heif_
item_ ⚠get_ property_ uuid_ type - Get the extended type for an extended “uuid” box.
- heif_
item_ ⚠get_ transformation_ properties - Returns all transformative properties in the correct order. This includes “irot”, “imir”, “clap”. The number of properties is returned, which are not more than ‘count’ if (out_list != nullptr). By setting out_list==nullptr, you can query the number of properties, ‘count’ is ignored.
- heif_
item_ ⚠get_ uri_ item_ uri_ type - Gets the item_uri_type for an item.
- heif_
item_ ⚠is_ item_ hidden - heif_
item_ ⚠set_ item_ name - heif_
item_ ⚠set_ property_ tai_ clock_ info - Creates a new clock info property if it doesn’t exist yet. You can only add one tai_clock_info to an image.
- heif_
item_ ⚠set_ property_ tai_ timestamp - Creates a new TAI timestamp property if it doesn’t exist yet. You can only add one tai_timestamp to an image.
- heif_
list_ ⚠compatible_ brands - Returns an array of compatible brands. The array is allocated by this function and has to be freed with ‘heif_free_list_of_compatible_brands()’. The number of entries is returned in out_size.
- heif_
load_ ⚠plugin - heif_
load_ ⚠plugins - heif_
main_ ⚠brand - input data should be at least 12 bytes DEPRECATED, use heif_read_main_brand() instead
- heif_
mastering_ ⚠display_ colour_ volume_ decode - Converts the internal numeric representation of heif_mastering_display_colour_volume to the normalized values, collected in heif_decoded_mastering_display_colour_volume. Values that are out-of-range are decoded to 0, indicating an undefined value (as specified in ISO/IEC 23008-2).
- heif_
nclx_ ⚠color_ profile_ alloc - Returned color profile has ‘version’ field set to the maximum allowed. Do not fill values for higher versions as these might be outside the allocated structure size. May return NULL.
- heif_
nclx_ ⚠color_ profile_ free - heif_
nclx_ ⚠color_ profile_ set_ color_ primaries - heif_
nclx_ ⚠color_ profile_ set_ matrix_ coefficients - heif_
nclx_ ⚠color_ profile_ set_ transfer_ characteristics - heif_
property_ ⚠user_ description_ release - Release all strings and the object itself. Only call for objects that you received from heif_item_get_property_user_description().
- heif_
raw_ ⚠sequence_ sample_ alloc - Allocate a new heif_raw_sequence_sample object. Free with heif_raw_sequence_sample_release().
- heif_
raw_ ⚠sequence_ sample_ get_ data - Get a pointer to the data of the (metadata) sample. The data pointer stays valid until the heif_raw_sequence_sample object is released.
- heif_
raw_ ⚠sequence_ sample_ get_ data_ size - Return the size of the raw data contained in the sample. This is the same as returned through the ‘out_array_size’ parameter of ‘heif_raw_sequence_sample_get_data()’.
- heif_
raw_ ⚠sequence_ sample_ get_ duration - Get the sample duration in clock ticks of this track. Make sure to use the timescale of the track and not the timescale of the total sequence.
- heif_
raw_ ⚠sequence_ sample_ get_ gimi_ sample_ content_ id - Get the GIMI content ID stored in the metadata sample. If there is no content ID, NULL is returned. @return
- heif_
raw_ ⚠sequence_ sample_ get_ tai_ timestamp - Get the TAI timestamp of the (metadata) sample. If there is no timestamp assigned to it, NULL will be returned.
- heif_
raw_ ⚠sequence_ sample_ has_ tai_ timestamp - Returns whether the raw (metadata) sample has a TAI timestamp attached to it (stored as SAI).
- heif_
raw_ ⚠sequence_ sample_ release - Release a heif_raw_sequence_sample object. You may pass NULL.
- heif_
raw_ ⚠sequence_ sample_ set_ data - Set the raw sequence sample data.
- heif_
raw_ ⚠sequence_ sample_ set_ duration - Set the sample duration in track timescale units.
- heif_
raw_ ⚠sequence_ sample_ set_ gimi_ sample_ content_ id - Set the GIMI content ID for a (metadata) sample. It will be stored as SAI. When passing NULL, a previously set ID will be removed.
- heif_
raw_ ⚠sequence_ sample_ set_ tai_ timestamp - Set the TAI timestamp for a raw sequence sample. The timestamp will be copied, you can release it after calling this function.
- heif_
read_ ⚠main_ brand - input data should be at least 12 bytes
- heif_
read_ ⚠minor_ version_ brand - input data should be at least 16 bytes
- heif_
region_ ⚠get_ ellipse - Get the values for an ellipse region.
- heif_
region_ ⚠get_ ellipse_ transformed - Get the transformed values for an ellipse region.
- heif_
region_ ⚠get_ inline_ mask_ data - Get data for an inline mask region.
- heif_
region_ ⚠get_ inline_ mask_ data_ len - Get the length of the data in an inline mask region.
- heif_
region_ ⚠get_ mask_ image - Get a mask region image.
- heif_
region_ ⚠get_ point - Get the values for a point region.
- heif_
region_ ⚠get_ point_ transformed - Get the transformed values for a point region.
- heif_
region_ ⚠get_ polygon_ num_ points - Get the number of points in a polygon.
- heif_
region_ ⚠get_ polygon_ points - Get the points in a polygon region.
- heif_
region_ ⚠get_ polygon_ points_ transformed - Get the transformed points in a polygon region.
- heif_
region_ ⚠get_ polyline_ num_ points - Get the number of points in a polyline.
- heif_
region_ ⚠get_ polyline_ points - Get the points in a polyline region.
- heif_
region_ ⚠get_ polyline_ points_ transformed - Get the transformed points in a polyline region.
- heif_
region_ ⚠get_ rectangle - Get the values for a rectangle region.
- heif_
region_ ⚠get_ rectangle_ transformed - Get the transformed values for a rectangle region.
- heif_
region_ ⚠get_ referenced_ mask_ ID - Get a referenced item mask region.
- heif_
region_ ⚠get_ type - Get the region type for a specified region.
- heif_
region_ ⚠item_ add_ region_ ellipse - Add a ellipse region to the region item.
- heif_
region_ ⚠item_ add_ region_ inline_ mask - Add an inline mask region image to the region item.
- heif_
region_ ⚠item_ add_ region_ inline_ mask_ data - Add an inline mask region to the region item.
- heif_
region_ ⚠item_ add_ region_ point - Add a point region to the region item.
- heif_
region_ ⚠item_ add_ region_ polygon - Add a polygon region to the region item.
- heif_
region_ ⚠item_ add_ region_ polyline - Add a polyline region to the region item.
- heif_
region_ ⚠item_ add_ region_ rectangle - Add a rectangle region to the region item.
- heif_
region_ ⚠item_ add_ region_ referenced_ mask - Add a referenced mask region to the region item.
- heif_
region_ ⚠item_ get_ id - Get the item identifier for a region item.
- heif_
region_ ⚠item_ get_ list_ of_ regions - Get the regions that are part of a region item.
- heif_
region_ ⚠item_ get_ number_ of_ regions - Get the number of regions within a region item.
- heif_
region_ ⚠item_ get_ reference_ size - Get the reference size for a region item.
- heif_
region_ ⚠item_ release - Release a region item.
- heif_
region_ ⚠release - Release a region.
- heif_
region_ ⚠release_ many - Release a list of regions.
- heif_
register_ ⚠decoder - DEPRECATED. Use heif_register_decoder_plugin(const struct heif_decoder_plugin*) instead.
- heif_
register_ ⚠decoder_ plugin - heif_
register_ ⚠encoder_ plugin - heif_
release_ ⚠item_ data - Free the item data.
- heif_
release_ ⚠item_ references - heif_
sequence_ ⚠encoding_ options_ alloc - heif_
sequence_ ⚠encoding_ options_ release - heif_
string_ ⚠release - Free a string returned by libheif in various API functions. You may pass NULL.
- heif_
tai_ ⚠clock_ info_ alloc - Allocate a new heif_tai_clock_info object and initialize with default values.
- heif_
tai_ ⚠clock_ info_ copy - Copies the source object into the destination object. Only the fields that are present in both objects are copied. The version property has to be set in both structs.
- heif_
tai_ ⚠clock_ info_ release - heif_
tai_ ⚠timestamp_ packet_ alloc - Allocate a new heif_tai_timestamp_packet object and initialize with default values.
- heif_
tai_ ⚠timestamp_ packet_ copy - Copies the source object into the destination object. Only the fields that are present in both objects are copied. The version property has to be set in both structs.
- heif_
tai_ ⚠timestamp_ packet_ release - heif_
track_ ⚠add_ raw_ sequence_ sample - Add a raw sequence sample (usually a metadata sample) to the (metadata) track.
- heif_
track_ ⚠add_ reference_ to_ track - Add a reference between tracks. ‘reference_type’ can be one of the four-cc codes listed in heif_track_reference_type or any other type.
- heif_
track_ ⚠decode_ next_ image - Decode the next image in the passed sequence track.
If there is no more image in the sequence,
heif_error_End_of_sequence
is returned. The parameterscolorspace
,chroma
andoptions
are similar to heif_decode_image(). If you want to let libheif decide the output colorspace and chroma, set these parameters to heif_colorspace_undefined / heif_chroma_undefined. Usually, libheif will return the image in the input colorspace, but it may also modify it for example when it has to rotate the image. If you want to get the image in a specific colorspace/chroma format, you can specify this and libheif will convert the image to match this format. - heif_
track_ ⚠encode_ sequence_ image - Encode the image into a visual track. If the passed track is no visual track, an error will be returned.
- heif_
track_ ⚠find_ referring_ tracks - Find tracks that are referring to the current track through the passed reference_type.
The found track IDs will be filled into the passed array, but no more than
array_size
entries will be filled. - heif_
track_ ⚠get_ gimi_ track_ content_ id - Get the GIMI content ID for the track (as a whole). If there is no content ID, nullptr is returned.
- heif_
track_ ⚠get_ id - Get the ID of the passed track. The track ID will never be 0.
- heif_
track_ ⚠get_ image_ resolution - Get the image resolution of the track. If the passed track is no visual track, an error is returned.
- heif_
track_ ⚠get_ next_ raw_ sequence_ sample - Get the next raw sample from the (metadata) sequence track. You have to free the returned sample with heif_raw_sequence_sample_release().
- heif_
track_ ⚠get_ number_ of_ sample_ aux_ infos - Returns how many different types of sample auxiliary data units are assigned to this track’s samples.
- heif_
track_ ⚠get_ number_ of_ track_ reference_ of_ type - Get the number of references of the passed type.
- heif_
track_ ⚠get_ number_ of_ track_ reference_ types - Return the number of different reference types used in this track’s tref box.
- heif_
track_ ⚠get_ references_ from_ track - List the track ids this track points to with the passed reference type. The passed array must have heif_track_get_number_of_track_reference_of_type() entries.
- heif_
track_ ⚠get_ sample_ aux_ info_ types - Get get the list of sample auxiliary data types used in the track. The passed array has to have heif_track_get_number_of_sample_aux_infos() entries.
- heif_
track_ ⚠get_ sample_ entry_ type_ of_ first_ cluster - Get the “sample entry type” of the first sample sample cluster in the track. In the case of metadata tracks, this will usually be “urim” for “URI Meta Sample Entry”. The exact URI can then be obtained with ‘heif_track_get_urim_sample_entry_uri_of_first_cluster’.
- heif_
track_ ⚠get_ tai_ clock_ info_ of_ first_ cluster - Returns the TAI clock info of the track. If there is no TAI clock info, NULL is returned. You should NOT free the returned heif_tai_clock_info. The structure stays valid until the heif_track object is released.
- heif_
track_ ⚠get_ timescale - Get the timescale (clock ticks per second) for this track. Note that this can be different from the timescale used at sequence level.
- heif_
track_ ⚠get_ track_ handler_ type - Get the four-cc track handler type. Typical codes are “vide” for video sequences, “pict” for image sequences, “meta” for metadata tracks. These are defined in heif_track_type_4cc, but files may also contain other types.
- heif_
track_ ⚠get_ track_ reference_ types - List the reference types used in this track. The passed array must have heif_track_get_number_of_track_reference_types() entries.
- heif_
track_ ⚠get_ urim_ sample_ entry_ uri_ of_ first_ cluster - Get the URI of the first sample cluster in an ‘urim’ track. Only call this for tracks with ‘urim’ sample entry types. It will return an error otherwise.
- heif_
track_ ⚠options_ alloc - Allocate track options object that is required to set options for a new track. When you create a new track, you can also pass a NULL heif_track_options pointer, in which case the default options are used.
- heif_
track_ ⚠options_ enable_ sample_ gimi_ content_ ids - heif_
track_ ⚠options_ enable_ sample_ tai_ timestamps - heif_
track_ ⚠options_ release - heif_
track_ ⚠options_ set_ gimi_ track_ id - Set the GIMI format track ID string. If NULL is passed, no track ID is saved. @param track_id
- heif_
track_ ⚠options_ set_ interleaved_ sample_ aux_ infos - Set whether the aux-info data should be stored interleaved with the sequence samples. Default is: false.
- heif_
track_ ⚠options_ set_ timescale - Set the track specific timescale. This is the number of clock ticks per second. The default is 90,000 Hz. @param timescale
- heif_
track_ ⚠release - Free a
heif_track
object received from libheif. Passing NULL is ok. - heif_
unload_ ⚠plugin
Type Aliases§
- heif_
alpha_ composition_ mode - heif_
brand - DEPRECATED, use heif_brand2 and the heif_brand2_* constants instead
- heif_
brand2 - heif_
channel - heif_
chroma - heif_
chroma_ downsampling_ algorithm - heif_
chroma_ upsampling_ algorithm - heif_
color_ primaries - heif_
color_ profile_ type - ———————–– color profiles ———————––
- heif_
colorspace - heif_
compression_ format - libheif known compression formats.
- heif_
depth_ representation_ type - heif_
encoder_ parameter_ type - heif_
entity_ group_ id - ———————–– entity groups ————————
- heif_
error_ code - heif_
filetype_ result - ========================= file type check ======================
- heif_
item_ id - heif_
item_ property_ type - ———————–– item properties ———————––
- heif_
matrix_ coefficients - heif_
metadata_ compression - heif_
orientation - The orientation values are defined equal to the EXIF Orientation tag.
- heif_
plugin_ type - — Plugins are currently only supported on Unix platforms.
- heif_
progress_ step - heif_
property_ id - heif_
reader_ grow_ status - heif_
region_ type - Region type.
- heif_
sample_ aux_ info_ presence - Specifies whether a ‘sample auxiliary info’ is stored with the samples.
The difference between
heif_sample_aux_info_presence_optional
andheif_sample_aux_info_presence_mandatory
is thatheif_sample_aux_info_presence_mandatory
will throw an error if the data is missing when writing a sample. - heif_
suberror_ code - heif_
track_ reference_ type - — track references
- heif_
track_ type - heif_
track_ type_ 4cc - heif_
transfer_ characteristics - heif_
transform_ mirror_ direction