pub struct ImageFrameExtra { /* private fields */ }Expand description
Per-ImageFrame extras — cover
art, an embedded thumbnail, a poster frame.
One seat, deliberately. This household is minimal at birth
because a still image’s AVFrame carries almost nothing a motion
frame’s does: no picture type, no field order, no best-effort
timestamp, no SAR worth a seat. What it does carry is side data,
and that is what is here.
EXIF orientation takes a seat here, read off the frame’s
AV_FRAME_DATA_DISPLAYMATRIX side data — see ImageOrientation
for the measurement that establishes that road, and for why an
earlier reading of libavcodec (which put orientation in
AVFrame.metadata) was wrong about where it arrives.
An ICC profile arrives as side data too
(AV_FRAME_DATA_ICC_PROFILE) and does not get a seat: it is a
payload, not a fact — kilobytes of colour transform this crate has
no vocabulary for and no business parsing. Self::side_data
carries it unparsed and whole for a consumer that does. That is the
line: a fact a picture cannot be displayed correctly without is
typed; a payload only a specialist reads rides raw.
Implementations§
Source§impl ImageFrameExtra
impl ImageFrameExtra
Sourcepub const fn orientation(&self) -> Option<ImageOrientation>
pub const fn orientation(&self) -> Option<ImageOrientation>
How the picture should be turned for display, when the file said.
None means the frame carried no display matrix — the ordinary
case for a still with no EXIF orientation tag, and also what an
out-of-range tag produces, because libavcodec emits no matrix
for one. A malformed matrix (not nine int32_t) is None too.
In every one of those cases the raw entry, if there was one, is
still in Self::side_data.
A consumer that ignores this displays a sideways photograph.
Sourcepub fn side_data(&self) -> &[SideDataEntry]
pub fn side_data(&self) -> &[SideDataEntry]
Returns the raw side-data entries from AVFrame.side_data —
AV_FRAME_DATA_ICC_PROFILE and the display matrix among them.
Sourcepub const fn with_orientation(self, value: Option<ImageOrientation>) -> Self
pub const fn with_orientation(self, value: Option<ImageOrientation>) -> Self
Sets the orientation (consuming builder).
Sourcepub fn with_side_data(self, value: Vec<SideDataEntry>) -> Self
pub fn with_side_data(self, value: Vec<SideDataEntry>) -> Self
Sets the side-data list (consuming builder).
Sourcepub const fn set_orientation(
&mut self,
value: Option<ImageOrientation>,
) -> &mut Self
pub const fn set_orientation( &mut self, value: Option<ImageOrientation>, ) -> &mut Self
Sets the orientation in place.
Sourcepub fn set_side_data(&mut self, value: Vec<SideDataEntry>) -> &mut Self
pub fn set_side_data(&mut self, value: Vec<SideDataEntry>) -> &mut Self
Sets the side-data list in place.
Trait Implementations§
Source§impl Clone for ImageFrameExtra
impl Clone for ImageFrameExtra
Source§fn clone(&self) -> ImageFrameExtra
fn clone(&self) -> ImageFrameExtra
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more