diff options
Diffstat (limited to 'krita/core/kis_painter.cc')
-rw-r--r-- | krita/core/kis_painter.cc | 176 |
1 files changed, 88 insertions, 88 deletions
diff --git a/krita/core/kis_painter.cc b/krita/core/kis_painter.cc index 8086696f..b8353918 100644 --- a/krita/core/kis_painter.cc +++ b/krita/core/kis_painter.cc @@ -26,19 +26,19 @@ #include <climits> #include <strings.h> -#include "qbrush.h" -#include "qfontinfo.h" -#include "qfontmetrics.h" -#include "qpen.h" -#include "qregion.h" -#include "qwmatrix.h" -#include <qimage.h> -#include <qmap.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qpointarray.h> -#include <qrect.h> -#include <qstring.h> +#include "tqbrush.h" +#include "tqfontinfo.h" +#include "tqfontmetrics.h" +#include "tqpen.h" +#include "tqregion.h" +#include "tqwmatrix.h" +#include <tqimage.h> +#include <tqmap.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqpointarray.h> +#include <tqrect.h> +#include <tqstring.h> #include <kdebug.h> #include <kcommand.h> @@ -121,7 +121,7 @@ KCommand *KisPainter::end() return endTransaction(); } -void KisPainter::beginTransaction(const QString& customName) +void KisPainter::beginTransaction(const TQString& customName) { if (m_transaction) delete m_transaction; @@ -145,24 +145,24 @@ KCommand *KisPainter::endTransaction() } -QRect KisPainter::dirtyRect() { - QRect r = m_dirtyRect; - m_dirtyRect = QRect(); +TQRect KisPainter::dirtyRect() { + TQRect r = m_dirtyRect; + m_dirtyRect = TQRect(); return r; } -void KisPainter::bitBlt(Q_INT32 dx, Q_INT32 dy, +void KisPainter::bitBlt(TQ_INT32 dx, TQ_INT32 dy, const KisCompositeOp& op, KisPaintDeviceSP srcdev, - Q_UINT8 opacity, - Q_INT32 sx, Q_INT32 sy, - Q_INT32 sw, Q_INT32 sh) + TQ_UINT8 opacity, + TQ_INT32 sx, TQ_INT32 sy, + TQ_INT32 sw, TQ_INT32 sh) { if (srcdev == 0) { return; } - QRect srcRect = QRect(sx, sy, sw, sh); + TQRect srcRect = TQRect(sx, sy, sw, sh); if (srcdev->extentIsValid() && op != COMPOSITE_COPY) { srcRect &= srcdev->extent(); @@ -180,42 +180,42 @@ void KisPainter::bitBlt(Q_INT32 dx, Q_INT32 dy, sw = srcRect.width(); sh = srcRect.height(); - addDirtyRect(QRect(dx, dy, sw, sh)); + addDirtyRect(TQRect(dx, dy, sw, sh)); KisColorSpace * srcCs = srcdev->colorSpace(); - Q_INT32 dstY = dy; - Q_INT32 srcY = sy; - Q_INT32 rowsRemaining = sh; + TQ_INT32 dstY = dy; + TQ_INT32 srcY = sy; + TQ_INT32 rowsRemaining = sh; while (rowsRemaining > 0) { - Q_INT32 dstX = dx; - Q_INT32 srcX = sx; - Q_INT32 columnsRemaining = sw; - Q_INT32 numContiguousDstRows = m_device->numContiguousRows(dstY, dstX, dstX + sw - 1); - Q_INT32 numContiguousSrcRows = srcdev->numContiguousRows(srcY, srcX, srcX + sw - 1); + TQ_INT32 dstX = dx; + TQ_INT32 srcX = sx; + TQ_INT32 columnsRemaining = sw; + TQ_INT32 numContiguousDstRows = m_device->numContiguousRows(dstY, dstX, dstX + sw - 1); + TQ_INT32 numContiguousSrcRows = srcdev->numContiguousRows(srcY, srcX, srcX + sw - 1); - Q_INT32 rows = QMIN(numContiguousDstRows, numContiguousSrcRows); - rows = QMIN(rows, rowsRemaining); + TQ_INT32 rows = TQMIN(numContiguousDstRows, numContiguousSrcRows); + rows = TQMIN(rows, rowsRemaining); while (columnsRemaining > 0) { - Q_INT32 numContiguousDstColumns = m_device->numContiguousColumns(dstX, dstY, dstY + rows - 1); - Q_INT32 numContiguousSrcColumns = srcdev->numContiguousColumns(srcX, srcY, srcY + rows - 1); + TQ_INT32 numContiguousDstColumns = m_device->numContiguousColumns(dstX, dstY, dstY + rows - 1); + TQ_INT32 numContiguousSrcColumns = srcdev->numContiguousColumns(srcX, srcY, srcY + rows - 1); - Q_INT32 columns = QMIN(numContiguousDstColumns, numContiguousSrcColumns); - columns = QMIN(columns, columnsRemaining); + TQ_INT32 columns = TQMIN(numContiguousDstColumns, numContiguousSrcColumns); + columns = TQMIN(columns, columnsRemaining); - Q_INT32 srcRowStride = srcdev->rowStride(srcX, srcY); - //const Q_UINT8 *srcData = srcdev->pixel(srcX, srcY); + TQ_INT32 srcRowStride = srcdev->rowStride(srcX, srcY); + //const TQ_UINT8 *srcData = srcdev->pixel(srcX, srcY); KisHLineIteratorPixel srcIt = srcdev->createHLineIterator(srcX, srcY, columns, false); - const Q_UINT8 *srcData = srcIt.rawData(); + const TQ_UINT8 *srcData = srcIt.rawData(); - //Q_UINT8 *dstData = m_device->writablePixel(dstX, dstY); - Q_INT32 dstRowStride = m_device->rowStride(dstX, dstY); + //TQ_UINT8 *dstData = m_device->writablePixel(dstX, dstY); + TQ_INT32 dstRowStride = m_device->rowStride(dstX, dstY); KisHLineIteratorPixel dstIt = m_device->createHLineIterator(dstX, dstY, columns, true); - Q_UINT8 *dstData = dstIt.rawData(); + TQ_UINT8 *dstData = dstIt.rawData(); m_colorSpace->bitBlt(dstData, @@ -241,16 +241,16 @@ void KisPainter::bitBlt(Q_INT32 dx, Q_INT32 dy, } } -void KisPainter::bltSelection(Q_INT32 dx, Q_INT32 dy, +void KisPainter::bltSelection(TQ_INT32 dx, TQ_INT32 dy, const KisCompositeOp &op, KisPaintDeviceSP srcdev, KisSelectionSP seldev, - Q_UINT8 opacity, - Q_INT32 sx, Q_INT32 sy, - Q_INT32 sw, Q_INT32 sh) + TQ_UINT8 opacity, + TQ_INT32 sx, TQ_INT32 sy, + TQ_INT32 sw, TQ_INT32 sh) { // Better use a probablistic method than a too slow one - if (seldev->isProbablyTotallyUnselected(QRect(dx, dy, sw, sh))) { + if (seldev->isProbablyTotallyUnselected(TQRect(dx, dy, sw, sh))) { /* kdDebug() << "Blitting outside selection rect\n"; @@ -264,13 +264,13 @@ void KisPainter::bltSelection(Q_INT32 dx, Q_INT32 dy, bltMask(dx,dy,op,srcdev,seldev.data(),opacity,sx,sy,sw,sh); } -void KisPainter::bltMask(Q_INT32 dx, Q_INT32 dy, +void KisPainter::bltMask(TQ_INT32 dx, TQ_INT32 dy, const KisCompositeOp &op, KisPaintDeviceSP srcdev, KisPaintDeviceSP seldev, - Q_UINT8 opacity, - Q_INT32 sx, Q_INT32 sy, - Q_INT32 sw, Q_INT32 sh) + TQ_UINT8 opacity, + TQ_INT32 sx, TQ_INT32 sy, + TQ_INT32 sw, TQ_INT32 sh) { if (srcdev == 0) return; @@ -280,7 +280,7 @@ void KisPainter::bltMask(Q_INT32 dx, Q_INT32 dy, if (m_device == 0) return; - QRect srcRect = QRect(sx, sy, sw, sh); + TQRect srcRect = TQRect(sx, sy, sw, sh); if (srcdev->extentIsValid() && op != COMPOSITE_COPY) { srcRect &= srcdev->extent(); @@ -298,51 +298,51 @@ void KisPainter::bltMask(Q_INT32 dx, Q_INT32 dy, sw = srcRect.width(); sh = srcRect.height(); - addDirtyRect(QRect(dx, dy, sw, sh)); + addDirtyRect(TQRect(dx, dy, sw, sh)); KisColorSpace * srcCs = srcdev->colorSpace(); - Q_INT32 dstY = dy; - Q_INT32 srcY = sy; - Q_INT32 rowsRemaining = sh; + TQ_INT32 dstY = dy; + TQ_INT32 srcY = sy; + TQ_INT32 rowsRemaining = sh; while (rowsRemaining > 0) { - Q_INT32 dstX = dx; - Q_INT32 srcX = sx; - Q_INT32 columnsRemaining = sw; - Q_INT32 numContiguousDstRows = m_device->numContiguousRows(dstY, dstX, dstX + sw - 1); - Q_INT32 numContiguousSrcRows = srcdev->numContiguousRows(srcY, srcX, srcX + sw - 1); - Q_INT32 numContiguousSelRows = seldev->numContiguousRows(dstY, dstX, dstX + sw - 1); + TQ_INT32 dstX = dx; + TQ_INT32 srcX = sx; + TQ_INT32 columnsRemaining = sw; + TQ_INT32 numContiguousDstRows = m_device->numContiguousRows(dstY, dstX, dstX + sw - 1); + TQ_INT32 numContiguousSrcRows = srcdev->numContiguousRows(srcY, srcX, srcX + sw - 1); + TQ_INT32 numContiguousSelRows = seldev->numContiguousRows(dstY, dstX, dstX + sw - 1); - Q_INT32 rows = QMIN(numContiguousDstRows, numContiguousSrcRows); - rows = QMIN(numContiguousSelRows, rows); - rows = QMIN(rows, rowsRemaining); + TQ_INT32 rows = TQMIN(numContiguousDstRows, numContiguousSrcRows); + rows = TQMIN(numContiguousSelRows, rows); + rows = TQMIN(rows, rowsRemaining); while (columnsRemaining > 0) { - Q_INT32 numContiguousDstColumns = m_device->numContiguousColumns(dstX, dstY, dstY + rows - 1); - Q_INT32 numContiguousSrcColumns = srcdev->numContiguousColumns(srcX, srcY, srcY + rows - 1); - Q_INT32 numContiguousSelColumns = seldev->numContiguousColumns(dstX, dstY, dstY + rows - 1); + TQ_INT32 numContiguousDstColumns = m_device->numContiguousColumns(dstX, dstY, dstY + rows - 1); + TQ_INT32 numContiguousSrcColumns = srcdev->numContiguousColumns(srcX, srcY, srcY + rows - 1); + TQ_INT32 numContiguousSelColumns = seldev->numContiguousColumns(dstX, dstY, dstY + rows - 1); - Q_INT32 columns = QMIN(numContiguousDstColumns, numContiguousSrcColumns); - columns = QMIN(numContiguousSelColumns, columns); - columns = QMIN(columns, columnsRemaining); + TQ_INT32 columns = TQMIN(numContiguousDstColumns, numContiguousSrcColumns); + columns = TQMIN(numContiguousSelColumns, columns); + columns = TQMIN(columns, columnsRemaining); - //Q_UINT8 *dstData = m_device->writablePixel(dstX, dstY); - Q_INT32 dstRowStride = m_device->rowStride(dstX, dstY); + //TQ_UINT8 *dstData = m_device->writablePixel(dstX, dstY); + TQ_INT32 dstRowStride = m_device->rowStride(dstX, dstY); KisHLineIteratorPixel dstIt = m_device->createHLineIterator(dstX, dstY, columns, true); - Q_UINT8 *dstData = dstIt.rawData(); + TQ_UINT8 *dstData = dstIt.rawData(); - //const Q_UINT8 *srcData = srcdev->pixel(srcX, srcY); - Q_INT32 srcRowStride = srcdev->rowStride(srcX, srcY); + //const TQ_UINT8 *srcData = srcdev->pixel(srcX, srcY); + TQ_INT32 srcRowStride = srcdev->rowStride(srcX, srcY); KisHLineIteratorPixel srcIt = srcdev->createHLineIterator(srcX, srcY, columns, false); - const Q_UINT8 *srcData = srcIt.rawData(); + const TQ_UINT8 *srcData = srcIt.rawData(); - //const Q_UINT8 *selData = seldev->pixel(dstX, dstY); - Q_INT32 selRowStride = seldev->rowStride(dstX, dstY); + //const TQ_UINT8 *selData = seldev->pixel(dstX, dstY); + TQ_INT32 selRowStride = seldev->rowStride(dstX, dstY); KisHLineIteratorPixel selIt = seldev->createHLineIterator(dstX, dstY, columns, false); - const Q_UINT8 *selData = selIt.rawData(); + const TQ_UINT8 *selData = selIt.rawData(); m_colorSpace->bitBlt(dstData, dstRowStride, @@ -368,12 +368,12 @@ void KisPainter::bltMask(Q_INT32 dx, Q_INT32 dy, } -void KisPainter::bltSelection(Q_INT32 dx, Q_INT32 dy, +void KisPainter::bltSelection(TQ_INT32 dx, TQ_INT32 dy, const KisCompositeOp& op, KisPaintDeviceSP srcdev, - Q_UINT8 opacity, - Q_INT32 sx, Q_INT32 sy, - Q_INT32 sw, Q_INT32 sh) + TQ_UINT8 opacity, + TQ_INT32 sx, TQ_INT32 sy, + TQ_INT32 sw, TQ_INT32 sh) { if (m_device == 0) return; if (!m_device->hasSelection()) { @@ -812,13 +812,13 @@ void KisPainter::fillPolygon(const vKisPoint& points, FillStyle fillStyle) } // Fill the polygon bounding rectangle with the required contents then we'll - // create a mask for the actual polygon coverage. + // create a tqmask for the actual polygon coverage. KisPaintDeviceSP polygon = new KisPaintDevice(m_device->colorSpace(), "polygon"); Q_CHECK_PTR(polygon); KisFillPainter fillPainter(polygon); - QRect boundingRectangle(x0, y0, x1 - x0 + 1, y1 - y0 + 1); + TQRect boundingRectangle(x0, y0, x1 - x0 + 1, y1 - y0 + 1); // Clip to the image bounds. if (m_device->image()) { @@ -899,7 +899,7 @@ void KisPainter::fillPolygon(const vKisPoint& points, FillStyle fillStyle) polygon->applySelectionMask(polygonMask); - QRect r = polygon->extent(); + TQRect r = polygon->extent(); // The strokes for the outline may have already added updated the dirtyrect, but it can't hurt, // and if we're painting without outlines, then there will be no dirty rect. Let's do it ourselves... |