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

◆ Logic() [5/6]

MayaFlux::Nodes::Generator::Logic::Logic ( SequentialFunction  function,
size_t  history_size 
)

Constructs a Logic node for state-based evaluation.

Parameters
functionFunction implementing sequential boolean logic
history_sizeSize of the state history buffer

Creates a Logic node that maintains a history of previous states and evaluates new inputs in the context of this history. This enables implementation of sequential logic circuits, pattern detectors, and finite state machines.

Definition at line 72 of file Logic.cpp.

75 , m_sequential_function(std::move(function))
76 , m_history_size(history_size)
77 , m_input_count(1)
78 , m_threshold(0.5)
79 , m_low_threshold(0.45)
80 , m_high_threshold(0.5)
82 , m_history_ring(history_size, false)
83 , m_history_linear(history_size, false)
86{
87}
SequentialFunction m_sequential_function
Function for sequential mode.
Definition Logic.hpp:596
std::vector< uint8_t > m_history_linear
Linear view of history for easy access.
Definition Logic.hpp:613
size_t m_history_size
Maximum size of the history buffer.
Definition Logic.hpp:600
EdgeType m_edge_type
Type of edge to detect.
Definition Logic.hpp:605
double m_threshold
Threshold for boolean conversion.
Definition Logic.hpp:602
double m_high_threshold
High threshold for hysteresis.
Definition Logic.hpp:604
std::vector< double > m_input_buffer
Definition Logic.hpp:610
LogicOperator m_operator
Current logic operator.
Definition Logic.hpp:593
double m_low_threshold
Low threshold for hysteresis.
Definition Logic.hpp:603
bool m_edge_detected
Whether an edge was detected in the last processing.
Definition Logic.hpp:606
std::vector< uint8_t > m_history_ring
Ring buffer for history storage.
Definition Logic.hpp:612
LogicMode m_mode
Current processing mode.
Definition Logic.hpp:592
size_t m_input_count
Expected number of inputs for multi-input mode.
Definition Logic.hpp:601
std::span< const float > get_gpu_data_buffer() const
Provides access to the GPU data buffer.
Definition Node.cpp:78
@ SEQUENTIAL
State-based evaluation using history of inputs (sequential logic)
@ CUSTOM
User-defined boolean function.