Skip to main content

GainMapApplyConfig

Struct GainMapApplyConfig 

Source
#[non_exhaustive]
pub struct GainMapApplyConfig { pub target: GainMapTarget, pub resample: GainMapResample, pub orientation: GainMapOrientation, pub policy: ConvertPolicy, pub destination_format: Option<PixelFormat>, }
Expand description

Configuration for ISO 21496-1 gain-map reconstruction via GainMapApplier, apply_gain_map_oriented, or apply_gain_map_with.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§target: GainMapTarget

Target display HDR headroom in log₂ stops or explicit rendition endpoint.

§resample: GainMapResample

Resampling kernel used when gain-map dimensions differ from base dimensions.

§orientation: GainMapOrientation

Pending EXIF orientation policy (Bake, Passthrough, or RequireIdentity).

§policy: ConvertPolicy

Conversion policy controlling SIMD Accelerators, diffuse_white, and CMS backends.

Defaults to ConvertPolicy::working_linear (accelerators: None, respecting the process-wide accel::enable* registry or scalar fallback for dead-stripping); override via with_policy (e.g. Accelerators::ALL.with_gainmap() or Accelerators::WEB_SDR.with_gainmap()).

§destination_format: Option<PixelFormat>

Optional target output PixelFormat.

  • None: outputs relative-linear RGBF32 (or RGBAF32 when base has alpha) in the resolved gain-map application primaries.
  • Some(spec): fuses conversion directly to spec (e.g. RGBAF16, RGB16 PQ, RGB16 HLG, RGBA8 sRGB, DisplayP3) in O(width) row memory with zero full-frame intermediate buffer.

Implementations§

Source§

impl GainMapApplyConfig

Source

pub fn from_headroom_stops(display_headroom_stops: f32) -> Self

Create a default configuration for display_headroom_stops (log₂ stops, e.g. 2.0 = 4× display boost).

Source

pub fn from_display_boost_linear(display_boost: f32) -> Self

Create a configuration from a linear display boost multiplier (e.g. 4.0 → 2.0 stops).

Source

pub fn alternate_rendition() -> Self

Create a configuration targeting exact full alternate reconstruction (|weight| == 1.0).

Source

pub fn base_rendition() -> Self

Create a configuration targeting exact base rendition bypass (weight == 0.0).

Source

pub fn with_target(self, target: GainMapTarget) -> Self

Replace the target headroom / rendition endpoint.

Source

pub fn with_resample(self, resample: GainMapResample) -> Self

Select the gain-map resampling filter (Bilinear, Bicubic, Mitchell, Nearest).

Source

pub fn with_orientation(self, orientation: GainMapOrientation) -> Self

Select how pending EXIF orientation on DualLayerHdrBuf / DualLayerHdrView is handled.

Source

pub fn with_policy(self, policy: ConvertPolicy) -> Self

Set the conversion policy (accelerators, diffuse_white, CMS backend, HLG rendering).

Source

pub fn with_destination_format(self, destination_format: PixelFormat) -> Self

Fuse row conversion straight into destination_format (e.g. RGBAF16, RGB16 PQ, RGBA8 sRGB).

Trait Implementations§

Source§

impl Clone for GainMapApplyConfig

Source§

fn clone(&self) -> GainMapApplyConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GainMapApplyConfig

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.