diff options
Diffstat (limited to 'src/kernel/qimage.cpp')
-rw-r--r-- | src/kernel/qimage.cpp | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/src/kernel/qimage.cpp b/src/kernel/qimage.cpp index fad12bfae..59ed9f106 100644 --- a/src/kernel/qimage.cpp +++ b/src/kernel/qimage.cpp @@ -1062,15 +1062,15 @@ void TQImage::fill( uint pixel ) void TQImage::invertPixels( bool invertAlpha ) { - Q_UINT32 n = numBytes(); + TQ_UINT32 n = numBytes(); if ( n % 4 ) { - Q_UINT8 *p = (Q_UINT8*)bits(); - Q_UINT8 *end = p + n; + TQ_UINT8 *p = (TQ_UINT8*)bits(); + TQ_UINT8 *end = p + n; while ( p < end ) *p++ ^= 0xff; } else { - Q_UINT32 *p = (Q_UINT32*)bits(); - Q_UINT32 *end = p + n/4; + TQ_UINT32 *p = (TQ_UINT32*)bits(); + TQ_UINT32 *end = p + n/4; uint xorbits = invertAlpha && depth() == 32 ? 0x00ffffff : 0xffffffff; while ( p < end ) *p++ ^= xorbits; @@ -3231,8 +3231,8 @@ TQImage TQImage::mirror(bool horizontal, bool vertical) const // 1 bit, 8 bit if (depth() == 1 || depth() == 8) { for (int sy = 0; sy < h; sy++, dy += dyi) { - Q_UINT8* ssl = (Q_UINT8*)(data->bits[sy]); - Q_UINT8* dsl = (Q_UINT8*)(result.data->bits[dy]); + TQ_UINT8* ssl = (TQ_UINT8*)(data->bits[sy]); + TQ_UINT8* dsl = (TQ_UINT8*)(result.data->bits[dy]); int dx = dxs; for (int sx = 0; sx < w; sx++, dx += dxi) dsl[dx] = ssl[sx]; @@ -3243,8 +3243,8 @@ TQImage TQImage::mirror(bool horizontal, bool vertical) const // 16 bit else if (depth() == 16) { for (int sy = 0; sy < h; sy++, dy += dyi) { - Q_UINT16* ssl = (Q_UINT16*)(data->bits[sy]); - Q_UINT16* dsl = (Q_UINT16*)(result.data->bits[dy]); + TQ_UINT16* ssl = (TQ_UINT16*)(data->bits[sy]); + TQ_UINT16* dsl = (TQ_UINT16*)(result.data->bits[dy]); int dx = dxs; for (int sx = 0; sx < w; sx++, dx += dxi) dsl[dx] = ssl[sx]; @@ -3254,8 +3254,8 @@ TQImage TQImage::mirror(bool horizontal, bool vertical) const // 32 bit else if (depth() == 32) { for (int sy = 0; sy < h; sy++, dy += dyi) { - Q_UINT32* ssl = (Q_UINT32*)(data->bits[sy]); - Q_UINT32* dsl = (Q_UINT32*)(result.data->bits[dy]); + TQ_UINT32* ssl = (TQ_UINT32*)(data->bits[sy]); + TQ_UINT32* dsl = (TQ_UINT32*)(result.data->bits[dy]); int dx = dxs; for (int sx = 0; sx < w; sx++, dx += dxi) dsl[dx] = ssl[sx]; @@ -3267,9 +3267,9 @@ TQImage TQImage::mirror(bool horizontal, bool vertical) const if (horizontal && depth() == 1) { int shift = width() % 8; for (int y = h-1; y >= 0; y--) { - Q_UINT8* a0 = (Q_UINT8*)(result.data->bits[y]); + TQ_UINT8* a0 = (TQ_UINT8*)(result.data->bits[y]); // Swap bytes - Q_UINT8* a = a0+dxs; + TQ_UINT8* a = a0+dxs; while (a >= a0) { *a = bitflip[*a]; a--; @@ -3277,17 +3277,17 @@ TQImage TQImage::mirror(bool horizontal, bool vertical) const // Shift bits if unaligned if (shift != 0) { a = a0+dxs; - Q_UINT8 c = 0; + TQ_UINT8 c = 0; if (bitOrder() == TQImage::LittleEndian) { while (a >= a0) { - Q_UINT8 nc = *a << shift; + TQ_UINT8 nc = *a << shift; *a = (*a >> (8-shift)) | c; --a; c = nc; } } else { while (a >= a0) { - Q_UINT8 nc = *a >> shift; + TQ_UINT8 nc = *a >> shift; *a = (*a << (8-shift)) | c; --a; c = nc; @@ -3590,10 +3590,10 @@ TQDataStream &operator<<( TQDataStream &s, const TQImage &image ) { if ( s.version() >= 5 ) { if ( image.isNull() ) { - s << (Q_INT32) 0; // null image marker + s << (TQ_INT32) 0; // null image marker return s; } else { - s << (Q_INT32) 1; + s << (TQ_INT32) 1; // continue ... } } @@ -3621,7 +3621,7 @@ TQDataStream &operator<<( TQDataStream &s, const TQImage &image ) TQDataStream &operator>>( TQDataStream &s, TQImage &image ) { if ( s.version() >= 5 ) { - Q_INT32 nullMarker; + TQ_INT32 nullMarker; s >> nullMarker; if ( !nullMarker ) { image = TQImage(); // null image @@ -4536,10 +4536,10 @@ const int BMP_FILEHDR_SIZE = 14; // size of BMP_FILEHDR data struct BMP_FILEHDR { // BMP file header char bfType[2]; // "BM" - Q_INT32 bfSize; // size of file - Q_INT16 bfReserved1; - Q_INT16 bfReserved2; - Q_INT32 bfOffBits; // pointer to the pixmap bits + TQ_INT32 bfSize; // size of file + TQ_INT16 bfReserved1; + TQ_INT16 bfReserved2; + TQ_INT32 bfOffBits; // pointer to the pixmap bits }; TQDataStream &operator>>( TQDataStream &s, BMP_FILEHDR &bf ) @@ -4567,17 +4567,17 @@ const int BMP_RLE4 = 2; // run-length encoded, 4 bits const int BMP_BITFIELDS = 3; // RGB values encoded in data as bit-fields struct BMP_INFOHDR { // BMP information header - Q_INT32 biSize; // size of this struct - Q_INT32 biWidth; // pixmap width - Q_INT32 biHeight; // pixmap height - Q_INT16 biPlanes; // should be 1 - Q_INT16 biBitCount; // number of bits per pixel - Q_INT32 biCompression; // compression method - Q_INT32 biSizeImage; // size of image - Q_INT32 biXPelsPerMeter; // horizontal resolution - Q_INT32 biYPelsPerMeter; // vertical resolution - Q_INT32 biClrUsed; // number of colors used - Q_INT32 biClrImportant; // number of important colors + TQ_INT32 biSize; // size of this struct + TQ_INT32 biWidth; // pixmap width + TQ_INT32 biHeight; // pixmap height + TQ_INT16 biPlanes; // should be 1 + TQ_INT16 biBitCount; // number of bits per pixel + TQ_INT32 biCompression; // compression method + TQ_INT32 biSizeImage; // size of image + TQ_INT32 biXPelsPerMeter; // horizontal resolution + TQ_INT32 biYPelsPerMeter; // vertical resolution + TQ_INT32 biClrUsed; // number of colors used + TQ_INT32 biClrImportant; // number of important colors }; @@ -4591,7 +4591,7 @@ TQDataStream &operator>>( TQDataStream &s, BMP_INFOHDR &bi ) s >> bi.biClrUsed >> bi.biClrImportant; } else { // probably old Windows format - Q_INT16 w, h; + TQ_INT16 w, h; s >> w >> h >> bi.biPlanes >> bi.biBitCount; bi.biWidth = w; bi.biHeight = h; @@ -4709,11 +4709,11 @@ bool read_dib( TQDataStream& s, int offset, int startpos, TQImage& image ) return FALSE; } } else if (comp == BMP_BITFIELDS && (nbits == 16 || nbits == 32)) { - if ( (Q_ULONG)d->readBlock( (char *)&red_mask, sizeof(red_mask) ) != sizeof(red_mask) ) + if ( (TQ_ULONG)d->readBlock( (char *)&red_mask, sizeof(red_mask) ) != sizeof(red_mask) ) return FALSE; - if ( (Q_ULONG)d->readBlock( (char *)&green_mask, sizeof(green_mask) ) != sizeof(green_mask) ) + if ( (TQ_ULONG)d->readBlock( (char *)&green_mask, sizeof(green_mask) ) != sizeof(green_mask) ) return FALSE; - if ( (Q_ULONG)d->readBlock( (char *)&blue_mask, sizeof(blue_mask) ) != sizeof(blue_mask) ) + if ( (TQ_ULONG)d->readBlock( (char *)&blue_mask, sizeof(blue_mask) ) != sizeof(blue_mask) ) return FALSE; red_shift = calc_shift(red_mask); red_scale = 256 / ((red_mask >> red_shift) + 1); @@ -4733,7 +4733,7 @@ bool read_dib( TQDataStream& s, int offset, int startpos, TQImage& image ) return FALSE; // offset can be bogus, be careful - if (offset>=0 && startpos + offset > (Q_LONG)d->at() ) + if (offset>=0 && startpos + offset > (TQ_LONG)d->at() ) d->at( startpos + offset ); // start of image data int bpl = image.bytesPerLine(); |