summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/styles/theme/ogfxeffect.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/noncore/styles/theme/ogfxeffect.cpp b/noncore/styles/theme/ogfxeffect.cpp
index a991728..55f3c1f 100644
--- a/noncore/styles/theme/ogfxeffect.cpp
+++ b/noncore/styles/theme/ogfxeffect.cpp
@@ -5,28 +5,30 @@
*/
// $Id$
#include <qimage.h>
#include <qpainter.h>
+#include <qpe/qmath.h>
+
#include "ogfxeffect.h"
//======================================================================
//
// Gradient effects
//
//======================================================================
QPixmap& OGfxEffect::gradient(QPixmap &pixmap, const QColor &ca,
- const QColor &cb, GradientType eff, int ncols)
+ const QColor &cb, GradientType eff, int /*ncols*/)
{
if(pixmap.depth() > 8 &&
(eff == VerticalGradient || eff == HorizontalGradient)) {
int rDiff, gDiff, bDiff;
int rca, gca, bca /*, rcb, gcb, bcb*/;
register int x, y;
@@ -86,23 +88,21 @@ QPixmap& OGfxEffect::gradient(QPixmap &pixmap, const QColor &ca,
//
// Blend effects
//
//======================================================================
QPixmap& OGfxEffect::blend(QPixmap &pixmap, float initial_intensity,
const QColor &bgnd, GradientType eff,
- bool anti_dir, int ncols)
+ bool anti_dir, int /*ncols*/)
{
QImage image = pixmap.convertToImage();
OGfxEffect::blend(image, initial_intensity, bgnd, eff, anti_dir);
- unsigned int tmp;
-
if ( pixmap. depth ( ) <= 8 )
image. convertDepth ( pixmap. depth ( ));
pixmap.convertFromImage(image);
return pixmap;
}
@@ -213,17 +213,17 @@ QImage& OGfxEffect::blend(QImage &image, float initial_intensity,
for (x = 0; x < image.width() / 2 + image.width() % 2; x++) {
xvar = var / image.width() * (image.width() - x*2/unaffected-1);
for (y = 0; y < image.height() / 2 + image.height() % 2; y++) {
yvar = var / image.height() * (image.height() - y*2/unaffected -1);
if (eff == RectangleGradient)
intensity = initial_intensity + QMAX(xvar, yvar);
else
- intensity = initial_intensity + sqrt(xvar * xvar + yvar * yvar);
+ intensity = initial_intensity + qSqrt(xvar * xvar + yvar * yvar);
if (intensity > 1) intensity = 1;
if (intensity < 0) intensity = 0;
//NW
ind = x + image.width() * y ;
r = qRed (data[ind]) + (int)(intensity *
(r_bgnd - qRed (data[ind])));
g = qGreen(data[ind]) + (int)(intensity *
@@ -257,17 +257,17 @@ QImage& OGfxEffect::blend(QImage &image, float initial_intensity,
for (x = 0; x < image.width() / 2; x++) {
xvar = var / image.width() * (image.width() - x*2/unaffected-1);
for (y = 0; y < image.height() / 2; y++) {
yvar = var / image.height() * (image.height() - y*2/unaffected -1);
if (eff == RectangleGradient)
intensity = initial_intensity + QMAX(xvar, yvar);
else
- intensity = initial_intensity + sqrt(xvar * xvar + yvar * yvar);
+ intensity = initial_intensity + qSqrt(xvar * xvar + yvar * yvar);
if (intensity > 1) intensity = 1;
if (intensity < 0) intensity = 0;
//SW
ind = x + image.width() * (image.height() - y -1) ;
r = qRed (data[ind]) + (int)(intensity *
(r_bgnd - qRed (data[ind])));
g = qGreen(data[ind]) + (int)(intensity *