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

◆ set_threshold()

void MayaFlux::Nodes::Generator::Logic::set_threshold ( double  threshold,
bool  create_default_direct_function = false 
)

Sets the decision boundary for binary quantization.

Parameters
thresholdValue above which input is considered true
create_default_direct_functionWhether to create a default direct function if none is set

Configures the threshold used to convert continuous input values to binary states (true/false). Critical for accurate digital interpretation of analog-like signals.

Definition at line 311 of file Logic.cpp.

312{
313 m_threshold = threshold;
314 m_high_threshold = threshold;
315 m_low_threshold = threshold * 0.9; // Default hysteresis
316
317 if (m_operator == LogicOperator::THRESHOLD && m_mode == LogicMode::DIRECT && create_default_direct_function) {
318 m_direct_function = [this](double input) {
319 return input > m_threshold;
320 };
321 }
322}
DirectFunction m_direct_function
Function for direct mode.
Definition Logic.hpp:561
double m_threshold
Threshold for boolean conversion.
Definition Logic.hpp:568
double m_high_threshold
High threshold for hysteresis.
Definition Logic.hpp:570
LogicOperator m_operator
Current logic operator.
Definition Logic.hpp:560
double m_low_threshold
Low threshold for hysteresis.
Definition Logic.hpp:569
LogicMode m_mode
Current processing mode.
Definition Logic.hpp:559
@ DIRECT
Stateless evaluation of current input only (combinational logic)
@ THRESHOLD
Binary quantization - true when input exceeds threshold.

References MayaFlux::Nodes::Generator::DIRECT, m_direct_function, m_high_threshold, m_low_threshold, m_mode, m_operator, m_threshold, and MayaFlux::Nodes::Generator::THRESHOLD.