template<typename T_point, typename T>
class KisLegacyCubicSpline< T_point, T >
Definition at line 96 of file kis_cubic_curve_spline.h.
template<typename T_point , typename T >
Create new spline and precalculate some values for future
- base points of the spline
Definition at line 131 of file kis_cubic_curve_spline.h.
131 {
133 int i;
135 m_end = a.last().x();
136
138 m_b.resize(intervals);
140 m_d.resize(intervals);
141 m_h.resize(intervals);
142
143 for (i = 0; i < intervals; i++) {
144 m_h[i] = a[i+1].x() - a[i].x();
145 m_a.append(a[i].
y());
146 }
147 m_a.append(a.last().y());
148
149
153
154 for (i = 0; i < intervals - 1; i++) {
155 tri_b.append(2.*(
m_h[i] +
m_h[i+1]));
156
158 }
159 for (i = 1; i < intervals - 1; i++)
160 tri_a.append(
m_h[i]);
161
162 if (intervals > 1) {
164 }
167
168 for (i = 0; i < intervals; i++)
170
171 for (i = 0; i < intervals; i++)
173 }
static QVector< T > calculate(QList< T > &a, QList< T > &b, QList< T > &c, QList< T > &f)
References KisTridiagonalSystem< T >::calculate(), KisLegacyCubicSpline< T_point, T >::m_a, KisLegacyCubicSpline< T_point, T >::m_b, KisLegacyCubicSpline< T_point, T >::m_begin, KisLegacyCubicSpline< T_point, T >::m_c, KisLegacyCubicSpline< T_point, T >::m_d, KisLegacyCubicSpline< T_point, T >::m_end, KisLegacyCubicSpline< T_point, T >::m_h, and KisLegacyCubicSpline< T_point, T >::m_intervals.
template<typename T_point , typename T >
findRegion - Searches for the region containing @x @x0 - out parameter, containing beginning of the region
- Returns
- - index of the region
Definition at line 203 of file kis_cubic_curve_spline.h.
203 {
204 int i;
207 if (x >= x0 && x < x0 +
m_h[i])
208 return i;
210 }
211 if (x >= x0) {
214 }
215
216 qDebug("X value: %f\n", x);
217 qDebug(
"m_begin: %f\n",
m_begin);
218 qDebug(
"m_end : %f\n",
m_end);
219 Q_ASSERT_X(0, "findRegion", "X value is outside regions");
220
221 return -1;
222 }
References KisLegacyCubicSpline< T_point, T >::m_begin, KisLegacyCubicSpline< T_point, T >::m_end, KisLegacyCubicSpline< T_point, T >::m_h, and KisLegacyCubicSpline< T_point, T >::m_intervals.