summaryrefslogtreecommitdiff
authorzecke <zecke>2002-11-03 11:14:01 (UTC)
committer zecke <zecke>2002-11-03 11:14:01 (UTC)
commit57e4563332689305ac247ca2e259b37c3592f389 (patch) (side-by-side diff)
treeb9b20a5a115c9aff7163db1a517a32d19a293b34
parent5ec23891e1c5b7bc571d86326b511d1a48b14c45 (diff)
downloadopie-57e4563332689305ac247ca2e259b37c3592f389.zip
opie-57e4563332689305ac247ca2e259b37c3592f389.tar.gz
opie-57e4563332689305ac247ca2e259b37c3592f389.tar.bz2
include fixlet
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/styles/theme/ogfxeffect.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/noncore/styles/theme/ogfxeffect.cpp b/noncore/styles/theme/ogfxeffect.cpp
index cc5bbcd..2071a67 100644
--- a/noncore/styles/theme/ogfxeffect.cpp
+++ b/noncore/styles/theme/ogfxeffect.cpp
@@ -1,64 +1,66 @@
/* 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 <qpe/qmath.h>
#include "ogfxeffect.h"
+#include <cstdlib>
+#include <cmath>
//======================================================================
//
// Gradient effects
//
//======================================================================
QPixmap& OGfxEffect::gradient(QPixmap &pixmap, const QColor &ca,
const QColor &cb, GradientType eff, int ncols)
{
QImage image = gradient(pixmap.size(), ca, cb, eff, ncols);
pixmap.convertFromImage(image);
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" );
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;
uint rgb;
register int rl = rca << 16;
register int gl = gca << 16;
register int bl = bca << 16;
if( eff == VerticalGradient ) {
int rcdelta = ((1<<16) / size.height()) * rDiff;