#include <interpolated_curve.h>
Definition at line 27 of file interpolated_curve.h.
◆ SplineType
◆ __interpolate()
static double ArdourCanvas::InterpolatedCurve::__interpolate |
( |
double |
p[4], |
|
|
double |
time[4], |
|
|
double |
t |
|
) |
| |
|
inlinestaticprivate |
Calculate the same values but introduces the ability to "parameterize" the t values used in the calculation. This is based on Figure 3 from http://www.cemyuksel.com/research/catmullrom_param/catmullrom.pdf
- Parameters
-
p | An array of double values of length 4, where interpolation occurs from p1 to p2. |
time | An array of time measures of length 4, corresponding to each p value. |
t | the actual interpolation ratio from 0 to 1 representing the position between p1 and p2 to interpolate the value. |
Definition at line 155 of file interpolated_curve.h.
◆ _interpolate()
static void ArdourCanvas::InterpolatedCurve::_interpolate |
( |
const Points & |
points, |
|
|
Points::size_type |
index, |
|
|
int |
points_per_segment, |
|
|
SplineType |
curve_type, |
|
|
Points & |
results |
|
) |
| |
|
inlinestaticprivate |
Given a list of control points, this will create a list of points_per_segment points spaced uniformly along the resulting Catmull-Rom curve.
- Parameters
-
points | The list of control points, leading and ending with a coordinate that is only used for controlling the spline and is not visualized. |
index | The index of control point p0, where p0, p1, p2, and p3 are used in order to create a curve between p1 and p2. |
points_per_segment | The total number of uniformly spaced interpolated points to calculate for each segment. The larger this number, the smoother the resulting curve. |
curve_type | Clarifies whether the curve should use uniform, chordal or centripetal curve types. Uniform can produce loops, chordal can produce large distortions from the original lines, and centripetal is an optimal balance without spaces. |
results | List of calculated coordinates that define the CatmullRom curve between the points defined by index+1 and index+2. |
Definition at line 185 of file interpolated_curve.h.
◆ interpolate()
static void ArdourCanvas::InterpolatedCurve::interpolate |
( |
const Points & |
coordinates, |
|
|
uint32_t |
points_per_segment, |
|
|
SplineType |
curve_type, |
|
|
bool |
closed, |
|
|
Points & |
results |
|
) |
| |
|
inlinestaticprotected |
This method will calculate the Catmull-Rom interpolation curve, returning it as a list of Coord coordinate objects. This method in particular adds the first and last control points which are not visible, but required for calculating the spline.
- Parameters
-
coordinates | The list of original straight line points to calculate an interpolation from. |
points_per_segment | The integer number of equally spaced points to return along each curve. The actual distance between each point will depend on the spacing between the control points. |
- Returns
- The list of interpolated coordinates.
- Parameters
-
curve_type | Chordal (stiff), Uniform(floppy), or Centripetal(medium) |
closed | Specify if the shape is open or closed |
results | List of calculated coordinates |
- Exceptions
-
gov.ca.water.shapelite.analysis.CatmullRomException | if points_per_segment is less than 2. |
Definition at line 56 of file interpolated_curve.h.
The documentation for this class was generated from the following file: