Skip to main content

DecodingOptions

Struct DecodingOptions 

Source
pub struct DecodingOptions { /* private fields */ }

Implementations§

Source§

impl DecodingOptions

Source

pub fn new() -> Option<Self>

Source§

impl DecodingOptions

Source

pub fn version(&self) -> u8

Source

pub fn ignore_transformations(&self) -> bool

Ignore geometric transformations like cropping, rotation, mirroring. Default: false (do not ignore).

Source

pub fn set_ignore_transformations(&mut self, enable: bool)

Source

pub fn convert_hdr_to_8bit(&self) -> bool

Source

pub fn set_convert_hdr_to_8bit(&mut self, enable: bool)

Source

pub fn strict_decoding(&self) -> bool

When strict decoding is enabled, an error is returned for invalid input. Otherwise, it will try its best and add decoding warnings to the decoded Image. Default is non-strict.

Source

pub fn set_strict_decoding(&mut self, enable: bool)

Source

pub fn decoder_id(&self) -> Option<&str>

ID of the decoder to use for the decoding. If set to None (default), the highest priority decoder is chosen. The priority is defined in the plugin.

Source

pub fn set_decoder_id( &mut self, decoder_id: Option<&str>, ) -> Result<(), HeifError>

Source

pub fn color_conversion_options(&self) -> ColorConversionOptions

Source

pub fn set_color_conversion_options(&mut self, options: ColorConversionOptions)

Source

pub fn alpha_composition_mode(&self) -> AlphaCompositionMode

Available on crate feature v1_20 only.
Source

pub fn set_alpha_composition_mode(&mut self, v: AlphaCompositionMode)

Available on crate feature v1_20 only.
Source

pub fn ignore_sequence_edit_list(&self) -> bool

Available on crate feature v1_21 only.

If enabled, it will decode the media timeline, ignoring the sequence tracks edit-list.

Source

pub fn set_ignore_sequence_edit_list(&mut self, v: bool)

Available on crate feature v1_21 only.

If enabled, it will decode the media timeline, ignoring the sequence tracks edit-list.

Source

pub fn output_image_nclx_profile(&self) -> Option<&ColorProfileNCLX>

Available on crate feature v1_21 only.
Source

pub fn set_output_image_nclx_profile(&mut self, v: Option<ColorProfileNCLX>)

Available on crate feature v1_21 only.
Source

pub fn num_library_threads(&self) -> u32

Available on crate feature v1_21 only.

0 = let libheif decide (TODO, currently ignored)

Source

pub fn set_num_library_threads(&mut self, v: u32)

Available on crate feature v1_21 only.

0 = let libheif decide (TODO, currently ignored)

Source

pub fn num_codec_threads(&self) -> u32

Available on crate feature v1_21 only.

0 = use decoder default

Source

pub fn set_num_codec_threads(&mut self, v: u32)

Available on crate feature v1_21 only.

0 = use decoder default

Source

pub fn autocorrect_broken_input(&self) -> bool

Available on crate feature v1_23 only.

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

Source

pub fn set_autocorrect_broken_input(&mut self, v: bool)

Available on crate feature v1_23 only.
Source

pub fn output_image_nclx_profile_passthrough(&self) -> bool

Available on crate feature v1_23 only.

Controls the meaning of output_image_nclx_profile == None.

When false (default), a None 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 None 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 decoding should generally enable it. Setting output_image_nclx_profile to a non-None value overrides this flag.

Source

pub fn set_output_image_nclx_profile_passthrough(&mut self, v: bool)

Available on crate feature v1_23 only.

Trait Implementations§

Source§

impl Debug for DecodingOptions

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Drop for DecodingOptions

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. 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.