pub struct MediaMetadata {
pub format: StillFormat,
pub stored_dimensions: (u32, u32),
pub orientation: Option<u16>,
pub bit_depth: Option<u8>,
pub gamut: Gamut,
}Expand description
What a header-only probe can say about a still, normalised onto Capsule’s own types.
This is the “metadata normalisation” half of the module: rawshift-image reports a format,
a size, an optional bit depth and a colour space, plus (from a separate EXIF read) an
orientation. None of those types may appear in Capsule’s public surface — they belong to a
pre-1.0 dependency — so each is mapped onto a Capsule type here, once.
Fields§
§format: StillFormatThe identified format.
stored_dimensions: (u32, u32)Dimensions as stored, i.e. before the EXIF orientation is applied. A probe reads the
codec header, which knows nothing about the orientation tag; the upright dimensions are
what DecodedImage carries.
orientation: Option<u16>The EXIF orientation tag (1..=8), where the format carries one and it was readable.
bit_depth: Option<u8>Bits per channel, where the header exposes it cheaply.
gamut: GamutThe gamut crate::lqip::Lqip::encode is told to interpret the samples in.
Always Gamut::Srgb in this build, and that is upstream’s doing rather than a
choice made here. probe_standard_image hard-codes ColorDescription::SRGB into every
ImageProbe it returns, and decode_standard_image likewise tags every decoded frame
sRGB without converting — so rawshift-image reports no source gamut for a
standard format at all, whatever the file’s ICC profile says. The consequence is a
fidelity limitation, not a correctness bug: a Display P3 source gets a placeholder
interpreted as sRGB, i.e. slightly under-saturated, which is the safer direction
when one has to be picked. This module’s private gamut_of is kept as the single
mapping point for when
the crate does start reporting it. A RAW frame is sRGB for a better reason: its colour
matrix converts camera RGB to sRGB primaries, so sRGB is what the samples really are.
Implementations§
Source§impl MediaMetadata
impl MediaMetadata
Sourcepub const fn upright_dimensions(&self) -> (u32, u32)
pub const fn upright_dimensions(&self) -> (u32, u32)
The dimensions a viewer shows: the stored ones, transposed when the orientation tag is one of the four quarter-turns (5, 6, 7, 8).
Trait Implementations§
Source§impl Clone for MediaMetadata
impl Clone for MediaMetadata
Source§fn clone(&self) -> MediaMetadata
fn clone(&self) -> MediaMetadata
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for MediaMetadata
Source§impl Debug for MediaMetadata
impl Debug for MediaMetadata
impl Eq for MediaMetadata
Source§impl PartialEq for MediaMetadata
impl PartialEq for MediaMetadata
Source§fn eq(&self, other: &MediaMetadata) -> bool
fn eq(&self, other: &MediaMetadata) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for MediaMetadata
Auto Trait Implementations§
impl Freeze for MediaMetadata
impl RefUnwindSafe for MediaMetadata
impl Send for MediaMetadata
impl Sync for MediaMetadata
impl Unpin for MediaMetadata
impl UnsafeUnpin for MediaMetadata
impl UnwindSafe for MediaMetadata
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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