MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / dsEmitSteppedFallback

Function dsEmitSteppedFallback

app/src/DSP.h:957–974  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

955 */
956template<typename XAt, typename YAt>
957inline void dsEmitSteppedFallback(std::size_t n,
958 int w,
959 std::size_t firstFinite,
960 std::size_t lastFinite,
961 XAt xAt,
962 YAt yAt,
963 QList<QPointF>& out)
964{
965 std::size_t step = n / (std::max(1, w));
966 if (step < 1)
967 step = 1;
968
969 for (std::size_t i = firstFinite; i <= lastFinite; i += step)
970 out.append(QPointF(xAt(i), yAt(i)));
971
972 if (out.isEmpty() || out.back().x() != xAt(lastFinite))
973 out.append(QPointF(xAt(lastFinite), yAt(lastFinite)));
974}
975
976/**
977 * @brief Accumulate per-column min/max/first/last indices into the workspace.

Callers 1

downsampleMonotonicFunction · 0.85

Calls 3

isEmptyMethod · 0.80
xMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected