Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
farindk committed Oct 10, 2023
1 parent 888d903 commit 673951f
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ endif()

macro(plugin_option optionVariableName displayName defaultEnabled defaultPlugin)
option(WITH_${optionVariableName} "Build ${displayName}" ${defaultEnabled})
option(WITH_${optionVariableName}_PLUGIN "Build ${displayName} as a plugin" ${defaultPlugin})
option(WITH_${optionVariableName}_PLUGIN "Build ${displayName} as a plugin" ${defaultPlugin} AND WITH_${optionVariableName})
endmacro()

macro(plugin_compilation_info optionVariableName detectionVariable displayName)
Expand Down
45 changes: 39 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ libheif has support for:
* decoding of files while downloading (e.g. extract image size before file has been completely downloaded)

Supported codecs:
* HEIC: libde265, x265, kvazaar
* AVIF: libaom, dav1d, rav1d, svt-av1
* JPEG: libjpeg
* JPEG-2000: OpenJPEG
| Format | Decoders | Encoders |
|:-------------|:----------------:|:--------------:|
| HEIC | libde265, ffmpeg | x265, kvazaar |
| AVIF | AOM, dav1d | rav1d, svt-av1 |
| JPEG | libjpeg | libjpeg |
| JPEG2000 | OpenJPEG | OpenJPEG |
| uncompressed | builtin | builtin |

## API

Expand Down Expand Up @@ -113,9 +116,11 @@ There is also an experimental Go API, but this is not stable yet.

This library uses the CMake build system (the earlier autotools build files have been removed in v1.16.0).

For a minimal configuration, we recommend to use the codecs libde265 and x265 for HEIC and AOM for AVIF.
Make sure that you compile and install [libde265](https://github.com/strukturag/libde265)
first, so that the configuration script will find this.
Also install x265 and its development files if you want to use HEIF encoding.
Also install x265 and its development files if you want to use HEIF encoding, but note that x265 is GPL.
An alternative to x265 is kvazaar (BSD).

The basic build steps are as follows:

Expand All @@ -136,7 +141,35 @@ There are CMake presets to cover the most frequent use cases.
* `fuzzing`: similar to `testing`, this builds the fuzzers. The library should not distributed.

You can optionally adapt these standard configurations to your needs.
This can be done, for example, by calling `ccmake ..` from within the `build` directory.
This can be done, for example, by calling `ccmake .` from within the `build` directory.

### CMake configuration variables

Libheif supports many different codecs. In order to reduce the number of dependencies and the library size,
you can choose which of these codecs to include. Each codec can be compiled either as built-in to the library
with a hard dependency, or as a separate plugin file that is loaded dynamically.

For each codec, there are two configuration variables:

* `WITH_{codec}`: enables the codec
* `WITH_{codec}_PLUGIN`: when enabled, the codec is compiled as a separate plugin.

In order to use dynamic plugins, also make sure that `ENABLE_PLUGIN_LOADING` is enabled.

Further options are:

* `WITH_UNCOMPRESSED_CODEC`: enable support for uncompressed images according to ISO/IEC 23001-17:2023. This is *experimental*
and not available as a dynamic plugin.
* `WITH_DEFLATE_HEADER_COMPRESSION`: enables support for compressed metadata. When enabled, it adds a dependency to `zlib`.
Note that header compression is not widely supported yet.
* `WITH_LIBSHARPYUV`: enables high-quality YCbCr/RGB color space conversion algorithms (requires `libsharpyuv`,
e.g. from the `third-party` directory).
* `ENABLE_MULTITHREADING_SUPPORT`: can be used to disable any multithreading support, e.g. for embedded platforms.
* `ENABLE_PARALLEL_TILE_DECODING`: when enabled, libheif will decode tiled images in parallel to speed up compilation.
* `PLUGIN_DIRECTORY`: the directory where libheif will search for dynamic plugins when the environment
variable `LIBHEIF_PLUGIN_PAT` is not set.
* `WITH_REDUCED_VISIBILITY`: only export those symbols into the library that are public API.
Has to be turned off for running the tests.

### macOS

Expand Down

0 comments on commit 673951f

Please sign in to comment.