Skip to main content

heif_decoding_options

Struct heif_decoding_options 

Source
#[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: u8

Ignore 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: u8

version 2 options

§strict_decoding: u8

When 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_char

name_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_options

version 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_ext

When set to NULL, default options will be used

§ignore_sequence_editlist: c_int

bool

§output_image_nclx_profile: *mut heif_color_profile_nclx

Requested 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_int

0 = let libheif decide (TODO, currently ignored)

§num_codec_threads: c_int

0 = use decoder default

§autocorrect_broken_input: u8

If 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: u8

Controls 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.

Trait Implementations§

Source§

impl Debug for heif_decoding_options

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.