• Skip to content
  • Skip to link menu
KDE 4.4 API Reference
  • KDE API Reference
  • KDE Support
  • Sitemap
  • Contact Us
 

qimageblitz

qimageblitz.h

Go to the documentation of this file.
00001 #ifndef __BLITZ_H
00002 #define __BLITZ_H
00003 
00004 /* 
00005  Copyright (C) 1998, 1999, 2001, 2002, 2004, 2005, 2007
00006       Daniel M. Duley <daniel.duley@verizon.net>
00007  (C) 2004 Zack Rusin <zack@kde.org>
00008  (C) 2000 Josef Weidendorfer <weidendo@in.tum.de>
00009  (C) 1999 Geert Jansen <g.t.jansen@stud.tue.nl>
00010  (C) 1998, 1999 Christian Tibirna <ctibirna@total.net>
00011  (C) 1998, 1999 Dirk Mueller <mueller@kde.org>
00012 
00013 Redistribution and use in source and binary forms, with or without
00014 modification, are permitted provided that the following conditions
00015 are met:
00016 
00017 1. Redistributions of source code must retain the above copyright
00018    notice, this list of conditions and the following disclaimer.
00019 2. Redistributions in binary form must reproduce the above copyright
00020    notice, this list of conditions and the following disclaimer in the
00021    documentation and/or other materials provided with the distribution.
00022 
00023 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
00024 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00025 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
00026 IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
00027 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
00028 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00029 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00030 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00031 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
00032 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00033 
00034 */
00035 
00036 #include <QtGui/QImage>
00037 #include "qimageblitz_export.h"
00038 
00039 class QIMAGEBLITZ_EXPORT Blitz
00040 {
00041 public:
00042     enum GradientType {VerticalGradient=0, HorizontalGradient, DiagonalGradient,
00043         CrossDiagonalGradient, PyramidGradient, RectangleGradient,
00044         PipeCrossGradient, EllipticGradient};
00045 
00046     enum RGBChannel{Grayscale=0, Brightness, Red, Green, Blue, Alpha, All};
00047     enum EffectQuality{Low=0, High};
00048 
00049     enum ScaleFilterType{UndefinedFilter=0, PointFilter, BoxFilter,
00050         TriangleFilter, HermiteFilter, HanningFilter, HammingFilter,
00051         BlackmanFilter, GaussianFilter, QuadraticFilter, CubicFilter,
00052         CatromFilter, MitchellFilter, LanczosFilter, BesselFilter,
00053         SincFilter};
00054 
00055     enum ModulationType{Intensity=0, Saturation, HueShift, Contrast};
00056 
00065     static bool invert(QImage &img, QImage::InvertMode mode =
00066                        QImage::InvertRgb);
00074     static bool grayscale(QImage &img, bool reduceDepth=false);
00084     static QImage smoothScale(QImage &img, const QSize &sz,
00085                               Qt::AspectRatioMode aspectRatio =
00086                               Qt::IgnoreAspectRatio);
00087     static QImage smoothScale(QImage &img, int dw, int dh,
00088                               Qt::AspectRatioMode aspectRatio =
00089                               Qt::IgnoreAspectRatio);
00102     static QImage smoothScaleFilter(QImage &img, const QSize &sz,
00103                                     float blur=1.0,
00104                                     ScaleFilterType filter=BlackmanFilter,
00105                                     Qt::AspectRatioMode aspectRatio =
00106                                     Qt::IgnoreAspectRatio);
00107     static QImage smoothScaleFilter(QImage &img, int dwX, int dwY,
00108                                     float blur=1.0,
00109                                     ScaleFilterType filter=BlackmanFilter,
00110                                     Qt::AspectRatioMode aspectRatio =
00111                                     Qt::IgnoreAspectRatio);
00112 
00124     static QImage convolve(QImage &img, int matrix_size, float *matrix);
00128     static QImage convolveInteger(QImage &img, int matrix_size, int *matrix,
00129                                   int divisor=0);
00138     static QImage blur(QImage &img, int radius=3);
00150     static QImage gaussianBlur(QImage &img, float radius=0.0, float sigma=1.0);
00158     static QImage edge(QImage &img);
00169     static QImage convolveEdge(QImage &img, float radius=0.0,
00170                                EffectQuality quality=High);
00183     static QImage gaussianSharpen(QImage &img, float radius=0.0, float sigma=1.0,
00184                                   EffectQuality quality=High);
00192     static QImage sharpen(QImage &img, int radius=3);
00205     static QImage emboss(QImage &img, float radius=0.0, float sigma=1.0,
00206                          EffectQuality quality=High);
00214     static QImage antialias(QImage &img);
00223     static QImage& despeckle(QImage &img);
00234     static QImage& contrast(QImage &img, bool sharpen, int weight=3);
00241     static bool equalize(QImage &img);
00249     static bool normalize(QImage &img);
00260     static QImage& intensity(QImage &img, float percent);
00271     static QImage& channelIntensity(QImage &img, float percent,
00272                                     RGBChannel channel);
00281     static QImage& desaturate(QImage &img, float desat = 0.5);
00291     static QImage& fade(QImage &img, float val, const QColor &color);
00292 
00301     static QImage& flatten(QImage &img, const QColor &ca, const QColor &cb);
00314     static QImage threshold(QImage &img, unsigned char thresholdValue=127,
00315                             RGBChannel channel=Grayscale,
00316                             unsigned int aboveColor=qRgb(255, 255, 255),
00317                             unsigned int belowColor=qRgb(0, 0, 0));
00326     static QImage swirl(QImage &img, float degrees=60.0);
00335     static QImage implode(QImage &img, float amount=0.3);
00347     static QImage wave(QImage &img, float amplitude=25.0, float frequency=150.0,
00348                        unsigned int background=0);
00359     static QImage oilPaint(QImage &img, float radius=0.0,
00360                            EffectQuality quality=High);
00368     static QImage charcoal(QImage &img);
00378     static QImage gradient(const QSize &size, const QColor &ca,
00379                            const QColor &cb, GradientType type);
00390     static QImage grayGradient(const QSize &size, unsigned char ca,
00391                                unsigned char cb, GradientType type);
00405     static QImage unbalancedGradient(const QSize &size, const QColor &ca,
00406                                      const QColor &cb, GradientType type,
00407                                      int xfactor=100, int yfactor=100);
00420     static QImage grayUnbalancedGradient(const QSize &size, unsigned char ca,
00421                                          unsigned char cb, GradientType type,
00422                                          int xfactor=100, int yfactor=100);
00434     static QImage& modulate(QImage &img, QImage &modImg, bool reverse,
00435                             ModulationType type, int factor,
00436                             RGBChannel channel);
00437 };
00438 
00439 #endif
00440 

qimageblitz

Skip menu "qimageblitz"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

KDE Support

Skip menu "KDE Support"
  • akonadi
  • Decibel
  • grantlee
  • kdewin
  • phonon
  •     Backend
  • polkit-qt
  • qca
  • qimageblitz
  • soprano
  • strigi
  •     searchclient
  •     streamanalyzer
  •     streams
Generated for KDE Support by doxygen 1.5.9-20090814
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal