pub struct Decoder<'a> { /* 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.
The decoder borrows the input data to avoid an unconditional copy.
Implementations§
Source§impl<'a> Decoder<'a>
impl<'a> Decoder<'a>
Sourcepub fn new(data: &'a [u8]) -> Result<Self>
pub fn new(data: &'a [u8]) -> Result<Self>
Create a new decoder from JPEG data.
The decoder borrows the data — no copy is made.
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 primary_jpeg(&self) -> Option<&[u8]>
pub fn primary_jpeg(&self) -> Option<&[u8]>
Get the raw primary (SDR base) JPEG data.
Use this to decode the base image with your own JPEG codec.
Sourcepub fn gainmap_jpeg(&self) -> Option<&[u8]>
pub fn gainmap_jpeg(&self) -> Option<&[u8]>
Get the raw gain map JPEG data.
Use this to decode the gain map with your own JPEG codec.
Sourcepub fn decode_sdr(&self) -> Result<RawImage>
pub fn decode_sdr(&self) -> Result<RawImage>
Decode the SDR base image.
This method is not available in the library. Access the raw JPEG bytes
via Decoder::primary_jpeg and decode with your own codec.
Sourcepub fn decode_gainmap(&self) -> Result<GainMap>
pub fn decode_gainmap(&self) -> Result<GainMap>
Decode the gain map.
This method is not available in the library. Access the raw JPEG bytes
via Decoder::gainmap_jpeg and decode with your own codec.
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.