Logo Search packages:      
Sourcecode: kdenlive version File versions

template<typename T_point, typename T>
int KisCubicSpline< T_point, T >::findRegion ( x,
T &  x0 
) const [inline, protected]

findRegion - Searches for the region containing - out parameter, containing beginning of the region

Returns:
- index of the region

Definition at line 213 of file kis_cubic_curve.cpp.

Referenced by KisCubicSpline< QPointF, qreal >::getValue().

                                     {
        int i;
        x0 = m_begin;
        for (i = 0; i < m_intervals; i++) {
            if (x >= x0 && x < x0 + m_h[i])
                return i;
            x0 += m_h[i];
        }
        if (x >= x0) {
            x0 -= m_h[m_intervals-1];
            return m_intervals - 1;
        }

        qDebug("X value: %f\n", x);
        qDebug("m_begin: %f\n", m_begin);
        qDebug("m_end  : %f\n", m_end);
        Q_ASSERT_X(0, "findRegion", "X value is outside regions");
        /* **never reached** */
        return -1;
    }

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index