MayaFlux 0.4.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 34 of file NodeCombine.cpp.

35 : m_lhs(lhs)
36 , m_rhs(rhs)
37 , m_func(std::move(func))
38 , m_context(0.0, 0.0, 0.0)
39 , m_context_gpu(0.0, 0.0, 0.0, get_gpu_data_buffer())
40{
41 if (!m_lhs || !m_rhs) {
42 error<std::invalid_argument>(
44 std::source_location::current(),
45 "BinaryOpNode requires both lhs and rhs nodes to be non-null");
46 }
47}
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.