Blender  V3.3
node_composite_bokehimage.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2006 Blender Foundation. All rights reserved. */
3 
8 #include "UI_interface.h"
9 #include "UI_resources.h"
10 
11 #include "node_composite_util.hh"
12 
13 /* **************** Bokeh image Tools ******************** */
14 
16 
18 {
19  b.add_output<decl::Color>(N_("Image"));
20 }
21 
23 {
24  NodeBokehImage *data = MEM_cnew<NodeBokehImage>(__func__);
25  data->angle = 0.0f;
26  data->flaps = 5;
27  data->rounding = 0.0f;
28  data->catadioptric = 0.0f;
29  data->lensshift = 0.0f;
30  node->storage = data;
31 }
32 
34 {
35  uiItemR(layout, ptr, "flaps", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
36  uiItemR(layout, ptr, "angle", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
37  uiItemR(
38  layout, ptr, "rounding", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
39  uiItemR(layout,
40  ptr,
41  "catadioptric",
43  nullptr,
44  ICON_NONE);
45  uiItemR(layout, ptr, "shift", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
46 }
47 
48 } // namespace blender::nodes::node_composite_bokehimage_cc
49 
51 {
53 
54  static bNodeType ntype;
55 
59  ntype.flag |= NODE_PREVIEW;
62  &ntype, "NodeBokehImage", node_free_standard_storage, node_copy_standard_storage);
63 
64  nodeRegisterType(&ntype);
65 }
#define CMP_NODE_BOKEHIMAGE
Definition: BKE_node.h:1280
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_INPUT
Definition: BKE_node.h:345
void nodeRegisterType(struct bNodeType *ntype)
Definition: node.cc:1357
#define UNUSED(x)
#define NODE_PREVIEW
@ UI_ITEM_R_SPLIT_EMPTY_NAME
@ UI_ITEM_R_SLIDER
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_bokehimage(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
static void cmp_node_bokehimage_declare(NodeDeclarationBuilder &b)
static void node_composit_init_bokehimage(bNodeTree *UNUSED(ntree), bNode *node)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void register_node_type_cmp_bokehimage()
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
Defines a node type.
Definition: BKE_node.h:226
short flag
Definition: BKE_node.h:236
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