diff options
Diffstat (limited to 'src/gui/general/PixmapFunctions.cpp')
-rw-r--r-- | src/gui/general/PixmapFunctions.cpp | 114 |
1 files changed, 57 insertions, 57 deletions
diff --git a/src/gui/general/PixmapFunctions.cpp b/src/gui/general/PixmapFunctions.cpp index d297dad..f61ff11 100644 --- a/src/gui/general/PixmapFunctions.cpp +++ b/src/gui/general/PixmapFunctions.cpp @@ -25,11 +25,11 @@ #include "PixmapFunctions.h" -#include <qbitmap.h> -#include <qcolor.h> -#include <qimage.h> -#include <qpainter.h> -#include <qpixmap.h> +#include <tqbitmap.h> +#include <tqcolor.h> +#include <tqimage.h> +#include <tqpainter.h> +#include <tqpixmap.h> #include <iostream> @@ -37,10 +37,10 @@ namespace Rosegarden { QBitmap -PixmapFunctions::generateMask(const QPixmap &map, const QRgb &px) +PixmapFunctions::generateMask(const TQPixmap &map, const QRgb &px) { - QImage i(map.convertToImage()); - QImage im(i.width(), i.height(), 1, 2, QImage::LittleEndian); + TQImage i(map.convertToImage()); + TQImage im(i.width(), i.height(), 1, 2, TQImage::LittleEndian); for (int y = 0; y < i.height(); ++y) { for (int x = 0; x < i.width(); ++x) { @@ -52,16 +52,16 @@ PixmapFunctions::generateMask(const QPixmap &map, const QRgb &px) } } - QBitmap m; + TQBitmap m; m.convertFromImage(im); return m; } QBitmap -PixmapFunctions::generateMask(const QPixmap &map) +PixmapFunctions::generateMask(const TQPixmap &map) { - QImage i(map.convertToImage()); - QImage im(i.width(), i.height(), 1, 2, QImage::LittleEndian); + TQImage i(map.convertToImage()); + TQImage im(i.width(), i.height(), 1, 2, TQImage::LittleEndian); QRgb px0(i.pixel(0, 0)); QRgb px1(i.pixel(i.width() - 1, 0)); @@ -82,18 +82,18 @@ PixmapFunctions::generateMask(const QPixmap &map) } } - QBitmap m; + TQBitmap m; m.convertFromImage(im); return m; } QPixmap -PixmapFunctions::colourPixmap(const QPixmap &map, int hue, int minValue) +PixmapFunctions::colourPixmap(const TQPixmap &map, int hue, int minValue) { // assumes pixmap is currently in shades of grey; maps black -> // solid colour and greys -> shades of colour - QImage image = map.convertToImage(); + TQImage image = map.convertToImage(); int s, v; @@ -102,7 +102,7 @@ PixmapFunctions::colourPixmap(const QPixmap &map, int hue, int minValue) for (int y = 0; y < image.height(); ++y) { for (int x = 0; x < image.width(); ++x) { - QColor pixel(image.pixel(x, y)); + TQColor pixel(image.pixel(x, y)); int oldHue; pixel.hsv(&oldHue, &s, &v); @@ -118,59 +118,59 @@ PixmapFunctions::colourPixmap(const QPixmap &map, int hue, int minValue) } image.setPixel - (x, y, QColor(hue, + (x, y, TQColor(hue, 255 - v, v > minValue ? v : minValue, - QColor::Hsv).rgb()); + TQColor::Hsv).rgb()); } } - QPixmap rmap; + TQPixmap rmap; rmap.convertFromImage(image); - if (map.mask()) - rmap.setMask(*map.mask()); + if (map.tqmask()) + rmap.setMask(*map.tqmask()); return rmap; } QPixmap -PixmapFunctions::shadePixmap(const QPixmap &map) +PixmapFunctions::shadePixmap(const TQPixmap &map) { - QImage image = map.convertToImage(); + TQImage image = map.convertToImage(); int h, s, v; for (int y = 0; y < image.height(); ++y) { for (int x = 0; x < image.width(); ++x) { - QColor pixel(image.pixel(x, y)); + TQColor pixel(image.pixel(x, y)); pixel.hsv(&h, &s, &v); image.setPixel - (x, y, QColor(h, + (x, y, TQColor(h, s, 255 - ((255 - v) / 2), - QColor::Hsv).rgb()); + TQColor::Hsv).rgb()); } } - QPixmap rmap; + TQPixmap rmap; rmap.convertFromImage(image); - if (map.mask()) - rmap.setMask(*map.mask()); + if (map.tqmask()) + rmap.setMask(*map.tqmask()); return rmap; } QPixmap -PixmapFunctions::flipVertical(const QPixmap &map) +PixmapFunctions::flipVertical(const TQPixmap &map) { - QPixmap rmap; - QImage i(map.convertToImage()); + TQPixmap rmap; + TQImage i(map.convertToImage()); rmap.convertFromImage(i.mirror(false, true)); - if (map.mask()) { - QImage im(map.mask()->convertToImage()); - QBitmap newMask; + if (map.tqmask()) { + TQImage im(map.tqmask()->convertToImage()); + TQBitmap newMask; newMask.convertFromImage(im.mirror(false, true)); rmap.setMask(newMask); } @@ -179,15 +179,15 @@ PixmapFunctions::flipVertical(const QPixmap &map) } QPixmap -PixmapFunctions::flipHorizontal(const QPixmap &map) +PixmapFunctions::flipHorizontal(const TQPixmap &map) { - QPixmap rmap; - QImage i(map.convertToImage()); + TQPixmap rmap; + TQImage i(map.convertToImage()); rmap.convertFromImage(i.mirror(true, false)); - if (map.mask()) { - QImage im(map.mask()->convertToImage()); - QBitmap newMask; + if (map.tqmask()) { + TQImage im(map.tqmask()->convertToImage()); + TQBitmap newMask; newMask.convertFromImage(im.mirror(true, false)); rmap.setMask(newMask); } @@ -195,23 +195,23 @@ PixmapFunctions::flipHorizontal(const QPixmap &map) return rmap; } -std::pair<QPixmap, QPixmap> -PixmapFunctions::splitPixmap(const QPixmap &pixmap, int x) +std::pair<TQPixmap, TQPixmap> +PixmapFunctions::splitPixmap(const TQPixmap &pixmap, int x) { - QPixmap left(x, pixmap.height(), pixmap.depth()); - QBitmap leftMask(left.width(), left.height()); + TQPixmap left(x, pixmap.height(), pixmap.depth()); + TQBitmap leftMask(left.width(), left.height()); - QPixmap right(pixmap.width() - x, pixmap.height(), pixmap.depth()); - QBitmap rightMask(right.width(), right.height()); + TQPixmap right(pixmap.width() - x, pixmap.height(), pixmap.depth()); + TQBitmap rightMask(right.width(), right.height()); - QPainter paint; + TQPainter paint; paint.begin(&left); paint.drawPixmap(0, 0, pixmap, 0, 0, left.width(), left.height()); paint.end(); paint.begin(&leftMask); - paint.drawPixmap(0, 0, *pixmap.mask(), 0, 0, left.width(), left.height()); + paint.drawPixmap(0, 0, *pixmap.tqmask(), 0, 0, left.width(), left.height()); paint.end(); left.setMask(leftMask); @@ -221,23 +221,23 @@ PixmapFunctions::splitPixmap(const QPixmap &pixmap, int x) paint.end(); paint.begin(&rightMask); - paint.drawPixmap(0, 0, *pixmap.mask(), left.width(), 0, right.width(), right.height()); + paint.drawPixmap(0, 0, *pixmap.tqmask(), left.width(), 0, right.width(), right.height()); paint.end(); right.setMask(rightMask); - return std::pair<QPixmap, QPixmap>(left, right); + return std::pair<TQPixmap, TQPixmap>(left, right); } void -PixmapFunctions::drawPixmapMasked(QPixmap &dest, QBitmap &destMask, +PixmapFunctions::drawPixmapMasked(TQPixmap &dest, TQBitmap &destMask, int x0, int y0, - const QPixmap &src) + const TQPixmap &src) { - QImage idp(dest.convertToImage()); - QImage idm(destMask.convertToImage()); - QImage isp(src.convertToImage()); - QImage ism(src.mask()->convertToImage()); + TQImage idp(dest.convertToImage()); + TQImage idm(destMask.convertToImage()); + TQImage isp(src.convertToImage()); + TQImage ism(src.tqmask()->convertToImage()); for (int y = 0; y < isp.height(); ++y) { for (int x = 0; x < isp.width(); ++x) { |