pub struct Decoder { /* private fields */ }Expand description
Ultra HDR decoder.
Decodes Ultra HDR JPEGs, extracting the SDR base image, gain map, and metadata. Can reconstruct HDR content at various display brightness levels.
Implementations§
Source§impl Decoder
impl Decoder
Sourcepub fn is_ultrahdr(&self) -> bool
pub fn is_ultrahdr(&self) -> bool
Check if this is a valid Ultra HDR image.
Sourcepub fn metadata(&self) -> Option<&GainMapMetadata>
pub fn metadata(&self) -> Option<&GainMapMetadata>
Get the gain map metadata.
Sourcepub fn gainmap_jpeg(&self) -> Option<&[u8]>
pub fn gainmap_jpeg(&self) -> Option<&[u8]>
Get the raw gain map JPEG data.
Sourcepub fn decode_sdr(&self) -> Result<RawImage>
pub fn decode_sdr(&self) -> Result<RawImage>
Decode the SDR base image.
Sourcepub fn decode_gainmap(&self) -> Result<GainMap>
pub fn decode_gainmap(&self) -> Result<GainMap>
Decode the gain map.
Sourcepub fn decode_hdr(&self, display_boost: f32) -> Result<RawImage>
pub fn decode_hdr(&self, display_boost: f32) -> Result<RawImage>
Decode to HDR at the specified display boost level.
display_boost is the ratio of display peak brightness to SDR white.
For example:
- 1.0 = SDR display (no HDR enhancement)
- 4.0 = Display capable of 4x SDR brightness
- ~49.0 = Full HDR10 (10000 nits / 203 SDR nits)
Sourcepub fn decode_hdr_with_format(
&self,
display_boost: f32,
format: HdrOutputFormat,
) -> Result<RawImage>
pub fn decode_hdr_with_format( &self, display_boost: f32, format: HdrOutputFormat, ) -> Result<RawImage>
Decode to HDR with a specific output format.
Sourcepub fn icc_profile(&self) -> Option<Vec<u8>>
pub fn icc_profile(&self) -> Option<Vec<u8>>
Get the ICC profile from the primary image if present.
Sourcepub fn dimensions(&self) -> Result<(u32, u32)>
pub fn dimensions(&self) -> Result<(u32, u32)>
Get information about the decoded image dimensions.
Auto Trait Implementations§
impl Freeze for Decoder
impl RefUnwindSafe for Decoder
impl Send for Decoder
impl Sync for Decoder
impl Unpin for Decoder
impl UnwindSafe for Decoder
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
Mutably borrows from an owned value. Read more