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

◆ create_context()

std::unique_ptr< NodeContext > MayaFlux::Nodes::Generator::Stochastics::Random::create_context ( double  value)
overrideprotectedvirtual

Creates a context object for callbacks.

Parameters
valueThe current generated value
Returns
A unique pointer to a StochasticContext object

This method creates a specialized context object containing the current value and all distribution parameters, providing callbacks with rich information about the generator's state.

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

Definition at line 93 of file Stochastic.cpp.

94{
95 if (m_gpu_compatible) {
96 return std::make_unique<StochasticContextGpu>(
97 value,
98 m_type,
104 }
105 return std::make_unique<StochasticContext>(value, m_type, m_amplitude, m_current_start, m_current_end, m_normal_spread);
106}
double m_amplitude
Base amplitude of the generator.
Utils::distribution m_type
Current probability distribution algorithm.
double m_normal_spread
Variance parameter for normal distribution.
double m_current_start
Lower bound of the current output range.
double m_current_end
Upper bound of the current output range.
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:387
std::span< const float > get_gpu_data_buffer() const
Provides access to the GPU data buffer.
Definition Node.cpp:78

References MayaFlux::Nodes::Node::get_gpu_data_buffer(), MayaFlux::Nodes::Generator::Generator::m_amplitude, m_current_end, m_current_start, MayaFlux::Nodes::Node::m_gpu_compatible, m_normal_spread, and m_type.

Referenced by notify_tick().

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