MayaFlux 1.0.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 436 of file Logic.cpp.

437{
440 m_low_threshold = threshold * 0.9; // Default hysteresis
441
442 if (m_operator == LogicOperator::THRESHOLD && m_mode == LogicMode::DIRECT && create_default_direct_function) {
443 m_direct_function = [this](double input) {
444 return input > m_threshold;
445 };
446 }
447}
Core::GlobalInputConfig input
Definition Config.cpp:42
float threshold
DirectFunction m_direct_function
Function for direct mode.
Definition Logic.hpp:696
double m_threshold
Threshold for boolean conversion.
Definition Logic.hpp:704
double m_high_threshold
High threshold for hysteresis.
Definition Logic.hpp:706
LogicOperator m_operator
Current logic operator.
Definition Logic.hpp:695
double m_low_threshold
Low threshold for hysteresis.
Definition Logic.hpp:705
LogicMode m_mode
Current processing mode.
Definition Logic.hpp:694
@ DIRECT
Stateless evaluation of current input only (combinational logic)
@ THRESHOLD
Binary quantization - true when input exceeds threshold.

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