author | mickeyl <mickeyl> | 2003-03-30 03:12:23 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-03-30 03:12:23 (UTC) |
commit | 161d9299ad2448092d62a1cff16e64c1b5b3a436 (patch) (side-by-side diff) | |
tree | 057fc5da398fc6927c9fd6a6ebafa8256fb87d02 | |
parent | 8e1504c3e8b8e5af509147f0b33f4e92a7c1c041 (diff) | |
download | opie-161d9299ad2448092d62a1cff16e64c1b5b3a436.zip opie-161d9299ad2448092d62a1cff16e64c1b5b3a436.tar.gz opie-161d9299ad2448092d62a1cff16e64c1b5b3a436.tar.bz2 |
remove unnecessary usage of and thus the dependency on libstdc++
-rw-r--r-- | libopie2/opieui/oimageeffect.cpp | 52 |
1 files changed, 13 insertions, 39 deletions
diff --git a/libopie2/opieui/oimageeffect.cpp b/libopie2/opieui/oimageeffect.cpp index 3c28bbe..2855da6 100644 --- a/libopie2/opieui/oimageeffect.cpp +++ b/libopie2/opieui/oimageeffect.cpp @@ -61,15 +61,13 @@ QImage OImageEffect::gradient(const QSize &size, const QColor &ca, int rDiff, gDiff, bDiff; int rca, gca, bca, rcb, gcb, bcb; QImage image(size, 32); if (size.width() == 0 || size.height() == 0) { -#ifndef NDEBUG - cerr << "WARNING: OImageEffect::gradient: invalid image" << endl; -#endif + qDebug( "WARNING: OImageEffect::gradient: invalid image" ); return image; } register int x, y; rDiff = (rcb = cb.red()) - (rca = ca.red()); @@ -349,15 +347,13 @@ QImage OImageEffect::unbalancedGradient(const QSize &size, const QColor &ca, int rDiff, gDiff, bDiff; int rca, gca, bca, rcb, gcb, bcb; QImage image(size, 32); if (size.width() == 0 || size.height() == 0) { -#ifndef NDEBUG - cerr << "WARNING: OImageEffect::unbalancedGradient : invalid image\n"; -#endif + qDebug( "WARNING: OImageEffect::unbalancedGradient : invalid image" ); return image; } register int x, y; unsigned int *scanline; @@ -570,15 +566,13 @@ QImage OImageEffect::unbalancedGradient(const QSize &size, const QColor &ca, * each pixel. (mosfet) */ QImage& OImageEffect::intensity(QImage &image, float percent) { if (image.width() == 0 || image.height() == 0) { -#ifndef NDEBUG - cerr << "WARNING: OImageEffect::intensity : invalid image\n"; -#endif + qDebug( "WARNING: OImageEffect::intensity : invalid image" ); return image; } int segColors = image.depth() > 8 ? 256 : image.numColors(); unsigned char *segTbl = new unsigned char[segColors]; int pixels = image.depth() > 8 ? image.width()*image.height() : @@ -637,15 +631,13 @@ QImage& OImageEffect::intensity(QImage &image, float percent) } QImage& OImageEffect::channelIntensity(QImage &image, float percent, RGBComponent channel) { if (image.width() == 0 || image.height() == 0) { -#ifndef NDEBUG - cerr << "WARNING: OImageEffect::channelIntensity : invalid image\n"; -#endif + qDebug( "WARNING: OImageEffect::channelIntensity : invalid image" ); return image; } int segColors = image.depth() > 8 ? 256 : image.numColors(); unsigned char *segTbl = new unsigned char[segColors]; int pixels = image.depth() > 8 ? image.width()*image.height() : @@ -729,15 +721,13 @@ QImage& OImageEffect::channelIntensity(QImage &image, float percent, // QImage& OImageEffect::modulate(QImage &image, QImage &modImage, bool reverse, ModulationType type, int factor, RGBComponent channel) { if (image.width() == 0 || image.height() == 0 || modImage.width() == 0 || modImage.height() == 0) { -#ifndef NDEBUG - cerr << "WARNING: OImageEffect::modulate : invalid image\n"; -#endif + qDebug( "WARNING: OImageEffect::modulate : invalid image" ); return image; } int r, g, b, h, s, v, a; QColor clr; int mod=0; @@ -860,15 +850,13 @@ QImage& OImageEffect::modulate(QImage &image, QImage &modImage, bool reverse, QImage& OImageEffect::blend(const QColor& clr, QImage& dst, float opacity) { if (dst.width() <= 0 || dst.height() <= 0) return dst; if (opacity < 0.0 || opacity > 1.0) { -#ifndef NDEBUG - cerr << "WARNING: OImageEffect::blend : invalid opacity. Range [0, 1]\n"; -#endif + qDebug( "WARNING: OImageEffect::blend : invalid opacity. Range [0, 1] "); return dst; } int depth = dst.depth(); if (depth != 32) dst = dst.convertDepth(32); @@ -905,22 +893,18 @@ QImage& OImageEffect::blend(QImage& src, QImage& dst, float opacity) if (src.width() <= 0 || src.height() <= 0) return dst; if (dst.width() <= 0 || dst.height() <= 0) return dst; if (src.width() != dst.width() || src.height() != dst.height()) { -#ifndef NDEBUG - cerr << "WARNING: OImageEffect::blend : src and destination images are not the same size\n"; -#endif + qDebug( "WARNING: OImageEffect::blend : src and destination images are not the same size" ); return dst; } if (opacity < 0.0 || opacity > 1.0) { -#ifndef NDEBUG - cerr << "WARNING: OImageEffect::blend : invalid opacity. Range [0, 1]\n"; -#endif + qDebug( "WARNING: OImageEffect::blend : invalid opacity. Range [0, 1]" ); return dst; } if (src.depth() != 32) src = src.convertDepth(32); if (dst.depth() != 32) dst = dst.convertDepth(32); @@ -954,15 +938,13 @@ QImage& OImageEffect::blend(QImage& src, QImage& dst, float opacity) QImage& OImageEffect::blend(QImage &image, float initial_intensity, const QColor &bgnd, GradientType eff, bool anti_dir) { if (image.width() == 0 || image.height() == 0 || image.depth()!=32 ) { -#ifndef NDEBUG - cerr << "WARNING: OImageEffect::blend : invalid image\n"; -#endif + qDebug( "WARNING: OImageEffect::blend : invalid image" ); return image; } int r_bgnd = bgnd.red(), g_bgnd = bgnd.green(), b_bgnd = bgnd.blue(); int r, g, b; int ind; @@ -1149,15 +1131,13 @@ QImage& OImageEffect::blend(QImage &image, float initial_intensity, if (b > 255) b = 255; if (b < 0 ) b = 0; a = qAlpha(data[ind]); data[ind] = qRgba(r, g, b, a); } } } -#ifndef NDEBUG - else cerr << "OImageEffect::blend effect not implemented" << endl; -#endif + else qDebug( "OImageEffect::blend effect not implemented" ); return image; } // Not very efficient as we create a third big image... // QImage& OImageEffect::blend(QImage &image1, QImage &image2, @@ -1181,15 +1161,13 @@ QImage& OImageEffect::blend(QImage &image1, QImage &image2, QImage& OImageEffect::blend(QImage &image1, QImage &image2, QImage &blendImage, RGBComponent channel) { if (image1.width() == 0 || image1.height() == 0 || image2.width() == 0 || image2.height() == 0 || blendImage.width() == 0 || blendImage.height() == 0) { -#ifndef NDEBUG - cerr << "OImageEffect::blend effect invalid image" << endl; -#endif + qDebug( "OImageEffect::blend effect invalid image" ); return image1; } int r, g, b; int ind1, ind2, ind3; @@ -1281,15 +1259,13 @@ unsigned int OImageEffect::uHash(unsigned int c) // ----------------------------------------------------------------------------- QImage& OImageEffect::hash(QImage &image, Lighting lite, unsigned int spacing) { if (image.width() == 0 || image.height() == 0) { -#ifndef NDEBUG - cerr << "OImageEffect::hash effect invalid image" << endl; -#endif + qDebug( "OImageEffect::hash effect invalid image" ); return image; } register int x, y; unsigned int *data = (unsigned int *)image.bits(); unsigned int ind; @@ -1791,15 +1767,13 @@ bool OImageEffect::blend( upper.width() > lower.width() || upper.height() > lower.height() || upper.depth() != 32 || lower.depth() != 32 ) { -#ifndef NDEBUG - cerr << "OImageEffect::blend : Sizes not correct\n" ; -#endif + qDebug( "OImageEffect::blend : Sizes not correct" ); return false; } output = lower.copy(); register uchar *i, *o; |