pub enum NodeKind {
Show 19 variants
Input,
Color([u8; 4]),
Clip(u64),
Asset(u64),
Effect(Effect),
Blend {
mode: BlendMode,
opacity: Animated,
},
Combine {
mode: BlendMode,
factor: Animated,
},
Merge,
Matte {
invert: bool,
use_alpha: bool,
},
Mask(Mask),
String(TextStyle),
Number(Animated),
Bool(bool),
Random {
seed: u32,
min: f64,
max: f64,
},
Math(MathOp),
Compare(CmpOp),
Logic(LogicOp),
Select,
Output,
}Expand description
What a node does. Input is the clip’s own decoded layer; Output is what the compositor draws.
Two kinds of wire run through a graph: pictures (one texture per node, evaluated on the GPU) and
values (one number per node, NodeGraph::eval_values). Value ports on a picture node — an
effect’s parameter ports, a blend’s amount — are what let the logic nodes drive the image.
Variants§
Input
The clip’s decoded layer (or, in an adjustment clip, everything below it).
Color([u8; 4])
A solid colour (RGBA) filling the canvas.
Clip(u64)
Another clip’s layer at the same time (compositing across tracks).
Asset(u64)
A project asset sampled as a texture — footage that need not be on the timeline at all.
Effect(Effect)
Blend
Combines two inputs (a under b) with a blend mode and opacity.
Combine
Same two inputs, mixed in by factor (0..1) — “how much of b”, not its opacity.
Merge
b composited straight over a (alpha over, no knobs).
Matte
Uses b’s luminance (or alpha) as a matte for a.
Mask(Mask)
A standalone mask (matte generator).
String(TextStyle)
A string rasterised into the graph. {frame}, {time} and {n} expand at evaluation time,
which is all a frame counter or a running clock needs (see expand_text). Called Text in
projects written before it was renamed — the alias keeps those loading.
Number(Animated)
A keyframeable constant: the plain number input, and a grey card at its value as a picture.
Bool(bool)
A constant flag — 1.0 or 0.0 downstream.
Random
Deterministic noise in min..max, hashed from (seed, frame): the same project always
renders the same numbers, and every frame gets a different one. A constant is a Number.
Math(MathOp)
Arithmetic on two value inputs.
Compare(CmpOp)
Compares two value inputs: 1.0 when it holds, 0.0 when it does not.
Logic(LogicOp)
Boolean logic on two value inputs (Not reads only a); anything >= 0.5 counts as true.
Select
cond ? a : b — the switch. Works on values and on pictures.
Output
Implementations§
Source§impl NodeKind
impl NodeKind
Sourcepub fn inputs(&self) -> usize
pub fn inputs(&self) -> usize
How many inputs the node consumes. An effect takes its picture on port 0 and one optional value per parameter after it, so any number in the graph can drive any knob.
Sourcepub fn port_label(&self, i: usize) -> &str
pub fn port_label(&self, i: usize) -> &str
What port i takes, for the node box and the tooltips. Empty when it has no name.
Sourcepub fn is_value(&self) -> bool
pub fn is_value(&self) -> bool
Nodes whose output is a number rather than a picture (they still paint as a grey card, so a value can be used as a matte without a conversion node).
pub fn title(&self) -> String
Trait Implementations§
Source§impl<'de> Deserialize<'de> for NodeKind
impl<'de> Deserialize<'de> for NodeKind
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>,
impl StructuralPartialEq for NodeKind
Auto Trait Implementations§
impl Freeze for NodeKind
impl RefUnwindSafe for NodeKind
impl Send for NodeKind
impl Sync for NodeKind
impl Unpin for NodeKind
impl UnwindSafe for NodeKind
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
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>
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>
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