Accept any paint element on the fill and stroke inputs

This commit is contained in:
Dennis Kobert
2026-09-08 18:54:21 +00:00
parent a593430e38
commit 35a34168d7
6 changed files with 181 additions and 22 deletions

View File

@@ -12,7 +12,9 @@ use graphene_std::registry::{ConstructionError, SourceHandle, NodeIOTypes, Regis
use graphene_std::runtime::RuntimeHandle;
use graphene_std::vector::Vector;
use graphene_std::{Context, Graphic, ProtoNodeIdentifier, concrete};
use graphene_std::gradient::Gradient;
use graphene_std::brush::Stroke;
use graphene_std::{Color, Context, Graphic, ProtoNodeIdentifier, concrete};
use node_registry_macros::{convert_node, into_node};
use std::collections::HashMap;
#[cfg(feature = "gpu")]
@@ -28,6 +30,16 @@ fn node_registry() -> HashMap<ProtoNodeIdentifier, Vec<RegistryEntry>> {
#[cfg(feature = "gpu")]
into_node!(from: List<Raster<GPU>>, to: List<Raster<GPU>>),
convert_node!(from: List<Vector>, to: List<Graphic>),
convert_node!(from: List<Color>, to: List<Graphic>),
convert_node!(from: List<Gradient>, to: List<Graphic>),
convert_node!(from: List<String>, to: List<Graphic>),
convert_node!(from: List<Stroke>, to: List<Graphic>),
convert_node!(from: Vector, to: Graphic),
convert_node!(from: Color, to: Graphic),
convert_node!(from: Gradient, to: Graphic),
convert_node!(from: String, to: Graphic),
convert_node!(from: Stroke, to: Graphic),
convert_node!(from: Raster<CPU>, to: Graphic),
convert_node!(from: List<Raster<CPU>>, to: List<Graphic>),
#[cfg(feature = "gpu")]
convert_node!(from: List<Raster<GPU>>, to: List<Graphic>),