Given a Bezier spline specified by an STL vector of Bezier segments (current control point position, outgoing tangent position, next point's incoming tangent position, next control point position), convert this to an XSpline in the form of an STL vector of control point location and tension.
All Beziers specified with a given number of segments N MUST convert to an XSpline with M points. For example, any time you have a Bezier specified with 4 segments (just for example) it will convert into an XSpline with 19 points (number chosen just for example).
X-splines are defined by Blanc, C. and Schlick, C. (1995), "X-splines : A Spline Model Designed for the End User", in Proceedings of SIGGRAPH 95.
Conversion code should be written as a self-contained C++ LIBRARY completely disconnected from any test harness UI or system dependency.
There should be 1 externally visible function call in the library.
std::vector<XSplinePoints> ConvertBtoX(BezierSegments * b, int numberOfSegments)
Each X-spline point is an x, y, and weight / tension. Weight goes from -1 to 1. At -1 the point behaves as in a cardinal spline. At 0 the point behaves as a corner. At 1 the point behaves as a B-spline point.
In addition to the multi-platform conversion library, a test harness must be written on the platform of your choice which given a file containing strings defining a Bezier, it should draw both the Bezier and the resulting X-spline. Input lines would be in the form of
cp.x<tab>cp.y<tab>ot.x<tab>ot.y<tab>it.x etc. see first paragraph
Code must compile cleanly with no warnings on Windows, Mac, and Linux.
We can supply the code to numerically evaluate a Bezier and an X-Spline so your harness would need only read the input file (a Bezier), call your code to convert to X-Spline and draw both.
## Deliverables
Bonuses have been awarded in the past.