Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Carlisle <carlisle.b3d@gmail.com>2022-01-11 10:10:36 +0300
committerAaron Carlisle <carlisle.b3d@gmail.com>2022-01-11 10:11:14 +0300
commitfd922f59404fa67d921691eac83288503f164b32 (patch)
treee3c8d6929f4c8d9640da99ce6577b21dbd70f792 /source/blender/nodes/composite/nodes/node_composite_colorbalance.cc
parentf2fb9a0c59ab64358301e4d98ba35b5f122a0eaf (diff)
Cleanup: Composite nodes: add namespace for every file
This puts all static functions in composite node files into a new namespace. This allows using unity build which can improve compile times significantly. This is a follow up on rB1df8abff257030ba79bc23dc321f35494f4d91c5 but for compositor nodes. The namespace name is derived from the file name. That makes it possible to write some tooling that checks the names later on. The filename extension (`cc`) is added to the namespace name as well. his also possibly simplifies tooling but also makes it more obvious that this namespace is specific to a file. Reviewed By: JacquesLucke, HooglyBoogly, jbakker Differential Revision: https://developer.blender.org/D13466
Diffstat (limited to 'source/blender/nodes/composite/nodes/node_composite_colorbalance.cc')
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_colorbalance.cc32
1 files changed, 17 insertions, 15 deletions
diff --git a/source/blender/nodes/composite/nodes/node_composite_colorbalance.cc b/source/blender/nodes/composite/nodes/node_composite_colorbalance.cc
index bddd702bcca..809641ec147 100644
--- a/source/blender/nodes/composite/nodes/node_composite_colorbalance.cc
+++ b/source/blender/nodes/composite/nodes/node_composite_colorbalance.cc
@@ -30,17 +30,6 @@
/* ******************* Color Balance ********************************* */
-namespace blender::nodes {
-
-static void cmp_node_colorbalance_declare(NodeDeclarationBuilder &b)
-{
- b.add_input<decl::Float>(N_("Fac")).default_value(1.0f).min(0.0f).max(1.0f).subtype(PROP_FACTOR);
- b.add_input<decl::Color>(N_("Image")).default_value({1.0f, 1.0f, 1.0f, 1.0f});
- b.add_output<decl::Color>(N_("Image"));
-}
-
-} // namespace blender::nodes
-
/* Sync functions update formula parameters for other modes, such that the result is comparable.
* Note that the results are not exactly the same due to differences in color handling
* (sRGB conversion happens for LGG),
@@ -69,6 +58,15 @@ void ntreeCompositColorBalanceSyncFromCDL(bNodeTree *UNUSED(ntree), bNode *node)
}
}
+namespace blender::nodes::node_composite_colorbalance_cc {
+
+static void cmp_node_colorbalance_declare(NodeDeclarationBuilder &b)
+{
+ b.add_input<decl::Float>(N_("Fac")).default_value(1.0f).min(0.0f).max(1.0f).subtype(PROP_FACTOR);
+ b.add_input<decl::Color>(N_("Image")).default_value({1.0f, 1.0f, 1.0f, 1.0f});
+ b.add_output<decl::Color>(N_("Image"));
+}
+
static void node_composit_init_colorbalance(bNodeTree *UNUSED(ntree), bNode *node)
{
NodeColorBalance *n = MEM_cnew<NodeColorBalance>(__func__);
@@ -157,16 +155,20 @@ static void node_composit_buts_colorbalance_ex(uiLayout *layout,
}
}
+} // namespace blender::nodes::node_composite_colorbalance_cc
+
void register_node_type_cmp_colorbalance()
{
+ namespace file_ns = blender::nodes::node_composite_colorbalance_cc;
+
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_COLORBALANCE, "Color Balance", NODE_CLASS_OP_COLOR);
- ntype.declare = blender::nodes::cmp_node_colorbalance_declare;
- ntype.draw_buttons = node_composit_buts_colorbalance;
- ntype.draw_buttons_ex = node_composit_buts_colorbalance_ex;
+ ntype.declare = file_ns::cmp_node_colorbalance_declare;
+ ntype.draw_buttons = file_ns::node_composit_buts_colorbalance;
+ ntype.draw_buttons_ex = file_ns::node_composit_buts_colorbalance_ex;
node_type_size(&ntype, 400, 200, 400);
- node_type_init(&ntype, node_composit_init_colorbalance);
+ node_type_init(&ntype, file_ns::node_composit_init_colorbalance);
node_type_storage(
&ntype, "NodeColorBalance", node_free_standard_storage, node_copy_standard_storage);