Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/composite/nodes/node_composite_curves.cc
- This file was moved from source/blender/nodes/composite/nodes/node_composite_curves.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" | ||||
| /* **************** CURVE Time ******************** */ | /* **************** CURVE Time ******************** */ | ||||
| /* custom1 = sfra, custom2 = efra */ | namespace blender::nodes { | ||||
| static bNodeSocketTemplate cmp_node_time_out[] = { | |||||
| {SOCK_FLOAT, N_("Fac")}, | |||||
| {-1, ""}, | |||||
| }; | |||||
| static void cmp_node_time_declare(NodeDeclarationBuilder &b) | |||||
| { | |||||
| b.add_output<decl::Float>("Fac"); | |||||
| } | |||||
| } // namespace blender::nodes | |||||
| /* custom1 = start_frame, custom2 = end_frame */ | |||||
| static void node_composit_init_curves_time(bNodeTree *UNUSED(ntree), bNode *node) | static void node_composit_init_curves_time(bNodeTree *UNUSED(ntree), bNode *node) | ||||
| { | { | ||||
| node->custom1 = 1; | node->custom1 = 1; | ||||
| node->custom2 = 250; | node->custom2 = 250; | ||||
| node->storage = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f); | node->storage = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f); | ||||
| } | } | ||||
| void register_node_type_cmp_curve_time(void) | void register_node_type_cmp_curve_time(void) | ||||
| { | { | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| cmp_node_type_base(&ntype, CMP_NODE_TIME, "Time", NODE_CLASS_INPUT, 0); | cmp_node_type_base(&ntype, CMP_NODE_TIME, "Time", NODE_CLASS_INPUT, 0); | ||||
| node_type_socket_templates(&ntype, NULL, cmp_node_time_out); | ntype.declare = blender::nodes::cmp_node_time_declare; | ||||
| node_type_size(&ntype, 140, 100, 320); | node_type_size(&ntype, 140, 100, 320); | ||||
| node_type_init(&ntype, node_composit_init_curves_time); | node_type_init(&ntype, node_composit_init_curves_time); | ||||
| node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves); | node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||
| /* **************** CURVE VEC ******************** */ | /* **************** CURVE VEC ******************** */ | ||||
| Show All 21 Lines | void register_node_type_cmp_curve_vec(void) | ||||
| node_type_size(&ntype, 200, 140, 320); | node_type_size(&ntype, 200, 140, 320); | ||||
| node_type_init(&ntype, node_composit_init_curve_vec); | node_type_init(&ntype, node_composit_init_curve_vec); | ||||
| node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves); | node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||
| /* **************** CURVE RGB ******************** */ | /* **************** CURVE RGB ******************** */ | ||||
| static bNodeSocketTemplate cmp_node_curve_rgb_in[] = { | |||||
| {SOCK_FLOAT, N_("Fac"), 1.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_FACTOR}, | |||||
| {SOCK_RGBA, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, | |||||
| {SOCK_RGBA, N_("Black Level"), 0.0f, 0.0f, 0.0f, 1.0f}, | |||||
| {SOCK_RGBA, N_("White Level"), 1.0f, 1.0f, 1.0f, 1.0f}, | |||||
| {-1, ""}, | |||||
| }; | |||||
| static bNodeSocketTemplate cmp_node_curve_rgb_out[] = { | namespace blender::nodes { | ||||
| {SOCK_RGBA, N_("Image")}, | |||||
| {-1, ""}, | static void cmp_node_rgbcurves_declare(NodeDeclarationBuilder &b) | ||||
| }; | { | ||||
| b.add_input<decl::Float>("Fac").default_value(1.0f).min(-1.0f).max(1.0f).subtype(PROP_FACTOR); | |||||
| b.add_input<decl::Color>("Image").default_value({1.0f, 1.0f, 1.0f, 1.0f}); | |||||
| b.add_input<decl::Color>("Black Level").default_value({0.0f, 0.0f, 0.0f, 1.0f}); | |||||
| b.add_input<decl::Color>("White Level").default_value({1.0f, 1.0f, 1.0f, 1.0f}); | |||||
| b.add_output<decl::Color>("Image"); | |||||
| } | |||||
| } // namespace blender::nodes | |||||
| static void node_composit_init_curve_rgb(bNodeTree *UNUSED(ntree), bNode *node) | static void node_composit_init_curve_rgb(bNodeTree *UNUSED(ntree), bNode *node) | ||||
| { | { | ||||
| node->storage = BKE_curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f); | node->storage = BKE_curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f); | ||||
| } | } | ||||
| void register_node_type_cmp_curve_rgb(void) | void register_node_type_cmp_curve_rgb(void) | ||||
| { | { | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| cmp_node_type_base(&ntype, CMP_NODE_CURVE_RGB, "RGB Curves", NODE_CLASS_OP_COLOR, 0); | cmp_node_type_base(&ntype, CMP_NODE_CURVE_RGB, "RGB Curves", NODE_CLASS_OP_COLOR, 0); | ||||
| node_type_socket_templates(&ntype, cmp_node_curve_rgb_in, cmp_node_curve_rgb_out); | ntype.declare = blender::nodes::cmp_node_rgbcurves_declare; | ||||
| node_type_size(&ntype, 200, 140, 320); | node_type_size(&ntype, 200, 140, 320); | ||||
| node_type_init(&ntype, node_composit_init_curve_rgb); | node_type_init(&ntype, node_composit_init_curve_rgb); | ||||
| node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves); | node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||