pub struct Hdr10PlusDynamicMeta {
pub application_version: u8,
pub targeted_system_display_max_luminance: u16,
pub average_maxrgb: f64,
pub maxrgb_percentiles: Vec<(u8, f64)>,
pub fraction_bright_pixels: f64,
pub knee_point: (f64, f64),
pub bezier_curve_anchors: Vec<f64>,
}Expand description
HDR10+ dynamic metadata for a single scene or frame.
HDR10+ (SMPTE ST 2094-40) carries per-scene tone-mapping information as SEI messages in HEVC or metadata OBUs in AV1.
Fields§
§application_version: u8Application version (currently 0 or 1).
targeted_system_display_max_luminance: u16Targeted system display maximum luminance (in cd/m²).
average_maxrgb: f64Average maxRGB of the scene (0.0–1.0 normalised to peak).
maxrgb_percentiles: Vec<(u8, f64)>Distribution maxRGB percentile values (up to 9).
fraction_bright_pixels: f64Fraction of selected area pixels.
knee_point: (f64, f64)Knee point (x, y) for the tone-mapping curve.
bezier_curve_anchors: Vec<f64>Bezier curve anchors for tone-mapping (0–9 points).
Implementations§
Source§impl Hdr10PlusDynamicMeta
impl Hdr10PlusDynamicMeta
Sourcepub fn new(targeted_max_lum: u16) -> Self
pub fn new(targeted_max_lum: u16) -> Self
Creates a new HDR10+ dynamic metadata descriptor with sensible defaults.
Sourcepub fn validate(&self) -> Result<(), HdrError>
pub fn validate(&self) -> Result<(), HdrError>
Validates the HDR10+ metadata fields.
§Errors
Returns HdrError::OutOfRange if any field is outside legal range.
Sourcepub fn encode(&self) -> Vec<u8> ⓘ
pub fn encode(&self) -> Vec<u8> ⓘ
Serialises HDR10+ dynamic metadata into a simplified binary payload.
Layout (variable length):
- 1 byte: application_version
- 2 bytes: targeted_system_display_max_luminance (u16 BE)
- 2 bytes: average_maxrgb (u16 BE, value * 10000)
- 2 bytes: fraction_bright_pixels (u16 BE, value * 10000)
- 2 bytes: knee_point_x (u16 BE, value * 10000)
- 2 bytes: knee_point_y (u16 BE, value * 10000)
- 1 byte: number of bezier anchors
- N * 2 bytes: anchor values (u16 BE, value * 10000)
Trait Implementations§
Source§impl Clone for Hdr10PlusDynamicMeta
impl Clone for Hdr10PlusDynamicMeta
Source§fn clone(&self) -> Hdr10PlusDynamicMeta
fn clone(&self) -> Hdr10PlusDynamicMeta
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Hdr10PlusDynamicMeta
impl Debug for Hdr10PlusDynamicMeta
Source§impl<'de> Deserialize<'de> for Hdr10PlusDynamicMeta
impl<'de> Deserialize<'de> for Hdr10PlusDynamicMeta
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for Hdr10PlusDynamicMeta
impl PartialEq for Hdr10PlusDynamicMeta
Source§impl Serialize for Hdr10PlusDynamicMeta
impl Serialize for Hdr10PlusDynamicMeta
impl StructuralPartialEq for Hdr10PlusDynamicMeta
Auto Trait Implementations§
impl Freeze for Hdr10PlusDynamicMeta
impl RefUnwindSafe for Hdr10PlusDynamicMeta
impl Send for Hdr10PlusDynamicMeta
impl Sync for Hdr10PlusDynamicMeta
impl Unpin for Hdr10PlusDynamicMeta
impl UnsafeUnpin for Hdr10PlusDynamicMeta
impl UnwindSafe for Hdr10PlusDynamicMeta
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more