Downsample a series to threshold points using LTTB.
<insightdock/decimate.h>
[[visibility]]
std::vector<DecimationPoint>
lttb_decimate(
std::vector<DecimationPoint> const& points,
std::size_t threshold);
Picks, per bucket, the point that forms the largest triangle with the previously chosen point and the next bucket's average — this preserves visual shape (spikes, valleys) far better than naive stride sampling. Always keeps the first and last point.
| Name | Description |
|---|---|
| points | Input series, ordered by x. |
| threshold | Target point count. No-op (returns points unchanged) when threshold is 0, < 3, or >= points.size(). |