mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-22 06:38:12 +08:00
Add Range parameter to the Threshold node (#1079)
* Add Range * Naming, order, and defaults --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
+5
-4
@@ -393,7 +393,7 @@ fn static_nodes() -> Vec<DocumentNodeType> {
|
||||
identifier: NodeImplementation::proto("graphene_core::raster::LuminanceNode<_>"),
|
||||
inputs: vec![
|
||||
DocumentInputType::value("Image", TaggedValue::ImageFrame(ImageFrame::empty()), true),
|
||||
DocumentInputType::value("Luma Calculation", TaggedValue::LuminanceCalculation(LuminanceCalculation::SRGB), false),
|
||||
DocumentInputType::value("Luminance Calc", TaggedValue::LuminanceCalculation(LuminanceCalculation::SRGB), false),
|
||||
],
|
||||
outputs: vec![DocumentOutputType::new("Image", FrontendGraphDataType::Raster)],
|
||||
properties: node_properties::luminance_properties,
|
||||
@@ -590,11 +590,12 @@ fn static_nodes() -> Vec<DocumentNodeType> {
|
||||
DocumentNodeType {
|
||||
name: "Threshold",
|
||||
category: "Image Adjustments",
|
||||
identifier: NodeImplementation::proto("graphene_core::raster::ThresholdNode<_, _>"),
|
||||
identifier: NodeImplementation::proto("graphene_core::raster::ThresholdNode<_, _, _>"),
|
||||
inputs: vec![
|
||||
DocumentInputType::value("Image", TaggedValue::ImageFrame(ImageFrame::empty()), true),
|
||||
DocumentInputType::value("Luma Calculation", TaggedValue::LuminanceCalculation(LuminanceCalculation::SRGB), false),
|
||||
DocumentInputType::value("Threshold", TaggedValue::F64(50.), false),
|
||||
DocumentInputType::value("Min Luminance", TaggedValue::F64(50.), false),
|
||||
DocumentInputType::value("Max Luminance", TaggedValue::F64(100.), false),
|
||||
DocumentInputType::value("Luminance Calc", TaggedValue::LuminanceCalculation(LuminanceCalculation::SRGB), false),
|
||||
],
|
||||
outputs: vec![DocumentOutputType::new("Image", FrontendGraphDataType::Raster)],
|
||||
properties: node_properties::adjust_threshold_properties,
|
||||
|
||||
+6
-5
@@ -478,9 +478,9 @@ pub fn blend_properties(document_node: &DocumentNode, node_id: NodeId, _context:
|
||||
}
|
||||
|
||||
pub fn luminance_properties(document_node: &DocumentNode, node_id: NodeId, _context: &mut NodePropertiesContext) -> Vec<LayoutGroup> {
|
||||
let luma_calculation = luminance_calculation(document_node, node_id, 1, "Luma Calculation", true);
|
||||
let luminance_calc = luminance_calculation(document_node, node_id, 1, "Luminance Calc", true);
|
||||
|
||||
vec![luma_calculation]
|
||||
vec![luminance_calc]
|
||||
}
|
||||
|
||||
pub fn adjust_hsl_properties(document_node: &DocumentNode, node_id: NodeId, _context: &mut NodePropertiesContext) -> Vec<LayoutGroup> {
|
||||
@@ -510,10 +510,11 @@ pub fn blur_image_properties(document_node: &DocumentNode, node_id: NodeId, _con
|
||||
}
|
||||
|
||||
pub fn adjust_threshold_properties(document_node: &DocumentNode, node_id: NodeId, _context: &mut NodePropertiesContext) -> Vec<LayoutGroup> {
|
||||
let luma_calculation = luminance_calculation(document_node, node_id, 1, "Luma Calculation", true);
|
||||
let thereshold = number_widget(document_node, node_id, 2, "Threshold", NumberInput::default().min(0.).max(100.).unit("%"), true);
|
||||
let thereshold_min = number_widget(document_node, node_id, 1, "Min Luminance", NumberInput::default().min(0.).max(100.).unit("%"), true);
|
||||
let thereshold_max = number_widget(document_node, node_id, 2, "Max Luminance", NumberInput::default().min(0.).max(100.).unit("%"), true);
|
||||
let luminance_calc = luminance_calculation(document_node, node_id, 3, "Luminance Calc", true);
|
||||
|
||||
vec![luma_calculation, LayoutGroup::Row { widgets: thereshold }]
|
||||
vec![LayoutGroup::Row { widgets: thereshold_min }, LayoutGroup::Row { widgets: thereshold_max }, luminance_calc]
|
||||
}
|
||||
|
||||
pub fn adjust_vibrance_properties(document_node: &DocumentNode, node_id: NodeId, _context: &mut NodePropertiesContext) -> Vec<LayoutGroup> {
|
||||
|
||||
Reference in New Issue
Block a user