#[repr(C)]pub struct heif_decoding_options {Show 18 fields
pub version: u8,
pub ignore_transformations: u8,
pub start_progress: Option<unsafe extern "C" fn(step: heif_progress_step, max_progress: c_int, progress_user_data: *mut c_void)>,
pub on_progress: Option<unsafe extern "C" fn(step: heif_progress_step, progress: c_int, progress_user_data: *mut c_void)>,
pub end_progress: Option<unsafe extern "C" fn(step: heif_progress_step, progress_user_data: *mut c_void)>,
pub progress_user_data: *mut c_void,
pub convert_hdr_to_8bit: u8,
pub strict_decoding: u8,
pub decoder_id: *const c_char,
pub color_conversion_options: heif_color_conversion_options,
pub cancel_decoding: Option<unsafe extern "C" fn(progress_user_data: *mut c_void) -> c_int>,
pub color_conversion_options_ext: *mut heif_color_conversion_options_ext,
pub ignore_sequence_editlist: c_int,
pub output_image_nclx_profile: *mut heif_color_profile_nclx,
pub num_library_threads: c_int,
pub num_codec_threads: c_int,
pub autocorrect_broken_input: u8,
pub output_image_nclx_profile_passthrough: u8,
}Fields§
§version: u8§ignore_transformations: u8Ignore geometric transformations like cropping, rotation, mirroring. Default: false (do not ignore).
start_progress: Option<unsafe extern "C" fn(step: heif_progress_step, max_progress: c_int, progress_user_data: *mut c_void)>Any of the progress functions may be called from background threads.
on_progress: Option<unsafe extern "C" fn(step: heif_progress_step, progress: c_int, progress_user_data: *mut c_void)>§end_progress: Option<unsafe extern "C" fn(step: heif_progress_step, progress_user_data: *mut c_void)>§progress_user_data: *mut c_void§convert_hdr_to_8bit: u8version 2 options
strict_decoding: u8When enabled, an error is returned for invalid input. Otherwise, it will try its best and add decoding warnings to the decoded heif_image. Default is non-strict.
decoder_id: *const c_charname_id of the decoder to use for the decoding. If set to NULL (default), the highest priority decoder is chosen. The priority is defined in the plugin.
color_conversion_options: heif_color_conversion_optionsversion 5 options
cancel_decoding: Option<unsafe extern "C" fn(progress_user_data: *mut c_void) -> c_int>version 6 options
color_conversion_options_ext: *mut heif_color_conversion_options_extWhen set to NULL, default options will be used
ignore_sequence_editlist: c_intbool
output_image_nclx_profile: *mut heif_color_profile_nclxRequested NCLX color profile of the decoded output image. If the input image’s NCLX differs, libheif will color-convert the pixels accordingly (e.g. YCbCr matrix, primaries, range) so the result matches what is requested here.
When set to NULL, the behavior depends on the flag output_image_nclx_profile_passthrough below: by default NULL means “convert to sRGB”; with the passthrough flag enabled, NULL means “keep the input image’s NCLX”.
num_library_threads: c_int0 = let libheif decide (TODO, currently ignored)
num_codec_threads: c_int0 = use decoder default
autocorrect_broken_input: u8If enabled, libheif will attempt to work around known broken-input quirks
(e.g. Sony HIF files where the NCLX colr box disagrees with the HEVC VUI
on the YCbCr range flag). Default: false (strict spec-conformant behavior).
output_image_nclx_profile_passthrough: u8Controls the meaning of output_image_nclx_profile == NULL.
When false (default), a NULL output_image_nclx_profile means “convert the decoded image to sRGB” (BT.709 primaries, sRGB transfer, BT.601 matrix, full-range). For HDR inputs (e.g. BT.2100 PQ) this silently discards the original color volume.
When true, a NULL output_image_nclx_profile means “keep the input image’s NCLX”. The decoded image carries the input file’s primaries / transfer / matrix / range, and no extra color-space conversion is performed solely because the output NCLX was unspecified. If a YCbCr<->RGB colorspace conversion fires for another reason, the input NCLX is used to drive that conversion (so the result is tagged consistently with the source).
Although this flag is off by default to preserve historical behavior, new code that wants to preserve HDR through decode should generally enable it. Setting output_image_nclx_profile to a non-NULL value overrides this flag.