summaryrefslogtreecommitdiff
path: root/libopie2/opieui/oimageeffect.h
Unidiff
Diffstat (limited to 'libopie2/opieui/oimageeffect.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opieui/oimageeffect.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/libopie2/opieui/oimageeffect.h b/libopie2/opieui/oimageeffect.h
index fb4d22d..4f86d5b 100644
--- a/libopie2/opieui/oimageeffect.h
+++ b/libopie2/opieui/oimageeffect.h
@@ -18,48 +18,50 @@ are met:
18 documentation and/or other materials provided with the distribution. 18 documentation and/or other materials provided with the distribution.
19 19
20THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 30
31*/ 31*/
32 32
33// $Id$ 33// $Id$
34 34
35#ifndef OIMAGEEFFECT_H 35#ifndef OIMAGEEFFECT_H
36#define OIMAGEEFFECT_H 36#define OIMAGEEFFECT_H
37 37
38class QImage; 38class QImage;
39class QSize; 39class QSize;
40class QColor; 40class QColor;
41 41
42namespace Opie {
43namespace Ui {
42/** 44/**
43 * This class includes various @ref QImage based graphical effects. 45 * This class includes various @ref QImage based graphical effects.
44 * 46 *
45 * Everything is 47 * Everything is
46 * static, so there is no need to create an instance of this class. You can 48 * static, so there is no need to create an instance of this class. You can
47 * just call the static methods. They are encapsulated here merely to provide 49 * just call the static methods. They are encapsulated here merely to provide
48 * a common namespace. 50 * a common namespace.
49 */ 51 */
50 52
51class OImageEffect 53class OImageEffect
52{ 54{
53public: 55public:
54 enum GradientType { VerticalGradient, HorizontalGradient, 56 enum GradientType { VerticalGradient, HorizontalGradient,
55 DiagonalGradient, CrossDiagonalGradient, 57 DiagonalGradient, CrossDiagonalGradient,
56 PyramidGradient, RectangleGradient, 58 PyramidGradient, RectangleGradient,
57 PipeCrossGradient, EllipticGradient }; 59 PipeCrossGradient, EllipticGradient };
58 enum RGBComponent { Red, Green, Blue, Gray, All }; 60 enum RGBComponent { Red, Green, Blue, Gray, All };
59 61
60 enum Lighting {NorthLite, NWLite, WestLite, SWLite, 62 enum Lighting {NorthLite, NWLite, WestLite, SWLite,
61 SouthLite, SELite, EastLite, NELite}; 63 SouthLite, SELite, EastLite, NELite};
62 64
63 enum ModulationType { Intensity, Saturation, HueShift, Contrast }; 65 enum ModulationType { Intensity, Saturation, HueShift, Contrast };
64 66
65 enum NoiseType { UniformNoise=0, GaussianNoise, MultiplicativeGaussianNoise, 67 enum NoiseType { UniformNoise=0, GaussianNoise, MultiplicativeGaussianNoise,
@@ -535,25 +537,28 @@ public:
535 unsigned int background = 0xFFFFFFFF); 537 unsigned int background = 0xFFFFFFFF);
536 538
537private: 539private:
538 540
539 /** 541 /**
540 * Helper function to fast calc some altered (lighten, shaded) colors 542 * Helper function to fast calc some altered (lighten, shaded) colors
541 * 543 *
542 */ 544 */
543 static unsigned int lHash(unsigned int c); 545 static unsigned int lHash(unsigned int c);
544 static unsigned int uHash(unsigned int c); 546 static unsigned int uHash(unsigned int c);
545 547
546 /** 548 /**
547 * Helper function to find the nearest color to the RBG triplet 549 * Helper function to find the nearest color to the RBG triplet
548 */ 550 */
549 static int nearestColor( int r, int g, int b, const QColor *pal, int size ); 551 static int nearestColor( int r, int g, int b, const QColor *pal, int size );
550 552
551 static void hull(const int x_offset, const int y_offset, const int polarity, 553 static void hull(const int x_offset, const int y_offset, const int polarity,
552 const int width, const int height, 554 const int width, const int height,
553 unsigned int *f, unsigned int *g); 555 unsigned int *f, unsigned int *g);
554 static unsigned int generateNoise(unsigned int pixel, NoiseType type); 556 static unsigned int generateNoise(unsigned int pixel, NoiseType type);
555 static unsigned int interpolateColor(QImage *image, double x, double y, 557 static unsigned int interpolateColor(QImage *image, double x, double y,
556 unsigned int background); 558 unsigned int background);
557}; 559};
558 560
561}
562}
563
559#endif 564#endif