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

◆ apply_deadzone()

double MayaFlux::Nodes::Input::HIDNode::apply_deadzone ( double  normalized) const
private

Definition at line 86 of file HIDNode.cpp.

87{
88 // Center at 0.5 for center-return axes
89 double centered = (normalized - 0.5) * 2.0; // -1 to 1
90 double abs_val = std::abs(centered);
91
92 if (abs_val < m_config.deadzone) {
93 return 0.5; // Dead center
94 }
95
96 // Scale remaining range
97 double sign = (centered >= 0) ? 1.0 : -1.0;
98 double scaled = (abs_val - m_config.deadzone) / (1.0 - m_config.deadzone);
99
100 return 0.5 + (sign * scaled * 0.5); // Back to 0-1
101}
std::vector< double > normalized(const std::vector< double > &data, double target_peak)
Normalize single-channel data (non-destructive)
Definition Yantra.cpp:593

References MayaFlux::Nodes::Input::HIDConfig::deadzone, m_config, and MayaFlux::normalized().

Referenced by parse_axis().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: