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

◆ data_range()

std::pair< float, float > MayaFlux::Portal::Forma::Plot::data_range ( std::span< const double >  series)

Compute [min, max] over a scalar series.

Returns {0, 1} for an empty span.

Definition at line 35 of file PlotSpec.cpp.

36{
37 if (series.empty())
38 return { 0.F, 1.F };
39
40 double lo = std::numeric_limits<double>::max();
41 double hi = std::numeric_limits<double>::lowest();
42 for (double v : series) {
43 if (v < lo)
44 lo = v;
45 if (v > hi)
46 hi = v;
47 }
48 if (lo == hi)
49 hi = lo + 1.0;
50 return { static_cast<float>(lo), static_cast<float>(hi) };
51}
Series series()
Begin a Series chain.
Definition Plot.hpp:109

References series().

Referenced by apply_auto_scale().

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