kdefx Library API Documentation

kpixmapeffect.h

00001 /* This file is part of the KDE libraries
00002     Copyright (C) 1998, 1999 Christian Tibirna <ctibirna@total.net>
00003               (C) 1998, 1999 Daniel M. Duley <mosfet@kde.org>
00004               (C) 1998, 1999 Dirk A. Mueller <mueller@kde.org>
00005 
00006 */
00007 
00008 // $Id: kpixmapeffect.h,v 1.40 2003/08/16 19:45:00 coolo Exp $
00009 
00010 #ifndef __KPIXMAP_EFFECT_H
00011 #define __KPIXMAP_EFFECT_H
00012 
00013 
00014 #include <qsize.h>
00015 class KPixmap;
00016 class QColor;
00017 
00026 class KPixmapEffect
00027 {
00028 public:
00029     enum GradientType { VerticalGradient, HorizontalGradient,
00030             DiagonalGradient, CrossDiagonalGradient,
00031             PyramidGradient, RectangleGradient,
00032             PipeCrossGradient, EllipticGradient };
00033     enum RGBComponent { Red, Green, Blue };
00034 
00035     enum Lighting {NorthLite, NWLite, WestLite, SWLite,
00036            SouthLite, SELite, EastLite, NELite};
00037 
00050     static KPixmap& gradient(KPixmap& pixmap, const QColor &ca, const QColor &cb,
00051                             GradientType type, int ncols=3);
00052 
00068     static KPixmap& unbalancedGradient(KPixmap& pixmap, const QColor &ca,
00069                    const QColor &cb, GradientType type, int xfactor = 100,
00070                    int yfactor = 100, int ncols=3);
00071 
00083     static KPixmap createTiled(const KPixmap& pixmap, QSize size);
00084 
00092     static KPixmap& intensity(KPixmap& pixmap, float ratio);
00093 
00102     static KPixmap& channelIntensity(KPixmap& pixmap, float ratio,
00103                                     RGBComponent channel);
00104 
00122     static KPixmap& blend(KPixmap& pixmap, float initial_intensity,
00123                          const QColor &bgnd, GradientType eff,
00124                          bool anti_dir=false, int ncols=3);
00125 
00136     static KPixmap& hash(KPixmap& pixmap, Lighting lite=NorthLite,
00137                         unsigned int spacing=0, int ncols=3);
00138 
00155     static KPixmap pattern(const KPixmap& pixmap, QSize size,
00156                    const QColor &ca, const QColor &cb, int ncols=8);
00157 
00166     static KPixmap& fade(KPixmap& pixmap, double val, const QColor &color);
00167 
00176     static KPixmap& toGray(KPixmap& pixmap, bool fast=false);
00177 
00185     static KPixmap& desaturate(KPixmap& pixmap, float desat = 0.3);
00186 
00194     static KPixmap& contrast(KPixmap& pixmap, int c);
00195 
00205     static KPixmap& dither(KPixmap &pixmap, const QColor *palette, int size);
00206 
00213     static KPixmap selectedPixmap( const KPixmap &pixmap, const QColor &col );
00214 };
00215 
00216 
00217 #endif
KDE Logo
This file is part of the documentation for kdefx Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sun Jan 15 13:32:15 2006 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003