summaryrefslogtreecommitdiffstats
path: root/src/misc.cpp
diff options
context:
space:
mode:
authorMavridis Philippe <[email protected]>2021-06-25 19:05:29 +0300
committerMavridis Philippe <[email protected]>2021-06-25 19:15:54 +0300
commita26e231b46ac6433f6500ddc9ed6b466cf38cc21 (patch)
treeeca43ec26318abfef06040103c74ccd6f1ac02eb /src/misc.cpp
parentd5914d4d3223d1bca7b1b845a229af9f30466189 (diff)
downloadtwin-style-suse2-a26e231b46ac6433f6500ddc9ed6b466cf38cc21.tar.gz
twin-style-suse2-a26e231b46ac6433f6500ddc9ed6b466cf38cc21.zip
Conversion Qt3→TQt
Signed-off-by: Mavridis Philippe <[email protected]>
Diffstat (limited to 'src/misc.cpp')
-rw-r--r--src/misc.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/misc.cpp b/src/misc.cpp
index 966f7b1..9963407 100644
--- a/src/misc.cpp
+++ b/src/misc.cpp
@@ -24,13 +24,13 @@
#include <kpixmap.h>
#include <kpixmapeffect.h>
-#include <qcolor.h>
-#include <qimage.h>
-#include <qpainter.h>
+#include <tqcolor.h>
+#include <tqimage.h>
+#include <tqpainter.h>
#include "misc.h"
-QColor hsvRelative(QColor& baseColor, int relativeH, int relativeS, int relativeV)
+TQColor hsvRelative(TQColor& baseColor, int relativeH, int relativeS, int relativeV)
{
int h, s, v;
baseColor.hsv(&h, &s, &v);
@@ -46,38 +46,38 @@ QColor hsvRelative(QColor& baseColor, int relativeH, int relativeS, int relative
if(v < 0) { v = 0; }
else if(v > 255) { v = 255; }
- QColor c;
+ TQColor c;
c.setHsv( h, s, v );
return c;
}
-QColor alphaBlendColors(const QColor &bgColor, const QColor &fgColor, const int a)
+TQColor alphaBlendColors(const TQColor &bgColor, const TQColor &fgColor, const int a)
{
// normal button...
- QRgb rgb = bgColor.rgb();
- QRgb rgb_b = fgColor.rgb();
+ TQRgb rgb = bgColor.rgb();
+ TQRgb rgb_b = fgColor.rgb();
int alpha = a;
if(alpha>255) alpha = 255;
if(alpha<0) alpha = 0;
int inv_alpha = 255 - alpha;
- QColor result = QColor( qRgb(qRed(rgb_b)*inv_alpha/255 + qRed(rgb)*alpha/255,
- qGreen(rgb_b)*inv_alpha/255 + qGreen(rgb)*alpha/255,
- qBlue(rgb_b)*inv_alpha/255 + qBlue(rgb)*alpha/255) );
+ TQColor result = TQColor( tqRgb(tqRed(rgb_b)*inv_alpha/255 + tqRed(rgb)*alpha/255,
+ tqGreen(rgb_b)*inv_alpha/255 + tqGreen(rgb)*alpha/255,
+ tqBlue(rgb_b)*inv_alpha/255 + tqBlue(rgb)*alpha/255) );
return result;
}
-QImage recolorImage(QImage *img, QColor color) {
- QImage destImg(img->width(),img->height(),32);
+TQImage recolorImage(TQImage *img, TQColor color) {
+ TQImage destImg(img->width(),img->height(),32);
destImg.setAlphaBuffer(true);
for (int x = 0; x < img->width(); x++) {
for (int y = 0; y < img->height(); y++) {
- if(img->pixel(x,y) == qRgb(0,0,0)) {
+ if(img->pixel(x,y) == tqRgb(0,0,0)) {
destImg.setPixel(x,y,color.rgb() ); // set to the new color
} else {
- destImg.setPixel(x,y,qRgba(0,0,0,0) ); // set transparent...
+ destImg.setPixel(x,y,tqRgba(0,0,0,0) ); // set transparent...
}
}
}