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

Function dsColumnYBounds

app/src/DSP.h:930–951  ·  view source on GitHub ↗

* @brief Extracts the global Y bounds from the filled workspace columns (O(columns), * replacing a second full pass over the samples). Returns false when no column * received a finite sample. */

Source from the content-addressed store, hash-verified

928 * received a finite sample.
929 */
930[[nodiscard]] inline bool dsColumnYBounds(const DownsampleWorkspace* ws,
931 std::size_t C,
932 ssfp_t& ymin,
933 ssfp_t& ymax)
934{
935 Q_ASSERT(ws != nullptr);
936 Q_ASSERT(ws->cnt.size() >= C);
937
938 bool any = false;
939 ymin = std::numeric_limits<ssfp_t>::infinity();
940 ymax = -std::numeric_limits<ssfp_t>::infinity();
941 for (std::size_t c = 0; c < C; ++c) {
942 if (ws->cnt[c] == 0)
943 continue;
944
945 any = true;
946 ymin = std::min(ymin, ws->minY[c]);
947 ymax = std::max(ymax, ws->maxY[c]);
948 }
949
950 return any;
951}
952
953/**
954 * @brief Emit a stepped polyline for the degenerate xmin==xmax case.

Callers 3

downsampleMonotonicFunction · 0.85
downsampleTimeWindowFunction · 0.85
downsampleWindowAbsoluteFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected