Skip to main content

NodeOp

Enum NodeOp 

Source
pub enum NodeOp {
Show 13 variants Clip {}, Media { source_id: SourceId, start: MediaTime, frame_interpolation: FrameInterpolation, }, Generator { generator: Generator, }, Effect { input: Option<NodeId>, inputs: BTreeMap<String, Option<NodeId>>, effect: ClipEffect, }, Transition { from: Option<NodeId>, to: Option<NodeId>, effect: ClipEffect, progress: Animated<f32>, }, Transform { input: Option<NodeId>, transform: VisualProperties, motion_blur: bool, }, Merge { layers: Vec<MergeLayer>, }, Matte { input: Option<NodeId>, matte: Option<NodeId>, mode: MatteMode, }, KeyMix { backdrop: Option<NodeId>, input: Option<NodeId>, mask: Option<NodeId>, opacity: Animated<f32>, }, ShapeMask { input: Option<NodeId>, masks: Vec<ShapeMask>, }, Group { composition: CompositionId, inputs: Vec<Option<NodeId>>, controls: BTreeMap<String, Animated<EffectValue>>, }, GroupInput { index: u32, }, TimeOffset { input: Option<NodeId>, offset: MediaTime, },
}
Expand description

The operation of a CompositionNode.

Animated settings are keyed in composition time (see ClipComposition).

Variants§

§

Clip

The picture of the clip showing the composition: its source at the time-mapped source time, or what its generated source draws. For an adjustment clip, the scene composited beneath it.

§

Media

Another visual source, read at start plus the composition time. Adds no sound to the mix.

Fields

§source_id: SourceId

The source; a video, image, or generated source.

§start: MediaTime

Source time shown at composition time zero. Non-negative.

§frame_interpolation: FrameInterpolation

What the node shows at a source time between two frames of a video source.

§

Generator

A picture the engine draws.

Fields

§generator: Generator

What is drawn.

§

Effect

A registered effect: its input plus any named images it samples.

Fields

§input: Option<NodeId>

The image the effect processes; a bypassed node passes it through.

§inputs: BTreeMap<String, Option<NodeId>>

The images the effect samples besides its input, by the names its definition declares (sample_<name> in its shader); at most MAX_EFFECT_INPUTS. An undeclared name, or a declared one left out, is invalid for a built-in and fails the frames that draw the node otherwise.

§effect: ClipEffect

The versioned effect and its parameters.

§

Transition

A registered two-input transition at an explicit progress.

Fields

§from: Option<NodeId>

The image at progress zero.

§to: Option<NodeId>

The image at progress one.

§effect: ClipEffect

The versioned transition and its parameters.

§progress: Animated<f32>

Progress through the transition, in 0..=1.

§

Transform

The input placed on the canvas by a transform and opacity.

Fields

§input: Option<NodeId>

The image placed.

§transform: VisualProperties

Position, anchor, scale, rotation, and opacity.

§motion_blur: bool

Whether the transform’s motion is averaged over the project’s shutter, measured in composition time. The image placed is the one at the frame’s composition time.

§

Merge

Ordered layers composited over transparency.

Fields

§layers: Vec<MergeLayer>

Layers from bottom to top.

§

Matte

The input kept where a second image says.

Fields

§input: Option<NodeId>

The image kept.

§matte: Option<NodeId>

The image whose alpha or luminance is coverage.

§mode: MatteMode

Which property of the matte image is coverage.

§

KeyMix

The backdrop replaced by the input by k = opacity x mask alpha, as (1 - k) backdrop + k input on premultiplied values: exactly the backdrop where k is 0 and the input where it is 1 (Nuke’s KeyMix with an opacity). Bypassed, it passes the backdrop through.

Fields

§backdrop: Option<NodeId>

The picture replaced.

§input: Option<NodeId>

The picture that replaces it.

§mask: Option<NodeId>

The image whose alpha is coverage; unconnected, the coverage is opacity everywhere.

§opacity: Animated<f32>

Scales the coverage, in 0..=1.

§

ShapeMask

The input kept inside shapes.

Fields

§input: Option<NodeId>

The image masked.

§masks: Vec<ShapeMask>

The shapes, combined in order; at most crate::MAX_CLIP_MASKS. Geometry is in the input image’s normalized space.

§

Group

Another composition drawn in this one’s time as a group: its output, with group inputs fed from inputs and controls set from controls.

Fields

§composition: CompositionId

The composition drawn.

§inputs: Vec<Option<NodeId>>

The image for each of its inputs, in its port order.

§controls: BTreeMap<String, Animated<EffectValue>>

Values for its controls, by name; unset controls keep the composition’s own value. Keyed in composition time.

§

GroupInput

In a composition used as a group, the image the group node gives its input index.

Fields

§index: u32

The input, in the composition’s port order.

§

TimeOffset

The input as it is offset later in composition time (earlier when negative): every node it is drawn from is sampled at the shifted time, and a clip node shows the clip at the matching timeline time, transparent outside the clip. Offsets nest and add. The input may not reach a group input, nor the clip node of a composition that an adjustment clip or a clip of a composition source shows.

Fields

§input: Option<NodeId>

The image read at the shifted time.

§offset: MediaTime

The shift in ticks of composition time.

Implementations§

Source§

impl NodeOp

Source

pub fn inputs(&self) -> Vec<NodeInput<'_>>

Every input of the operation, connected or not, in a fixed order.

Source

pub fn bypass_input(&self) -> Option<NodeInput<'_>>

The input a bypassed node passes through: input for one-input operations and mattes, from for a transition, backdrop for a key mix, a merge’s bottom layer, and a group’s first input. None for operations without inputs and merges without layers.

Source

pub const fn has_inputs(&self) -> bool

Whether the operation takes inputs, and so can be bypassed.

Source

pub const fn effect(&self) -> Option<&ClipEffect>

The effect or transition invocation the operation runs, if any.

Trait Implementations§

Source§

impl Clone for NodeOp

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 NodeOp

Source§

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

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

impl<'de> Deserialize<'de> for NodeOp

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 NodeOp

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 NodeOp

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 NodeOp

Auto Trait Implementations§

§

impl Forget for NodeOp

§

impl Freeze for NodeOp

§

impl Move for NodeOp

§

impl RefUnwindSafe for NodeOp

§

impl Send for NodeOp
where RawVecInner: Send, BoxRaw<DataBinding>: Send, BoxRaw<MotionPath>: Send, BoxRaw<TextStyle>: Send, BoxRaw<LayoutNode>: Send, NodeRef<Owned, String, Animated<EffectValue>, LeafOrInternal>: Send, BoxRaw<(String, Animated<EffectValue>)>: Send, NodeRef<Owned, String, EffectResourceId, LeafOrInternal>: Send, BoxRaw<(String, EffectResourceId)>: Send, NodeRef<Owned, String, Option<NodeId>, LeafOrInternal>: Send, BoxRaw<(String, Option<NodeId>)>: Send,

§

impl Sync for NodeOp
where RawVecInner: Sync, BoxRaw<DataBinding>: Sync, BoxRaw<MotionPath>: Sync, BoxRaw<TextStyle>: Sync, BoxRaw<LayoutNode>: Sync, NodeRef<Owned, String, Animated<EffectValue>, LeafOrInternal>: Sync, BoxRaw<(String, Animated<EffectValue>)>: Sync, NodeRef<Owned, String, EffectResourceId, LeafOrInternal>: Sync, BoxRaw<(String, EffectResourceId)>: Sync, NodeRef<Owned, String, Option<NodeId>, LeafOrInternal>: Sync, BoxRaw<(String, Option<NodeId>)>: Sync,

§

impl Unpin for NodeOp

§

impl UnsafeUnpin for NodeOp

§

impl UnwindSafe for NodeOp

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.