insightdock::charts::detail::catmull_rom_expand

Expands a polyline's control points into a smooth Catmull-Rom curve.

Synopsis

Declared in <insightdock/detail/spline.h>
[[visibility]]
std::vector<std::pair<float, float>>
catmull_rom_expand(
    std::vector<std::pair<float, float>> const& points,
    int segments_per_span = 8);

Description

Used by LineChart/AreaChart/ComboChart when spline is enabled: the returned denser point list is passed to ImageBuffer::draw_polyline()/fill_polygon() unchanged, while the original points remain the marker/data-label positions.

Return Value

Expanded point list; a straight copy of points if fewer than 3 points are given.

Parameters

Name Description
points Control points (category-ordered).
segments_per_span Points generated between each pair of control points.

Created with MrDocs