Blender  V3.3
node_composite_denoise.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2019 Blender Foundation. All rights reserved. */
3 
8 #include "BLI_system.h"
9 
10 #include "UI_interface.h"
11 #include "UI_resources.h"
12 
13 #include "node_composite_util.hh"
14 
16 
18 {
19  b.add_input<decl::Color>(N_("Image")).default_value({1.0f, 1.0f, 1.0f, 1.0f});
20  b.add_input<decl::Vector>(N_("Normal"))
21  .default_value({0.0f, 0.0f, 0.0f})
22  .min(-1.0f)
23  .max(1.0f)
24  .hide_value();
25  b.add_input<decl::Color>(N_("Albedo")).default_value({1.0f, 1.0f, 1.0f, 1.0f}).hide_value();
26  b.add_output<decl::Color>(N_("Image"));
27 }
28 
30 {
31  NodeDenoise *ndg = MEM_cnew<NodeDenoise>(__func__);
32  ndg->hdr = true;
34  node->storage = ndg;
35 }
36 
38 {
39 #ifndef WITH_OPENIMAGEDENOISE
40  uiItemL(layout, IFACE_("Disabled, built without OpenImageDenoise"), ICON_ERROR);
41 #else
42  /* Always supported through Accelerate framework BNNS on macOS. */
43 # ifndef __APPLE__
44  if (!BLI_cpu_support_sse41()) {
45  uiItemL(layout, IFACE_("Disabled, CPU with SSE4.1 is required"), ICON_ERROR);
46  }
47 # endif
48 #endif
49 
50  uiItemL(layout, IFACE_("Prefilter:"), ICON_NONE);
51  uiItemR(layout, ptr, "prefilter", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
52  uiItemR(layout, ptr, "use_hdr", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
53 }
54 
55 } // namespace blender::nodes::node_composite_denoise_cc
56 
58 {
60 
61  static bNodeType ntype;
62 
68 
69  nodeRegisterType(&ntype);
70 }
#define CMP_NODE_DENOISE
Definition: BKE_node.h:1290
void node_type_init(struct bNodeType *ntype, void(*initfunc)(struct bNodeTree *ntree, struct bNode *node))
Definition: node.cc:4390
void node_type_storage(struct bNodeType *ntype, const char *storagename, void(*freefunc)(struct bNode *node), void(*copyfunc)(struct bNodeTree *dest_ntree, struct bNode *dest_node, const struct bNode *src_node))
Definition: node.cc:4426
#define NODE_CLASS_OP_FILTER
Definition: BKE_node.h:349
void nodeRegisterType(struct bNodeType *ntype)
Definition: node.cc:1357
int BLI_cpu_support_sse41(void)
Definition: system.c:136
#define UNUSED(x)
#define IFACE_(msgid)
@ CMP_NODE_DENOISE_PREFILTER_ACCURATE
void uiItemL(uiLayout *layout, const char *name, int icon)
@ UI_ITEM_R_SPLIT_EMPTY_NAME
void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon)
OperationNode * node
bNodeTree * ntree
static void node_composit_buts_denoise(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
static void node_composit_init_denonise(bNodeTree *UNUSED(ntree), bNode *node)
static void cmp_node_denoise_declare(NodeDeclarationBuilder &b)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void register_node_type_cmp_denoise()
void cmp_node_type_base(bNodeType *ntype, int type, const char *name, short nclass)
void node_copy_standard_storage(bNodeTree *UNUSED(dest_ntree), bNode *dest_node, const bNode *src_node)
Definition: node_util.c:55
void node_free_standard_storage(bNode *node)
Definition: node_util.c:43
#define min(a, b)
Definition: sort.c:35
Defines a node type.
Definition: BKE_node.h:226
void(* draw_buttons)(struct uiLayout *, struct bContext *C, struct PointerRNA *ptr)
Definition: BKE_node.h:244
NodeDeclareFunction declare
Definition: BKE_node.h:324
#define N_(msgid)
PointerRNA * ptr
Definition: wm_files.c:3480