Update Imaginate to output bitmap data to the graph via Image Frame node (#1001)

* Multiple node outputs

* Add new nodes

* gcore use std by default to allow for testing

* Allow multiple node outputs

* Multiple outputs to frontend

* Add ImageFrameNode to node registry

* Minor cleanup

* Basic transform implementation

* Add some logging to image encoding

* Fix ImageFrameNode

* Add transform input to Imaginate node (#1014)

* Add transform input to imaginate node

* Force the resolution to be edited with no transform

* Add transform to imaginate generation

* Fix compilation

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>

* Add labels to node outputs

* Fix seed; disable mask when transform is disconnected; add Imaginate tooltips

* Rename 'Input Multiple' node to 'Input'

* Code review

* Replicate to Svelte

* Show only the primary input chain in the Properties panel

---------

Co-authored-by: Dennis Kobert <dennis@kobert.dev>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
0HyperCube
2023-02-11 08:56:31 +00:00
committed by GitHub
parent 70f4d60e66
commit e14618b234
35 changed files with 1172 additions and 553 deletions

View File

@@ -1,7 +1,7 @@
pub use dyn_any::StaticType;
use dyn_any::{DynAny, Upcast};
use dyn_clone::DynClone;
pub use glam::DVec2;
pub use glam::{DAffine2, DVec2};
use graphene_core::raster::LuminanceCalculation;
use graphene_core::Node;
use std::hash::Hash;
@@ -22,6 +22,7 @@ pub enum TaggedValue {
Bool(bool),
DVec2(DVec2),
OptionalDVec2(Option<DVec2>),
DAffine2(DAffine2),
Image(graphene_core::raster::Image),
RcImage(Option<Arc<graphene_core::raster::Image>>),
Color(graphene_core::raster::color::Color),
@@ -68,44 +69,48 @@ impl Hash for TaggedValue {
8.hash(state);
Self::DVec2(*v).hash(state)
}
Self::Image(i) => {
Self::DAffine2(m) => {
9.hash(state);
i.hash(state)
m.to_cols_array().iter().for_each(|x| x.to_bits().hash(state))
}
Self::RcImage(i) => {
Self::Image(i) => {
10.hash(state);
i.hash(state)
}
Self::Color(c) => {
Self::RcImage(i) => {
11.hash(state);
i.hash(state)
}
Self::Color(c) => {
12.hash(state);
c.hash(state)
}
Self::Subpath(s) => {
12.hash(state);
s.hash(state)
}
Self::RcSubpath(s) => {
13.hash(state);
s.hash(state)
}
Self::LuminanceCalculation(l) => {
Self::RcSubpath(s) => {
14.hash(state);
s.hash(state)
}
Self::LuminanceCalculation(l) => {
15.hash(state);
l.hash(state)
}
Self::ImaginateSamplingMethod(m) => {
15.hash(state);
16.hash(state);
m.hash(state)
}
Self::ImaginateMaskStartingFill(f) => {
16.hash(state);
17.hash(state);
f.hash(state)
}
Self::ImaginateStatus(s) => {
17.hash(state);
18.hash(state);
s.hash(state)
}
Self::LayerPath(p) => {
18.hash(state);
19.hash(state);
p.hash(state)
}
}
@@ -124,6 +129,7 @@ impl<'a> TaggedValue {
TaggedValue::Bool(x) => Box::new(x),
TaggedValue::DVec2(x) => Box::new(x),
TaggedValue::OptionalDVec2(x) => Box::new(x),
TaggedValue::DAffine2(x) => Box::new(x),
TaggedValue::Image(x) => Box::new(x),
TaggedValue::RcImage(x) => Box::new(x),
TaggedValue::Color(x) => Box::new(x),