Commit graph

908 commits

Author SHA1 Message Date
0HyperCube
66ec85a3c9 Bézier-rs: Add utils to subpath (#1058)
* Add utils to bezier-rs subpath

* Apply code review changes

* Remove tan from constant

* Fix compile

* Fix tests
2023-03-02 16:48:09 +00:00
Dennis Kobert
7254c008f9 Introduce scopes (#1053)
* Implement let binding

* Add lambda inputs

* Fix tests

* Fix proto network formatting

* Generate a template Scoped network by default

* Add comment to explain the lambda parameter

* Move binding wrapping out of the template

* Fix errors cause by image frames
2023-03-02 17:13:28 +01:00
Alexandru Ică
0b813805d2 Make use of ImageFrame in the node system more extensively (#1055) (#1062)
Make the node system use ImageFrame more extensively (#1055)
2023-03-02 15:55:10 +02:00
Dennis Kobert
02d4565b0c Update node graph guide readme with new syntax (#1061) 2023-03-01 15:13:51 +01:00
Rob Nadal
8bc290fde9 Bezier-rs: Add function to smoothly join bezier curves (#1037)
* Added bezier join

* Stylistic changes per review
2023-02-28 18:59:06 -05:00
Hannah Li
8d3daeae78 Bezier-rs: Add trim for Subpath (#1006)
* Move compare.rs

* Update traits for Subpath and ManipulatorGroup

* Implement trim

* UI adjustments and more tests

* Add reverse, refactor code, rename variables

* Improve comments

* Comment nits

* Address comments

* Update trim behavior

* Update doc comment for trim

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-26 18:41:11 -05:00
0HyperCube
4495488546 Refactor vector data type from document-legacy into node graph (#1057)
Add vector data type
2023-02-25 16:55:05 +00:00
0HyperCube
08b2782917 Bézier-rs: Add ids to manipulator groups (#1054)
* Add ids to manipulator groups

* Fix tests

* Rename trait from ManipulatorGroupId to Identifier

* Rename EmptyManipulatorGroupId to EmptyId
2023-02-25 16:23:58 +00:00
multisn8
7a52e50a94 Add 'Zoom with Scroll' input navigation scheme to preferences (#1021)
* Add use_scroll_as_zoom field to preference handler

* Add {Create,Delete}Mapping variants to message

* Revert "Add {Create,Delete}Mapping variants to message"

This reverts commit 0ba74754c9fb0c78d0b590c96e1d4fe2cfdd13e7.

* Revert "Add use_scroll_as_zoom field to preference handler"

This reverts commit d30f7c9edfa6d6e156939ca07f4db81f288975fd.

* Add basic scroll_as_zoom mapping

* Create overengineered mapping patch abstraction

* Add (for now passthrough) input layout manager

* Actually handle ModifyLayout messages (untested)

* Add backend preferences <-> layout manager comms

* Add scroll-as-zoom to actual preferences UI

* Rename LayoutManager -> KeyMapping

* Add Input section to preferences and title case

* Add scrollAsZoom frontend handling code (untested)

* Handle frontend <-> preferences comms

* (broken) Move scrollAsZoom persistence into state

* Fix scrollAsZoom having no effect on node graph

* Remove debugging helpers

* Fix confusion between horizontal and vertical

* Rename feature

* Move new message handler into folder

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-24 07:18:04 +01:00
Angel Kozlev
c2234ce3fe Select Tool: Deselect selected layer when clicked while holding shift (#1030)
* Change tauri build directory back to `../dist` (#1033)

* Select Tool: Deselect selected layer when clicked while holding shift

* Fix formatting

* Change deselecting to happen on mouse up

* Clean up debug and rustfmt

---------

Co-authored-by: Dennis Kobert <dennis@kobert.dev>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-24 00:47:21 +00:00
isiko
8fe19063c1 Add "Blend" node (#1024)
* Add Blend node

* Add more implementations

Currently, known buggy implementations:
* Color Burn
* Saturation

Opacity is currently achieved by linear interpolation, this will be changed as soon as all filters are implemented.

* Add more implementations

Currently, known incorrect implementations:
* Color Burn
* Saturation

Not yet Tested:
* Linear Burn
* Linear Dodge
* Vivid Light
* Linear Light
* Pin Light
* Hard Mix
* Subtract
* Divide

Opacity is currently achieved by linear interpolation, this will be changed as soon as all filters are implemented.

* Cleanup

* Removed Unused Code
* Fixed Clamping Issue
* Fixed Inverted Opacity
* Moved Opacity Calculation from individual  Blend Functions into 'blend_node' function

* Fix 'Color Burn' blend mode

Currently, known incorrect implementations:
* Saturation

Not yet Tested:
* Linear Burn
* Darker Color
* Linear Dodge
* Lighter Color
* Vivid Light
* Linear Light
* Pin Light
* Hard Mix
* Subtract
* Divide

Opacity is currently achieved by linear interpolation, this will be changed as soon as all filters are implemented.

* Fix 'Saturation' blend mode

Currently, known incorrect implementations:
* None :D

Not yet Tested:
* Linear Burn
* Darker Color
* Linear Dodge
* Lighter Color
* Vivid Light
* Linear Light
* Pin Light
* Hard Mix
* Subtract
* Divide

Opacity is currently achieved by linear interpolation, this will be changed as soon as all filters are implemented.

* Final Cleanups

* Add proper Inputs

* cargo fmt

* Add test for doubling number

* Display implementation for ProtoNetwork

* Switch top and bottom

* Add input types for blend image node

* Fix test

---------

Co-authored-by: 0hypercube <0hypercube@gmail.com>
Co-authored-by: Dennis Kobert <dennis@kobert.dev>
2023-02-23 12:55:32 +01:00
timblah
48dcc2774b Fix file paths mentioned in website's Contribute page (#1052)
* Updated paths for frontend / backend communication section of contribute page to reflect current project structure

* Added starting / for consistency with other paths on the page

* Mapping actually happens in subscription router

* Changed path to show code that dispatches FrontendMessage rather than the type def

* Missing / at start of path

* Fix files

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-23 02:40:28 -05:00
Dennis Kobert
c09af266d8 Fix default type for Identity node (#1051) 2023-02-22 23:22:31 +01:00
Adam Jahn
069a2351f2 Add lock angle modifier to the Pen tool (#1049)
* adds lock angle to pen tool

 The current [Shift] Break Handle behavior should become Alt instead of Shift
 The current [Ctrl] Snap 15° behavior should become Shift instead of Ctrl
 Implement the extend-in-this-direction feature called [Ctrl] Lock Angle that exists in the Line tool, but doesn't yet exist in the Pen tool

* avoid clone by passing exlusive ref to tool data field directly

* Rearrange hints

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-22 02:27:49 -05:00
Shouvik Ghosh
92cb553961 Restore handle length when Shift is released while dragging opposite handle with Path tool (#1009)
* Restore path handle length to previous length when shift is released while dragging

* Reset previous opposing handle length on Delete and Abort messages

* Move the opposing handle length state to the path tool

* Use MoveManipulatorPoint messages instead of modifying MoveSelectedManipulatorPoints + break handle mirroring on dragging both handles without anchor

* Handle alt + improve reset logic + comments

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-22 05:21:46 +05:30
Keavon Chambers
107e55e91d Improve the Vibrance node (#1050)
* Fix vibrance

* Improve results

* Clean up implementation

* Fix warnings from unrelated commit

* Improve negative vibrance
2023-02-21 15:42:13 -08:00
Thomas Cheng
f2d35f50de Bezier-rs: Add self_intersection to subpath (#1035)
* add self-intersection to subpath, rebased old work onto master

* fix interactive website after rebase

* fix rustdoc iframe placement

* remove double comment

* address comments

* revert evaluate change

* address comment + fix assert statement bug

* update function comments
2023-02-21 17:08:55 -05:00
Adam Jahn
4797aed05b Add 'View > Zoom to Selected' action (#1047)
* implements pan/zoom to the selected layer(s) on Period

Relates to #989

* adds layer menu support: Layer -> Center View on Selection

* relocate Center View on Selection to View -> Zoom to selected

* use the proper menu title
2023-02-20 20:00:07 -05:00
Linda Zheng
37775eb9e9 Bezier-rs: Add bounding box, extrema, and inflection functions for subpath (#953)
* Create bbox function for subpath

* Create extrema and inflection function for subpath

* Address comments

* Prevent selecting text in SVG demo boxes

* Address Keavon's comments

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-20 13:40:38 -05:00
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
Christopher Mendoza
b7f2163998 Selecting an individual anchor point deselects each of the other points (#963)
* Selecting an individual anchor point deselects each of the other points

* git gra

* Selecting intersecting shapes,selects top shape

* Merge commit

* cargo fmt

* fixed: can't drag multiple selected shapes.

* Merge commit

* Merge commit

* Code review tweaks

* Merge commit

* Fixed topmost layer and previous_mouse_position

* Fixed issues when clicking on anchors

* Works

* Function name change

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: Dennis Kobert <dennis@kobert.dev>
2023-02-19 23:26:02 -08:00
Keavon Chambers
964cf6df15 Fix Svelte regressions related to some input widgets 2023-02-19 22:57:11 -08:00
Dennis Kobert
a993938d80 Add type checking for parameter inputs (#1045) 2023-02-20 01:37:13 +01:00
Hannah Li
98f172414a Bezier-rs: Add iframes to rustdoc (#1036)
* Add iframes examples

* Move TValue selection to bottom

* Remove spaces

* Add background, adjust heights

* Minor lint fix
2023-02-17 19:09:36 -05:00
Rob Nadal
9a52cae9b9 Bezier-rs: Add SubpathTValue and euclidean parameterization for subpaths (#1027)
* Added SubpathTValue and euclidean parameterization for subpaths

* Small fix

* Added bounds checking to get_segment

* Code review

* code review nit for clarity

---------

Co-authored-by: Hannah Li <hannahli2010@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-17 15:33:52 -05: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
63b9b670a1 Change tauri build directory back to ../dist (#1033) 2023-02-16 15:43:21 +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
Rob Nadal
a64c856ec4 Bezier-rs: Updated Bezier function signatures to accept TValue (#967)
* Create helper for converting d to t values

* Add euclidean option for tangent and normal

* Modified bezier functions signatures to accept ComputeType

* Stylistic changes per review

* Added ComputeType documentation

* Renamed ComputeType to TValue

* Fixed comments

* Fixed failing unit tests

* Code review

* Fix comments in code review

* Renamed compute_type_to_parametric to t_value_to_parametric

---------

Co-authored-by: Linda Zheng <thelindazheng@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-13 12:31:51 -05:00
Keavon Chambers
f0ad4c91d3 Replace "Edit" icon with final version 2023-02-12 20:02:15 -08:00
Keavon Chambers
33b5c0f5f4 Svelte: Fix FontInput component infinite loop 2023-02-12 01:01:40 -08:00
locriacyber
717e9c861a Svelte: Fix part of MenuBarInput (#982)
Fix MenuBarInput

Fix menubar - remove dead code

Amend minor code style
2023-02-11 22:38:34 +00:00
Keavon Chambers
91f5f74d58 Update release series to Alpha Milestone 2 2023-02-11 12:00:00 -08: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
d456640bb8 Fix regressions in previous PR 2023-02-09 11:53:14 -08:00
locriacyber
bf21cbf3ce Fix text overflow in text/radio buttons (#1004)
* [frontend] Clip button text, show ellipsis on overflow

* Fix CSS rules, replicate to Vue

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-09 09:16:54 +00:00
Hannah Li
ff51098c11 Bezier-rs: Add hash URLs for individual API examples (#968)
* Handle displaying single demos

* Address comments

* Update eslintrc

* Add hash links

* Use hash instead of pathname

* Address small nits

* Change url format

* CSS improvements

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-08 23:32:28 -05: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
5462bf5f2f Use cargo nextest and sccache in ci (#1011)
* Use cargo nextest

* add sccache
2023-02-08 00:15:41 +01: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
Sahra Zhou
77e69f4e5b Add scaling by nudging with the Alt key (#990)
* update current progress working on issue#930

* Issue#930: features other than local scaling implemented

* runs cargo fmt

* issue930: implemented features(local scaling disregraded) update: merged master branch and solved coflicts

* combined scaling and nudge feature

* combined scaling and nudge feature

* resolved issues when trying to scale below 1. pixel and other comments

* reduce code complexity

* reduce complexity

* Improve code readability/idiomaticness

* Add hints

---------

Co-authored-by: Shiro <shiro@damedane.local>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
2023-02-07 01:14:50 -08:00
Keavon Chambers
97b461377f Fix error spam from Rust-Analyzer due to build scripts 2023-02-03 13:00:55 -08:00