Commit graph

493 commits

Author SHA1 Message Date
isiko
4bb4e2c22e Add Minimum and Maximum option to Threshold node (#1029)
This might be usefull later when spliting Images into Seperate Images for each Channel, as then the other modes might behave weirdly

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-20 08:39:09 +01:00
0HyperCube
6caed9e761 Fix default value for the Output node (#1042)
* Fix default value for output node

* Don't set frame transform to zero

* Fix typo in hash function

* Clear frame on empty image

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-20 07:32:49 +00:00
Dennis Kobert
a993938d80 Add type checking for parameter inputs (#1045) 2023-02-20 01:37:13 +01:00
isiko
344f243432 Fix Levels node gamma correction (#1034)
* Fix Levels Node

* Fix the fix

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-16 18:33:03 +01:00
Dennis Kobert
3015a9c8af Chain cache node and Clone to make them usable from the ui (#1032)
Chain cache node and Clone to make it a drop in replacement
2023-02-16 15:03:13 +01:00
Dennis Kobert
e6a8d5c573 Add input caching to old blur implementation (#1018) 2023-02-16 15:00:08 +01:00
Dennis Kobert
761cec54ef Hash a type based on its name because the id could be empty (#1031) 2023-02-16 09:27:47 +01:00
isiko
7071aabba8 Add Levels adjustment node (#1028)
* Add Levels Node

* Fix naming and algorithm

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-16 01:11:31 +01:00
Dennis Kobert
5dab7de68d Add type checking to the node graph (#1025)
* Implement type inference

Add type hints to node trait

Add type annotation infrastructure

Refactor type ascription infrastructure

Run cargo fix

Insert infer types stub

Remove types from node identifier

* Implement covariance

* Disable rejection of generic inputs + parameters

* Fix lints

* Extend type checking to cover Network inputs

* Implement generic specialization

* Relax covariance rules

* Fix type annotations for TypErasedComposeNode

* Fix type checking errors

* Keep connection information during node resolution
* Fix TypeDescriptor PartialEq implementation

* Apply review suggestions

* Add documentation to type inference

* Add Imaginate node to document node types

* Fix whitespace in macros

* Add types to imaginate node

* Fix type declaration for imaginate node + add console logging

* Use fully qualified type names as fallback during comparison

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-15 23:31:30 +01:00
0HyperCube
1b0e1b9bdf 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>
2023-02-11 08:56:31 +00:00
isiko
a709a772d5 Add color weights to Grayscale node and improve luminance handling (#1015)
* Add weighted grayscale node

* Rename nodes, fix grayscale weighting, add luma calc options

* Fix tests

* Add Tint Option

* Improve (but not full fix) tint

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-10 21:55:01 +01:00
Keavon Chambers
875f2a5cd1 Improve Threshold node, move Gamma into Exposure node 2023-02-08 17:48:08 -08:00
Dennis Kobert
8e3480e952 Image adjustment nodes restructure (#1013)
* Add macro for creation of Map image nodes

* Move nodes to adjustments module

* Add Saturation and Lightness to hue shift node

* Fix raster node macro

* Add Threshold Node

* Convert all adjustment nodes to new format

* Start implementing vibrance node

* Remove package-lock.json

* Code review

---------

Co-authored-by: isiko404 <isihd.ko@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-09 01:17:09 +01:00
Keavon Chambers
202b0ee6ed Remove Color struct from document-legacy (#1012) 2023-02-07 17:31:50 -08:00
Dennis Kobert
620540d7cd Incremental compilation and stable node IDs (#977)
* Generate stable node ids

* checkpoint

* Implement borrow tree

* Add eval function on borrow tree

* Refactor Node trait to fix lifetime issues

* Compiler infinite loop

* Impl compose pair

* Transition to double lifetime on trait

* Change node trait to use a generic arg for the input

* Start adapting node_macro

* Migrate more nodes to new macro

* Fix raster tests

* Port vector nodes

* Make Node trait object safe

* Fix FlatMapResultNode

* Translate most of gstd

* Fix DowncastBothNode

* Refactor node trait once again to allow for HRTB for type erased nodes

* Start working on type erased nodes

* Try getting DowncastBothNode to work

* Introduce Upcasting node + work on BorrowTree

* Make enough 'static to get the code to compile

* Transition DynamicExecutor to use borrow tree

* Make Compose Node use HRTB's

* Fix MapResultNode

* Disable blur test

* Add workaround for Composing type erased nodes

* Convert more nodes in the node_registry

* Convert more of the node_registry

* Add update tree fn and hook up to frontend

* Fix blur node

* Implement CacheNode

* Make frontend use graph compiler

* Fix document_node_types type declaration for most nodes

* Remove unused imports

* Move comment down

* Reuse nodes via borrow tree

* Deprecate trait based value in favor of TaggedValue

* Remove unsafe code in buffer creation

* Fix blur node

* Fix stable node id generation

* Fix types for Image adjustment document nodes

* Fix Imaginate Node

* Remove unused imports

* Remove log

* Fix off by one error

* Remove macro generated imaginate node entry

* Create parameterized add node

* Fix test case

* Remove link from layer_panel.rs

* Fix formatting
2023-02-07 20:06:24 +01:00
Keavon Chambers
d990110f63 Apply lints and cleanup to Rust code 2023-01-29 03:01:57 -08:00
Brendan Allan
5388b59e97 Groundwork for integrating Specta (#949)
* add derive(specta::Type)

* use specta from git

* introduce Uuid type

* remove unnecessary specta::Type

* document export_types test

* upgrade Specta
The previous Specta branch had some hacks that were just for this project. They have all been converted into proper features so they can be merged into main.

* remove some unnecessary specta::Type uses

* add MessageDiscriminantDef explanation

* manually export types with specta

* rename 'specta.rs' to 'export_types.rs'

* rename 'export_types' to 'generate_ts_types'

---------

Co-authored-by: Oscar Beaumont <oscar@otbeaumont.me>
2023-01-28 22:29:38 -08:00
0HyperCube
64e62699fc Replace the image layer type with an Image node (#948)
* Use builder pattern for widgets

* Arguments to new function

* Add node graph when dragging in image

* Fix duplicate import

* Skip processing under node graph frame if unused

* Reduce node graph rerenders

* DUPLICATE ALL frontend changes into other frontend

* DUPLICATE more changes to another frontend

* Code review

* Allow importing SVG files as bitmaps

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-01-27 10:01:09 +00:00
Keavon Chambers
66e8325362 Update project readme and MSRV 2023-01-24 01:33:30 -08:00
Oliver Davies
0019340096 Remove additional boolean for mirroring distance (#965)
Removed the additional boolean for mirroring distance
2023-01-13 15:00:20 -08:00
Keavon Chambers
bf1a3e3daf Clean up imports and warnings in Rust code 2023-01-13 12:45:14 -08:00
0HyperCube
741e61a59d Hide handle overlays too close to the parent anchor (#951)
Hide handle overlay

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-01-09 03:32:26 +00:00
0HyperCube
2bcc3d3baf Improve history states (#932)
* Add some more history states

* Fix undo whilst drawing

* Paste image history

* Toggle output and preview history

* Code review nits

* Remove extra '{'

* Fix typo

* Fix about.toml

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-01-01 22:02:44 +00:00
Dennis Kobert
a9601ab164 Implement the Gaussian Blur node (#933) 2022-12-31 21:12:02 +01:00
Dennis Kobert
74bfd630a9 Quantization node (#887)
Add basic quantization node
2022-12-31 18:30:35 +01:00
Dennis Kobert
79ad3e7908 Restructure GPU compilation execution pipeline (#903)
* Restructure gpu compilation execution pipeline

* Add compilation server/client infrastructure

* Add wgpu executor
2022-12-31 02:52:04 +01:00
0HyperCube
b408bef14b Make copying/duplicating nodes not preserve the incoming connection (#917)
* Remove wires to nodes outside of copy

* Fix logic error

* Shift pasted nodes

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-12-28 20:00:53 +00:00
0HyperCube
c552edd525 Node 'Disable' and 'Preview' UX improvements (#918)
* Don't allow disabling input or output nodes

* Shortcuts to show and preview node

* Update preview tooltip and label

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-12-28 19:38:35 +00:00
Keavon Chambers
0c9f457866 Rename some Imaginate parameters 2022-12-27 14:30:54 -08:00
0HyperCube
8d7e6c530e Add preview and disable buttons for nodes (#905)
* Add preview and disable button

* Fix tests

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-12-25 10:28:18 +00:00
0HyperCube
8f4f7b3cf1 Add drag to connect nodes (#901)
* Add drag to connect nodes

* Clean up node graph code

* Close node list with escape or click

* Check if line is contained within box

* Shift the nodes

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-12-22 21:14:21 +00:00
Keavon Chambers
49b9b8cfec Rename the legacy Graphene crate to document-legacy (#899)
* Rename /graphene to /document-legacy

* Update names in code
2022-12-22 02:12:05 -08:00
0HyperCube
5b3c015f71 Better downcast panics (#898) 2022-12-22 09:27:55 +00:00
0HyperCube
951c49a979 Node code cleanup for vector data, and add node creation guide (#895)
* Cleanup Vector Nodes

* Add the creating nodes guide

* Rename guide as readme so GitHub shows it by default

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-12-21 19:50:40 +00:00
0HyperCube
3a4a0eaf68 Fix Imaginate flicker during generation (#891)
Fix imaginate flicker

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-12-21 10:09:01 +00:00
0HyperCube
2732492307 Make Imaginate into a node (#878)
* Simplify document node input defenitions

* Remove imaginate layer

* Imaginate node properties

* Fix serde feature gate

* Add Proc Macro for Protonode implementation

* Fix incorrect type

* Add cargo.toml metadata

* Send imaginate params to frontend

* Fix image_creativity range

* Finish imaginate implementation

* Fix the imaginate draw tool

* Remove node-graph/rpco-macro

* Cargo fmt

* Fix missing workspace member

* Changes to the resolution

* Add checkbox for Imaginate auto resolution; improve Properties panel layouts

And fix bugs in panel resizing

* Implement the Rescale button

* Reorder imports

* Update Rust deps

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-12-20 22:51:38 +00:00
0HyperCube
9d40539dc7 Nested networks UI (#885)
* Initial UI for nested nodes

* Clean up deleting nodes

* Print address of nested network

* Add exiting network message

* Implement the breadcrumb trail

* Remove whitespace

* Fix double click not registering in Chromium

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-12-17 15:38:29 +00:00
TrueDoctor
7d8f94462a Bundle Graphite using Tauri (#873)
* Setup tauri component for graphite editor

Integrate graphite into tauri app

Split interpreted-executor out of graph-craft

* Add gpu execution node

* General Cleanup
2022-12-07 12:49:34 +01:00
0HyperCube
9a4af4f87a Fix inability to expose the Add node's parameter (#877)
* Fix add node

* Simplify document node input defenitions
2022-12-10 23:54:14 +00:00
TrueDoctor
57a1f653e1 Implement node graph gpu execution via vulkano and rust gpu (#870)
* Add Executor abstraction

* Resolve inputs for proto nodes by adding compose nodes

* Add infrastructure for compiling gpu code

* Integrate nodegraph gpu execution into graph-crafter

* Extract graphene core path from env vars

* Make Color struct usable for gpu code
2022-12-05 12:56:36 +01:00
Keavon Chambers
33d5db76c0 Improve naming of nodes and 'add' menu styling 2022-12-03 23:29:55 -08:00
0HyperCube
eb9848365f Add some additional image effect nodes (#869)
* Move the Subpath type to graphene-std

* Add the transform subpath node

* Delete selected nodes

* Inserting node list on right click

* Add several bitmap manipulator nodes

* Convert add node to use f64

* Add posterize node

* Rename names randomly

* Fix naming

* Exposure node

* Fix typo

* Adjust exposure node range

* Comment out vector nodes

* Adjust exposure range again

* Posterise as ints

* Rename input

* Use >= in the to hsl function
2022-12-03 22:29:45 +00:00
0HyperCube
3dd9e88655 Add support for exposing node parameter inputs (#866)
* Add exposing inputs to graph

* Use uuids and better node positioning

* Fix accidentally refering to the wrong grid spacing

* Secondary input without primary input

* Cleanup document node types

* Rename to input and addend
2022-11-22 19:57:08 +00:00
0HyperCube
0a78ebda25 Add secondary inputs to nodes UI (#863)
* Add secondary inputs to UI

* Fix add node

* Dragging nodes

* Add ParameterExposeButton component

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-11-22 17:36:19 +00:00
0HyperCube
2994afa6b8 Node graph improvements (#855)
* Selecting multiple nodes

* Improve logs

* Log bad types in dyn any

* Add (broken) node links

* New topological sort

* Fix reorder ids function

* Input and output node

* Add nodes that operate on images

* Fixups

* Show node parameters together with layer properties

* New nodes don't crash editor

* Fix tests

* Node positions backend

* Generate node graph on value change

* Add expose input message

* Fix tests

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2022-11-17 23:36:23 +00:00
0HyperCube
504136b61b Add a basic API and rudimentary frontend for node graph layers (#846)
* Node graph API stub

* Rename and fix SetInputValue

* Get list of links from network

* Test populating node graph UI

* Node properties

* Fix viewport bounds

* Slightly change promise usage

* A tiny bit of cleanup I did while reading code

* Cleanup and work towards hooking up node links in Vue template

* Add the brighten colour node

* Run cargo fmt

* Add to and from hsla

* GrayscaleImage node with small perf improvement

* Fix gutter panel resizing

* Display node links from backend

* Add support for connecting node links

* Use existing message

* Fix formatting error

* Add a (currently crashing) brighten node

* Replace brighten node with proto node implementation

* Add support for connecting node links

* Update watch dirs

* Add hue shift node

* Add create_node function to editor api

* Basic insert node UI

* Fix broken names

* Add log

* Fix positioning

* Set connector index to 0

* Add properties for Heu shift / brighten

* Allow deselecting nodes

* Redesign Properties panel collapsible sections

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: Dennis Kobert <dennis@kobert.dev>
2022-11-12 21:23:28 +00:00
Keavon Chambers
3f98d1c896 Add rotation custom cursor icon for the transform cage 2022-11-05 23:02:21 -07:00
0HyperCube
18507b78ac 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>
2022-11-05 21:38:14 +00:00
TrueDoctor
ae7affda74 Implement Upcasting without nightly support (#825) 2022-10-26 01:37:18 +02:00
TrueDoctor
4ec600957c Node graph dynamic execution (#824)
Restructure document node implementation

* Implement topological sort

* Enforce the usage of type annotations

* Add complete test case
2022-10-26 00:45:42 +02:00