diff options
Diffstat (limited to 'krita/core/kis_rotate_visitor.cc')
-rw-r--r-- | krita/core/kis_rotate_visitor.cc | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/krita/core/kis_rotate_visitor.cc b/krita/core/kis_rotate_visitor.cc index 4e703633..2a8bfd45 100644 --- a/krita/core/kis_rotate_visitor.cc +++ b/krita/core/kis_rotate_visitor.cc @@ -16,9 +16,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <math.h> -#include <qapplication.h> -#include <qwmatrix.h> -#include <qrect.h> +#include <tqapplication.h> +#include <tqwmatrix.h> +#include <tqrect.h> #include <kdebug.h> #include <klocale.h> @@ -37,7 +37,7 @@ void KisRotateVisitor::rotate(double angle, bool rotateAboutImageCentre, KisProg if (rotateAboutImageCentre) { centreOfRotation = KisPoint(m_dev->image()->width() / 2.0, m_dev->image()->height() / 2.0); } else { - QRect r = m_dev->exactBounds(); + TQRect r = m_dev->exactBounds(); centreOfRotation = KisPoint(r.x() + (r.width() / 2.0), r.y() + (r.height() / 2.0)); } @@ -54,7 +54,7 @@ void KisRotateVisitor::rotate(double angle, bool rotateAboutImageCentre, KisProg } KisPainter p(m_dev); - QRect r = rotated->extent(); + TQRect r = rotated->extent(); // OVER ipv COPY p.bitBlt(r.x(), r.y(), COMPOSITE_OVER, rotated, OPACITY_OPAQUE, r.x(), r.y(), r.width(), r.height()); @@ -69,7 +69,7 @@ void KisRotateVisitor::shear(double angleX, double angleY, KisProgressDisplayInt double thetaY = angleY * pi / 180; double shearY = tan(thetaY); - QRect r = m_dev->exactBounds(); + TQRect r = m_dev->exactBounds(); const int xShearSteps = r.height(); const int yShearSteps = r.width(); @@ -115,11 +115,11 @@ KisPaintDeviceSP KisRotateVisitor::rotateRight90(KisPaintDeviceSP src) dst->setX(src->getX()); dst->setY(src->getY()); - Q_INT32 pixelSize = src->pixelSize(); - QRect r = src->exactBounds(); - Q_INT32 x = 0; + TQ_INT32 pixelSize = src->pixelSize(); + TQRect r = src->exactBounds(); + TQ_INT32 x = 0; - for (Q_INT32 y = r.bottom(); y >= r.top(); --y) { + for (TQ_INT32 y = r.bottom(); y >= r.top(); --y) { KisHLineIteratorPixel hit = src->createHLineIterator(r.x(), y, r.width(), false); KisVLineIterator vit = dst->createVLineIterator(-y, r.x(), r.width(), true); @@ -141,11 +141,11 @@ KisPaintDeviceSP KisRotateVisitor::rotateLeft90(KisPaintDeviceSP src) { KisPaintDeviceSP dst = new KisPaintDevice(src->colorSpace(), "rotateleft90"); - Q_INT32 pixelSize = src->pixelSize(); - QRect r = src->exactBounds(); - Q_INT32 x = 0; + TQ_INT32 pixelSize = src->pixelSize(); + TQRect r = src->exactBounds(); + TQ_INT32 x = 0; - for (Q_INT32 y = r.top(); y <= r.bottom(); ++y) { + for (TQ_INT32 y = r.top(); y <= r.bottom(); ++y) { // Read the horizontal line from back to front, write onto the vertical column KisHLineIteratorPixel hit = src->createHLineIterator(r.x(), y, r.width(), false); KisVLineIterator vit = dst->createVLineIterator(y, -r.x() - r.width(), r.width(), true); @@ -171,10 +171,10 @@ KisPaintDeviceSP KisRotateVisitor::rotate180(KisPaintDeviceSP src) dst->setX(src->getX()); dst->setY(src->getY()); - Q_INT32 pixelSize = src->pixelSize(); - QRect r = src->exactBounds(); + TQ_INT32 pixelSize = src->pixelSize(); + TQRect r = src->exactBounds(); - for (Q_INT32 y = r.top(); y <= r.bottom(); ++y) { + for (TQ_INT32 y = r.top(); y <= r.bottom(); ++y) { KisHLineIteratorPixel srcIt = src->createHLineIterator(r.x(), y, r.width(), false); KisHLineIterator dstIt = dst->createHLineIterator( -r.x() - r.width(), -y, r.width(), true); @@ -202,7 +202,7 @@ KisPaintDeviceSP KisRotateVisitor::rotate(KisPaintDeviceSP src, double angle, Ki angle = angle + 360; } - QRect r = src->exactBounds(); + TQRect r = src->exactBounds(); const int xShearSteps = r.height(); const int yShearSteps = r.width(); @@ -265,8 +265,8 @@ KisPaintDeviceSP KisRotateVisitor::rotate(KisPaintDeviceSP src, double angle, Ki centreOfRotation.x() * cosAngle - centreOfRotation.y() * sinAngle, centreOfRotation.x() * sinAngle + centreOfRotation.y() * cosAngle); - dst->setX((Q_INT32)(dst->getX() + centreOfRotation.x() - rotatedCentreOfRotation.x())); - dst->setY((Q_INT32)(dst->getY() + centreOfRotation.y() - rotatedCentreOfRotation.y())); + dst->setX((TQ_INT32)(dst->getX() + centreOfRotation.x() - rotatedCentreOfRotation.x())); + dst->setY((TQ_INT32)(dst->getY() + centreOfRotation.y() - rotatedCentreOfRotation.y())); setProgressDone(); @@ -279,23 +279,23 @@ KisPaintDeviceSP KisRotateVisitor::xShear(KisPaintDeviceSP src, double shearX) dst->setX(src->getX()); dst->setY(src->getY()); - QRect r = src->exactBounds(); + TQRect r = src->exactBounds(); double displacement; - Q_INT32 displacementInt; + TQ_INT32 displacementInt; double weight; - for (Q_INT32 y = r.top(); y <= r.bottom(); y++) { + for (TQ_INT32 y = r.top(); y <= r.bottom(); y++) { //calculate displacement displacement = -y * shearX; - displacementInt = (Q_INT32)(floor(displacement)); + displacementInt = (TQ_INT32)(floor(displacement)); weight = displacement - displacementInt; - Q_UINT8 pixelWeights[2]; + TQ_UINT8 pixelWeights[2]; - pixelWeights[0] = static_cast<Q_UINT8>(weight * 255 + 0.5); + pixelWeights[0] = static_cast<TQ_UINT8>(weight * 255 + 0.5); pixelWeights[1] = 255 - pixelWeights[0]; KisHLineIteratorPixel srcIt = src->createHLineIterator(r.x(), y, r.width() + 1, false); @@ -304,7 +304,7 @@ KisPaintDeviceSP KisRotateVisitor::xShear(KisPaintDeviceSP src, double shearX) while (!srcIt.isDone()) { - const Q_UINT8 *pixelPtrs[2]; + const TQ_UINT8 *pixelPtrs[2]; pixelPtrs[0] = leftSrcIt.rawData(); pixelPtrs[1] = srcIt.rawData(); @@ -327,23 +327,23 @@ KisPaintDeviceSP KisRotateVisitor::yShear(KisPaintDeviceSP src, double shearY) dst->setX(src->getX()); dst->setY(src->getY()); - QRect r = src->exactBounds(); + TQRect r = src->exactBounds(); double displacement; - Q_INT32 displacementInt; + TQ_INT32 displacementInt; double weight; - for (Q_INT32 x = r.left(); x <= r.right(); x++) { + for (TQ_INT32 x = r.left(); x <= r.right(); x++) { //calculate displacement displacement = x * shearY; - displacementInt = (Q_INT32)(floor(displacement)); + displacementInt = (TQ_INT32)(floor(displacement)); weight = displacement - displacementInt; - Q_UINT8 pixelWeights[2]; + TQ_UINT8 pixelWeights[2]; - pixelWeights[0] = static_cast<Q_UINT8>(weight * 255 + 0.5); + pixelWeights[0] = static_cast<TQ_UINT8>(weight * 255 + 0.5); pixelWeights[1] = 255 - pixelWeights[0]; KisVLineIteratorPixel srcIt = src->createVLineIterator(x, r.y(), r.height() + 1, false); @@ -352,7 +352,7 @@ KisPaintDeviceSP KisRotateVisitor::yShear(KisPaintDeviceSP src, double shearY) while (!srcIt.isDone()) { - const Q_UINT8 *pixelPtrs[2]; + const TQ_UINT8 *pixelPtrs[2]; pixelPtrs[0] = leftSrcIt.rawData(); pixelPtrs[1] = srcIt.rawData(); @@ -369,7 +369,7 @@ KisPaintDeviceSP KisRotateVisitor::yShear(KisPaintDeviceSP src, double shearY) return dst; } -void KisRotateVisitor::initProgress(Q_INT32 totalSteps) +void KisRotateVisitor::initProgress(TQ_INT32 totalSteps) { if (!m_progress) return; @@ -388,7 +388,7 @@ void KisRotateVisitor::incrementProgress() if (!m_progress) return; m_progressStep++; - Q_INT32 progressPerCent = (m_progressStep * 100) / m_progressTotalSteps; + TQ_INT32 progressPerCent = (m_progressStep * 100) / m_progressTotalSteps; if (progressPerCent != m_lastProgressPerCent) { m_lastProgressPerCent = progressPerCent; |