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.38 2002/07/31 23:14:10 orlovich 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 
00120     static KPixmap& blend(KPixmap& pixmap, float initial_intensity,
00121                          const QColor &bgnd, GradientType eff,
00122                          bool anti_dir=false, int ncols=3);
00123 
00132     static KPixmap& hash(KPixmap& pixmap, Lighting lite=NorthLite,
00133                         unsigned int spacing=0, int ncols=3);
00134 
00148     static KPixmap pattern(const KPixmap& pixmap, QSize size,
00149                    const QColor &ca, const QColor &cb, int ncols=8);
00150 
00164     static KPixmap& fade(KPixmap& pixmap, double val, const QColor &color);
00165 
00174     static KPixmap& toGray(KPixmap& pixmap, bool fast=false);
00175 
00183     static KPixmap& desaturate(KPixmap& pixmap, float desat = 0.3);
00184 
00192     static KPixmap& contrast(KPixmap& pixmap, int c);
00193 
00203     static KPixmap& dither(KPixmap &pixmap, const QColor *palette, int size);
00204 
00211     static KPixmap selectedPixmap( const KPixmap &pixmap, const QColor &col );
00212 };
00213 
00214 
00215 #endif
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.4.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sun Feb 27 22:14:38 2005 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001