2 * This file is part of jSpeed.
4 * jSpeed is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * jSpeed is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with jSpeed. If not, see <http://www.gnu.org/licenses/>.
19 #include <QtCore/QString>
20 #include <QtGui/QGraphicsItem>
22 #include "dropshadoweffect.h"
23 #include "blureffect.h"
24 #include "opacityeffect.h"
25 #include "flickereffect.h"
32 Effect* Effect::getEffect(QString const& name)
34 if(name == "dropshadow")
36 return new DropshadowEffect;
38 else if(name == "blur")
40 return new BlurEffect;
42 else if(name == "opacity")
44 return new OpacityEffect;
46 else if(name == "flicker")
48 return new FlickerEffect;
54 int Effect::getAttribute(QString const& name,
56 const Effect::AttributeDetails details[],
60 QString lower = name.toLower();
62 for(int i = 0; i < count; i++)
64 if(details[i].name == lower)
66 if(!details[i].isQreal)
73 double tmp = value.toDouble(&ok);
77 realValue = static_cast<qreal>(tmp);