2
* Copyright (C) 2012 Canonical, Ltd.
5
* Florian Boucault <florian.boucault@canonical.com>
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; version 3.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20
#ifndef COLORIZEEFFECT_H
21
#define COLORIZEEFFECT_H
23
#include <QGraphicsEffect>
26
class ColorizeEffect : public QGraphicsEffect
30
Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
31
Q_PROPERTY(qreal saturation READ saturation WRITE setSaturation NOTIFY saturationChanged)
34
explicit ColorizeEffect(QObject *parent = 0);
38
qreal saturation() const;
41
void setColor(const QColor &color);
42
void setSaturation(qreal saturation);
45
void colorChanged(const QColor &color);
46
void saturationChanged(qreal saturation);
49
void draw(QPainter *painter);
50
void sourceChanged(ChangeFlags flags);
56
// caching of intermediary renderings
57
QPixmap m_tintedPixmap;
60
#endif // COLORIZEEFFECT_H