Skip to main content

GainMapRowExtractor

Struct GainMapRowExtractor 

Source
pub struct GainMapRowExtractor { /* private fields */ }
Expand description

Row-streaming linear-f32 ISO 21496-1 gain-map encoder.

Implementations§

Source§

impl GainMapRowExtractor

Source

pub fn new_custom( metadata: GainMapMetadata, app_primaries: CustomPrimaries, ) -> Result<Self, At<ConvertError>>

Construct a row extractor using exact GainMapMetadata and custom primaries.

Source

pub fn new( metadata: GainMapMetadata, app_primaries: Primaries, ) -> Result<Self, At<ConvertError>>

Construct a row extractor using exact GainMapMetadata and application primaries.

Source

pub fn from_config( config: &GainMapExtractConfig, app_primaries: Primaries, ) -> Result<Self, At<ConvertError>>

Construct a row extractor from a GainMapExtractConfig and application primaries.

Source

pub fn encode_row_linear_f32( &mut self, base_linear: &[f32], alt_linear: &[f32], input_channels: LinearInputChannels, gain_map_layout: SampleLayout, dst_row: &mut [u8], ) -> Result<(), At<ConvertError>>

Quantize one row of paired linear RGB(A) f32 pixels (input_channels: LinearInputChannels::Rgb or LinearInputChannels::Rgba) into packed gain-map sample bytes matching gain_map_layout (U8 or U16, Full/Lsb/Msb, Gray/Rgb/Generic(1|3)).

Computes exact f64 signed-offset ratios (alt + k_alt) / (base + k_base) without near-black floor clamping.

Source

pub fn observed_gain_stops(&self) -> Option<(f32, f32)>

Observe the (min_log2_stops, max_log2_stops) gain range accumulated across all rows encoded so far (None if zero pixels were processed).

Source

pub fn metadata(&self) -> GainMapMetadata

Return the exact GainMapMetadata matching the encoded bytes.

Source

pub fn build_metadata_widening_headroom(&self) -> GainMapMetadata

Build GainMapMetadata for the encoded bytes, optionally widening alternate_hdr_headroom (in Forward mode) if observed content gain exceeded the configured alternate headroom (matching ultrahdr-core’s contract #33).

Trait Implementations§

Source§

impl Clone for GainMapRowExtractor

Source§

fn clone(&self) -> GainMapRowExtractor

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 GainMapRowExtractor

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.