Skip to main content

Decode

Trait Decode 

Source
pub trait Decode<T>: TransferFunction {
    // Required method
    fn decode(v: T) -> T;
}
Expand description

Decode a value from a stored signal to linear light (inverse OETF / EOTF).

Implement for scalar F: Float to get a transfer function at any precision. A blanket impl provides Decode<[F; N]> automatically for any Decode<F>.

Note: the HLG EOTF per ITU-R BT.2100 additionally applies an OOTF. This returns inverse-OETF scene-linear, correct for scene-referred pipelines that apply the OOTF separately.

Required Methods§

Source

fn decode(v: T) -> T

Convert an encoded signal value to a linear-light value.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<F: Float> Decode<F> for AcesCc

Source§

impl<F: Float> Decode<F> for AcesCct

Source§

impl<F: Float> Decode<F> for DciP3

Source§

impl<F: Float> Decode<F> for Hlg

Source§

impl<F: Float> Decode<F> for Linear

Source§

impl<F: Float> Decode<F> for Pq

Source§

impl<F: Float> Decode<F> for ProPhoto

Source§

impl<F: Float> Decode<F> for Rec709

Source§

impl<F: Float> Decode<F> for Srgb

Source§

impl<F: Float, TF: Decode<F>, const N: usize> Decode<[F; N]> for TF