diff options
Diffstat (limited to 'krita/core/kis_convolution_painter.cc')
-rw-r--r-- | krita/core/kis_convolution_painter.cc | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/krita/core/kis_convolution_painter.cc b/krita/core/kis_convolution_painter.cc index cb51480c..c9146527 100644 --- a/krita/core/kis_convolution_painter.cc +++ b/krita/core/kis_convolution_painter.cc @@ -20,25 +20,25 @@ #include <string.h> #include <cfloat> -#include "qbrush.h" -#include "qcolor.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 "tqcolor.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 <klocale.h> -#include <qcolor.h> +#include <tqcolor.h> #include "kis_brush.h" #include "kis_global.h" @@ -56,16 +56,16 @@ #include "kis_convolution_painter.h" -KisKernelSP KisKernel::fromQImage(const QImage& img) +KisKernelSP KisKernel::fromTQImage(const TQImage& img) { KisKernelSP k = new KisKernel; k->width = img.width(); k->height = img.height(); k->offset = 0; uint count = k->width * k->height; - k->data = new Q_INT32[count]; - Q_INT32* itData = k->data; - Q_UINT8* itImg = img.bits(); + k->data = new TQ_INT32[count]; + TQ_INT32* itData = k->data; + TQ_UINT8* itImg = img.bits(); k->factor = 0; for(uint i = 0; i < count; ++i , ++itData, itImg+=4) { @@ -85,14 +85,14 @@ KisConvolutionPainter::KisConvolutionPainter(KisPaintDeviceSP device) : super(de { } -void KisConvolutionPainter::applyMatrix(KisKernelSP kernel, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, +void KisConvolutionPainter::applyMatrix(KisKernelSP kernel, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, KisConvolutionBorderOp borderOp, KisChannelInfo::enumChannelFlags channelFlags ) { // Make the area we cover as small as possible if (m_device->hasSelection()) { - QRect r = m_device->selection()->selectedRect().intersect(QRect(x, y, w, h)); + TQRect r = m_device->selection()->selectedRect().intersect(TQRect(x, y, w, h)); x = r.x(); y = r.y(); w = r.width(); @@ -103,7 +103,7 @@ void KisConvolutionPainter::applyMatrix(KisKernelSP kernel, Q_INT32 x, Q_INT32 y if ( w == 0 && h == 0 ) return; // Determine the kernel's extent from the center pixel - Q_INT32 kw, kh, khalfWidth, khalfHeight, xLastMinuskhw, yLastMinuskhh; + TQ_INT32 kw, kh, khalfWidth, khalfHeight, xLastMinuskhw, yLastMinuskhh; kw = kernel->width; kh = kernel->height; khalfWidth = (kw - 1) / 2; @@ -141,9 +141,9 @@ void KisConvolutionPainter::applyMatrix(KisKernelSP kernel, Q_INT32 x, Q_INT32 y int cacheSize = kw * kh; int cdepth = cs -> pixelSize(); - Q_UINT8** pixelPtrCache = new Q_UINT8*[cacheSize]; + TQ_UINT8** pixelPtrCache = new TQ_UINT8*[cacheSize]; for (int i = 0; i < cacheSize; i++) - pixelPtrCache[i] = new Q_UINT8[cdepth]; + pixelPtrCache[i] = new TQ_UINT8[cdepth]; // pixelPtrCache.fill(0); // row == the y position of the pixel we want to change in the paint device @@ -162,8 +162,8 @@ void KisConvolutionPainter::applyMatrix(KisKernelSP kernel, Q_INT32 x, Q_INT32 y // krow = the y position in the kernel matrix if(needFull) { - Q_INT32 i = 0; - for (Q_INT32 krow = 0; krow < kh; ++krow) { + TQ_INT32 i = 0; + for (TQ_INT32 krow = 0; krow < kh; ++krow) { // col - khalfWidth = the left starting point of the kernel as centered on our pixel // krow - khalfHeight = the offset for the top of the kernel as centered on our pixel @@ -180,14 +180,14 @@ void KisConvolutionPainter::applyMatrix(KisKernelSP kernel, Q_INT32 x, Q_INT32 y needFull = false; Q_ASSERT (i==kw*kh); } else { - for (Q_INT32 krow = 0; krow < kh; ++krow) { // shift the cache to the left - Q_UINT8** d = pixelPtrCache + krow * kw; - //memmove( d, d + 1, (kw-1)*sizeof(Q_UINT8*)); + for (TQ_INT32 krow = 0; krow < kh; ++krow) { // shift the cache to the left + TQ_UINT8** d = pixelPtrCache + krow * kw; + //memmove( d, d + 1, (kw-1)*sizeof(TQ_UINT8*)); for (int i = 0; i < (kw-1); i++) { memcpy(d[i], d[i+1], cdepth); } } - Q_INT32 i = kw - 1; + TQ_INT32 i = kw - 1; KisVLineIteratorPixel kit = m_device->createVLineIterator(col + khalfWidth, row - khalfHeight, kh, false); while (!kit.isDone()) { memcpy(pixelPtrCache[i], kit.oldRawData(), cdepth); @@ -220,7 +220,7 @@ void KisConvolutionPainter::applyMatrix(KisKernelSP kernel, Q_INT32 x, Q_INT32 y } - addDirtyRect(QRect(x, y, w, h)); + addDirtyRect(TQRect(x, y, w, h)); emit notifyProgressDone(); @@ -229,12 +229,12 @@ void KisConvolutionPainter::applyMatrix(KisKernelSP kernel, Q_INT32 x, Q_INT32 y delete[] pixelPtrCache; } -void KisConvolutionPainter::applyMatrixRepeat(KisKernelSP kernel, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, +void KisConvolutionPainter::applyMatrixRepeat(KisKernelSP kernel, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, KisChannelInfo::enumChannelFlags channelFlags) { int lastProgressPercent = 0; // Determine the kernel's extent from the center pixel - Q_INT32 kw, kh, khalfWidth, khalfHeight, xLastMinuskhw, yLastMinuskhh; + TQ_INT32 kw, kh, khalfWidth, khalfHeight, xLastMinuskhw, yLastMinuskhh; kw = kernel->width; kh = kernel->height; khalfWidth = (kw - 1) / 2; @@ -249,9 +249,9 @@ void KisConvolutionPainter::applyMatrixRepeat(KisKernelSP kernel, Q_INT32 x, Q_I int cacheSize = kw * kh; int cdepth = cs -> pixelSize(); - Q_UINT8** pixelPtrCache = new Q_UINT8*[cacheSize]; + TQ_UINT8** pixelPtrCache = new TQ_UINT8*[cacheSize]; for (int i = 0; i < cacheSize; i++) - pixelPtrCache[i] = new Q_UINT8[cdepth]; + pixelPtrCache[i] = new TQ_UINT8[cdepth]; // row == the y position of the pixel we want to change in the paint device int row = y; @@ -264,8 +264,8 @@ void KisConvolutionPainter::applyMatrixRepeat(KisKernelSP kernel, Q_INT32 x, Q_I KisHLineIteratorPixel hit = m_device->createHLineIterator(x, row, w, true); bool needFull = true; - Q_INT32 itStart = row - khalfHeight; - Q_INT32 itH = kh; + TQ_INT32 itStart = row - khalfHeight; + TQ_INT32 itH = kh; if(itStart < 0) { itH += itStart; @@ -281,15 +281,15 @@ void KisConvolutionPainter::applyMatrixRepeat(KisKernelSP kernel, Q_INT32 x, Q_I // krow = the y position in the kernel matrix if(needFull) // The cache has not been fill, so we need to fill it { - Q_INT32 i = 0; - Q_INT32 krow = 0; + TQ_INT32 i = 0; + TQ_INT32 krow = 0; if( row < khalfHeight ) { // We are just outside the layer, all the row in the cache will be identical // so we need to create them only once, and then to copy them if( x < khalfWidth) { // the left pixels are outside of the layer, in the corner - Q_INT32 kcol = 0; + TQ_INT32 kcol = 0; KisHLineIteratorPixel kit = m_device->createHLineIterator(0, 0, kw, false); for(; kcol < (khalfWidth - x) + 1; ++kcol) { // First copy the address of the topleft pixel @@ -318,7 +318,7 @@ void KisConvolutionPainter::applyMatrixRepeat(KisKernelSP kernel, Q_INT32 x, Q_I } i = krow * kw; } - Q_INT32 itH = kh; + TQ_INT32 itH = kh; if(row + khalfHeight > yLastMinuskhh) { itH += yLastMinuskhh - row - khalfHeight; @@ -330,8 +330,8 @@ void KisConvolutionPainter::applyMatrixRepeat(KisKernelSP kernel, Q_INT32 x, Q_I // kw = the width of the kernel // Fill the cache with pointers to the pixels under the kernel - Q_INT32 itHStart = col - khalfWidth; - Q_INT32 itW = kw; + TQ_INT32 itHStart = col - khalfWidth; + TQ_INT32 itW = kw; if(itHStart < 0) { itW += itHStart; @@ -351,7 +351,7 @@ void KisConvolutionPainter::applyMatrixRepeat(KisKernelSP kernel, Q_INT32 x, Q_I ++i; } } - Q_INT32 lastvalid = i - kw; + TQ_INT32 lastvalid = i - kw; for(; krow < kh; ++krow) { // Copy the last valid line in the current line for (int i = 0; i < kw; i++) @@ -360,19 +360,19 @@ void KisConvolutionPainter::applyMatrixRepeat(KisKernelSP kernel, Q_INT32 x, Q_I } needFull = false; } else { -/* for (Q_INT32 krow = 0; krow < kh; ++krow) { // shift the cache to the left - Q_UINT8** d = pixelPtrCache + krow * kw; -// memmove( d, d + 1, (kw-1)*sizeof(Q_UINT8*)); +/* for (TQ_INT32 krow = 0; krow < kh; ++krow) { // shift the cache to the left + TQ_UINT8** d = pixelPtrCache + krow * kw; +// memmove( d, d + 1, (kw-1)*sizeof(TQ_UINT8*)); for (int i = 0; i < (kw-1); i++) { memcpy(d[i], d[i+1], cdepth); } }*/ - Q_UINT8* firstincache = pixelPtrCache[0]; - memmove(pixelPtrCache, pixelPtrCache + 1, (cacheSize - 1) * sizeof(Q_UINT8*) ); + TQ_UINT8* firstincache = pixelPtrCache[0]; + memmove(pixelPtrCache, pixelPtrCache + 1, (cacheSize - 1) * sizeof(TQ_UINT8*) ); pixelPtrCache[cacheSize - 1] = firstincache; if(col < xLastMinuskhw) { - Q_INT32 i = kw - 1; + TQ_INT32 i = kw - 1; // KisVLineIteratorPixel kit = m_device->createVLineIterator(col + khalfWidth, itStart, itH, false); kit.nextCol(); if( row < khalfHeight ) @@ -387,7 +387,7 @@ void KisConvolutionPainter::applyMatrixRepeat(KisKernelSP kernel, Q_INT32 x, Q_I ++kit; i += kw; } - Q_INT32 lastvalid = i - kw; + TQ_INT32 lastvalid = i - kw; for(;i < kw*kh; i+=kw) { memcpy(pixelPtrCache[i], pixelPtrCache[lastvalid], cdepth); @@ -417,7 +417,7 @@ void KisConvolutionPainter::applyMatrixRepeat(KisKernelSP kernel, Q_INT32 x, Q_I } - addDirtyRect(QRect(x, y, w, h)); + addDirtyRect(TQRect(x, y, w, h)); emit notifyProgressDone(); for (int i = 0; i < cacheSize; i++) |