diff options
Diffstat (limited to 'krita/core/tiles/kis_tileddatamanager.cc')
-rw-r--r-- | krita/core/tiles/kis_tileddatamanager.cc | 282 |
1 files changed, 141 insertions, 141 deletions
diff --git a/krita/core/tiles/kis_tileddatamanager.cc b/krita/core/tiles/kis_tileddatamanager.cc index 4372e487..629b1b38 100644 --- a/krita/core/tiles/kis_tileddatamanager.cc +++ b/krita/core/tiles/kis_tileddatamanager.cc @@ -16,7 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qvaluevector.h> +#include <tqvaluevector.h> #include <kdebug.h> @@ -36,11 +36,11 @@ * Even though the matrix has grown it may still not contain tiles at specific positions. They are created on demand */ -KisTiledDataManager::KisTiledDataManager(Q_UINT32 pixelSize, const Q_UINT8 *defPixel) +KisTiledDataManager::KisTiledDataManager(TQ_UINT32 pixelSize, const TQ_UINT8 *defPixel) { m_pixelSize = pixelSize; - m_defPixel = new Q_UINT8[m_pixelSize]; + m_defPixel = new TQ_UINT8[m_pixelSize]; Q_CHECK_PTR(m_defPixel); memcpy(m_defPixel, defPixel, m_pixelSize); @@ -54,10 +54,10 @@ KisTiledDataManager::KisTiledDataManager(Q_UINT32 pixelSize, const Q_UINT8 *defP m_hashTable [i] = 0; m_numTiles = 0; m_currentMemento = 0; - m_extentMinX = Q_INT32_MAX; - m_extentMinY = Q_INT32_MAX; - m_extentMaxX = Q_INT32_MIN; - m_extentMaxY = Q_INT32_MIN; + m_extentMinX = TQ_INT32_MAX; + m_extentMinY = TQ_INT32_MAX; + m_extentMaxX = TQ_INT32_MIN; + m_extentMaxY = TQ_INT32_MIN; } KisTiledDataManager::KisTiledDataManager(const KisTiledDataManager & dm) @@ -65,7 +65,7 @@ KisTiledDataManager::KisTiledDataManager(const KisTiledDataManager & dm) { m_pixelSize = dm.m_pixelSize; - m_defPixel = new Q_UINT8[m_pixelSize]; + m_defPixel = new TQ_UINT8[m_pixelSize]; Q_CHECK_PTR(m_defPixel); memcpy(m_defPixel, dm.m_defPixel, m_pixelSize); @@ -123,7 +123,7 @@ KisTiledDataManager::~KisTiledDataManager() delete [] m_defPixel; } -void KisTiledDataManager::setDefaultPixel(const Q_UINT8 *defPixel) +void KisTiledDataManager::setDefaultPixel(const TQ_UINT8 *defPixel) { if (defPixel == 0) return; @@ -170,9 +170,9 @@ bool KisTiledDataManager::read(KoStore *store) //Q_ASSERT(store != 0); char str[80]; - Q_INT32 x,y,w,h; + TQ_INT32 x,y,w,h; - QIODevice *stream = store->device(); + TQIODevice *stream = store->device(); if (stream == 0) return false; //Q_ASSERT(stream != 0); @@ -180,7 +180,7 @@ bool KisTiledDataManager::read(KoStore *store) sscanf(str,"%u",&m_numTiles); - for(Q_UINT32 i = 0; i < m_numTiles; i++) + for(TQ_UINT32 i = 0; i < m_numTiles; i++) { stream->readLine(str, 79); sscanf(str,"%d,%d,%d,%d",&x,&y,&w,&h); @@ -188,9 +188,9 @@ bool KisTiledDataManager::read(KoStore *store) // the following is only correct as long as tile size is not changed // The first time we change tilesize the dimensions just read needs to be respected // but for now we just assume that tiles are the same size as ever. - Q_INT32 row = yToRow(y); - Q_INT32 col = xToCol(x); - Q_UINT32 tileHash = calcTileHash(col, row); + TQ_INT32 row = yToRow(y); + TQ_INT32 col = xToCol(x); + TQ_UINT32 tileHash = calcTileHash(col, row); KisTile *tile = new KisTile(m_pixelSize, col, row, m_defPixel); Q_CHECK_PTR(tile); @@ -207,7 +207,7 @@ bool KisTiledDataManager::read(KoStore *store) return true; } -void KisTiledDataManager::extent(Q_INT32 &x, Q_INT32 &y, Q_INT32 &w, Q_INT32 &h) const +void KisTiledDataManager::extent(TQ_INT32 &x, TQ_INT32 &y, TQ_INT32 &w, TQ_INT32 &h) const { x = m_extentMinX; y = m_extentMinY; @@ -225,27 +225,27 @@ void KisTiledDataManager::extent(Q_INT32 &x, Q_INT32 &y, Q_INT32 &w, Q_INT32 &h) } } -QRect KisTiledDataManager::extent() const +TQRect KisTiledDataManager::extent() const { - Q_INT32 x; - Q_INT32 y; - Q_INT32 w; - Q_INT32 h; + TQ_INT32 x; + TQ_INT32 y; + TQ_INT32 w; + TQ_INT32 h; extent(x, y, w, h); - return QRect(x, y, w, h); + return TQRect(x, y, w, h); } -void KisTiledDataManager::setExtent(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h) +void KisTiledDataManager::setExtent(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h) { - QRect newRect = QRect(x, y, w, h).normalize(); + TQRect newRect = TQRect(x, y, w, h).normalize(); //printRect("newRect", newRect); - QRect oldRect = QRect(m_extentMinX, m_extentMinY, m_extentMaxX - m_extentMinX + 1, m_extentMaxY - m_extentMinY + 1).normalize(); + TQRect oldRect = TQRect(m_extentMinX, m_extentMinY, m_extentMaxX - m_extentMinX + 1, m_extentMaxY - m_extentMinY + 1).normalize(); //printRect("oldRect", oldRect); // Do nothing if the desired size is bigger than we currently are: that is handled by the autoextending automatically - if (newRect.contains(oldRect)) return; + if (newRect.tqcontains(oldRect)) return; // Loop through all tiles, if a tile is wholly outside the extent, add to the memento, then delete it, // if the tile is partially outside the extent, clear the outside pixels to the default pixel. @@ -256,10 +256,10 @@ void KisTiledDataManager::setExtent(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h) while(tile) { - QRect tileRect = QRect(tile->getCol() * KisTile::WIDTH, tile->getRow() * KisTile::HEIGHT, KisTile::WIDTH, KisTile::HEIGHT); + TQRect tileRect = TQRect(tile->getCol() * KisTile::WIDTH, tile->getRow() * KisTile::HEIGHT, KisTile::WIDTH, KisTile::HEIGHT); //printRect("tileRect", tileRect); - if (newRect.contains(tileRect)) { + if (newRect.tqcontains(tileRect)) { // Completely inside, do nothing previousTile = tile; tile = tile->getNext(); @@ -270,7 +270,7 @@ void KisTiledDataManager::setExtent(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h) if (newRect.intersects(tileRect)) { // Create the intersection of the tile and new rect - QRect intersection = newRect.intersect(tileRect); + TQRect intersection = newRect.intersect(tileRect); //printRect("intersection", intersection); intersection.setRect(intersection.x() - tileRect.x(), intersection.y() - tileRect.y(), intersection.width(), intersection.height()); @@ -279,8 +279,8 @@ void KisTiledDataManager::setExtent(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h) tile->addReader(); for (int y = 0; y < KisTile::HEIGHT; ++y) { for (int x = 0; x < KisTile::WIDTH; ++x) { - if (!intersection.contains(x,y)) { - Q_UINT8 * ptr = tile->data(x, y); + if (!intersection.tqcontains(x,y)) { + TQ_UINT8 * ptr = tile->data(x, y); memcpy(ptr, m_defPixel, m_pixelSize); } } @@ -314,10 +314,10 @@ void KisTiledDataManager::setExtent(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h) void KisTiledDataManager::recalculateExtent() { - m_extentMinX = Q_INT32_MAX; - m_extentMinY = Q_INT32_MAX; - m_extentMaxX = Q_INT32_MIN; - m_extentMaxY = Q_INT32_MIN; + m_extentMinX = TQ_INT32_MAX; + m_extentMinY = TQ_INT32_MAX; + m_extentMaxX = TQ_INT32_MIN; + m_extentMaxY = TQ_INT32_MIN; // Loop through all tiles. for (int tileHash = 0; tileHash < 1024; tileHash++) @@ -332,29 +332,29 @@ void KisTiledDataManager::recalculateExtent() } } -void KisTiledDataManager::clear(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, Q_UINT8 clearValue) +void KisTiledDataManager::clear(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, TQ_UINT8 clearValue) { if (w < 1 || h < 1) { return; } - Q_INT32 firstColumn = xToCol(x); - Q_INT32 lastColumn = xToCol(x + w - 1); + TQ_INT32 firstColumn = xToCol(x); + TQ_INT32 lastColumn = xToCol(x + w - 1); - Q_INT32 firstRow = yToRow(y); - Q_INT32 lastRow = yToRow(y + h - 1); + TQ_INT32 firstRow = yToRow(y); + TQ_INT32 lastRow = yToRow(y + h - 1); - QRect clearRect(x, y, w, h); + TQRect clearRect(x, y, w, h); - const Q_UINT32 rowStride = KisTile::WIDTH * m_pixelSize; + const TQ_UINT32 rowStride = KisTile::WIDTH * m_pixelSize; - for (Q_INT32 row = firstRow; row <= lastRow; ++row) { - for (Q_INT32 column = firstColumn; column <= lastColumn; ++column) { + for (TQ_INT32 row = firstRow; row <= lastRow; ++row) { + for (TQ_INT32 column = firstColumn; column <= lastColumn; ++column) { KisTile *tile = getTile(column, row, true); - QRect tileRect = tile->extent(); + TQRect tileRect = tile->extent(); - QRect clearTileRect = clearRect & tileRect; + TQRect clearTileRect = clearRect & tileRect; tile->addReader(); if (clearTileRect == tileRect) { @@ -362,8 +362,8 @@ void KisTiledDataManager::clear(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, Q_UI memset(tile->data(), clearValue, KisTile::WIDTH * KisTile::HEIGHT * m_pixelSize); } else { - Q_UINT32 rowsRemaining = clearTileRect.height(); - Q_UINT8 *dst = tile->data(clearTileRect.x() - tileRect.x(), clearTileRect.y() - tileRect.y()); + TQ_UINT32 rowsRemaining = clearTileRect.height(); + TQ_UINT8 *dst = tile->data(clearTileRect.x() - tileRect.x(), clearTileRect.y() - tileRect.y()); while (rowsRemaining > 0) { memset(dst, clearValue, clearTileRect.width() * m_pixelSize); @@ -376,7 +376,7 @@ void KisTiledDataManager::clear(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, Q_UI } } -void KisTiledDataManager::clear(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, const Q_UINT8 *clearPixel) +void KisTiledDataManager::clear(TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, const TQ_UINT8 *clearPixel) { Q_ASSERT(clearPixel != 0); @@ -386,7 +386,7 @@ void KisTiledDataManager::clear(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, cons bool pixelBytesAreTheSame = true; - for (Q_UINT32 i = 0; i < m_pixelSize; ++i) { + for (TQ_UINT32 i = 0; i < m_pixelSize; ++i) { if (clearPixel[i] != clearPixel[0]) { pixelBytesAreTheSame = false; break; @@ -397,25 +397,25 @@ void KisTiledDataManager::clear(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, cons clear(x, y, w, h, clearPixel[0]); } else { - Q_INT32 firstColumn = xToCol(x); - Q_INT32 lastColumn = xToCol(x + w - 1); + TQ_INT32 firstColumn = xToCol(x); + TQ_INT32 lastColumn = xToCol(x + w - 1); - Q_INT32 firstRow = yToRow(y); - Q_INT32 lastRow = yToRow(y + h - 1); + TQ_INT32 firstRow = yToRow(y); + TQ_INT32 lastRow = yToRow(y + h - 1); - QRect clearRect(x, y, w, h); + TQRect clearRect(x, y, w, h); - const Q_UINT32 rowStride = KisTile::WIDTH * m_pixelSize; + const TQ_UINT32 rowStride = KisTile::WIDTH * m_pixelSize; - Q_UINT8 *clearPixelData = 0; + TQ_UINT8 *clearPixelData = 0; if (w >= KisTile::WIDTH && h >= KisTile::HEIGHT) { // There might be a whole tile to be cleared so generate a cleared tile. - clearPixelData = new Q_UINT8[KisTile::WIDTH * KisTile::HEIGHT * m_pixelSize]; + clearPixelData = new TQ_UINT8[KisTile::WIDTH * KisTile::HEIGHT * m_pixelSize]; - Q_UINT8 *dst = clearPixelData; - Q_UINT32 pixelsRemaining = KisTile::WIDTH; + TQ_UINT8 *dst = clearPixelData; + TQ_UINT32 pixelsRemaining = KisTile::WIDTH; // Generate one row while (pixelsRemaining > 0) { @@ -424,7 +424,7 @@ void KisTiledDataManager::clear(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, cons --pixelsRemaining; } - Q_UINT32 rowsRemaining = KisTile::HEIGHT - 1; + TQ_UINT32 rowsRemaining = KisTile::HEIGHT - 1; // Copy to the rest of the rows. while (rowsRemaining > 0) { @@ -436,12 +436,12 @@ void KisTiledDataManager::clear(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, cons } else { // Generate one row - Q_UINT32 maxRunLength = QMIN(w, KisTile::WIDTH); + TQ_UINT32 maxRunLength = TQMIN(w, KisTile::WIDTH); - clearPixelData = new Q_UINT8[maxRunLength * m_pixelSize]; + clearPixelData = new TQ_UINT8[maxRunLength * m_pixelSize]; - Q_UINT8 *dst = clearPixelData; - Q_UINT32 pixelsRemaining = maxRunLength; + TQ_UINT8 *dst = clearPixelData; + TQ_UINT32 pixelsRemaining = maxRunLength; while (pixelsRemaining > 0) { memcpy(dst, clearPixel, m_pixelSize); @@ -450,13 +450,13 @@ void KisTiledDataManager::clear(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, cons } } - for (Q_INT32 row = firstRow; row <= lastRow; ++row) { - for (Q_INT32 column = firstColumn; column <= lastColumn; ++column) { + for (TQ_INT32 row = firstRow; row <= lastRow; ++row) { + for (TQ_INT32 column = firstColumn; column <= lastColumn; ++column) { KisTile *tile = getTile(column, row, true); - QRect tileRect = tile->extent(); + TQRect tileRect = tile->extent(); - QRect clearTileRect = clearRect & tileRect; + TQRect clearTileRect = clearRect & tileRect; if (clearTileRect == tileRect) { @@ -466,9 +466,9 @@ void KisTiledDataManager::clear(Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, cons tile->removeReader(); } else { - Q_UINT32 rowsRemaining = clearTileRect.height(); + TQ_UINT32 rowsRemaining = clearTileRect.height(); tile->addReader(); - Q_UINT8 *dst = tile->data(clearTileRect.x() - tileRect.x(), clearTileRect.y() - tileRect.y()); + TQ_UINT8 *dst = tile->data(clearTileRect.x() - tileRect.x(), clearTileRect.y() - tileRect.y()); while (rowsRemaining > 0) { memcpy(dst, clearPixelData, clearTileRect.width() * m_pixelSize); @@ -506,21 +506,21 @@ void KisTiledDataManager::clear() m_numTiles = 0; // Set the extent correctly - m_extentMinX = Q_INT32_MAX; - m_extentMinY = Q_INT32_MAX; - m_extentMaxX = Q_INT32_MIN; - m_extentMaxY = Q_INT32_MIN; + m_extentMinX = TQ_INT32_MAX; + m_extentMinY = TQ_INT32_MAX; + m_extentMaxX = TQ_INT32_MIN; + m_extentMaxY = TQ_INT32_MIN; } -void KisTiledDataManager::paste(KisDataManagerSP data, Q_INT32 sx, Q_INT32 sy, Q_INT32 dx, Q_INT32 dy, - Q_INT32 w, Q_INT32 h) +void KisTiledDataManager::paste(KisDataManagerSP data, TQ_INT32 sx, TQ_INT32 sy, TQ_INT32 dx, TQ_INT32 dy, + TQ_INT32 w, TQ_INT32 h) { //CBR_MISSING sx=sy=dx=dy=w=h;data=0; } -Q_UINT32 KisTiledDataManager::calcTileHash(Q_INT32 col, Q_INT32 row) +TQ_UINT32 KisTiledDataManager::calcTileHash(TQ_INT32 col, TQ_INT32 row) { return ((row << 5) + (col & 0x1F)) & 0x3FF; } @@ -692,7 +692,7 @@ void KisTiledDataManager::deleteTiles(const KisMemento::DeletedTile *d) { while (d) { - Q_UINT32 tileHash = calcTileHash(d->col(), d->row()); + TQ_UINT32 tileHash = calcTileHash(d->col(), d->row()); KisTile *curTile = m_hashTable[tileHash]; KisTile *preTile = 0; while(curTile) @@ -721,7 +721,7 @@ void KisTiledDataManager::deleteTiles(const KisMemento::DeletedTile *d) recalculateExtent(); } -void KisTiledDataManager::ensureTileMementoed(Q_INT32 col, Q_INT32 row, Q_UINT32 tileHash, const KisTile *refTile) +void KisTiledDataManager::ensureTileMementoed(TQ_INT32 col, TQ_INT32 row, TQ_UINT32 tileHash, const KisTile *refTile) { if (refTile == 0) return; //Q_ASSERT(refTile != 0); @@ -751,7 +751,7 @@ void KisTiledDataManager::ensureTileMementoed(Q_INT32 col, Q_INT32 row, Q_UINT32 m_currentMemento->m_numTiles++; } -void KisTiledDataManager::updateExtent(Q_INT32 col, Q_INT32 row) +void KisTiledDataManager::updateExtent(TQ_INT32 col, TQ_INT32 row) { if(m_extentMinX > col * KisTile::WIDTH) m_extentMinX = col * KisTile::WIDTH; @@ -763,9 +763,9 @@ void KisTiledDataManager::updateExtent(Q_INT32 col, Q_INT32 row) m_extentMaxY = (row+1) * KisTile::HEIGHT - 1; } -KisTile *KisTiledDataManager::getTile(Q_INT32 col, Q_INT32 row, bool writeAccess) +KisTile *KisTiledDataManager::getTile(TQ_INT32 col, TQ_INT32 row, bool writeAccess) { - Q_UINT32 tileHash = calcTileHash(col, row); + TQ_UINT32 tileHash = calcTileHash(col, row); // Lookup tile in hash table KisTile *tile = m_hashTable[tileHash]; @@ -806,7 +806,7 @@ KisTile *KisTiledDataManager::getTile(Q_INT32 col, Q_INT32 row, bool writeAccess return tile; } -KisTile *KisTiledDataManager::getOldTile(Q_INT32 col, Q_INT32 row, KisTile *def) +KisTile *KisTiledDataManager::getOldTile(TQ_INT32 col, TQ_INT32 row, KisTile *def) { KisTile *tile = 0; @@ -816,7 +816,7 @@ KisTile *KisTiledDataManager::getOldTile(Q_INT32 col, Q_INT32 row, KisTile *def) if (!m_currentMemento->valid()) return def; //Q_ASSERT(m_currentMemento->valid()); - Q_UINT32 tileHash = calcTileHash(col, row); + TQ_UINT32 tileHash = calcTileHash(col, row); tile = m_currentMemento->m_hashTable[tileHash]; while (tile != 0) { @@ -833,48 +833,48 @@ KisTile *KisTiledDataManager::getOldTile(Q_INT32 col, Q_INT32 row, KisTile *def) return tile; } -Q_UINT8* KisTiledDataManager::pixelPtr(Q_INT32 x, Q_INT32 y, bool writable) +TQ_UINT8* KisTiledDataManager::pixelPtr(TQ_INT32 x, TQ_INT32 y, bool writable) { // Ahem, this is a bit not as good. The point is, this function needs the tile data, // but it might be swapped out. This code swaps it in, but at function exit it might - // be swapped out again! THIS MAKES THE RETURNED POINTER QUITE VOLATILE + // be swapped out again! THIS MAKES THE RETURNED POINTER TQUITE VOLATILE return pixelPtrSafe(x, y, writable) -> data(); } -KisTileDataWrapperSP KisTiledDataManager::pixelPtrSafe(Q_INT32 x, Q_INT32 y, bool writable) { - Q_INT32 row = yToRow(y); - Q_INT32 col = xToCol(x); +KisTileDataWrapperSP KisTiledDataManager::pixelPtrSafe(TQ_INT32 x, TQ_INT32 y, bool writable) { + TQ_INT32 row = yToRow(y); + TQ_INT32 col = xToCol(x); // calc limits within the tile - Q_INT32 yInTile = y - row * KisTile::HEIGHT; - Q_INT32 xInTile = x - col * KisTile::WIDTH; - Q_INT32 offset = m_pixelSize * (yInTile * KisTile::WIDTH + xInTile); + TQ_INT32 yInTile = y - row * KisTile::HEIGHT; + TQ_INT32 xInTile = x - col * KisTile::WIDTH; + TQ_INT32 offset = m_pixelSize * (yInTile * KisTile::WIDTH + xInTile); KisTile *tile = getTile(col, row, writable); return new KisTileDataWrapper(tile, offset); } -const Q_UINT8* KisTiledDataManager::pixel(Q_INT32 x, Q_INT32 y) +const TQ_UINT8* KisTiledDataManager::pixel(TQ_INT32 x, TQ_INT32 y) { return pixelPtr(x, y, false); } -Q_UINT8* KisTiledDataManager::writablePixel(Q_INT32 x, Q_INT32 y) +TQ_UINT8* KisTiledDataManager::writablePixel(TQ_INT32 x, TQ_INT32 y) { return pixelPtr(x, y, true); } -void KisTiledDataManager::setPixel(Q_INT32 x, Q_INT32 y, const Q_UINT8 * data) +void KisTiledDataManager::setPixel(TQ_INT32 x, TQ_INT32 y, const TQ_UINT8 * data) { - Q_UINT8 *pixel = pixelPtr(x, y, true); + TQ_UINT8 *pixel = pixelPtr(x, y, true); memcpy(pixel, data, m_pixelSize); } -void KisTiledDataManager::readBytes(Q_UINT8 * data, - Q_INT32 x, Q_INT32 y, - Q_INT32 w, Q_INT32 h) +void KisTiledDataManager::readBytes(TQ_UINT8 * data, + TQ_INT32 x, TQ_INT32 y, + TQ_INT32 w, TQ_INT32 h) { if (data == 0) return; //Q_ASSERT(data != 0); @@ -884,33 +884,33 @@ void KisTiledDataManager::readBytes(Q_UINT8 * data, if (h < 0) h = 0; - Q_INT32 dstY = 0; - Q_INT32 srcY = y; - Q_INT32 rowsRemaining = h; + TQ_INT32 dstY = 0; + TQ_INT32 srcY = y; + TQ_INT32 rowsRemaining = h; while (rowsRemaining > 0) { - Q_INT32 dstX = 0; - Q_INT32 srcX = x; - Q_INT32 columnsRemaining = w; - Q_INT32 numContiguousSrcRows = numContiguousRows(srcY, srcX, srcX + w - 1); + TQ_INT32 dstX = 0; + TQ_INT32 srcX = x; + TQ_INT32 columnsRemaining = w; + TQ_INT32 numContiguousSrcRows = numContiguousRows(srcY, srcX, srcX + w - 1); - Q_INT32 rows = QMIN(numContiguousSrcRows, rowsRemaining); + TQ_INT32 rows = TQMIN(numContiguousSrcRows, rowsRemaining); while (columnsRemaining > 0) { - Q_INT32 numContiguousSrcColumns = numContiguousColumns(srcX, srcY, srcY + rows - 1); + TQ_INT32 numContiguousSrcColumns = numContiguousColumns(srcX, srcY, srcY + rows - 1); - Q_INT32 columns = QMIN(numContiguousSrcColumns, columnsRemaining); + TQ_INT32 columns = TQMIN(numContiguousSrcColumns, columnsRemaining); KisTileDataWrapperSP tileData = pixelPtrSafe(srcX, srcY, false); - const Q_UINT8 *srcData = tileData -> data(); - Q_INT32 srcRowStride = rowStride(srcX, srcY); + const TQ_UINT8 *srcData = tileData -> data(); + TQ_INT32 srcRowStride = rowStride(srcX, srcY); - Q_UINT8 *dstData = data + ((dstX + (dstY * w)) * m_pixelSize); - Q_INT32 dstRowStride = w * m_pixelSize; + TQ_UINT8 *dstData = data + ((dstX + (dstY * w)) * m_pixelSize); + TQ_INT32 dstRowStride = w * m_pixelSize; - for (Q_INT32 row = 0; row < rows; row++) { + for (TQ_INT32 row = 0; row < rows; row++) { memcpy(dstData, srcData, columns * m_pixelSize); dstData += dstRowStride; srcData += srcRowStride; @@ -929,9 +929,9 @@ void KisTiledDataManager::readBytes(Q_UINT8 * data, } -void KisTiledDataManager::writeBytes(const Q_UINT8 * bytes, - Q_INT32 x, Q_INT32 y, - Q_INT32 w, Q_INT32 h) +void KisTiledDataManager::writeBytes(const TQ_UINT8 * bytes, + TQ_INT32 x, TQ_INT32 y, + TQ_INT32 w, TQ_INT32 h) { if (bytes == 0) return; //Q_ASSERT(bytes != 0); @@ -943,34 +943,34 @@ void KisTiledDataManager::writeBytes(const Q_UINT8 * bytes, if (h < 0) h = 0; - Q_INT32 srcY = 0; - Q_INT32 dstY = y; - Q_INT32 rowsRemaining = h; + TQ_INT32 srcY = 0; + TQ_INT32 dstY = y; + TQ_INT32 rowsRemaining = h; while (rowsRemaining > 0) { - Q_INT32 srcX = 0; - Q_INT32 dstX = x; - Q_INT32 columnsRemaining = w; - Q_INT32 numContiguousdstRows = numContiguousRows(dstY, dstX, dstX + w - 1); + TQ_INT32 srcX = 0; + TQ_INT32 dstX = x; + TQ_INT32 columnsRemaining = w; + TQ_INT32 numContiguousdstRows = numContiguousRows(dstY, dstX, dstX + w - 1); - Q_INT32 rows = QMIN(numContiguousdstRows, rowsRemaining); + TQ_INT32 rows = TQMIN(numContiguousdstRows, rowsRemaining); while (columnsRemaining > 0) { - Q_INT32 numContiguousdstColumns = numContiguousColumns(dstX, dstY, dstY + rows - 1); + TQ_INT32 numContiguousdstColumns = numContiguousColumns(dstX, dstY, dstY + rows - 1); - Q_INT32 columns = QMIN(numContiguousdstColumns, columnsRemaining); + TQ_INT32 columns = TQMIN(numContiguousdstColumns, columnsRemaining); - //Q_UINT8 *dstData = writablePixel(dstX, dstY); + //TQ_UINT8 *dstData = writablePixel(dstX, dstY); KisTileDataWrapperSP tileData = pixelPtrSafe(dstX, dstY, true); - Q_UINT8 *dstData = tileData->data(); - Q_INT32 dstRowStride = rowStride(dstX, dstY); + TQ_UINT8 *dstData = tileData->data(); + TQ_INT32 dstRowStride = rowStride(dstX, dstY); - const Q_UINT8 *srcData = bytes + ((srcX + (srcY * w)) * m_pixelSize); - Q_INT32 srcRowStride = w * m_pixelSize; + const TQ_UINT8 *srcData = bytes + ((srcX + (srcY * w)) * m_pixelSize); + TQ_INT32 srcRowStride = w * m_pixelSize; - for (Q_INT32 row = 0; row < rows; row++) { + for (TQ_INT32 row = 0; row < rows; row++) { memcpy(dstData, srcData, columns * m_pixelSize); srcData += srcRowStride; dstData += dstRowStride; @@ -987,9 +987,9 @@ void KisTiledDataManager::writeBytes(const Q_UINT8 * bytes, } } -Q_INT32 KisTiledDataManager::numContiguousColumns(Q_INT32 x, Q_INT32 minY, Q_INT32 maxY) +TQ_INT32 KisTiledDataManager::numContiguousColumns(TQ_INT32 x, TQ_INT32 minY, TQ_INT32 maxY) { - Q_INT32 numColumns; + TQ_INT32 numColumns; Q_UNUSED(minY); Q_UNUSED(maxY); @@ -1003,9 +1003,9 @@ Q_INT32 KisTiledDataManager::numContiguousColumns(Q_INT32 x, Q_INT32 minY, Q_INT return numColumns; } -Q_INT32 KisTiledDataManager::numContiguousRows(Q_INT32 y, Q_INT32 minX, Q_INT32 maxX) +TQ_INT32 KisTiledDataManager::numContiguousRows(TQ_INT32 y, TQ_INT32 minX, TQ_INT32 maxX) { - Q_INT32 numRows; + TQ_INT32 numRows; Q_UNUSED(minX); Q_UNUSED(maxX); @@ -1019,7 +1019,7 @@ Q_INT32 KisTiledDataManager::numContiguousRows(Q_INT32 y, Q_INT32 minX, Q_INT32 return numRows; } -Q_INT32 KisTiledDataManager::rowStride(Q_INT32 x, Q_INT32 y) +TQ_INT32 KisTiledDataManager::rowStride(TQ_INT32 x, TQ_INT32 y) { Q_UNUSED(x); Q_UNUSED(y); @@ -1027,12 +1027,12 @@ Q_INT32 KisTiledDataManager::rowStride(Q_INT32 x, Q_INT32 y) return KisTile::WIDTH * m_pixelSize; } -Q_INT32 KisTiledDataManager::numTiles(void) const +TQ_INT32 KisTiledDataManager::numTiles(void) const { return m_numTiles; } -KisTileDataWrapper::KisTileDataWrapper(KisTile* tile, Q_INT32 offset) +KisTileDataWrapper::KisTileDataWrapper(KisTile* tile, TQ_INT32 offset) : m_tile(tile), m_offset(offset) { m_tile->addReader(); |