Rename 'Grayscale' node to 'Black & White'

This commit is contained in:
Keavon Chambers 2023-10-24 21:22:22 -07:00
parent 1bab2affdb
commit ee08938bb0
11 changed files with 20 additions and 24 deletions

View File

@ -686,9 +686,9 @@ fn static_nodes() -> Vec<DocumentNodeType> {
..Default::default() ..Default::default()
}, },
DocumentNodeType { DocumentNodeType {
name: "Grayscale", name: "Black & White",
category: "Image Adjustments", category: "Image Adjustments",
identifier: NodeImplementation::proto("graphene_core::raster::GrayscaleNode<_, _, _, _, _, _, _>"), identifier: NodeImplementation::proto("graphene_core::raster::BlackAndWhiteNode<_, _, _, _, _, _, _>"),
inputs: vec![ inputs: vec![
DocumentInputType { DocumentInputType {
name: "Image", name: "Image",
@ -732,7 +732,7 @@ fn static_nodes() -> Vec<DocumentNodeType> {
}, },
], ],
outputs: vec![DocumentOutputType::new("Image", FrontendGraphDataType::Raster)], outputs: vec![DocumentOutputType::new("Image", FrontendGraphDataType::Raster)],
properties: node_properties::grayscale_properties, properties: node_properties::black_and_white_properties,
..Default::default() ..Default::default()
}, },
DocumentNodeType { DocumentNodeType {

View File

@ -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<LayoutGroup> { pub fn black_and_white_properties(document_node: &DocumentNode, node_id: NodeId, _context: &mut NodePropertiesContext) -> Vec<LayoutGroup> {
const MIN: f64 = -200.; const MIN: f64 = -200.;
const MAX: f64 = 300.; const MAX: f64 = 300.;
// TODO: Add tint color (blended above using the "Color" blend mode) // TODO: Add tint color (blended above using the "Color" blend mode)

View File

@ -163,10 +163,6 @@
function nodeIcon(nodeName: string): IconName { function nodeIcon(nodeName: string): IconName {
const iconMap: Record<string, IconName> = { const iconMap: Record<string, IconName> = {
Output: "NodeOutput", Output: "NodeOutput",
Imaginate: "NodeImaginate",
"Hue Shift Image": "NodeColorCorrection",
"Brighten Image": "NodeColorCorrection",
"Grayscale Image": "NodeColorCorrection",
}; };
return iconMap[nodeName] || "NodeNodes"; return iconMap[nodeName] || "NodeNodes";
} }

View File

@ -279,7 +279,7 @@ fn levels_node(color: Color, input_start: f32, input_mid: f32, input_end: f32, o
} }
#[derive(Debug, Clone, Copy, Default)] #[derive(Debug, Clone, Copy, Default)]
pub struct GrayscaleNode<Tint, Reds, Yellows, Greens, Cyans, Blues, Magentas> { pub struct BlackAndWhiteNode<Tint, Reds, Yellows, Greens, Cyans, Blues, Magentas> {
tint: Tint, tint: Tint,
reds: Reds, reds: Reds,
yellows: Yellows, yellows: Yellows,
@ -291,8 +291,8 @@ pub struct GrayscaleNode<Tint, Reds, Yellows, Greens, Cyans, Blues, Magentas> {
// From <https://stackoverflow.com/a/55233732/775283> // From <https://stackoverflow.com/a/55233732/775283>
// Works the same for gamma and linear color // Works the same for gamma and linear color
#[node_macro::node_fn(GrayscaleNode)] #[node_macro::node_fn(BlackAndWhiteNode)]
fn grayscale_color_node(color: Color, tint: Color, reds: f32, yellows: f32, greens: f32, cyans: f32, blues: f32, magentas: f32) -> Color { 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 color = color.to_gamma_srgb();
let reds = reds / 100.; let reds = reds / 100.;

View File

@ -211,7 +211,7 @@
"path": null "path": null
}, },
"2037214651900404495": { "2037214651900404495": {
"name": "Grayscale", "name": "Black & White",
"inputs": [ "inputs": [
{ {
"Value": { "Value": {
@ -299,7 +299,7 @@
], ],
"implementation": { "implementation": {
"Unresolved": { "Unresolved": {
"name": "graphene_core::raster::GrayscaleNode<_, _, _, _, _, _, _>" "name": "graphene_core::raster::BlackAndWhiteNode<_, _, _, _, _, _, _>"
} }
}, },
"metadata": { "metadata": {

View File

@ -211,7 +211,7 @@
"path": null "path": null
}, },
"2037214651900404495": { "2037214651900404495": {
"name": "Grayscale", "name": "Black & White",
"inputs": [ "inputs": [
{ {
"Value": { "Value": {
@ -299,7 +299,7 @@
], ],
"implementation": { "implementation": {
"Unresolved": { "Unresolved": {
"name": "graphene_core::raster::GrayscaleNode<_, _, _, _, _, _, _>" "name": "graphene_core::raster::BlackAndWhiteNode<_, _, _, _, _, _, _>"
} }
}, },
"metadata": { "metadata": {

View File

@ -211,7 +211,7 @@
"path": null "path": null
}, },
"2037214651900404495": { "2037214651900404495": {
"name": "Grayscale", "name": "Black & White",
"inputs": [ "inputs": [
{ {
"Value": { "Value": {
@ -299,7 +299,7 @@
], ],
"implementation": { "implementation": {
"Unresolved": { "Unresolved": {
"name": "graphene_core::raster::GrayscaleNode<_, _, _, _, _, _, _>" "name": "graphene_core::raster::BlackAndWhiteNode<_, _, _, _, _, _, _>"
} }
}, },
"metadata": { "metadata": {

View File

@ -211,7 +211,7 @@
"path": null "path": null
}, },
"2037214651900404495": { "2037214651900404495": {
"name": "Grayscale", "name": "Black & White",
"inputs": [ "inputs": [
{ {
"Value": { "Value": {
@ -299,7 +299,7 @@
], ],
"implementation": { "implementation": {
"Unresolved": { "Unresolved": {
"name": "graphene_core::raster::GrayscaleNode<_, _, _, _, _, _, _>" "name": "graphene_core::raster::BlackAndWhiteNode<_, _, _, _, _, _, _>"
} }
}, },
"metadata": { "metadata": {

View File

@ -211,7 +211,7 @@
"path": null "path": null
}, },
"2037214651900404495": { "2037214651900404495": {
"name": "Grayscale", "name": "Black & White",
"inputs": [ "inputs": [
{ {
"Value": { "Value": {
@ -299,7 +299,7 @@
], ],
"implementation": { "implementation": {
"Unresolved": { "Unresolved": {
"name": "graphene_core::raster::GrayscaleNode<_, _, _, _, _, _, _>" "name": "graphene_core::raster::BlackAndWhiteNode<_, _, _, _, _, _, _>"
} }
}, },
"metadata": { "metadata": {

View File

@ -211,7 +211,7 @@
"path": null "path": null
}, },
"2037214651900404495": { "2037214651900404495": {
"name": "Grayscale", "name": "Black & White",
"inputs": [ "inputs": [
{ {
"Value": { "Value": {
@ -299,7 +299,7 @@
], ],
"implementation": { "implementation": {
"Unresolved": { "Unresolved": {
"name": "graphene_core::raster::GrayscaleNode<_, _, _, _, _, _, _>" "name": "graphene_core::raster::BlackAndWhiteNode<_, _, _, _, _, _, _>"
} }
}, },
"metadata": { "metadata": {

View File

@ -460,7 +460,7 @@ fn node_registry() -> HashMap<NodeIdentifier, HashMap<NodeIOTypes, NodeConstruct
vec![fn_type!(ImageFrame<Color>), fn_type!(BlendMode), fn_type!(f32)], vec![fn_type!(ImageFrame<Color>), 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::HueSaturationNode<_, _, _>, params: [f32, f32, f32]),
raster_node!(graphene_core::raster::InvertRGBNode, params: []), raster_node!(graphene_core::raster::InvertRGBNode, params: []),
raster_node!(graphene_core::raster::ThresholdNode<_, _, _>, params: [f32, f32, LuminanceCalculation]), raster_node!(graphene_core::raster::ThresholdNode<_, _, _>, params: [f32, f32, LuminanceCalculation]),