#[non_exhaustive]pub struct Metadata {
pub icc_profile: Option<Arc<[u8]>>,
pub exif: Option<Arc<[u8]>>,
pub xmp: Option<Arc<[u8]>>,
pub cicp: Option<Cicp>,
pub content_light_level: Option<ContentLightLevel>,
pub mastering_display: Option<MasteringDisplay>,
pub orientation: Orientation,
}Expand description
Owned image metadata for encode/decode roundtrip.
Byte buffers (ICC, EXIF, XMP) use Arc<[u8]> so cloning is a cheap
ref-count bump. Construct via Metadata::none() + builders,
or extract from decoded info via From<&ImageInfo>.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.icc_profile: Option<Arc<[u8]>>ICC color profile.
exif: Option<Arc<[u8]>>EXIF metadata.
xmp: Option<Arc<[u8]>>XMP metadata.
cicp: Option<Cicp>CICP color description.
content_light_level: Option<ContentLightLevel>Content Light Level Info for HDR content.
mastering_display: Option<MasteringDisplay>Mastering Display Color Volume for HDR content.
orientation: OrientationEXIF orientation.
Implementations§
Source§impl Metadata
impl Metadata
Sourcepub fn with_icc(self, icc: impl Into<Arc<[u8]>>) -> Self
pub fn with_icc(self, icc: impl Into<Arc<[u8]>>) -> Self
Set the ICC color profile.
Accepts Vec<u8>, &[u8], or Arc<[u8]>.
Sourcepub fn with_exif(self, exif: impl Into<Arc<[u8]>>) -> Self
pub fn with_exif(self, exif: impl Into<Arc<[u8]>>) -> Self
Set the EXIF metadata.
Accepts Vec<u8>, &[u8], or Arc<[u8]>.
Sourcepub fn with_xmp(self, xmp: impl Into<Arc<[u8]>>) -> Self
pub fn with_xmp(self, xmp: impl Into<Arc<[u8]>>) -> Self
Set the XMP metadata.
Accepts Vec<u8>, &[u8], or Arc<[u8]>.
Sourcepub fn with_content_light_level(self, clli: ContentLightLevel) -> Self
pub fn with_content_light_level(self, clli: ContentLightLevel) -> Self
Set the Content Light Level Info.
Sourcepub fn with_mastering_display(self, mdcv: MasteringDisplay) -> Self
pub fn with_mastering_display(self, mdcv: MasteringDisplay) -> Self
Set the Mastering Display Color Volume.
Sourcepub fn with_orientation(self, orientation: Orientation) -> Self
pub fn with_orientation(self, orientation: Orientation) -> Self
Set the EXIF orientation.
Sourcepub fn transfer_function(&self) -> TransferFunction
pub fn transfer_function(&self) -> TransferFunction
Derive the transfer function from CICP metadata.
Returns the TransferFunction corresponding to the CICP
transfer_characteristics code, or Unknown
if CICP is absent or the code is not recognized.
Sourcepub fn color_primaries(&self) -> ColorPrimaries
pub fn color_primaries(&self) -> ColorPrimaries
Derive the color primaries from CICP metadata.
Returns Bt709 if CICP is absent.