summaryrefslogtreecommitdiffstats
path: root/krita/core/kis_scale_visitor.cc
diff options
context:
space:
mode:
Diffstat (limited to 'krita/core/kis_scale_visitor.cc')
-rw-r--r--krita/core/kis_scale_visitor.cc52
1 files changed, 26 insertions, 26 deletions
diff --git a/krita/core/kis_scale_visitor.cc b/krita/core/kis_scale_visitor.cc
index 424db7c62..25ad47c42 100644
--- a/krita/core/kis_scale_visitor.cc
+++ b/krita/core/kis_scale_visitor.cc
@@ -15,7 +15,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <qdatetime.h>
+#include <tqdatetime.h>
#include <kdebug.h>
#include <klocale.h>
@@ -29,60 +29,60 @@ void KisScaleWorker::run()
{
double fwidth = m_filterStrategy->support();
- QRect rect = m_dev -> exactBounds();
- Q_INT32 width = rect.width();
- Q_INT32 height = rect.height();
+ TQRect rect = m_dev -> exactBounds();
+ TQ_INT32 width = rect.width();
+ TQ_INT32 height = rect.height();
m_pixelSize=m_dev -> pixelSize();
// compute size of target image
if ( m_sx == 1.0F && m_sy == 1.0F ) {
return;
}
- Q_INT32 targetW = QABS( qRound( m_sx * width ) );
- Q_INT32 targetH = QABS( qRound( m_sy * height ) );
+ TQ_INT32 targetW = TQABS( tqRound( m_sx * width ) );
+ TQ_INT32 targetH = TQABS( tqRound( m_sy * height ) );
- Q_UINT8* newData = new Q_UINT8[targetW * targetH * m_pixelSize ];
+ TQ_UINT8* newData = new TQ_UINT8[targetW * targetH * m_pixelSize ];
Q_CHECK_PTR(newData);
double* weight = new double[ m_pixelSize ]; /* filter calculation variables */
- Q_UINT8* pel = new Q_UINT8[ m_pixelSize ];
+ TQ_UINT8* pel = new TQ_UINT8[ m_pixelSize ];
Q_CHECK_PTR(pel);
- Q_UINT8 *pel2 = new Q_UINT8[ m_pixelSize ];
+ TQ_UINT8 *pel2 = new TQ_UINT8[ m_pixelSize ];
Q_CHECK_PTR(pel2);
bool* bPelDelta = new bool[ m_pixelSize ];
ContribList *contribX;
ContribList contribY;
- const Q_INT32 BLACK_PIXEL=0;
- const Q_INT32 WHITE_PIXEL=255;
+ const TQ_INT32 BLACK_PIXEL=0;
+ const TQ_INT32 WHITE_PIXEL=255;
// create intermediate row to hold vertical dst row zoom
- Q_UINT8 * tmp = new Q_UINT8[ width * m_pixelSize ];
+ TQ_UINT8 * tmp = new TQ_UINT8[ width * m_pixelSize ];
Q_CHECK_PTR(tmp);
//create array of pointers to intermediate rows
- Q_UINT8 **tmpRows = new Q_UINT8*[ height ];
+ TQ_UINT8 **tmpRows = new TQ_UINT8*[ height ];
//create array of pointers to intermediate rows that are actually used simultaneously and allocate memory for the rows
- Q_UINT8 **tmpRowsMem;
+ TQ_UINT8 **tmpRowsMem;
if(m_sy < 1.0)
{
- tmpRowsMem = new Q_UINT8*[ (int)(fwidth / m_sy * 2 + 1) ];
+ tmpRowsMem = new TQ_UINT8*[ (int)(fwidth / m_sy * 2 + 1) ];
for(int i = 0; i < (int)(fwidth / m_sy * 2 + 1); i++)
{
- tmpRowsMem[i] = new Q_UINT8[ width * m_pixelSize ];
+ tmpRowsMem[i] = new TQ_UINT8[ width * m_pixelSize ];
Q_CHECK_PTR(tmpRowsMem[i]);
}
}
else
{
- tmpRowsMem = new Q_UINT8*[ (int)(fwidth * 2 + 1) ];
+ tmpRowsMem = new TQ_UINT8*[ (int)(fwidth * 2 + 1) ];
for(int i = 0; i < (int)(fwidth * 2 + 1); i++)
{
- tmpRowsMem[i] = new Q_UINT8[ width * m_pixelSize ];
+ tmpRowsMem[i] = new TQ_UINT8[ width * m_pixelSize ];
Q_CHECK_PTR(tmpRowsMem[i]);
}
}
@@ -94,7 +94,7 @@ void KisScaleWorker::run()
calcContrib(&contribX[x], m_sx, fwidth, width, m_filterStrategy, x);
}
- QTime starttime = QTime::currentTime ();
+ TQTime starttime = TQTime::currentTime ();
for(int y = 0; y < targetH; y++)
{
@@ -106,7 +106,7 @@ void KisScaleWorker::run()
{
if (!(contribY.p[srcpos].m_pixel < 0 || contribY.p[srcpos].m_pixel >= height))
{
- tmpRows[contribY.p[srcpos].m_pixel] = new Q_UINT8[ width * m_pixelSize ];
+ tmpRows[contribY.p[srcpos].m_pixel] = new TQ_UINT8[ width * m_pixelSize ];
//tmpRows[ contribY.p[srcpos].m_pixel ] = tmpRowsMem[ srcpos ];
m_dev ->readBytes(tmpRows[contribY.p[srcpos].m_pixel], 0, contribY.p[srcpos].m_pixel, width, 1);
}
@@ -133,8 +133,8 @@ void KisScaleWorker::run()
}
for(int channel = 0; channel < m_pixelSize; channel++){
- weight[channel] = bPelDelta[channel] ? static_cast<int>(qRound(weight[channel])) : pel[channel];
- tmp[ x * m_pixelSize + channel ] = static_cast<Q_UINT8>(CLAMP(weight[channel], BLACK_PIXEL, WHITE_PIXEL));
+ weight[channel] = bPelDelta[channel] ? static_cast<int>(tqRound(weight[channel])) : pel[channel];
+ tmp[ x * m_pixelSize + channel ] = static_cast<TQ_UINT8>(CLAMP(weight[channel], BLACK_PIXEL, WHITE_PIXEL));
}
} /* next row in temp column */
delete[] contribY.p;
@@ -156,7 +156,7 @@ void KisScaleWorker::run()
}
}
for(int channel = 0; channel < m_pixelSize; channel++){
- weight[channel] = bPelDelta[channel] ? static_cast<int>(qRound(weight[channel])) : pel[channel];
+ weight[channel] = bPelDelta[channel] ? static_cast<int>(tqRound(weight[channel])) : pel[channel];
int currentPos = (y*targetW+x) * m_pixelSize; // try to be at least a little efficient
if (weight[channel]<0)
newData[currentPos + channel] = 0;
@@ -201,11 +201,11 @@ void KisScaleWorker::run()
}
}
- QTime stoptime = QTime::currentTime ();
+ TQTime stoptime = TQTime::currentTime ();
return;
}
-int KisScaleWorker::calcContrib(ContribList *contrib, double scale, double fwidth, int srcwidth, KisFilterStrategy* filterStrategy, Q_INT32 i)
+int KisScaleWorker::calcContrib(ContribList *contrib, double scale, double fwidth, int srcwidth, KisFilterStrategy* filterStrategy, TQ_INT32 i)
{
//ContribList* contribX: receiver of contrib info
//double m_sx: horizontal zooming scale
@@ -219,7 +219,7 @@ int KisScaleWorker::calcContrib(ContribList *contrib, double scale, double fwidt
double fscale;
double center, begin, end;
double weight;
- Q_INT32 k, n;
+ TQ_INT32 k, n;
if(scale < 1.0)
{