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

◆ update_context()

void MayaFlux::Nodes::Generator::Polynomial::update_context ( double  value)
overrideprotectedvirtual

Updates the context object with the current node state.

Parameters
valueThe current sample value

Reimplemented from MayaFlux::Nodes::Generator::Generator.

Definition at line 185 of file Polynomial.cpp.

186{
187 auto view = m_history.linearized_view();
188
189 if (m_gpu_compatible) {
190 m_context_gpu.value = value;
195
196 m_context_gpu.gpu_float_buffer.resize(view.size());
197 for (size_t i = 0; i < view.size(); ++i)
198 m_context_gpu.gpu_float_buffer[i] = static_cast<float>(view[i]);
199
200 m_context_gpu.m_gpu_data = std::span<const float>(m_context_gpu.gpu_float_buffer);
201 } else {
202 m_context.value = value;
207 }
208}
std::span< T > linearized_view()
Get mutable linearized view of entire history.
std::span< double > m_output_buffer
Copy of output buffer.
PolynomialMode m_mode
Current processing mode.
std::span< double > m_input_buffer
Copy of input buffer.
PolynomialMode m_mode
Converts coefficient vector to a polynomial function.
Memory::HistoryBuffer< double > m_history
Ring buffer for input/output history.
size_t m_buffer_size
Maximum size of the buffers.
std::span< const float > m_gpu_data
double value
Current sample value.
Definition Node.hpp:40
bool m_gpu_compatible
Flag indicating if the node supports GPU processing This flag is set by derived classes to indicate w...
Definition Node.hpp:386

References MayaFlux::Nodes::Generator::PolynomialContextGpu::gpu_float_buffer, MayaFlux::Memory::HistoryBuffer< T >::linearized_view(), MayaFlux::Nodes::Generator::PolynomialContext::m_buffer_size, m_buffer_size, m_context, m_context_gpu, MayaFlux::Nodes::Node::m_gpu_compatible, MayaFlux::Nodes::GpuVectorData::m_gpu_data, m_history, MayaFlux::Nodes::Generator::PolynomialContext::m_input_buffer, MayaFlux::Nodes::Generator::PolynomialContext::m_mode, m_mode, MayaFlux::Nodes::Generator::PolynomialContext::m_output_buffer, and MayaFlux::Nodes::NodeContext::value.

Referenced by notify_tick().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: