MayaFlux 0.2.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 309 of file Logic.cpp.

310{
311 m_threshold = threshold;
312 m_high_threshold = threshold;
313 m_low_threshold = threshold * 0.9; // Default hysteresis
314
315 if (m_operator == LogicOperator::THRESHOLD && m_mode == LogicMode::DIRECT && create_default_direct_function) {
316 m_direct_function = [this](double input) {
317 return input > m_threshold;
318 };
319 }
320}
DirectFunction m_direct_function
Function for direct mode.
Definition Logic.hpp:568
double m_threshold
Threshold for boolean conversion.
Definition Logic.hpp:576
double m_high_threshold
High threshold for hysteresis.
Definition Logic.hpp:578
LogicOperator m_operator
Current logic operator.
Definition Logic.hpp:567
double m_low_threshold
Low threshold for hysteresis.
Definition Logic.hpp:577
LogicMode m_mode
Current processing mode.
Definition Logic.hpp:566
@ 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.