animation/qguivariantanimation.cpp

Source codeSwitch to Preprocessed file
LineSource CodeCoverage
1/**************************************************************************** -
2** -
3** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -
4** Contact: http://www.qt-project.org/legal -
5** -
6** This file is part of the QtGui module of the Qt Toolkit. -
7** -
8** $QT_BEGIN_LICENSE:LGPL$ -
9** Commercial License Usage -
10** Licensees holding valid commercial Qt licenses may use this file in -
11** accordance with the commercial license agreement provided with the -
12** Software or, alternatively, in accordance with the terms contained in -
13** a written agreement between you and Digia. For licensing terms and -
14** conditions see http://qt.digia.com/licensing. For further information -
15** use the contact form at http://qt.digia.com/contact-us. -
16** -
17** GNU Lesser General Public License Usage -
18** Alternatively, this file may be used under the terms of the GNU Lesser -
19** General Public License version 2.1 as published by the Free Software -
20** Foundation and appearing in the file LICENSE.LGPL included in the -
21** packaging of this file. Please review the following information to -
22** ensure the GNU Lesser General Public License version 2.1 requirements -
23** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -
24** -
25** In addition, as a special exception, Digia gives you certain additional -
26** rights. These rights are described in the Digia Qt LGPL Exception -
27** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -
28** -
29** GNU General Public License Usage -
30** Alternatively, this file may be used under the terms of the GNU -
31** General Public License version 3.0 as published by the Free Software -
32** Foundation and appearing in the file LICENSE.GPL included in the -
33** packaging of this file. Please review the following information to -
34** ensure the GNU General Public License version 3.0 requirements will be -
35** met: http://www.gnu.org/copyleft/gpl.html. -
36** -
37** -
38** $QT_END_LICENSE$ -
39** -
40****************************************************************************/ -
41#include <QtCore/qvariantanimation.h> -
42#include <private/qvariantanimation_p.h> -
43 -
44#ifndef QT_NO_ANIMATION -
45 -
46#include <QtGui/qcolor.h> -
47#include <QtGui/qvector2d.h> -
48#include <QtGui/qvector3d.h> -
49#include <QtGui/qvector4d.h> -
50#include <QtGui/qquaternion.h> -
51 -
52QT_BEGIN_NAMESPACE -
53 -
54template<> Q_INLINE_TEMPLATE QColor _q_interpolate(const QColor &f,const QColor &t, qreal progress) -
55{ -
56 return QColor(qBound(0,_q_interpolate(f.red(), t.red(), progress),255),
never executed: return QColor(qBound(0,_q_interpolate(f.red(), t.red(), progress),255), qBound(0,_q_interpolate(f.green(), t.green(), progress),255), qBound(0,_q_interpolate(f.blue(), t.blue(), progress),255), qBound(0,_q_interpolate(f.alpha(), t.alpha(), progress),255));
0
57 qBound(0,_q_interpolate(f.green(), t.green(), progress),255),
never executed: return QColor(qBound(0,_q_interpolate(f.red(), t.red(), progress),255), qBound(0,_q_interpolate(f.green(), t.green(), progress),255), qBound(0,_q_interpolate(f.blue(), t.blue(), progress),255), qBound(0,_q_interpolate(f.alpha(), t.alpha(), progress),255));
0
58 qBound(0,_q_interpolate(f.blue(), t.blue(), progress),255),
never executed: return QColor(qBound(0,_q_interpolate(f.red(), t.red(), progress),255), qBound(0,_q_interpolate(f.green(), t.green(), progress),255), qBound(0,_q_interpolate(f.blue(), t.blue(), progress),255), qBound(0,_q_interpolate(f.alpha(), t.alpha(), progress),255));
0
59 qBound(0,_q_interpolate(f.alpha(), t.alpha(), progress),255));
never executed: return QColor(qBound(0,_q_interpolate(f.red(), t.red(), progress),255), qBound(0,_q_interpolate(f.green(), t.green(), progress),255), qBound(0,_q_interpolate(f.blue(), t.blue(), progress),255), qBound(0,_q_interpolate(f.alpha(), t.alpha(), progress),255));
0
60} -
61 -
62template<> Q_INLINE_TEMPLATE QQuaternion _q_interpolate(const QQuaternion &f,const QQuaternion &t, qreal progress) -
63{ -
64 return QQuaternion::slerp(f, t, progress);
never executed: return QQuaternion::slerp(f, t, progress);
0
65} -
66 -
67static void qRegisterGuiGetInterpolator() -
68{ -
69 qRegisterAnimationInterpolator<QColor>(_q_interpolateVariant<QColor>);
executed (the execution status of this line is deduced): qRegisterAnimationInterpolator<QColor>(_q_interpolateVariant<QColor>);
-
70 qRegisterAnimationInterpolator<QVector2D>(_q_interpolateVariant<QVector2D>);
executed (the execution status of this line is deduced): qRegisterAnimationInterpolator<QVector2D>(_q_interpolateVariant<QVector2D>);
-
71 qRegisterAnimationInterpolator<QVector3D>(_q_interpolateVariant<QVector3D>);
executed (the execution status of this line is deduced): qRegisterAnimationInterpolator<QVector3D>(_q_interpolateVariant<QVector3D>);
-
72 qRegisterAnimationInterpolator<QVector4D>(_q_interpolateVariant<QVector4D>);
executed (the execution status of this line is deduced): qRegisterAnimationInterpolator<QVector4D>(_q_interpolateVariant<QVector4D>);
-
73 qRegisterAnimationInterpolator<QQuaternion>(_q_interpolateVariant<QQuaternion>);
executed (the execution status of this line is deduced): qRegisterAnimationInterpolator<QQuaternion>(_q_interpolateVariant<QQuaternion>);
-
74}
executed: }
Execution Count:200
200
75Q_CONSTRUCTOR_FUNCTION(qRegisterGuiGetInterpolator)
executed: }
Execution Count:200
200
76 -
77static void qUnregisterGuiGetInterpolator() -
78{ -
79 // casts required by Sun CC 5.5 -
80 qRegisterAnimationInterpolator<QColor>(
never executed (the execution status of this line is deduced): qRegisterAnimationInterpolator<QColor>(
-
81 (QVariant (*)(const QColor &, const QColor &, qreal))0);
never executed (the execution status of this line is deduced): (QVariant (*)(const QColor &, const QColor &, qreal))0);
-
82 qRegisterAnimationInterpolator<QVector2D>(
never executed (the execution status of this line is deduced): qRegisterAnimationInterpolator<QVector2D>(
-
83 (QVariant (*)(const QVector2D &, const QVector2D &, qreal))0);
never executed (the execution status of this line is deduced): (QVariant (*)(const QVector2D &, const QVector2D &, qreal))0);
-
84 qRegisterAnimationInterpolator<QVector3D>(
never executed (the execution status of this line is deduced): qRegisterAnimationInterpolator<QVector3D>(
-
85 (QVariant (*)(const QVector3D &, const QVector3D &, qreal))0);
never executed (the execution status of this line is deduced): (QVariant (*)(const QVector3D &, const QVector3D &, qreal))0);
-
86 qRegisterAnimationInterpolator<QVector4D>(
never executed (the execution status of this line is deduced): qRegisterAnimationInterpolator<QVector4D>(
-
87 (QVariant (*)(const QVector4D &, const QVector4D &, qreal))0);
never executed (the execution status of this line is deduced): (QVariant (*)(const QVector4D &, const QVector4D &, qreal))0);
-
88 qRegisterAnimationInterpolator<QQuaternion>(
never executed (the execution status of this line is deduced): qRegisterAnimationInterpolator<QQuaternion>(
-
89 (QVariant (*)(const QQuaternion &, const QQuaternion &, qreal))0);
never executed (the execution status of this line is deduced): (QVariant (*)(const QQuaternion &, const QQuaternion &, qreal))0);
-
90}
never executed: }
0
91Q_DESTRUCTOR_FUNCTION(qUnregisterGuiGetInterpolator)
never executed: }
0
92 -
93QT_END_NAMESPACE -
94 -
95#endif //QT_NO_ANIMATION -
96 -
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial