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

◆ update_context()

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

Updates the context with the latest sample value.

Parameters
valueThe current generated sample

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

Definition at line 474 of file Logic.cpp.

475{
476 auto view = history_linearized_view();
477
478 if (m_gpu_compatible) {
479 m_context_gpu.value = value;
486
488 for (size_t i = 0; i < m_history_count; ++i)
489 m_context_gpu.gpu_float_buffer[i] = m_history_linear[i] ? 1.0F : 0.0F;
490
491 m_context_gpu.m_gpu_data = std::span<const float>(m_context_gpu.gpu_float_buffer);
492 } else {
493 m_context.value = value;
496 m_context.m_history = view;
500 }
501}
std::span< bool > m_history
History of boolean states.
Definition Logic.hpp:109
LogicMode m_mode
Current computational model.
Definition Logic.hpp:107
LogicOperator m_operator
Current boolean operator.
Definition Logic.hpp:108
EdgeType m_edge_type
Type of transition being monitored.
Definition Logic.hpp:112
bool m_edge_detected
Whether a state transition was detected.
Definition Logic.hpp:111
double m_threshold
Decision boundary for binary quantization.
Definition Logic.hpp:110
std::vector< uint8_t > m_history_linear
Linear view of history for easy access.
Definition Logic.hpp:601
EdgeType m_edge_type
Type of edge to detect.
Definition Logic.hpp:593
double m_threshold
Threshold for boolean conversion.
Definition Logic.hpp:590
LogicOperator m_operator
Current logic operator.
Definition Logic.hpp:581
bool m_edge_detected
Whether an edge was detected in the last processing.
Definition Logic.hpp:594
size_t m_history_count
Number of valid entries in the history buffer.
Definition Logic.hpp:587
LogicMode m_mode
Current processing mode.
Definition Logic.hpp:580
std::span< bool > history_linearized_view()
Definition Logic.cpp:638
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::LogicContextGpu::gpu_float_buffer, history_linearized_view(), m_context, m_context_gpu, MayaFlux::Nodes::Generator::LogicContext::m_edge_detected, m_edge_detected, MayaFlux::Nodes::Generator::LogicContext::m_edge_type, m_edge_type, MayaFlux::Nodes::Node::m_gpu_compatible, MayaFlux::Nodes::GpuVectorData::m_gpu_data, MayaFlux::Nodes::Generator::LogicContext::m_history, m_history_count, m_history_linear, MayaFlux::Nodes::Generator::LogicContext::m_mode, m_mode, MayaFlux::Nodes::Generator::LogicContext::m_operator, m_operator, MayaFlux::Nodes::Generator::LogicContext::m_threshold, m_threshold, 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: