pub struct Effect {
pub kind: EffectKind,
pub enabled: bool,
pub params: Vec<Animated>,
pub mask: Option<Mask>,
pub shader: String,
pub start: f64,
pub len: f64,
}Expand description
An effect instance on a clip; params[i] follows kind.params()[i] (each keyframeable).
Fields§
§kind: EffectKind§enabled: bool§params: Vec<Animated>§mask: Option<Mask>Limits the effect to (or outside) a shape.
shader: StringEffectKind::Shader only: the GLSL fragment shader source.
start: f64Clip-local second the effect switches on (CapCut-style window inside the clip).
len: f64How long it stays on; <= 0 means “to the end of the clip”, which is what every effect written
before this field existed deserialises to.
Implementations§
Source§impl Effect
impl Effect
pub fn new(kind: EffectKind) -> Self
Sourcepub fn on_at(&self, t: f64) -> bool
pub fn on_at(&self, t: f64) -> bool
Is the effect on at clip-local time t? Enabled + inside its window (the default window is the
whole clip, so this is just enabled for every project that never touched the timing).
Sourcepub fn at(&self, i: usize, t: f64) -> f64
pub fn at(&self, i: usize, t: f64) -> f64
Parameter i at clip-local time t (spec default when missing, e.g. older files).
pub fn specs(&self) -> &'static [ParamSpec]
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Effect
impl<'de> Deserialize<'de> for Effect
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Effect
Auto Trait Implementations§
impl Freeze for Effect
impl RefUnwindSafe for Effect
impl Send for Effect
impl Sync for Effect
impl Unpin for Effect
impl UnwindSafe for Effect
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§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>
Converts
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>
Converts
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