From ee08938bb0869a35d895cf718c5539e195d8e4a5 Mon Sep 17 00:00:00 2001 From: Keavon Chambers Date: Tue, 24 Oct 2023 21:22:22 -0700 Subject: [PATCH] Rename 'Grayscale' node to 'Black & White' --- .../node_graph_message_handler/document_node_types.rs | 6 +++--- .../node_graph_message_handler/node_properties.rs | 2 +- frontend/src/components/views/Graph.svelte | 4 ---- node-graph/gcore/src/raster/adjustments.rs | 6 +++--- node-graph/graphene-cli/test_files/gray.graphite | 4 ++-- node-graph/graphene-cli/test_files/hue.graphite | 4 ++-- node-graph/graphene-cli/test_files/id.graphite | 4 ++-- node-graph/graphene-cli/test_files/invert.graphite | 4 ++-- node-graph/graphene-cli/test_files/levels.graphite | 4 ++-- node-graph/graphene-cli/test_files/vibrance.graphite | 4 ++-- node-graph/interpreted-executor/src/node_registry.rs | 2 +- 11 files changed, 20 insertions(+), 24 deletions(-) diff --git a/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler/document_node_types.rs b/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler/document_node_types.rs index bee1a8662..1c3d538bf 100644 --- a/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler/document_node_types.rs +++ b/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler/document_node_types.rs @@ -686,9 +686,9 @@ fn static_nodes() -> Vec { ..Default::default() }, DocumentNodeType { - name: "Grayscale", + name: "Black & White", category: "Image Adjustments", - identifier: NodeImplementation::proto("graphene_core::raster::GrayscaleNode<_, _, _, _, _, _, _>"), + identifier: NodeImplementation::proto("graphene_core::raster::BlackAndWhiteNode<_, _, _, _, _, _, _>"), inputs: vec![ DocumentInputType { name: "Image", @@ -732,7 +732,7 @@ fn static_nodes() -> Vec { }, ], outputs: vec![DocumentOutputType::new("Image", FrontendGraphDataType::Raster)], - properties: node_properties::grayscale_properties, + properties: node_properties::black_and_white_properties, ..Default::default() }, DocumentNodeType { diff --git a/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler/node_properties.rs b/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler/node_properties.rs index 717557dea..4b104ba27 100644 --- a/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler/node_properties.rs +++ b/editor/src/messages/portfolio/document/node_graph/node_graph_message_handler/node_properties.rs @@ -687,7 +687,7 @@ pub fn levels_properties(document_node: &DocumentNode, node_id: NodeId, _context ] } -pub fn grayscale_properties(document_node: &DocumentNode, node_id: NodeId, _context: &mut NodePropertiesContext) -> Vec { +pub fn black_and_white_properties(document_node: &DocumentNode, node_id: NodeId, _context: &mut NodePropertiesContext) -> Vec { const MIN: f64 = -200.; const MAX: f64 = 300.; // TODO: Add tint color (blended above using the "Color" blend mode) diff --git a/frontend/src/components/views/Graph.svelte b/frontend/src/components/views/Graph.svelte index 7593ac20f..8df57754d 100644 --- a/frontend/src/components/views/Graph.svelte +++ b/frontend/src/components/views/Graph.svelte @@ -163,10 +163,6 @@ function nodeIcon(nodeName: string): IconName { const iconMap: Record = { Output: "NodeOutput", - Imaginate: "NodeImaginate", - "Hue Shift Image": "NodeColorCorrection", - "Brighten Image": "NodeColorCorrection", - "Grayscale Image": "NodeColorCorrection", }; return iconMap[nodeName] || "NodeNodes"; } diff --git a/node-graph/gcore/src/raster/adjustments.rs b/node-graph/gcore/src/raster/adjustments.rs index 89d7cfa5f..fc22e0bf5 100644 --- a/node-graph/gcore/src/raster/adjustments.rs +++ b/node-graph/gcore/src/raster/adjustments.rs @@ -279,7 +279,7 @@ fn levels_node(color: Color, input_start: f32, input_mid: f32, input_end: f32, o } #[derive(Debug, Clone, Copy, Default)] -pub struct GrayscaleNode { +pub struct BlackAndWhiteNode { tint: Tint, reds: Reds, yellows: Yellows, @@ -291,8 +291,8 @@ pub struct GrayscaleNode { // From // Works the same for gamma and linear color -#[node_macro::node_fn(GrayscaleNode)] -fn grayscale_color_node(color: Color, tint: Color, reds: f32, yellows: f32, greens: f32, cyans: f32, blues: f32, magentas: f32) -> Color { +#[node_macro::node_fn(BlackAndWhiteNode)] +fn black_and_white_color_node(color: Color, tint: Color, reds: f32, yellows: f32, greens: f32, cyans: f32, blues: f32, magentas: f32) -> Color { let color = color.to_gamma_srgb(); let reds = reds / 100.; diff --git a/node-graph/graphene-cli/test_files/gray.graphite b/node-graph/graphene-cli/test_files/gray.graphite index ce4cccde8..88857daed 100644 --- a/node-graph/graphene-cli/test_files/gray.graphite +++ b/node-graph/graphene-cli/test_files/gray.graphite @@ -211,7 +211,7 @@ "path": null }, "2037214651900404495": { - "name": "Grayscale", + "name": "Black & White", "inputs": [ { "Value": { @@ -299,7 +299,7 @@ ], "implementation": { "Unresolved": { - "name": "graphene_core::raster::GrayscaleNode<_, _, _, _, _, _, _>" + "name": "graphene_core::raster::BlackAndWhiteNode<_, _, _, _, _, _, _>" } }, "metadata": { diff --git a/node-graph/graphene-cli/test_files/hue.graphite b/node-graph/graphene-cli/test_files/hue.graphite index 90201b37b..4e2482c27 100644 --- a/node-graph/graphene-cli/test_files/hue.graphite +++ b/node-graph/graphene-cli/test_files/hue.graphite @@ -211,7 +211,7 @@ "path": null }, "2037214651900404495": { - "name": "Grayscale", + "name": "Black & White", "inputs": [ { "Value": { @@ -299,7 +299,7 @@ ], "implementation": { "Unresolved": { - "name": "graphene_core::raster::GrayscaleNode<_, _, _, _, _, _, _>" + "name": "graphene_core::raster::BlackAndWhiteNode<_, _, _, _, _, _, _>" } }, "metadata": { diff --git a/node-graph/graphene-cli/test_files/id.graphite b/node-graph/graphene-cli/test_files/id.graphite index 72e261ae4..e9265499b 100644 --- a/node-graph/graphene-cli/test_files/id.graphite +++ b/node-graph/graphene-cli/test_files/id.graphite @@ -211,7 +211,7 @@ "path": null }, "2037214651900404495": { - "name": "Grayscale", + "name": "Black & White", "inputs": [ { "Value": { @@ -299,7 +299,7 @@ ], "implementation": { "Unresolved": { - "name": "graphene_core::raster::GrayscaleNode<_, _, _, _, _, _, _>" + "name": "graphene_core::raster::BlackAndWhiteNode<_, _, _, _, _, _, _>" } }, "metadata": { diff --git a/node-graph/graphene-cli/test_files/invert.graphite b/node-graph/graphene-cli/test_files/invert.graphite index 8e44fbf1d..4d2dee5b9 100644 --- a/node-graph/graphene-cli/test_files/invert.graphite +++ b/node-graph/graphene-cli/test_files/invert.graphite @@ -211,7 +211,7 @@ "path": null }, "2037214651900404495": { - "name": "Grayscale", + "name": "Black & White", "inputs": [ { "Value": { @@ -299,7 +299,7 @@ ], "implementation": { "Unresolved": { - "name": "graphene_core::raster::GrayscaleNode<_, _, _, _, _, _, _>" + "name": "graphene_core::raster::BlackAndWhiteNode<_, _, _, _, _, _, _>" } }, "metadata": { diff --git a/node-graph/graphene-cli/test_files/levels.graphite b/node-graph/graphene-cli/test_files/levels.graphite index 95c50e319..084dbd207 100644 --- a/node-graph/graphene-cli/test_files/levels.graphite +++ b/node-graph/graphene-cli/test_files/levels.graphite @@ -211,7 +211,7 @@ "path": null }, "2037214651900404495": { - "name": "Grayscale", + "name": "Black & White", "inputs": [ { "Value": { @@ -299,7 +299,7 @@ ], "implementation": { "Unresolved": { - "name": "graphene_core::raster::GrayscaleNode<_, _, _, _, _, _, _>" + "name": "graphene_core::raster::BlackAndWhiteNode<_, _, _, _, _, _, _>" } }, "metadata": { diff --git a/node-graph/graphene-cli/test_files/vibrance.graphite b/node-graph/graphene-cli/test_files/vibrance.graphite index 715f80705..681b6b0d8 100644 --- a/node-graph/graphene-cli/test_files/vibrance.graphite +++ b/node-graph/graphene-cli/test_files/vibrance.graphite @@ -211,7 +211,7 @@ "path": null }, "2037214651900404495": { - "name": "Grayscale", + "name": "Black & White", "inputs": [ { "Value": { @@ -299,7 +299,7 @@ ], "implementation": { "Unresolved": { - "name": "graphene_core::raster::GrayscaleNode<_, _, _, _, _, _, _>" + "name": "graphene_core::raster::BlackAndWhiteNode<_, _, _, _, _, _, _>" } }, "metadata": { diff --git a/node-graph/interpreted-executor/src/node_registry.rs b/node-graph/interpreted-executor/src/node_registry.rs index 9d2f69cb3..9009c5eaf 100644 --- a/node-graph/interpreted-executor/src/node_registry.rs +++ b/node-graph/interpreted-executor/src/node_registry.rs @@ -460,7 +460,7 @@ fn node_registry() -> HashMap), fn_type!(BlendMode), fn_type!(f32)], ), )], - raster_node!(graphene_core::raster::GrayscaleNode<_, _, _, _, _, _, _>, params: [Color, f32, f32, f32, f32, f32, f32]), + raster_node!(graphene_core::raster::BlackAndWhiteNode<_, _, _, _, _, _, _>, params: [Color, f32, f32, f32, f32, f32, f32]), raster_node!(graphene_core::raster::HueSaturationNode<_, _, _>, params: [f32, f32, f32]), raster_node!(graphene_core::raster::InvertRGBNode, params: []), raster_node!(graphene_core::raster::ThresholdNode<_, _, _>, params: [f32, f32, LuminanceCalculation]),