Blender  V2.93
COM_CryptomatteNode.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * Copyright 2018, Blender Foundation.
17  */
18 
19 #pragma once
20 
21 #include "BLI_string_ref.hh"
22 #include "BLI_vector.hh"
23 
25 #include "COM_Node.h"
26 
27 namespace blender::compositor {
28 
33 class CryptomatteBaseNode : public Node {
34  protected:
35  CryptomatteBaseNode(bNode *editor_node) : Node(editor_node)
36  {
37  /* pass */
38  }
39 
40  public:
41  void convertToOperations(NodeConverter &converter,
42  const CompositorContext &context) const override;
43 
44  protected:
46  NodeConverter &converter,
48  const bNode &node,
49  const NodeCryptomatte *cryptomatte_settings) const = 0;
50 };
51 
53  public:
54  CryptomatteNode(bNode *editor_node) : CryptomatteBaseNode(editor_node)
55  {
56  /* pass */
57  }
58 
59  protected:
61  NodeConverter &converter,
63  const bNode &node,
64  const NodeCryptomatte *cryptomatte_settings) const override;
65 
66  private:
67  static Vector<NodeOperation *> create_input_operations(const CompositorContext &context,
68  const bNode &node);
69  static void input_operations_from_render_source(const CompositorContext &context,
70  const bNode &node,
71  Vector<NodeOperation *> &r_input_operations);
72  static void input_operations_from_image_source(const CompositorContext &context,
73  const bNode &node,
74  Vector<NodeOperation *> &r_input_operations);
75 };
76 
78  public:
79  CryptomatteLegacyNode(bNode *editor_node) : CryptomatteBaseNode(editor_node)
80  {
81  /* pass */
82  }
83 
84  protected:
86  NodeConverter &converter,
88  const bNode &node,
89  const NodeCryptomatte *cryptomatte_settings) const override;
90 };
91 
92 } // namespace blender::compositor
Overall context of the compositor.
virtual CryptomatteOperation * create_cryptomatte_operation(NodeConverter &converter, const CompositorContext &context, const bNode &node, const NodeCryptomatte *cryptomatte_settings) const =0
void convertToOperations(NodeConverter &converter, const CompositorContext &context) const override
convert node to operation
CryptomatteOperation * create_cryptomatte_operation(NodeConverter &converter, const CompositorContext &context, const bNode &node, const NodeCryptomatte *cryptomatte_settings) const override
CryptomatteOperation * create_cryptomatte_operation(NodeConverter &converter, const CompositorContext &context, const bNode &node, const NodeCryptomatte *cryptomatte_settings) const override
OperationNode * node