Blender  V2.93
node_composite_antialiasing.c
Go to the documentation of this file.
1 /*
2  * ***** BEGIN GPL LICENSE BLOCK *****
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software Foundation,
16  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  *
18  * The Original Code is Copyright (C) 2017 Blender Foundation.
19  * All rights reserved.
20  *
21  * The Original Code is: all of this file.
22  *
23  * Contributor(s): IRIE Shinsuke
24  *
25  * ***** END GPL LICENSE BLOCK *****
26  */
27 
32 #include "node_composite_util.h"
33 
34 /* **************** Anti-Aliasing (SMAA 1x) ******************** */
35 
37  {SOCK_RGBA, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f}, {-1, ""}};
38 
39 static bNodeSocketTemplate cmp_node_antialiasing_out[] = {{SOCK_RGBA, N_("Image")}, {-1, ""}};
40 
42 {
43  NodeAntiAliasingData *data = MEM_callocN(sizeof(NodeAntiAliasingData), "node antialiasing data");
44 
45  data->threshold = 1.0f;
46  data->contrast_limit = 0.2f;
47  data->corner_rounding = 0.25f;
48 
49  node->storage = data;
50 }
51 
53 {
54  static bNodeType ntype;
55 
57  &ntype, CMP_NODE_ANTIALIASING, "Anti-Aliasing", NODE_CLASS_OP_FILTER, NODE_PREVIEW);
59  node_type_size(&ntype, 170, 140, 200);
62  &ntype, "NodeAntiAliasingData", node_free_standard_storage, node_copy_standard_storage);
63 
64  nodeRegisterType(&ntype);
65 }
void node_type_size(struct bNodeType *ntype, int width, int minwidth, int maxwidth)
Definition: node.cc:4565
void node_type_socket_templates(struct bNodeType *ntype, struct bNodeSocketTemplate *inputs, struct bNodeSocketTemplate *outputs)
Definition: node.cc:4527
void node_type_init(struct bNodeType *ntype, void(*initfunc)(struct bNodeTree *ntree, struct bNode *node))
Definition: node.cc:4559
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:4599
#define NODE_CLASS_OP_FILTER
Definition: BKE_node.h:338
void nodeRegisterType(struct bNodeType *ntype)
Definition: node.cc:1298
#define UNUSED(x)
#define N_(msgid)
#define NODE_PREVIEW
@ SOCK_RGBA
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add Ambient Diffuse Glossy Refraction Transparent Toon Principled Hair Volume Principled Light Particle Volume Image Sky Noise Wave Voronoi Brick Texture Vector Combine Vertex Separate Vector White RGB Map Separate Set Z Dilate Combine Combine Color Channel Split ID Combine Luminance Directional Alpha Distance Hue Movie Ellipse Bokeh View Corner CMP_NODE_ANTIALIASING
OperationNode * node
bNodeTree * ntree
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:45
static bNodeSocketTemplate cmp_node_antialiasing_out[]
static bNodeSocketTemplate cmp_node_antialiasing_in[]
void register_node_type_cmp_antialiasing(void)
static void node_composit_init_antialiasing(bNodeTree *UNUSED(ntree), bNode *node)
void cmp_node_type_base(bNodeType *ntype, int type, const char *name, short nclass, short flag)
void node_copy_standard_storage(bNodeTree *UNUSED(dest_ntree), bNode *dest_node, const bNode *src_node)
Definition: node_util.c:67
void node_free_standard_storage(bNode *node)
Definition: node_util.c:55
Compact definition of a node socket.
Definition: BKE_node.h:95
Defines a node type.
Definition: BKE_node.h:221