Skip to main content

NodeOp

Enum NodeOp 

Source
pub enum NodeOp {
    Clip {},
    Media {
        source_id: SourceId,
        start: MediaTime,
    },
    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,
    },
    Merge {
        layers: Vec<MergeLayer>,
    },
    Matte {
        input: Option<NodeId>,
        matte: Option<NodeId>,
        mode: MatteMode,
    },
    ShapeMask {
        input: Option<NodeId>,
        masks: Vec<ShapeMask>,
    },
    Group {
        composition: CompositionId,
        inputs: Vec<Option<NodeId>>,
        controls: BTreeMap<String, Animated<EffectValue>>,
    },
    GroupInput {
        index: u32,
    },
}
Expand description

The operation of a CompositionNode.

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

Variants§

§

Clip

The picture of the clip showing the composition: its source at the source time the clip’s time map gives, or what its generated source draws.

§

Media

Another visual source, read at start plus the composition time. A media node 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.

§

Generator

A picture the engine draws.

Fields

§generator: Generator

What is drawn.

§

Effect

A registered effect: its input and the named images it samples besides.

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. A name the definition does not declare, or one it declares and this leaves out, fails the frames that draw the node.

§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.

§

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.

§

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 its group inputs fed from inputs and its 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; a control not set keeps 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.

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, the bottom layer of a merge, and a group’s first input. None for an operation without inputs, which cannot be bypassed, and for a merge 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§

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.