Function libheif_sys::heif_init

source ·
pub unsafe extern "C" fn heif_init(
    arg1: *mut heif_init_params
) -> heif_error
Expand description

Initialise library.

You should call heif_init() when you start using libheif and heif_deinit() when you are finished. These calls are reference counted. Each call to heif_init() should be matched by one call to heif_deinit().

For backwards compatibility, it is not really necessary to call heif_init(), but some library memory objects will never be freed if you do not call heif_init()/heif_deinit().

heif_init() will load the external modules installed in the default plugin path. Thus, you need it when you want to load external plugins from the default path. Codec plugins that are compiled into the library directly (selected by the compile-time parameters of libheif) will be available even without heif_init().

Make sure that you do not have one part of your program use heif_init()/heif_deinit() and another part that does not use it as the latter may try to use an uninitialized library. If in doubt, enclose everything with init/deinit.

You may pass nullptr to get default parameters. Currently, no parameters are supported.