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

◆ scale_if()

AxisRange & MayaFlux::Portal::Forma::Plot::AxisRange::scale_if ( std::function< bool()>  predicate)
inline

Gate auto-scaling behind an arbitrary bool-returning callable.

Any nullary callable returning bool is accepted: an atomic flag read, a node output comparison, a MappedState check, a lambda closing over external state. Implicitly enables auto_scaling.

The predicate is evaluated once per process() call before the new data-derived range is applied. Returning false keeps the current range.

// Only scale when signal exceeds a threshold:
AxisRange{}.scale_if([node]{ return node->get_last_output() > 0.5; });
// Gate on an atomic flag set elsewhere:
AxisRange{}.scale_if([&active]{ return active.load(); });
AxisRange & scale_if(std::function< bool()> predicate)
Gate auto-scaling behind an arbitrary bool-returning callable.
Definition AxisRange.hpp:76
Scalar domain extent for one plot axis.
Definition AxisRange.hpp:22

Definition at line 76 of file AxisRange.hpp.

77 {
78 scale_predicate = std::move(predicate);
79 auto_scaling = true;
80 return *this;
81 }
std::function< bool()> scale_predicate
When set, evaluated before applying a data-derived range.
Definition AxisRange.hpp:29

References auto_scaling, and scale_predicate.