summaryrefslogtreecommitdiff
path: root/noncore/styles/theme/ogfxeffect.cpp
Side-by-side diff
Diffstat (limited to 'noncore/styles/theme/ogfxeffect.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/styles/theme/ogfxeffect.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/noncore/styles/theme/ogfxeffect.cpp b/noncore/styles/theme/ogfxeffect.cpp
index 90b45fe..ab63c98 100644
--- a/noncore/styles/theme/ogfxeffect.cpp
+++ b/noncore/styles/theme/ogfxeffect.cpp
@@ -1,28 +1,32 @@
/* This file is part of the KDE libraries
Copyright (C) 1998, 1999 Christian Tibirna <ctibirna@total.net>
(C) 1998, 1999 Daniel M. Duley <mosfet@kde.org>
(C) 1998, 1999 Dirk A. Mueller <mueller@kde.org>
*/
// $Id$
-#include <qimage.h>
-#include <qpainter.h>
+#include "ogfxeffect.h"
+/* OPIE */
+#include <opie2/odebug.h>
#include <qpe/qmath.h>
-#include "ogfxeffect.h"
+/* QT */
+#include <qimage.h>
+#include <qpainter.h>
+/* STD */
#include <cstdlib>
#include <cmath>
//======================================================================
//
// Gradient effects
//
//======================================================================
QPixmap& OGfxEffect::gradient(QPixmap &pixmap, const QColor &ca,
const QColor &cb, GradientType eff, int ncols)
@@ -34,25 +38,25 @@ QPixmap& OGfxEffect::gradient(QPixmap &pixmap, const QColor &ca,
return pixmap;
}
QImage OGfxEffect::gradient(const QSize &size, const QColor &ca,
const QColor &cb, GradientType eff, int /*ncols*/)
{
int rDiff, gDiff, bDiff;
int rca, gca, bca, rcb, gcb, bcb;
QImage image(size, 32);
if (size.width() == 0 || size.height() == 0) {
- qDebug ( "WARNING: OGfxEffect::gradient: invalid image" );
+ odebug << "WARNING: OGfxEffect::gradient: invalid image" << oendl;
return image;
}
register int x, y;
rDiff = (rcb = cb.red()) - (rca = ca.red());
gDiff = (gcb = cb.green()) - (gca = ca.green());
bDiff = (bcb = cb.blue()) - (bca = ca.blue());
if( eff == VerticalGradient || eff == HorizontalGradient ){
uint *p;
@@ -290,25 +294,25 @@ QPixmap& OGfxEffect::blend(QPixmap &pixmap, float initial_intensity,
pixmap.convertFromImage(image);
}
return pixmap;
}
QImage& OGfxEffect::blend(QImage &image, float initial_intensity,
const QColor &bgnd, GradientType eff,
bool anti_dir)
{
if (image.width() == 0 || image.height() == 0) {
- qDebug ( "Invalid image\n" );
+ odebug << "Invalid image" << oendl;
return image;
}
int r_bgnd = bgnd.red(), g_bgnd = bgnd.green(), b_bgnd = bgnd.blue();
int r, g, b;
int ind;
unsigned int xi, xf, yi, yf;
unsigned int a;
// check the boundaries of the initial intesity param
float unaffected = 1;
@@ -476,25 +480,25 @@ QImage& OGfxEffect::blend(QImage &image, float initial_intensity,
b = qBlue (data[ind]) + (int)(intensity *
(b_bgnd - qBlue (data[ind])));
if (r > 255) r = 255; if (r < 0 ) r = 0;
if (g > 255) g = 255; if (g < 0 ) g = 0;
if (b > 255) b = 255; if (b < 0 ) b = 0;
a = qAlpha(data[ind]);
data[ind] = qRgba(r, g, b, a);
}
}
}
else
- qDebug ( "not implemented\n" );
+ odebug << "not implemented" << oendl;
return image;
}
#if 0
// Not very efficient as we create a third big image...
//
QImage& KQGfxEffect::blend(QImage &image1, QImage &image2,
GradientType gt, int xf, int yf)
{
if (image1.width() == 0 || image1.height() == 0 ||
image2.width() == 0 || image2.height() == 0)