* @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. */
| 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. |
no test coverage detected