Skip to main content

lumen_engine/node/
mod.rs

1//! Renderer-agnostic node schema and shared parameter types.
2//!
3//! Node structs stay intentionally small here: they describe graph shape and
4//! animatable parameters. GPU lowering lives in `crate::gpu`.
5
6mod deferred;
7mod delegate;
8mod ids;
9mod kind;
10mod param_type;
11mod ports;
12mod property;
13mod schema;
14
15pub mod compositing;
16pub mod media_output;
17pub mod processing;
18pub mod source;
19pub mod vector;
20
21pub use deferred::Deferred;
22#[cfg(feature = "json")]
23pub use deferred::DeferredJsonValue;
24pub use deferred::DeferredValue;
25pub use delegate::{
26    DelegateEvalContext, DelegateEvaluable, DelegateValue, DelegateVec, Delegated,
27    NodeParamEvalContext, NodeParams,
28};
29pub use ids::{NodeId, TrackId};
30pub use kind::NodeKind;
31pub use param_type::NodeParamType;
32pub use ports::{InputPortDef, OutputPortDef, PortKind, PortRef, SINGLE_RASTER_OUTPUT};
33pub use property::{PropertyExpression, PropertyValue};
34#[cfg(feature = "json")]
35pub use schema::JsonNode;
36#[cfg(any(feature = "json", feature = "metadata"))]
37pub use schema::{EnumDef, EnumOptionDef, NodeEnum};
38pub use schema::{NodeCategory, NodeSchemaDef, PropertyDef, PropertyKind};
39#[cfg(feature = "metadata")]
40pub use schema::{NodeSchema, PropertyConstraints};
41
42pub trait Node: Send + Sync {
43    fn id(&self) -> NodeId;
44    fn input_port_defs(&self) -> &'static [InputPortDef];
45    fn input_ports(&self) -> Vec<PortRef>;
46    fn output_port_defs(&self) -> &'static [OutputPortDef] {
47        SINGLE_RASTER_OUTPUT
48    }
49}
50
51pub trait PropertyEval {
52    fn get_property(&self, id: &str) -> crate::Result<Option<PropertyExpression>>;
53}