MayaFlux 0.3.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ BinaryOpNode() [1/2]

MayaFlux::Nodes::BinaryOpNode::BinaryOpNode ( const std::shared_ptr< Node > &  lhs,
const std::shared_ptr< Node > &  rhs,
CombineFunc  func 
)

Creates a new binary operation node.

Parameters
lhsThe left-hand side node
rhsThe right-hand side node
funcThe function to combine the outputs of both nodes

Common combine functions include:

  • Addition: [](double a, double b) { return a + b; }
  • Multiplication: [](double a, double b) { return a * b; }

Definition at line 36 of file NodeCombine.cpp.

37 : m_lhs(lhs)
38 , m_rhs(rhs)
39 , m_func(std::move(func))
40 , m_context(0.0, 0.0, 0.0)
41 , m_context_gpu(0.0, 0.0, 0.0, get_gpu_data_buffer())
42{
43 if (!m_lhs || !m_rhs) {
44 error<std::invalid_argument>(
46 std::source_location::current(),
47 "BinaryOpNode requires both lhs and rhs nodes to be non-null");
48 }
49}
std::shared_ptr< Node > m_lhs
The left-hand side node.
CombineFunc m_func
The function used to combine the outputs of both nodes.
std::shared_ptr< Node > m_rhs
The right-hand side node.
BinaryOpContextGpu m_context_gpu
std::span< const float > get_gpu_data_buffer() const
Provides access to the GPU data buffer.
Definition Node.cpp:78
@ Init
Engine/subsystem initialization.
@ Nodes
DSP Generator and Filter Nodes, graph pipeline, node management.

References MayaFlux::Journal::Init, m_lhs, m_rhs, and MayaFlux::Journal::Nodes.