Differential D13466 Diff 45669 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 19 Lines | |||||
| /** \file | /** \file | ||||
| * \ingroup cmpnodes | * \ingroup cmpnodes | ||||
| */ | */ | ||||
| #include "node_composite_util.hh" | #include "node_composite_util.hh" | ||||
| /* ******************* Color Correction ********************************* */ | /* ******************* Color Correction ********************************* */ | ||||
| namespace blender::nodes { | namespace blender::nodes::node_cmp_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 = (NodeColorCorrection *)MEM_callocN(sizeof(NodeColorCorrection), | NodeColorCorrection *n = (NodeColorCorrection *)MEM_callocN(sizeof(NodeColorCorrection), | ||||
| "node colorcorrection"); | "node colorcorrection"); | ||||
| 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; | ||||
| Show All 14 Lines | static void node_composit_init_colorcorrection(bNodeTree *UNUSED(ntree), bNode *node) | ||||
| n->highlights.gain = 1.0f; | n->highlights.gain = 1.0f; | ||||
| n->highlights.gamma = 1.0f; | n->highlights.gamma = 1.0f; | ||||
| n->highlights.lift = 0.0f; | n->highlights.lift = 0.0f; | ||||
| n->highlights.saturation = 1.0f; | n->highlights.saturation = 1.0f; | ||||
| node->custom1 = 7; // red + green + blue enabled | node->custom1 = 7; // red + green + blue enabled | ||||
| node->storage = n; | node->storage = n; | ||||
| } | } | ||||
| } // namespace blender::nodes::node_cmp_colorcorrection_cc | |||||
| void register_node_type_cmp_colorcorrection() | void register_node_type_cmp_colorcorrection() | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_cmp_colorcorrection_cc; | |||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| cmp_node_type_base(&ntype, CMP_NODE_COLORCORRECTION, "Color Correction", NODE_CLASS_OP_COLOR, 0); | cmp_node_type_base(&ntype, CMP_NODE_COLORCORRECTION, "Color Correction", NODE_CLASS_OP_COLOR, 0); | ||||
| ntype.declare = blender::nodes::cmp_node_colorcorrection_declare; | ntype.declare = file_ns::cmp_node_colorcorrection_declare; | ||||
| 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); | ||||
| } | } | ||||