mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-17 07:18:04 +08:00
Add the Mask node (#1080)
* Add MaskImageNode Co-authored-by: Dennis Kobert <dennis@kobert.dev>
This commit is contained in:
@@ -286,7 +286,18 @@ fn static_nodes() -> Vec<DocumentNodeType> {
|
||||
properties: |_document_node, _node_id, _context| node_properties::string_properties("Creates an embedded image with the given transform"),
|
||||
},
|
||||
DocumentNodeType {
|
||||
name: "Blend Node",
|
||||
name: "Mask",
|
||||
category: "Image Adjustments",
|
||||
identifier: NodeImplementation::proto("graphene_std::raster::MaskImageNode<_>"),
|
||||
inputs: vec![
|
||||
DocumentInputType::value("Image", TaggedValue::ImageFrame(ImageFrame::empty()), true),
|
||||
DocumentInputType::value("Stencil", TaggedValue::ImageFrame(ImageFrame::empty()), true),
|
||||
],
|
||||
outputs: vec![DocumentOutputType::new("Image", FrontendGraphDataType::Raster)],
|
||||
properties: node_properties::mask_properties,
|
||||
},
|
||||
DocumentNodeType {
|
||||
name: "Blend",
|
||||
category: "Image Adjustments",
|
||||
identifier: NodeImplementation::proto("graphene_core::raster::BlendNode<_, _, _, _>"),
|
||||
inputs: vec![
|
||||
|
||||
@@ -477,6 +477,12 @@ pub fn blend_properties(document_node: &DocumentNode, node_id: NodeId, _context:
|
||||
vec![backdrop, blend_mode, LayoutGroup::Row { widgets: opacity }]
|
||||
}
|
||||
|
||||
pub fn mask_properties(document_node: &DocumentNode, node_id: NodeId, _context: &mut NodePropertiesContext) -> Vec<LayoutGroup> {
|
||||
let mask = color_widget(document_node, node_id, 1, "Stencil", ColorInput::default(), true);
|
||||
|
||||
vec![mask]
|
||||
}
|
||||
|
||||
pub fn luminance_properties(document_node: &DocumentNode, node_id: NodeId, _context: &mut NodePropertiesContext) -> Vec<LayoutGroup> {
|
||||
let luminance_calc = luminance_calculation(document_node, node_id, 1, "Luminance Calc", true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user