Integrate the node graph as a Node Graph Frame layer type (#812)

* Add node graph frame tool

* Add a brighten

* Use the node graph

* Fix topological_sort

* Update UI

* Add icons for the tool and layer type

* Avoid serde & use bitmaps to improve performance

* Allow serialising a node graph

* Fix missing ..Default::default()

* Fix incorrect comments

* Cache node graph output image

* Suppress no-cycle import warning

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
0HyperCube
2022-11-05 21:38:14 +00:00
committed by GitHub
parent 596b9f4531
commit 9cdebfb1f0
33 changed files with 1018 additions and 258 deletions

View File

@@ -4,6 +4,26 @@ use dyn_clone::DynClone;
use dyn_any::{DynAny, Upcast};
/// A type that is known, allowing serialization (serde::Deserialize is not object safe)
#[derive(Clone, Debug, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum TaggedValue {
String(String),
U32(u32),
//Image(graphene_std::raster::Image),
Color(graphene_core::raster::color::Color),
}
impl TaggedValue {
pub fn to_value(self) -> Value {
match self {
TaggedValue::String(x) => Box::new(x),
TaggedValue::U32(x) => Box::new(x),
TaggedValue::Color(x) => Box::new(x),
}
}
}
pub type Value = Box<dyn ValueTrait>;
pub trait ValueTrait: DynAny<'static> + Upcast<dyn DynAny<'static>> + std::fmt::Debug + DynClone {}