Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/composite/nodes/node_composite_tonemap.cc
| Show All 22 Lines | |||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "UI_interface.h" | #include "UI_interface.h" | ||||
| #include "UI_resources.h" | #include "UI_resources.h" | ||||
| #include "node_composite_util.hh" | #include "node_composite_util.hh" | ||||
| namespace blender::nodes { | namespace blender::nodes::node_composite_tonemap_cc { | ||||
| static void cmp_node_tonemap_declare(NodeDeclarationBuilder &b) | static void cmp_node_tonemap_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_output<decl::Color>(N_("Image")); | b.add_output<decl::Color>(N_("Image")); | ||||
| } | } | ||||
| } // namespace blender::nodes | |||||
| static void node_composit_init_tonemap(bNodeTree *UNUSED(ntree), bNode *node) | static void node_composit_init_tonemap(bNodeTree *UNUSED(ntree), bNode *node) | ||||
| { | { | ||||
| NodeTonemap *ntm = MEM_cnew<NodeTonemap>(__func__); | NodeTonemap *ntm = MEM_cnew<NodeTonemap>(__func__); | ||||
| ntm->type = 1; | ntm->type = 1; | ||||
| ntm->key = 0.18; | ntm->key = 0.18; | ||||
| ntm->offset = 1; | ntm->offset = 1; | ||||
| ntm->gamma = 1; | ntm->gamma = 1; | ||||
| ntm->f = 0; | ntm->f = 0; | ||||
| Show All 22 Lines | uiItemR( | ||||
| col, ptr, "contrast", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE); | col, ptr, "contrast", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE); | ||||
| uiItemR( | uiItemR( | ||||
| col, ptr, "adaptation", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE); | col, ptr, "adaptation", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE); | ||||
| uiItemR( | uiItemR( | ||||
| col, ptr, "correction", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE); | col, ptr, "correction", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE); | ||||
| } | } | ||||
| } | } | ||||
| } // namespace blender::nodes::node_composite_tonemap_cc | |||||
| void register_node_type_cmp_tonemap() | void register_node_type_cmp_tonemap() | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_composite_tonemap_cc; | |||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| cmp_node_type_base(&ntype, CMP_NODE_TONEMAP, "Tonemap", NODE_CLASS_OP_COLOR, 0); | cmp_node_type_base(&ntype, CMP_NODE_TONEMAP, "Tonemap", NODE_CLASS_OP_COLOR); | ||||
| ntype.declare = blender::nodes::cmp_node_tonemap_declare; | ntype.declare = file_ns::cmp_node_tonemap_declare; | ||||
| ntype.draw_buttons = node_composit_buts_tonemap; | ntype.draw_buttons = file_ns::node_composit_buts_tonemap; | ||||
| node_type_init(&ntype, node_composit_init_tonemap); | node_type_init(&ntype, file_ns::node_composit_init_tonemap); | ||||
| node_type_storage(&ntype, "NodeTonemap", node_free_standard_storage, node_copy_standard_storage); | node_type_storage(&ntype, "NodeTonemap", node_free_standard_storage, node_copy_standard_storage); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||