Add nondestructive vector editing (#1676)

* Initial vector modify node

* Initial extraction of data from monitor nodes

* Migrate to point id

* Start converting to modify node

* Non destructive spline tool (tout le reste est cassé)

* Fix unconnected modify node

* Fix freehand tool

* Pen tool

* Migrate demo art

* Select points

* Fix the demo artwork

* Fix the X and Y inputs for path tool

* G1 continous toggle

* Delete points

* Fix test

* Insert point

* Improve robustness of handles

* Fix GRS shortcuts on path

* Dragging points

* Fix build

* Preserve opposing handle lengths

* Update demo art and snapping

* Fix polygon tool

* Double click end anchor

* Improve dragging

* Fix text shifting

* Select only connected verts

* Colinear alt

* Cleanup

* Fix imports

* Improve pen tool avoiding handle placement

* Improve disolve

* Remove pivot widget from Transform node properties

* Fix demo art

* Fix bugs

* Re-save demo artwork

* Code review

* Serialize hashmap as tuple vec to enable deserialize_inputs

* Fix migrate

* Add document upgrade function to editor_api.rs

* Finalize document upgrading

* Rename to the Path node

* Remove smoothing from Freehand tool

* Upgrade demo artwork

* Propertly disable raw-rs tests

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
Co-authored-by: Adam <adamgerhant@gmail.com>
Co-authored-by: Dennis Kobert <dennis@kobert.dev>
This commit is contained in:
James Lindsay
2024-07-05 13:42:40 -07:00
committed by GitHub
co-authored by Keavon Chambers Adam Dennis Kobert
parent fd3613018a
commit 1652c713a6
96 changed files with 3343 additions and 2622 deletions
+4 -4
View File
@@ -12,15 +12,15 @@ homepage = "https://github.com/GraphiteEditor/Graphite/tree/master/libraries/raw
repository = "https://github.com/GraphiteEditor/Graphite/tree/master/libraries/raw-rs"
documentation = "https://docs.rs/raw-rs"
[features]
raw-rs-tests = []
[dependencies]
bitstream-io = "2.3.0"
num_enum = "0.7.2"
thiserror = { workspace = true }
tag-derive = { path = "tag-derive" }
libraw-rs = { version = "0.0.4", optional = true }
[dev-dependencies]
libraw-rs = "0.0.4"
downloader = "0.2.7"
[features]
raw-rs-tests = ["libraw-rs"]
+7 -4
View File
@@ -7,13 +7,13 @@ use std::path::Path;
use raw_rs::RawImage;
use downloader::{Download, Downloader};
use libraw::Processor;
const TEST_FILES: [&str; 3] = ["ILCE-7M3-ARW2.3.5-blossoms.arw", "ILCE-7RM4-ARW2.3.5-kestrel.arw", "ILCE-6000-ARW2.3.1-windsock.arw"];
const BASE_URL: &str = "https://static.graphite.rs/test-data/libraries/raw-rs/";
const BASE_PATH: &str = "./tests/images";
#[cfg_attr(feature = "raw-rs-tests", test)]
#[test]
#[cfg(feature = "raw-rs-tests")]
fn test_images_match_with_libraw() {
download_images();
@@ -54,6 +54,7 @@ fn test_images_match_with_libraw() {
}
}
#[cfg(feature = "raw-rs-tests")]
fn download_images() {
let mut path = Path::new(BASE_PATH).to_owned();
let mut downloads: Vec<Download> = Vec::new();
@@ -74,8 +75,9 @@ fn download_images() {
}
}
#[cfg(feature = "raw-rs-tests")]
fn test_raw_data(content: &[u8]) -> Result<RawImage, String> {
let processor = Processor::new();
let processor = libraw::Processor::new();
let libraw_raw_image = processor.decode(content).unwrap();
let mut content = Cursor::new(content);
@@ -147,8 +149,9 @@ fn test_raw_data(content: &[u8]) -> Result<RawImage, String> {
Ok(raw_image)
}
#[cfg(feature = "raw-rs-tests")]
fn test_final_image(content: &[u8], raw_image: RawImage) -> Result<(), String> {
let processor = Processor::new();
let processor = libraw::Processor::new();
let libraw_image = processor.process_8bit(content).unwrap();
let image = raw_rs::process_8bit(raw_image);