Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/composite/nodes/node_composite_denoise.cc
| Show All 17 Lines | |||||
| * | * | ||||
| * The Original Code is: all of this file. | * The Original Code is: all of this file. | ||||
| */ | */ | ||||
| /** \file | /** \file | ||||
| * \ingroup cmpnodes | * \ingroup cmpnodes | ||||
| */ | */ | ||||
| #include "UI_interface.h" | |||||
| #include "UI_resources.h" | |||||
| #include "node_composite_util.hh" | #include "node_composite_util.hh" | ||||
| namespace blender::nodes { | namespace blender::nodes { | ||||
| static void cmp_node_denoise_declare(NodeDeclarationBuilder &b) | static void cmp_node_denoise_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_input<decl::Vector>(N_("Normal")) | b.add_input<decl::Vector>(N_("Normal")) | ||||
| Show All 10 Lines | |||||
| static void node_composit_init_denonise(bNodeTree *UNUSED(ntree), bNode *node) | static void node_composit_init_denonise(bNodeTree *UNUSED(ntree), bNode *node) | ||||
| { | { | ||||
| NodeDenoise *ndg = (NodeDenoise *)MEM_callocN(sizeof(NodeDenoise), "node denoise data"); | NodeDenoise *ndg = (NodeDenoise *)MEM_callocN(sizeof(NodeDenoise), "node denoise data"); | ||||
| ndg->hdr = true; | ndg->hdr = true; | ||||
| ndg->prefilter = CMP_NODE_DENOISE_PREFILTER_ACCURATE; | ndg->prefilter = CMP_NODE_DENOISE_PREFILTER_ACCURATE; | ||||
| node->storage = ndg; | node->storage = ndg; | ||||
| } | } | ||||
| static void node_composit_buts_denoise(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) | |||||
| { | |||||
| #ifndef WITH_OPENIMAGEDENOISE | |||||
| uiItemL(layout, IFACE_("Disabled, built without OpenImageDenoise"), ICON_ERROR); | |||||
| #else | |||||
| /* Always supported through Accelerate framework BNNS on macOS. */ | |||||
| # ifndef __APPLE__ | |||||
| if (!BLI_cpu_support_sse41()) { | |||||
| uiItemL(layout, IFACE_("Disabled, CPU with SSE4.1 is required"), ICON_ERROR); | |||||
| } | |||||
| # endif | |||||
| #endif | |||||
| uiItemL(layout, IFACE_("Prefilter:"), ICON_NONE); | |||||
| uiItemR(layout, ptr, "prefilter", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE); | |||||
| uiItemR(layout, ptr, "use_hdr", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE); | |||||
| } | |||||
| void register_node_type_cmp_denoise() | void register_node_type_cmp_denoise() | ||||
| { | { | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| cmp_node_type_base(&ntype, CMP_NODE_DENOISE, "Denoise", NODE_CLASS_OP_FILTER, 0); | cmp_node_type_base(&ntype, CMP_NODE_DENOISE, "Denoise", NODE_CLASS_OP_FILTER, 0); | ||||
| ntype.declare = blender::nodes::cmp_node_denoise_declare; | ntype.declare = blender::nodes::cmp_node_denoise_declare; | ||||
| ntype.draw_buttons = node_composit_buts_denoise; | |||||
| node_type_init(&ntype, node_composit_init_denonise); | node_type_init(&ntype, node_composit_init_denonise); | ||||
| node_type_storage(&ntype, "NodeDenoise", node_free_standard_storage, node_copy_standard_storage); | node_type_storage(&ntype, "NodeDenoise", node_free_standard_storage, node_copy_standard_storage); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||