pub trait ImageAdapter {
type CodecId: Copy + Eq + Debug;
type PixelFormat: Clone + Eq + Debug;
type PacketExtra;
type FrameExtra;
}Expand description
Backend vocabulary for a compressed/decoded still image — cover art, an embedded thumbnail, a poster frame.
A separate vocabulary from VideoAdapter rather than a reuse of
it, because the two disagree about the one thing an adapter exists
to name: what rides the frame. A still’s extras are EXIF, an ICC
profile, an orientation — not a picture type, not a field order,
not a best-effort timestamp. Bending VideoAdapter::FrameExtra
over both would give every motion frame seats that only a still
fills and every still seats that only motion fills.
The compressed side is an
AttachmentPacket: a still
image inside a container is an attachment, one whole file, no
timeline. PacketExtra is therefore the
attachment’s extras, and a backend that also implements
DemuxAdapter will normally bind
the same type in both seats — the packet a demuxer hands out is the
packet an image decoder is fed.
Required Associated Types§
Sourcetype CodecId: Copy + Eq + Debug
type CodecId: Copy + Eq + Debug
Codec identifier — the still’s own codec (MJPEG, PNG, BMP, …), in the same namespace the rest of the backend uses.
Sourcetype PixelFormat: Clone + Eq + Debug
type PixelFormat: Clone + Eq + Debug
Pixel format identifier.
Clone, not Copy, for the same reason
VideoAdapter::PixelFormat is.
Sourcetype PacketExtra
type PacketExtra
Backend-specific extras carried on the
AttachmentPacket an image
decoder is fed.
Sourcetype FrameExtra
type FrameExtra
Backend-specific extras carried on every
ImageFrame — EXIF, ICC profile,
side data.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".