From ce76dbee6a531c1d6b3a05d74fbfbc23d5235207 Mon Sep 17 00:00:00 2001 From: Keavon Chambers Date: Sun, 9 Apr 2023 15:22:22 -0700 Subject: [PATCH] Rename the Downscale node to Downres --- .../portfolio/document/document_message_handler.rs | 12 ++++++------ .../document_node_types.rs | 13 ++++++------- node-graph/gstd/src/raster.rs | 6 +++--- .../interpreted-executor/src/node_registry.rs | 2 +- 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/editor/src/messages/portfolio/document/document_message_handler.rs b/editor/src/messages/portfolio/document/document_message_handler.rs index 6e887c25..2880c5e4 100644 --- a/editor/src/messages/portfolio/document/document_message_handler.rs +++ b/editor/src/messages/portfolio/document/document_message_handler.rs @@ -600,14 +600,14 @@ impl MessageHandler Vec { properties: |_document_node, _node_id, _context| node_properties::string_properties("The identity node simply returns the input"), }, DocumentNodeType { - name: "Downscale", + name: "Downres", category: "Ignore", identifier: NodeImplementation::DocumentNode(NodeNetwork { inputs: vec![0], outputs: vec![NodeOutput::new(2, 0)], nodes: [ DocumentNode { - name: "Downscale".to_string(), + name: "Downres".to_string(), inputs: vec![NodeInput::Network(concrete!(ImageFrame))], - implementation: DocumentNodeImplementation::Unresolved(NodeIdentifier::new("graphene_std::raster::DownscaleNode")), + implementation: DocumentNodeImplementation::Unresolved(NodeIdentifier::new("graphene_std::raster::DownresNode")), metadata: Default::default(), }, DocumentNode { @@ -138,7 +137,7 @@ fn static_nodes() -> Vec { }), inputs: vec![DocumentInputType::value("Image", TaggedValue::ImageFrame(ImageFrame::empty()), false)], outputs: vec![DocumentOutputType::new("Image", FrontendGraphDataType::Raster)], - properties: |_document_node, _node_id, _context| node_properties::string_properties("Downscale the image to a lower resolution"), + properties: |_document_node, _node_id, _context| node_properties::string_properties("Downres the image to a lower resolution"), }, // DocumentNodeType { // name: "Input Frame", diff --git a/node-graph/gstd/src/raster.rs b/node-graph/gstd/src/raster.rs index 5a710f47..e7a8c5c1 100644 --- a/node-graph/gstd/src/raster.rs +++ b/node-graph/gstd/src/raster.rs @@ -90,10 +90,10 @@ pub fn export_image_node<'i, 's: 'i>() -> impl Node<'i, 's, (Image, &'i str), Ou } */ -pub struct DownscaleNode; +pub struct DownresNode; -#[node_macro::node_fn(DownscaleNode)] -fn downscale(image_frame: ImageFrame) -> ImageFrame { +#[node_macro::node_fn(DownresNode)] +fn downres(image_frame: ImageFrame) -> ImageFrame { let target_width = (image_frame.transform.transform_vector2((1., 0.).into()).length() as usize).min(image_frame.image.width as usize); let target_height = (image_frame.transform.transform_vector2((0., 1.).into()).length() as usize).min(image_frame.image.height as usize); diff --git a/node-graph/interpreted-executor/src/node_registry.rs b/node-graph/interpreted-executor/src/node_registry.rs index a7979162..cdb9a0e5 100644 --- a/node-graph/interpreted-executor/src/node_registry.rs +++ b/node-graph/interpreted-executor/src/node_registry.rs @@ -135,7 +135,7 @@ fn node_registry() -> HashMap, input: f64, params: [&f64]), register_node!(graphene_core::ops::AddParameterNode<_>, input: &f64, params: [&f64]), register_node!(graphene_core::ops::SomeNode, input: ImageFrame, params: []), - register_node!(graphene_std::raster::DownscaleNode, input: ImageFrame, params: []), + register_node!(graphene_std::raster::DownresNode, input: ImageFrame, params: []), register_node!(graphene_std::raster::MaskImageNode<_>, input: ImageFrame, params: [ImageFrame]), #[cfg(feature = "gpu")] register_node!(graphene_std::executor::MapGpuSingleImageNode<_>, input: Image, params: [String]),