-int QuadraticSplinePatchSubdivisionLevelForDeviation(float deviation, float level1tolerance, int levellimit)
-{
- int level;
- // count the automatic flatten step which reduces deviation by 50%
- deviation *= 0.5f;
- // count the levels to subdivide to come under the tolerance
- for (level = 0;level < levellimit && deviation > level1tolerance;level++)
- deviation *= 0.25f;
- return level;
-}
-
-int QuadraticSplinePatchSubdivisionLevelOnX(int cpwidth, int cpheight, int components, const float *in, float level1tolerance, int levellimit)
-{
- return QuadraticSplinePatchSubdivisionLevelForDeviation(QuadraticSplinePatchLargestDeviationOnX(cpwidth, cpheight, components, in), level1tolerance, levellimit);
-}
-
-int QuadraticSplinePatchSubdivisionLevelOnY(int cpwidth, int cpheight, int components, const float *in, float level1tolerance, int levellimit)
-{
- return QuadraticSplinePatchSubdivisionLevelForDeviation(QuadraticSplinePatchLargestDeviationOnY(cpwidth, cpheight, components, in), level1tolerance, levellimit);
-}
-
-/*
- d = a * (1 - 2 * t + t * t) + b * (2 * t - 2 * t * t) + c * t * t;
- d = a * (1 + t * t + -2 * t) + b * (2 * t + -2 * t * t) + c * t * t;
- d = a * 1 + a * t * t + a * -2 * t + b * 2 * t + b * -2 * t * t + c * t * t;
- d = a * 1 + (a * t + a * -2) * t + (b * 2 + b * -2 * t) * t + (c * t) * t;
- d = a + ((a * t + a * -2) + (b * 2 + b * -2 * t) + (c * t)) * t;
- d = a + (a * (t - 2) + b * 2 + b * -2 * t + c * t) * t;
- d = a + (a * (t - 2) + b * 2 + (b * -2 + c) * t) * t;
- d = a + (a * (t - 2) + b * 2 + (c + b * -2) * t) * t;
- d = a + a * (t - 2) * t + b * 2 * t + (c + b * -2) * t * t;
- d = a * (1 + (t - 2) * t) + b * 2 * t + (c + b * -2) * t * t;
- d = a * (1 + (t - 2) * t) + b * 2 * t + c * t * t + b * -2 * t * t;
- d = a * 1 + a * (t - 2) * t + b * 2 * t + c * t * t + b * -2 * t * t;
- d = a * 1 + a * t * t + a * -2 * t + b * 2 * t + c * t * t + b * -2 * t * t;
- d = a * (1 - 2 * t + t * t) + b * 2 * t + c * t * t + b * -2 * t * t;
- d = a * (1 - 2 * t) + a * t * t + b * 2 * t + c * t * t + b * -2 * t * t;
- d = a + a * -2 * t + a * t * t + b * 2 * t + c * t * t + b * -2 * t * t;
- d = a + a * -2 * t + a * t * t + b * 2 * t + b * -2 * t * t + c * t * t;
- d = a + a * -2 * t + a * t * t + b * 2 * t + b * -2 * t * t + c * t * t;
- d = a + a * -2 * t + b * 2 * t + b * -2 * t * t + a * t * t + c * t * t;
- d = a + a * -2 * t + b * 2 * t + (a + c + b * -2) * t * t;
- d = a + (a * -2 + b * 2) * t + (a + c + b * -2) * t * t;
- d = a + ((a * -2 + b * 2) + (a + c + b * -2) * t) * t;
- d = a + ((b + b - a - a) + (a + c - b - b) * t) * t;
- d = a + (b + b - a - a) * t + (a + c - b - b) * t * t;
- d = a + (b - a) * 2 * t + (a + c - b * 2) * t * t;
- d = a + (b - a) * 2 * t + (a - b + c - b) * t * t;
-
- d = in[0] + (in[1] - in[0]) * 2 * t + (in[0] - in[1] + in[2] - in[1]) * t * t;
-*/
-