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

◆ set_buffer_function() [1/2]

void MayaFlux::Nodes::Generator::Polynomial::set_buffer_function ( BufferFunction  function,
PolynomialMode  mode,
size_t  buffer_size 
)

Sets a custom buffer function.

Parameters
functionFunction that processes a buffer of values
modeProcessing mode (RECURSIVE or FEEDFORWARD)
buffer_sizeNumber of previous values to maintain

Updates the generator to use the specified buffer function and mode.

Definition at line 155 of file Polynomial.cpp.

156{
157 m_coef_bound = false;
158 m_coef_function = nullptr;
159 m_buffer_function = std::move(function);
160 m_mode = mode;
161
162 if (buffer_size != m_buffer_size) {
163 m_buffer_size = buffer_size;
164 m_history.resize(buffer_size);
165 m_linear_view.resize(buffer_size);
166 }
167}
uint32_t mode
void resize(size_t new_capacity)
Resize buffer capacity.
CoefBufferFunction m_coef_function
The function behind m_buffer_function while a CoefBufferFunction is bound.
PolynomialMode m_mode
Current processing mode.
Memory::HistoryBuffer< double > m_history
Ring buffer for input/output history.
size_t m_buffer_size
Maximum size of the buffers.
std::vector< double > m_linear_view
Linearized view of history for easy access.
BufferFunction m_buffer_function
Function for recursive/feedforward mode.
bool m_coef_bound
True once a CoefBufferFunction has been bound.

References m_buffer_function, m_buffer_size, m_coef_bound, m_coef_function, m_history, m_linear_view, m_mode, mode, and MayaFlux::Memory::HistoryBuffer< T >::resize().

Referenced by set_buffer_function().

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