libheif
Loading...
Searching...
No Matches
heif_library.h File Reference
#include <stddef.h>
#include <stdint.h>
#include <libheif/heif_export.h>
#include <libheif/heif_version.h>
#include <libheif/heif_error.h>
Include dependency graph for heif_library.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  heif_init_params
struct  heif_plugin_info

Macros

#define heif_fourcc(a, b, c, d)
 Build a 32 bit integer from a 4-character code.
#define LIBHEIF_MAKE_VERSION(h, m, l)
#define LIBHEIF_HAVE_VERSION(h, m, l)

Typedefs

typedef struct heif_context heif_context
typedef struct heif_image_handle heif_image_handle
typedef uint32_t heif_item_id
typedef uint32_t heif_property_id
typedef struct heif_init_params heif_init_params
typedef enum heif_plugin_type heif_plugin_type
typedef struct heif_plugin_info heif_plugin_info
typedef struct heif_decoder_plugin heif_decoder_plugin
typedef struct heif_encoder_plugin heif_encoder_plugin

Enumerations

enum  heif_plugin_type { heif_plugin_type_encoder , heif_plugin_type_decoder }

Functions

const char * heif_get_version (void)
uint32_t heif_get_version_number (void)
int heif_get_version_number_major (void)
int heif_get_version_number_minor (void)
int heif_get_version_number_maintenance (void)
void heif_string_release (const char *)
 Free a string returned by libheif in various API functions.
heif_error heif_init (heif_init_params *)
 Initialise library.
void heif_deinit (void)
 Deinitialise and clean up library.
heif_error heif_load_plugin (const char *filename, heif_plugin_info const **out_plugin)
heif_error heif_load_plugins (const char *directory, const heif_plugin_info **out_plugins, int *out_nPluginsLoaded, int output_array_size)
heif_error heif_unload_plugin (const heif_plugin_info *plugin)
const char *const * heif_get_plugin_directories (void)
void heif_free_plugin_directories (const char *const *)
heif_error heif_register_decoder_plugin (const heif_decoder_plugin *)
heif_error heif_register_encoder_plugin (const heif_encoder_plugin *)
heif_error heif_register_decoder (heif_context *heif, const heif_decoder_plugin *)

Macro Definition Documentation

◆ heif_fourcc

#define heif_fourcc ( a,
b,
c,
d )
Value:
((uint32_t)((a<<24) | (b<<16) | (c<<8) | d))

Build a 32 bit integer from a 4-character code.

◆ LIBHEIF_HAVE_VERSION

#define LIBHEIF_HAVE_VERSION ( h,
m,
l )
Value:
(LIBHEIF_NUMERIC_VERSION >= LIBHEIF_MAKE_VERSION(h, m, l))
#define LIBHEIF_MAKE_VERSION(h, m, l)
Definition heif_library.h:86

◆ LIBHEIF_MAKE_VERSION

#define LIBHEIF_MAKE_VERSION ( h,
m,
l )
Value:
((h) << 24 | (m) << 16 | (l) << 8)

Typedef Documentation

◆ heif_context

typedef struct heif_context heif_context

◆ heif_decoder_plugin

◆ heif_encoder_plugin

◆ heif_image_handle

◆ heif_init_params

typedef struct heif_init_params heif_init_params

◆ heif_item_id

typedef uint32_t heif_item_id

◆ heif_plugin_info

typedef struct heif_plugin_info heif_plugin_info

◆ heif_plugin_type

◆ heif_property_id

typedef uint32_t heif_property_id

Enumeration Type Documentation

◆ heif_plugin_type

Enumerator
heif_plugin_type_encoder 
heif_plugin_type_decoder 

Function Documentation

◆ heif_deinit()

void heif_deinit ( void )

Deinitialise and clean up 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().

Note: heif_deinit() must not be called after exit(), for example in a global C++ object's destructor. If you do, global variables in libheif might have already been released when heif_deinit() is running, leading to a crash.

See also
heif_init()

◆ heif_free_plugin_directories()

void heif_free_plugin_directories ( const char *const * )

◆ heif_get_plugin_directories()

const char *const * heif_get_plugin_directories ( void )

◆ heif_get_version()

const char * heif_get_version ( void )

◆ heif_get_version_number()

uint32_t heif_get_version_number ( void )

◆ heif_get_version_number_maintenance()

int heif_get_version_number_maintenance ( void )

◆ heif_get_version_number_major()

int heif_get_version_number_major ( void )

◆ heif_get_version_number_minor()

int heif_get_version_number_minor ( void )

◆ heif_init()

heif_error heif_init ( heif_init_params * )

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.

◆ heif_load_plugin()

heif_error heif_load_plugin ( const char * filename,
heif_plugin_info const ** out_plugin )

◆ heif_load_plugins()

heif_error heif_load_plugins ( const char * directory,
const heif_plugin_info ** out_plugins,
int * out_nPluginsLoaded,
int output_array_size )

◆ heif_register_decoder()

heif_error heif_register_decoder ( heif_context * heif,
const heif_decoder_plugin *  )

◆ heif_register_decoder_plugin()

heif_error heif_register_decoder_plugin ( const heif_decoder_plugin * )

◆ heif_register_encoder_plugin()

heif_error heif_register_encoder_plugin ( const heif_encoder_plugin * )

◆ heif_string_release()

void heif_string_release ( const char * )

Free a string returned by libheif in various API functions.

You may pass NULL.

◆ heif_unload_plugin()

heif_error heif_unload_plugin ( const heif_plugin_info * plugin)