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

◆ BinaryOpNode()

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 176 of file NodeStructure.cpp.

177 : m_lhs(lhs)
178 , m_rhs(rhs)
179 , m_func(std::move(func))
180 , m_context(0.0, 0.0, 0.0)
181 , m_context_gpu(0.0, 0.0, 0.0, get_gpu_data_buffer())
182{
183 if (!m_lhs || !m_rhs) {
184 error<std::invalid_argument>(
186 std::source_location::current(),
187 "BinaryOpNode requires both lhs and rhs nodes to be non-null");
188 }
189}
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.
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.