Differential D13466 Diff 46714 source/blender/nodes/composite/nodes/node_composite_colorcorrection.cc
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/composite/nodes/node_composite_colorcorrection.cc
| Show All 22 Lines | |||||
| #include "UI_interface.h" | #include "UI_interface.h" | ||||
| #include "UI_resources.h" | #include "UI_resources.h" | ||||
| #include "node_composite_util.hh" | #include "node_composite_util.hh" | ||||
| /* ******************* Color Correction ********************************* */ | /* ******************* Color Correction ********************************* */ | ||||
| namespace blender::nodes { | namespace blender::nodes::node_composite_colorcorrection_cc { | ||||
| static void cmp_node_colorcorrection_declare(NodeDeclarationBuilder &b) | static void cmp_node_colorcorrection_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.add_input<decl::Color>(N_("Image")).default_value({1.0f, 1.0f, 1.0f, 1.0f}); | b.add_input<decl::Color>(N_("Image")).default_value({1.0f, 1.0f, 1.0f, 1.0f}); | ||||
| b.add_input<decl::Float>(N_("Mask")).default_value(1.0f).min(0.0f).max(1.0f); | b.add_input<decl::Float>(N_("Mask")).default_value(1.0f).min(0.0f).max(1.0f); | ||||
| b.add_output<decl::Color>(N_("Image")); | b.add_output<decl::Color>(N_("Image")); | ||||
| } | } | ||||
| } // namespace blender::nodes | |||||
| static void node_composit_init_colorcorrection(bNodeTree *UNUSED(ntree), bNode *node) | static void node_composit_init_colorcorrection(bNodeTree *UNUSED(ntree), bNode *node) | ||||
| { | { | ||||
| NodeColorCorrection *n = MEM_cnew<NodeColorCorrection>(__func__); | NodeColorCorrection *n = MEM_cnew<NodeColorCorrection>(__func__); | ||||
| n->startmidtones = 0.2f; | n->startmidtones = 0.2f; | ||||
| n->endmidtones = 0.7f; | n->endmidtones = 0.7f; | ||||
| n->master.contrast = 1.0f; | n->master.contrast = 1.0f; | ||||
| n->master.gain = 1.0f; | n->master.gain = 1.0f; | ||||
| n->master.gamma = 1.0f; | n->master.gamma = 1.0f; | ||||
| ▲ Show 20 Lines • Show All 229 Lines • ▼ Show 20 Lines | static void node_composit_buts_colorcorrection_ex(uiLayout *layout, | ||||
| uiItemR( | uiItemR( | ||||
| row, ptr, "shadows_lift", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE); | row, ptr, "shadows_lift", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE); | ||||
| row = uiLayoutRow(layout, false); | row = uiLayoutRow(layout, false); | ||||
| uiItemR(row, ptr, "midtones_start", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE); | uiItemR(row, ptr, "midtones_start", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE); | ||||
| uiItemR(row, ptr, "midtones_end", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE); | uiItemR(row, ptr, "midtones_end", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE); | ||||
| } | } | ||||
| } // namespace blender::nodes::node_composite_colorcorrection_cc | |||||
| void register_node_type_cmp_colorcorrection() | void register_node_type_cmp_colorcorrection() | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_composite_colorcorrection_cc; | |||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| cmp_node_type_base(&ntype, CMP_NODE_COLORCORRECTION, "Color Correction", NODE_CLASS_OP_COLOR); | cmp_node_type_base(&ntype, CMP_NODE_COLORCORRECTION, "Color Correction", NODE_CLASS_OP_COLOR); | ||||
| ntype.declare = blender::nodes::cmp_node_colorcorrection_declare; | ntype.declare = file_ns::cmp_node_colorcorrection_declare; | ||||
| ntype.draw_buttons = node_composit_buts_colorcorrection; | ntype.draw_buttons = file_ns::node_composit_buts_colorcorrection; | ||||
| ntype.draw_buttons_ex = node_composit_buts_colorcorrection_ex; | ntype.draw_buttons_ex = file_ns::node_composit_buts_colorcorrection_ex; | ||||
| node_type_size(&ntype, 400, 200, 600); | node_type_size(&ntype, 400, 200, 600); | ||||
| node_type_init(&ntype, node_composit_init_colorcorrection); | node_type_init(&ntype, file_ns::node_composit_init_colorcorrection); | ||||
| node_type_storage( | node_type_storage( | ||||
| &ntype, "NodeColorCorrection", node_free_standard_storage, node_copy_standard_storage); | &ntype, "NodeColorCorrection", node_free_standard_storage, node_copy_standard_storage); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||