Skip to main content

ProviderSource

Enum ProviderSource 

Source
#[non_exhaustive]
pub enum ProviderSource { Svg, AnimatedImage, Lottie { animation: Option<String>, }, ImageSequence { frames: Vec<Option<String>>, frame_rate: FrameRate, start_number: u64, missing: MissingFrames, primaries: Option<LinearPrimaries>, }, Exr { primaries: Option<LinearPrimaries>, }, }
Expand description

A source whose media an extension provider supplies instead of the host’s video and image decoders.

A host picks the provider by probing the bytes at import, never by file name, and records it here so every host opens the source the same way. The engine does not read it.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Svg

A static SVG document, rasterized at its shown size. The source’s kind is image.

§

AnimatedImage

A GIF, animated WebP, or APNG: one cycle of frames, each with its own duration. Repetition is the clip’s. The source’s kind is video.

§

Lottie

A Lottie animation (JSON file or dotLottie package), evaluated at its own frames. The source’s kind is video.

Fields

§animation: Option<String>

The dotLottie animation shown, by ID. Absent means the package’s first; always absent for a Lottie JSON file.

§

ImageSequence

Still images played in order at a fixed rate. The source’s kind is video.

Fields

§frames: Vec<Option<String>>

Each frame’s locator, in play order. null marks a missing number, allowed only when missing says how to show it.

§frame_rate: FrameRate

The rate the frames play at.

§start_number: u64

The number of the first frame, as its file was numbered.

§missing: MissingFrames

How a missing frame is shown.

§primaries: Option<LinearPrimaries>

The primaries of OpenEXR frames’ linear RGB, overriding the first frame’s chromaticities. Only for OpenEXR frames.

§

Exr

A still OpenEXR image: linear-light RGB(A), read at half precision. The source’s kind is image.

Fields

§primaries: Option<LinearPrimaries>

The primaries of its linear RGB, overriding the file’s chromaticities (BT.709 when the file has none, as OpenEXR defines).

Implementations§

Source§

impl ProviderSource

Source

pub const fn kind(&self) -> MediaKind

The kind of source the provider’s media is.

Source

pub fn is_valid(&self) -> bool

Whether the settings are coherent: a Lottie animation ID is not empty, and an image sequence lists at most MAX_SEQUENCE_FRAMES frames, the first present, no locator empty or repeated, and a missing frame only with a policy for it.

Trait Implementations§

Source§

impl Clone for ProviderSource

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProviderSource

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ProviderSource

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for ProviderSource

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ProviderSource

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ProviderSource

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.