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, rather than the host’s video and image decoders.

A host picks the provider by probing the bytes at import, never by a file name, and records it here with the settings the source needs, so every host opens the source the same way. The engine does not read it: a provider source needs frames like any video or image source.

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 the size it is shown. 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, from a Lottie JSON file or a dotLottie package, evaluated at its own frames. The source’s kind is video.

Fields

§animation: Option<String>

The dotLottie animation shown, by its ID; the package’s first when absent, and 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 is a number missing from the sequence, 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 OpenEXR frames’ linear RGB is in, overriding what the first frame’s chromaticities say. 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 its linear RGB is in, overriding what the file’s chromaticities say (BT.709 when it says nothing, 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 listed twice, 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.