author | mickeyl <mickeyl> | 2003-09-16 13:07:56 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-09-16 13:07:56 (UTC) |
commit | 9cd1a5708fa9f10e391bd18cbf1f5800cdc76851 (patch) (unidiff) | |
tree | 65404702ea418b9270158a941b408870d981eca4 | |
parent | 81171716bb686e709f27fbbc0931740aa9d9462a (diff) | |
download | opie-9cd1a5708fa9f10e391bd18cbf1f5800cdc76851.zip opie-9cd1a5708fa9f10e391bd18cbf1f5800cdc76851.tar.gz opie-9cd1a5708fa9f10e391bd18cbf1f5800cdc76851.tar.bz2 |
remove unneccessary #include
-rw-r--r-- | libopie2/opieui/oimageeffect.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/libopie2/opieui/oimageeffect.cpp b/libopie2/opieui/oimageeffect.cpp index 2855da6..01e7c6f 100644 --- a/libopie2/opieui/oimageeffect.cpp +++ b/libopie2/opieui/oimageeffect.cpp | |||
@@ -1,84 +1,83 @@ | |||
1 | /* This file is part of the KDE libraries | 1 | /* This file is part of the KDE libraries |
2 | Copyright (C) 1998, 1999, 2001, 2002 Daniel M. Duley <mosfet@kde.org> | 2 | Copyright (C) 1998, 1999, 2001, 2002 Daniel M. Duley <mosfet@kde.org> |
3 | (C) 1998, 1999 Christian Tibirna <ctibirna@total.net> | 3 | (C) 1998, 1999 Christian Tibirna <ctibirna@total.net> |
4 | (C) 1998, 1999 Dirk A. Mueller <mueller@kde.org> | 4 | (C) 1998, 1999 Dirk A. Mueller <mueller@kde.org> |
5 | (C) 2000 Josef Weidendorfer <weidendo@in.tum.de> | 5 | (C) 2000 Josef Weidendorfer <weidendo@in.tum.de> |
6 | 6 | ||
7 | Redistribution and use in source and binary forms, with or without | 7 | Redistribution and use in source and binary forms, with or without |
8 | modification, are permitted provided that the following conditions | 8 | modification, are permitted provided that the following conditions |
9 | are met: | 9 | are met: |
10 | 10 | ||
11 | 1. Redistributions of source code must retain the above copyright | 11 | 1. Redistributions of source code must retain the above copyright |
12 | notice, this list of conditions and the following disclaimer. | 12 | notice, this list of conditions and the following disclaimer. |
13 | 2. Redistributions in binary form must reproduce the above copyright | 13 | 2. Redistributions in binary form must reproduce the above copyright |
14 | notice, this list of conditions and the following disclaimer in the | 14 | notice, this list of conditions and the following disclaimer in the |
15 | documentation and/or other materials provided with the distribution. | 15 | documentation and/or other materials provided with the distribution. |
16 | 16 | ||
17 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | 17 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
18 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | 18 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
19 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | 19 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
20 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | 20 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
21 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | 21 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
22 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 | ||
28 | */ | 28 | */ |
29 | 29 | ||
30 | // $Id$ | 30 | // $Id$ |
31 | 31 | ||
32 | #include <math.h> | 32 | #include <math.h> |
33 | 33 | ||
34 | #include <qimage.h> | 34 | #include <qimage.h> |
35 | #include <stdlib.h> | 35 | #include <stdlib.h> |
36 | #include <iostream> | ||
37 | 36 | ||
38 | #include "oimageeffect.h" | 37 | #include "oimageeffect.h" |
39 | 38 | ||
40 | #define MaxRGB 255L | 39 | #define MaxRGB 255L |
41 | #define DegreesToRadians(x) ((x)*M_PI/180.0) | 40 | #define DegreesToRadians(x) ((x)*M_PI/180.0) |
42 | 41 | ||
43 | using namespace std; | 42 | using namespace std; |
44 | 43 | ||
45 | inline unsigned int intensityValue(unsigned int color) | 44 | inline unsigned int intensityValue(unsigned int color) |
46 | { | 45 | { |
47 | return((unsigned int)((0.299*qRed(color) + | 46 | return((unsigned int)((0.299*qRed(color) + |
48 | 0.587*qGreen(color) + | 47 | 0.587*qGreen(color) + |
49 | 0.1140000000000001*qBlue(color)))); | 48 | 0.1140000000000001*qBlue(color)))); |
50 | } | 49 | } |
51 | 50 | ||
52 | //====================================================================== | 51 | //====================================================================== |
53 | // | 52 | // |
54 | // Gradient effects | 53 | // Gradient effects |
55 | // | 54 | // |
56 | //====================================================================== | 55 | //====================================================================== |
57 | 56 | ||
58 | QImage OImageEffect::gradient(const QSize &size, const QColor &ca, | 57 | QImage OImageEffect::gradient(const QSize &size, const QColor &ca, |
59 | const QColor &cb, GradientType eff, int ncols) | 58 | const QColor &cb, GradientType eff, int ncols) |
60 | { | 59 | { |
61 | int rDiff, gDiff, bDiff; | 60 | int rDiff, gDiff, bDiff; |
62 | int rca, gca, bca, rcb, gcb, bcb; | 61 | int rca, gca, bca, rcb, gcb, bcb; |
63 | 62 | ||
64 | QImage image(size, 32); | 63 | QImage image(size, 32); |
65 | 64 | ||
66 | if (size.width() == 0 || size.height() == 0) { | 65 | if (size.width() == 0 || size.height() == 0) { |
67 | qDebug( "WARNING: OImageEffect::gradient: invalid image" ); | 66 | qDebug( "WARNING: OImageEffect::gradient: invalid image" ); |
68 | return image; | 67 | return image; |
69 | } | 68 | } |
70 | 69 | ||
71 | register int x, y; | 70 | register int x, y; |
72 | 71 | ||
73 | rDiff = (rcb = cb.red()) - (rca = ca.red()); | 72 | rDiff = (rcb = cb.red()) - (rca = ca.red()); |
74 | gDiff = (gcb = cb.green()) - (gca = ca.green()); | 73 | gDiff = (gcb = cb.green()) - (gca = ca.green()); |
75 | bDiff = (bcb = cb.blue()) - (bca = ca.blue()); | 74 | bDiff = (bcb = cb.blue()) - (bca = ca.blue()); |
76 | 75 | ||
77 | if( eff == VerticalGradient || eff == HorizontalGradient ){ | 76 | if( eff == VerticalGradient || eff == HorizontalGradient ){ |
78 | 77 | ||
79 | uint *p; | 78 | uint *p; |
80 | uint rgb; | 79 | uint rgb; |
81 | 80 | ||
82 | register int rl = rca << 16; | 81 | register int rl = rca << 16; |
83 | register int gl = gca << 16; | 82 | register int gl = gca << 16; |
84 | register int bl = bca << 16; | 83 | register int bl = bca << 16; |