Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/composite/nodes/node_composite_invert.cc
- This file was moved from source/blender/nodes/composite/nodes/node_composite_invert.c.
| Show All 15 Lines | |||||
| * The Original Code is Copyright (C) 2006 Blender Foundation. | * The Original Code is Copyright (C) 2006 Blender Foundation. | ||||
| * All rights reserved. | * All rights reserved. | ||||
| */ | */ | ||||
| /** \file | /** \file | ||||
| * \ingroup cmpnodes | * \ingroup cmpnodes | ||||
| */ | */ | ||||
| #include "node_composite_util.h" | #include "node_composite_util.hh" | ||||
| /* **************** INVERT ******************** */ | /* **************** INVERT ******************** */ | ||||
| static bNodeSocketTemplate cmp_node_invert_in[] = { | |||||
| {SOCK_FLOAT, N_("Fac"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR}, | |||||
| {SOCK_RGBA, N_("Color"), 1.0f, 1.0f, 1.0f, 1.0f}, | |||||
| {-1, ""}}; | |||||
| static bNodeSocketTemplate cmp_node_invert_out[] = {{SOCK_RGBA, N_("Color")}, {-1, ""}}; | namespace blender::nodes { | ||||
| static void cmp_node_invert_declare(NodeDeclarationBuilder &b) | |||||
| { | |||||
| b.add_input<decl::Float>("Fac").default_value(1.0f).min(0.0f).max(1.0f).subtype(PROP_FACTOR); | |||||
| b.add_input<decl::Color>("Color").default_value({1.0f, 1.0f, 1.0f, 1.0f}); | |||||
| b.add_output<decl::Color>("Color"); | |||||
| } | |||||
| } // namespace blender::nodes | |||||
| static void node_composit_init_invert(bNodeTree *UNUSED(ntree), bNode *node) | static void node_composit_init_invert(bNodeTree *UNUSED(ntree), bNode *node) | ||||
| { | { | ||||
| node->custom1 |= CMP_CHAN_RGB; | node->custom1 |= CMP_CHAN_RGB; | ||||
| } | } | ||||
| /* custom1 = mix type */ | /* custom1 = mix type */ | ||||
| void register_node_type_cmp_invert(void) | void register_node_type_cmp_invert(void) | ||||
| { | { | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| cmp_node_type_base(&ntype, CMP_NODE_INVERT, "Invert", NODE_CLASS_OP_COLOR, 0); | cmp_node_type_base(&ntype, CMP_NODE_INVERT, "Invert", NODE_CLASS_OP_COLOR, 0); | ||||
| node_type_socket_templates(&ntype, cmp_node_invert_in, cmp_node_invert_out); | ntype.declare = blender::nodes::cmp_node_invert_declare; | ||||
| node_type_init(&ntype, node_composit_init_invert); | node_type_init(&ntype, node_composit_init_invert); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||