summaryrefslogtreecommitdiff
path: root/libopie2/opieui/opixmapeffect.cpp
Unidiff
Diffstat (limited to 'libopie2/opieui/opixmapeffect.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opieui/opixmapeffect.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/libopie2/opieui/opixmapeffect.cpp b/libopie2/opieui/opixmapeffect.cpp
index 05f851d..794c7b2 100644
--- a/libopie2/opieui/opixmapeffect.cpp
+++ b/libopie2/opieui/opixmapeffect.cpp
@@ -1,43 +1,45 @@
1/* This file is part of the KDE libraries 1/* This file is part of the KDE libraries
2 Copyright (C) 1998, 1999 Christian Tibirna <ctibirna@total.net> 2 Copyright (C) 1998, 1999 Christian Tibirna <ctibirna@total.net>
3 (C) 1998, 1999 Daniel M. Duley <mosfet@kde.org> 3 (C) 1998, 1999 Daniel M. Duley <mosfet@kde.org>
4 (C) 1998, 1999 Dirk A. Mueller <mueller@kde.org> 4 (C) 1998, 1999 Dirk A. Mueller <mueller@kde.org>
5 5
6*/ 6*/
7 7
8// $Id$ 8// $Id$
9 9
10/* QT */ 10/* QT */
11 11
12#include <qimage.h> 12#include <qimage.h>
13#include <qpainter.h> 13#include <qpainter.h>
14 14
15/* OPIE */ 15/* OPIE */
16 16
17#include <opie2/opixmapeffect.h> 17#include <opie2/opixmapeffect.h>
18#include <opie2/oimageeffect.h> 18#include <opie2/oimageeffect.h>
19 19
20
21using namespace Opie::Ui;
20//====================================================================== 22//======================================================================
21// 23//
22// Gradient effects 24// Gradient effects
23// 25//
24//====================================================================== 26//======================================================================
25 27
26 28
27OPixmap& OPixmapEffect::gradient(OPixmap &pixmap, const QColor &ca, 29OPixmap& OPixmapEffect::gradient(OPixmap &pixmap, const QColor &ca,
28 const QColor &cb, GradientType eff, int ncols) 30 const QColor &cb, GradientType eff, int ncols)
29{ 31{
30 if(pixmap.depth() > 8 && 32 if(pixmap.depth() > 8 &&
31 (eff == VerticalGradient || eff == HorizontalGradient)) { 33 (eff == VerticalGradient || eff == HorizontalGradient)) {
32 34
33 int rDiff, gDiff, bDiff; 35 int rDiff, gDiff, bDiff;
34 int rca, gca, bca /*, rcb, gcb, bcb*/; 36 int rca, gca, bca /*, rcb, gcb, bcb*/;
35 37
36 register int x, y; 38 register int x, y;
37 39
38 rDiff = (/*rcb = */ cb.red()) - (rca = ca.red()); 40 rDiff = (/*rcb = */ cb.red()) - (rca = ca.red());
39 gDiff = (/*gcb = */ cb.green()) - (gca = ca.green()); 41 gDiff = (/*gcb = */ cb.green()) - (gca = ca.green());
40 bDiff = (/*bcb = */ cb.blue()) - (bca = ca.blue()); 42 bDiff = (/*bcb = */ cb.blue()) - (bca = ca.blue());
41 43
42 register int rl = rca << 16; 44 register int rl = rca << 16;
43 register int gl = gca << 16; 45 register int gl = gca << 16;