Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/composite/nodes/node_composite_brightness.cc
- This file was moved from source/blender/nodes/composite/nodes/node_composite_brightness.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" | ||||
| /* **************** Brigh and contrsast ******************** */ | /* **************** Bright and Contrast ******************** */ | ||||
| static bNodeSocketTemplate cmp_node_brightcontrast_in[] = { | namespace blender::nodes { | ||||
| {SOCK_RGBA, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, | |||||
| {SOCK_FLOAT, N_("Bright"), 0.0f, 0.0f, 0.0f, 0.0f, -100.0f, 100.0f, PROP_NONE}, | static void cmp_node_brightcontrast_declare(NodeDeclarationBuilder &b) | ||||
| {SOCK_FLOAT, N_("Contrast"), 0.0f, 0.0f, 0.0f, 0.0f, -100.0f, 100.0f, PROP_NONE}, | { | ||||
| {-1, ""}, | b.add_input<decl::Color>("Image").default_value({1.0f, 1.0f, 1.0f, 1.0f}); | ||||
| }; | b.add_input<decl::Float>("Bright").min(-100.0f).max(100.0f); | ||||
| static bNodeSocketTemplate cmp_node_brightcontrast_out[] = { | b.add_input<decl::Float>("Contrast").min(-100.0f).max(100.0f); | ||||
| {SOCK_RGBA, N_("Image")}, | b.add_output<decl::Color>("Image"); | ||||
| {-1, ""}, | } | ||||
| }; | |||||
| } // namespace blender::nodes | |||||
| static void node_composit_init_brightcontrast(bNodeTree *UNUSED(ntree), bNode *node) | static void node_composit_init_brightcontrast(bNodeTree *UNUSED(ntree), bNode *node) | ||||
| { | { | ||||
| node->custom1 = 1; | node->custom1 = 1; | ||||
| } | } | ||||
| void register_node_type_cmp_brightcontrast(void) | void register_node_type_cmp_brightcontrast(void) | ||||
| { | { | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| cmp_node_type_base(&ntype, CMP_NODE_BRIGHTCONTRAST, "Bright/Contrast", NODE_CLASS_OP_COLOR, 0); | cmp_node_type_base(&ntype, CMP_NODE_BRIGHTCONTRAST, "Bright/Contrast", NODE_CLASS_OP_COLOR, 0); | ||||
| node_type_socket_templates(&ntype, cmp_node_brightcontrast_in, cmp_node_brightcontrast_out); | ntype.declare = blender::nodes::cmp_node_brightcontrast_declare; | ||||
| node_type_init(&ntype, node_composit_init_brightcontrast); | node_type_init(&ntype, node_composit_init_brightcontrast); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||