diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-01-07 03:45:53 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-01-07 03:45:53 +0000 |
commit | 10308be19ef7fa44699562cc75946e7ea1fdf6b9 (patch) | |
tree | 4bc444c00a79e88105f2cfce5b6209994c413ca0 /kimgio | |
parent | 307136d8eef0ba133b78ceee8e901138d4c996a1 (diff) | |
download | tdelibs-10308be19ef7fa44699562cc75946e7ea1fdf6b9.tar.gz tdelibs-10308be19ef7fa44699562cc75946e7ea1fdf6b9.zip |
Revert automated changes
Sorry guys, they are just not ready for prime time
Work will continue as always
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1212479 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kimgio')
-rw-r--r-- | kimgio/dds.cpp | 68 | ||||
-rw-r--r-- | kimgio/eps.cpp | 10 | ||||
-rw-r--r-- | kimgio/exr.cpp | 2 | ||||
-rw-r--r-- | kimgio/hdr.cpp | 4 | ||||
-rw-r--r-- | kimgio/ico.cpp | 66 | ||||
-rw-r--r-- | kimgio/jp2.cpp | 12 | ||||
-rw-r--r-- | kimgio/pcx.cpp | 44 | ||||
-rw-r--r-- | kimgio/pcx.h | 46 | ||||
-rw-r--r-- | kimgio/psd.cpp | 8 | ||||
-rw-r--r-- | kimgio/rgb.cpp | 58 | ||||
-rw-r--r-- | kimgio/rgb.h | 22 | ||||
-rw-r--r-- | kimgio/tga.cpp | 32 | ||||
-rw-r--r-- | kimgio/tiffr.cpp | 2 | ||||
-rw-r--r-- | kimgio/xcf.cpp | 260 | ||||
-rw-r--r-- | kimgio/xcf.h | 70 | ||||
-rw-r--r-- | kimgio/xview.cpp | 14 |
16 files changed, 359 insertions, 359 deletions
diff --git a/kimgio/dds.cpp b/kimgio/dds.cpp index 3438de2b3..caacb2a3c 100644 --- a/kimgio/dds.cpp +++ b/kimgio/dds.cpp @@ -33,9 +33,9 @@ #define sqrtf(x) ((float)sqrt(x)) #endif -typedef TQ_UINT32 uint; -typedef TQ_UINT16 ushort; -typedef TQ_UINT8 uchar; +typedef Q_UINT32 uint; +typedef Q_UINT16 ushort; +typedef Q_UINT8 uchar; namespace { // Private. @@ -137,10 +137,10 @@ namespace { // Private. uint flags; uint fourcc; uint bitcount; - uint rtqmask; - uint gtqmask; - uint btqmask; - uint atqmask; + uint rmask; + uint gmask; + uint bmask; + uint amask; }; static TQDataStream & operator>> ( TQDataStream & s, DDSPixelFormat & pf ) @@ -149,10 +149,10 @@ namespace { // Private. s >> pf.flags; s >> pf.fourcc; s >> pf.bitcount; - s >> pf.rtqmask; - s >> pf.gtqmask; - s >> pf.btqmask; - s >> pf.atqmask; + s >> pf.rmask; + s >> pf.gmask; + s >> pf.bmask; + s >> pf.amask; return s; } @@ -230,7 +230,7 @@ namespace { // Private. if( header.pf.flags & DDPF_ALPHAPIXELS ) { switch( header.pf.bitcount ) { case 16: - return (header.pf.atqmask == 0x8000) ? DDS_A1R5G5B5 : DDS_A4R4G4B4; + return (header.pf.amask == 0x8000) ? DDS_A1R5G5B5 : DDS_A4R4G4B4; case 32: return DDS_A8R8G8B8; } @@ -298,7 +298,7 @@ namespace { // Private. for( uint x = 0; x < w; x++ ) { uchar r, g, b, a; s >> b >> g >> r >> a; - scanline[x] = tqRgba(r, g, b, a); + scanline[x] = qRgba(r, g, b, a); } } @@ -315,7 +315,7 @@ namespace { // Private. for( uint x = 0; x < w; x++ ) { uchar r, g, b; s >> b >> g >> r; - scanline[x] = tqRgb(r, g, b); + scanline[x] = qRgb(r, g, b); } } @@ -336,7 +336,7 @@ namespace { // Private. uchar r = (color.c.r << 3) | (color.c.r >> 2); uchar g = (color.c.g << 3) | (color.c.g >> 2); uchar b = (color.c.b << 3) | (color.c.b >> 2); - scanline[x] = tqRgba(r, g, b, a); + scanline[x] = qRgba(r, g, b, a); } } @@ -357,7 +357,7 @@ namespace { // Private. uchar r = (color.c.r << 4) | color.c.r; uchar g = (color.c.g << 4) | color.c.g; uchar b = (color.c.b << 4) | color.c.b; - scanline[x] = tqRgba(r, g, b, a); + scanline[x] = qRgba(r, g, b, a); } } @@ -377,7 +377,7 @@ namespace { // Private. uchar r = (color.c.r << 3) | (color.c.r >> 2); uchar g = (color.c.g << 2) | (color.c.g >> 4); uchar b = (color.c.b << 3) | (color.c.b >> 2); - scanline[x] = tqRgb(r, g, b); + scanline[x] = qRgb(r, g, b); } } @@ -539,16 +539,16 @@ namespace { // Private. Color8888 color_array[4]; block.GetColors(color_array); - // bit tqmasks = 00000011, 00001100, 00110000, 11000000 - const uint tqmasks[4] = { 3, 3<<2, 3<<4, 3<<6 }; + // bit masks = 00000011, 00001100, 00110000, 11000000 + const uint masks[4] = { 3, 3<<2, 3<<4, 3<<6 }; const int shift[4] = { 0, 2, 4, 6 }; // Write color block. for( uint j = 0; j < 4; j++ ) { for( uint i = 0; i < 4; i++ ) { if( img.valid( x+i, y+j ) ) { - uint idx = (block.row[j] & tqmasks[i]) >> shift[i]; - scanline[j][x+i] = tqRgba(color_array[idx].r, color_array[idx].g, color_array[idx].b, color_array[idx].a); + uint idx = (block.row[j] & masks[i]) >> shift[i]; + scanline[j][x+i] = qRgba(color_array[idx].r, color_array[idx].g, color_array[idx].b, color_array[idx].a); } } } @@ -580,8 +580,8 @@ namespace { // Private. Color8888 color_array[4]; block.GetColors(color_array); - // bit tqmasks = 00000011, 00001100, 00110000, 11000000 - const uint tqmasks[4] = { 3, 3<<2, 3<<4, 3<<6 }; + // bit masks = 00000011, 00001100, 00110000, 11000000 + const uint masks[4] = { 3, 3<<2, 3<<4, 3<<6 }; const int shift[4] = { 0, 2, 4, 6 }; // Write color block. @@ -589,10 +589,10 @@ namespace { // Private. ushort a = alpha.row[j]; for( uint i = 0; i < 4; i++ ) { if( img.valid( x+i, y+j ) ) { - uint idx = (block.row[j] & tqmasks[i]) >> shift[i]; + uint idx = (block.row[j] & masks[i]) >> shift[i]; color_array[idx].a = a & 0x0f; color_array[idx].a = color_array[idx].a | (color_array[idx].a << 4); - scanline[j][x+i] = tqRgba(color_array[idx].r, color_array[idx].g, color_array[idx].b, color_array[idx].a); + scanline[j][x+i] = qRgba(color_array[idx].r, color_array[idx].g, color_array[idx].b, color_array[idx].a); } a >>= 4; } @@ -638,17 +638,17 @@ namespace { // Private. uchar bit_array[16]; alpha.GetBits(bit_array); - // bit tqmasks = 00000011, 00001100, 00110000, 11000000 - const uint tqmasks[4] = { 3, 3<<2, 3<<4, 3<<6 }; + // bit masks = 00000011, 00001100, 00110000, 11000000 + const uint masks[4] = { 3, 3<<2, 3<<4, 3<<6 }; const int shift[4] = { 0, 2, 4, 6 }; // Write color block. for( uint j = 0; j < 4; j++ ) { for( uint i = 0; i < 4; i++ ) { if( img.valid( x+i, y+j ) ) { - uint idx = (block.row[j] & tqmasks[i]) >> shift[i]; + uint idx = (block.row[j] & masks[i]) >> shift[i]; color_array[idx].a = alpha_array[bit_array[j*4+i]]; - scanline[j][x+i] = tqRgba(color_array[idx].r, color_array[idx].g, color_array[idx].b, color_array[idx].a); + scanline[j][x+i] = qRgba(color_array[idx].r, color_array[idx].g, color_array[idx].b, color_array[idx].a); } } } @@ -693,17 +693,17 @@ namespace { // Private. uchar bit_array[16]; alpha.GetBits(bit_array); - // bit tqmasks = 00000011, 00001100, 00110000, 11000000 - const uint tqmasks[4] = { 3, 3<<2, 3<<4, 3<<6 }; + // bit masks = 00000011, 00001100, 00110000, 11000000 + const uint masks[4] = { 3, 3<<2, 3<<4, 3<<6 }; const int shift[4] = { 0, 2, 4, 6 }; // Write color block. for( uint j = 0; j < 4; j++ ) { for( uint i = 0; i < 4; i++ ) { if( img.valid( x+i, y+j ) ) { - uint idx = (block.row[j] & tqmasks[i]) >> shift[i]; + uint idx = (block.row[j] & masks[i]) >> shift[i]; color_array[idx].a = alpha_array[bit_array[j*4+i]]; - scanline[j][x+i] = tqRgb(color_array[idx].a, color_array[idx].g, color_array[idx].b); + scanline[j][x+i] = qRgb(color_array[idx].a, color_array[idx].g, color_array[idx].b); } } } @@ -757,7 +757,7 @@ namespace { // Private. const float fz = sqrtf(1.0f - fx*fx - fy*fy); const uchar nz = uchar((fz + 1.0f) * 127.5f); - scanline[j][x+i] = tqRgb(nx, ny, nz); + scanline[j][x+i] = qRgb(nx, ny, nz); } } } diff --git a/kimgio/eps.cpp b/kimgio/eps.cpp index 118d1ba4b..5067fb8e1 100644 --- a/kimgio/eps.cpp +++ b/kimgio/eps.cpp @@ -15,7 +15,7 @@ #define BBOX "%%BoundingBox:" #define BBOX_LEN strlen(BBOX) -static bool seekToCodeStart( TQIODevice * io, TQ_UINT32 & ps_offset, TQ_UINT32 & ps_size ) +static bool seekToCodeStart( TQIODevice * io, Q_UINT32 & ps_offset, Q_UINT32 & ps_size ) { char buf[4]; // We at most need to read 4 bytes at a time ps_offset=0L; @@ -134,13 +134,13 @@ KDE_EXPORT void kimgio_eps_read (TQImageIO *image) TQString tmp; TQIODevice* io = image->ioDevice(); - TQ_UINT32 ps_offset, ps_size; + Q_UINT32 ps_offset, ps_size; - // tqfind start of PostScript code + // find start of PostScript code if ( !seekToCodeStart(io, ps_offset, ps_size) ) return; - // tqfind bounding box + // find bounding box if ( !bbox (io, &x1, &y1, &x2, &y2)) { kdError(399) << "kimgio EPS: no bounding box found!" << endl; return; @@ -210,7 +210,7 @@ KDE_EXPORT void kimgio_eps_read (TQImageIO *image) return; } - fprintf (ghostfd, "\n%d %d translate\n", -tqRound(x1*xScale), -tqRound(y1*yScale)); + fprintf (ghostfd, "\n%d %d translate\n", -qRound(x1*xScale), -qRound(y1*yScale)); if ( needsScaling ) fprintf (ghostfd, "%g %g scale\n", xScale, yScale); diff --git a/kimgio/exr.cpp b/kimgio/exr.cpp index c28cb799b..e45812700 100644 --- a/kimgio/exr.cpp +++ b/kimgio/exr.cpp @@ -110,7 +110,7 @@ QRgb RgbaToQrgba(struct Rgba imagePixel) // the display's maximum intensity). // // 7) Clamp the values to [0, 255]. - return tqRgba( char (Imath::clamp ( r * 84.66f, 0.f, 255.f ) ), + return qRgba( char (Imath::clamp ( r * 84.66f, 0.f, 255.f ) ), char (Imath::clamp ( g * 84.66f, 0.f, 255.f ) ), char (Imath::clamp ( b * 84.66f, 0.f, 255.f ) ), char (Imath::clamp ( a * 84.66f, 0.f, 255.f ) ) ); diff --git a/kimgio/hdr.cpp b/kimgio/hdr.cpp index 2916a92e5..bf8bc5f03 100644 --- a/kimgio/hdr.cpp +++ b/kimgio/hdr.cpp @@ -16,7 +16,7 @@ #include <kdebug.h> #include <kglobal.h> -typedef TQ_UINT8 uchar; +typedef Q_UINT8 uchar; namespace { // Private. @@ -85,7 +85,7 @@ namespace { // Private. v = 1.0f / float(1 << -e); } - scanline[j] = tqRgb( ClipToByte(float(image[0]) * v), + scanline[j] = qRgb( ClipToByte(float(image[0]) * v), ClipToByte(float(image[1]) * v), ClipToByte(float(image[2]) * v) ); diff --git a/kimgio/ico.cpp b/kimgio/ico.cpp index fb2b70e97..01ee37a1b 100644 --- a/kimgio/ico.cpp +++ b/kimgio/ico.cpp @@ -29,9 +29,9 @@ namespace struct IcoHeader { enum Type { Icon = 1, Cursor }; - TQ_UINT16 reserved; - TQ_UINT16 type; - TQ_UINT16 count; + Q_UINT16 reserved; + Q_UINT16 type; + Q_UINT16 count; }; inline TQDataStream& operator >>( TQDataStream& s, IcoHeader& h ) @@ -43,21 +43,21 @@ namespace // (c) 1992-2002 Trolltech AS. struct BMP_INFOHDR { - static const TQ_UINT32 Size = 40; - TQ_UINT32 biSize; // size of this struct - TQ_UINT32 biWidth; // pixmap width - TQ_UINT32 biHeight; // pixmap height - TQ_UINT16 biPlanes; // should be 1 - TQ_UINT16 biBitCount; // number of bits per pixel + static const Q_UINT32 Size = 40; + Q_UINT32 biSize; // size of this struct + Q_UINT32 biWidth; // pixmap width + Q_UINT32 biHeight; // pixmap height + Q_UINT16 biPlanes; // should be 1 + Q_UINT16 biBitCount; // number of bits per pixel enum Compression { RGB = 0 }; - TQ_UINT32 biCompression; // compression method - TQ_UINT32 biSizeImage; // size of image - TQ_UINT32 biXPelsPerMeter; // horizontal resolution - TQ_UINT32 biYPelsPerMeter; // vertical resolution - TQ_UINT32 biClrUsed; // number of colors used - TQ_UINT32 biClrImportant; // number of important colors + Q_UINT32 biCompression; // compression method + Q_UINT32 biSizeImage; // size of image + Q_UINT32 biXPelsPerMeter; // horizontal resolution + Q_UINT32 biYPelsPerMeter; // vertical resolution + Q_UINT32 biClrUsed; // number of colors used + Q_UINT32 biClrImportant; // number of important colors }; - const TQ_UINT32 BMP_INFOHDR::Size; + const Q_UINT32 BMP_INFOHDR::Size; TQDataStream& operator >>( TQDataStream &s, BMP_INFOHDR &bi ) { @@ -92,11 +92,11 @@ namespace { unsigned char width; unsigned char height; - TQ_UINT16 colors; - TQ_UINT16 hotspotX; - TQ_UINT16 hotspotY; - TQ_UINT32 size; - TQ_UINT32 offset; + Q_UINT16 colors; + Q_UINT16 hotspotX; + Q_UINT16 hotspotY; + Q_UINT32 size; + Q_UINT32 offset; }; inline TQDataStream& operator >>( TQDataStream& s, IconRec& r ) @@ -163,7 +163,7 @@ namespace paletteEntries = header.biClrUsed; } - // Always create a 32-bit image to get the tqmask right + // Always create a 32-bit image to get the mask right // Note: this is safe as rec.width, rec.height are bytes icon.create( rec.width, rec.height, 32 ); if ( icon.isNull() ) return false; @@ -177,7 +177,7 @@ namespace unsigned char rgb[ 4 ]; stream.readRawBytes( reinterpret_cast< char* >( &rgb ), sizeof( rgb ) ); - colorTable[ i ] = tqRgb( rgb[ 2 ], rgb[ 1 ], rgb[ 0 ] ); + colorTable[ i ] = qRgb( rgb[ 2 ], rgb[ 1 ], rgb[ 0 ] ); } unsigned bpl = ( rec.width * header.biBitCount + 31 ) / 32 * 4; @@ -207,13 +207,13 @@ namespace break; case 24: for ( unsigned x = 0; x < rec.width; ++x ) - *p++ = tqRgb( pixel[ 3 * x + 2 ], + *p++ = qRgb( pixel[ 3 * x + 2 ], pixel[ 3 * x + 1 ], pixel[ 3 * x ] ); break; case 32: for ( unsigned x = 0; x < rec.width; ++x ) - *p++ = tqRgba( pixel[ 4 * x + 2 ], + *p++ = qRgba( pixel[ 4 * x + 2 ], pixel[ 4 * x + 1 ], pixel[ 4 * x ], pixel[ 4 * x + 3] ); @@ -224,7 +224,7 @@ namespace if ( header.biBitCount < 32 ) { - // Traditional 1-bit tqmask + // Traditional 1-bit mask bpl = ( rec.width + 31 ) / 32 * 4; buf = new unsigned char[ bpl ]; for ( unsigned y = rec.height; y--; ) @@ -233,7 +233,7 @@ namespace QRgb* p = reinterpret_cast< QRgb* >( lines[ y ] ); for ( unsigned x = 0; x < rec.width; ++x, ++p ) if ( ( ( buf[ x / 8 ] >> ( 7 - ( x & 0x07 ) ) ) & 1 ) ) - *p &= TQRGB_MASK; + *p &= RGB_MASK; } delete[] buf; } @@ -321,21 +321,21 @@ void kimgio_ico_write(TQImageIO *io) dib.setByteOrder(TQDataStream::LittleEndian); TQImage pixels = io->image(); - TQImage tqmask; + TQImage mask; if (io->image().hasAlphaBuffer()) - tqmask = io->image().createAlphaMask(); + mask = io->image().createAlphaMask(); else - tqmask = io->image().createHeuristicMask(); - tqmask.invertPixels(); + mask = io->image().createHeuristicMask(); + mask.invertPixels(); for ( int y = 0; y < pixels.height(); ++y ) for ( int x = 0; x < pixels.width(); ++x ) - if ( tqmask.pixel( x, y ) == 0 ) pixels.setPixel( x, y, 0 ); + if ( mask.pixel( x, y ) == 0 ) pixels.setPixel( x, y, 0 ); if (!qt_write_dib(dib, pixels)) return; uint hdrPos = dib.device()->at(); - if (!qt_write_dib(dib, tqmask)) + if (!qt_write_dib(dib, mask)) return; memmove(dibData.data() + hdrPos, dibData.data() + hdrPos + BMP_WIN + 8, dibData.size() - hdrPos - BMP_WIN - 8); dibData.resize(dibData.size() - BMP_WIN - 8); diff --git a/kimgio/jp2.cpp b/kimgio/jp2.cpp index 2200c948c..71b260375 100644 --- a/kimgio/jp2.cpp +++ b/kimgio/jp2.cpp @@ -60,7 +60,7 @@ read_image( const TQImageIO* io ) TQFile* out = tempf->file(); // 4096 (=4k) is a common page size. TQByteArray b( 4096 ); - TQ_LONG size; + Q_LONG size; // 0 or -1 is EOF / error while( ( size = io->ioDevice()->readBlock( b.data(), 4096 ) ) > 0 ) { // in case of a write error, still give the decoder a try @@ -139,7 +139,7 @@ render_view( gs_t& gs, TQImage& qti ) else if( v[k] > 255 ) v[k] = 255; } // for k - *data++ = tqRgb( v[0], v[1], v[2] ); + *data++ = qRgb( v[0], v[1], v[2] ); } // for x } // for y return true; @@ -211,19 +211,19 @@ write_components( jas_image_t* ji, const TQImage& qi ) jas_image_setcmpttype( ji, 0, JAS_IMAGE_CT_RGB_R ); for( uint y = 0; y < height; ++y ) for( uint x = 0; x < width; ++x ) - jas_matrix_set( m, y, x, tqRed( qi.pixel( x, y ) ) ); + jas_matrix_set( m, y, x, qRed( qi.pixel( x, y ) ) ); jas_image_writecmpt( ji, 0, 0, 0, width, height, m ); jas_image_setcmpttype( ji, 1, JAS_IMAGE_CT_RGB_G ); for( uint y = 0; y < height; ++y ) for( uint x = 0; x < width; ++x ) - jas_matrix_set( m, y, x, tqGreen( qi.pixel( x, y ) ) ); + jas_matrix_set( m, y, x, qGreen( qi.pixel( x, y ) ) ); jas_image_writecmpt( ji, 1, 0, 0, width, height, m ); jas_image_setcmpttype( ji, 2, JAS_IMAGE_CT_RGB_B ); for( uint y = 0; y < height; ++y ) for( uint x = 0; x < width; ++x ) - jas_matrix_set( m, y, x, tqBlue( qi.pixel( x, y ) ) ); + jas_matrix_set( m, y, x, qBlue( qi.pixel( x, y ) ) ); jas_image_writecmpt( ji, 2, 0, 0, width, height, m ); jas_matrix_destroy( m ); @@ -288,7 +288,7 @@ kimgio_jp2_write( TQImageIO* io ) TQFile* in = ktempf->file(); TQByteArray b( 4096 ); - TQ_LONG size; + Q_LONG size; // seek to the beginning of the file. if( !in->at( 0 ) ) { delete ktempf; return; } diff --git a/kimgio/pcx.cpp b/kimgio/pcx.cpp index 444bc7974..3d866ad0a 100644 --- a/kimgio/pcx.cpp +++ b/kimgio/pcx.cpp @@ -45,7 +45,7 @@ static TQDataStream &operator>>( TQDataStream &s, PCXHEADER &ph ) s >> ph.VScreenSize; // Skip the rest of the header - TQ_UINT8 byte; + Q_UINT8 byte; while ( s.device()->at() < 128 ) s >> byte; @@ -83,7 +83,7 @@ static TQDataStream &operator<<( TQDataStream &s, const PCXHEADER &ph ) s << ph.HScreenSize; s << ph.VScreenSize; - TQ_UINT8 byte = 0; + Q_UINT8 byte = 0; for ( int i=0; i<54; ++i ) s << byte; @@ -101,9 +101,9 @@ PCXHEADER::PCXHEADER() static void readLine( TQDataStream &s, TQByteArray &buf, const PCXHEADER &header ) { - TQ_UINT32 i=0; - TQ_UINT32 size = buf.size(); - TQ_UINT8 byte, count; + Q_UINT32 i=0; + Q_UINT32 size = buf.size(); + Q_UINT8 byte, count; if ( header.isCompressed() ) { @@ -155,8 +155,8 @@ static void readImage1( TQImage &img, TQDataStream &s, const PCXHEADER &header ) } // Set the color palette - img.setColor( 0, tqRgb( 0, 0, 0 ) ); - img.setColor( 1, tqRgb( 255, 255, 255 ) ); + img.setColor( 0, qRgb( 0, 0, 0 ) ); + img.setColor( 1, qRgb( 255, 255, 255 ) ); } static void readImage4( TQImage &img, TQDataStream &s, const PCXHEADER &header ) @@ -180,7 +180,7 @@ static void readImage4( TQImage &img, TQDataStream &s, const PCXHEADER &header ) for ( int i=0; i<4; i++ ) { - TQ_UINT32 offset = i*header.BytesPerLine; + Q_UINT32 offset = i*header.BytesPerLine; for ( unsigned int x=0; x<header.width(); ++x ) if ( buf[ offset + ( x/8 ) ] & ( 128 >> ( x%8 ) ) ) pixbuf[ x ] += ( 1 << i ); @@ -219,18 +219,18 @@ static void readImage8( TQImage &img, TQDataStream &s, const PCXHEADER &header ) p[ x ] = buf[ x ]; } - TQ_UINT8 flag; + Q_UINT8 flag; s >> flag; kdDebug( 399 ) << "Palette Flag: " << flag << endl; if ( flag == 12 && ( header.Version == 5 || header.Version == 2 ) ) { // Read the palette - TQ_UINT8 r, g, b; + Q_UINT8 r, g, b; for ( int i=0; i<256; ++i ) { s >> r >> g >> b; - img.setColor( i, tqRgb( r, g, b ) ); + img.setColor( i, qRgb( r, g, b ) ); } } } @@ -258,7 +258,7 @@ static void readImage24( TQImage &img, TQDataStream &s, const PCXHEADER &header uint *p = ( uint * )img.scanLine( y ); for ( unsigned int x=0; x<header.width(); ++x ) - p[ x ] = tqRgb( r_buf[ x ], g_buf[ x ], b_buf[ x ] ); + p[ x ] = qRgb( r_buf[ x ], g_buf[ x ], b_buf[ x ] ); } } @@ -333,9 +333,9 @@ KDE_EXPORT void kimgio_pcx_read( TQImageIO *io ) static void writeLine( TQDataStream &s, TQByteArray &buf ) { - TQ_UINT32 i = 0; - TQ_UINT32 size = buf.size(); - TQ_UINT8 count, data; + Q_UINT32 i = 0; + Q_UINT32 size = buf.size(); + Q_UINT8 count, data; char byte; while ( i < size ) @@ -375,7 +375,7 @@ static void writeImage1( TQImage &img, TQDataStream &s, PCXHEADER &header ) for ( int y=0; y<header.height(); ++y ) { - TQ_UINT8 *p = img.scanLine( y ); + Q_UINT8 *p = img.scanLine( y ); // Invert as TQImage uses reverse palette for monochrome images? for ( int i=0; i<header.BytesPerLine; ++i ) @@ -403,7 +403,7 @@ static void writeImage4( TQImage &img, TQDataStream &s, PCXHEADER &header ) for ( int y=0; y<header.height(); ++y ) { - TQ_UINT8 *p = img.scanLine( y ); + Q_UINT8 *p = img.scanLine( y ); for ( int i=0; i<4; ++i ) buf[ i ].fill( 0 ); @@ -432,7 +432,7 @@ static void writeImage8( TQImage &img, TQDataStream &s, PCXHEADER &header ) for ( int y=0; y<header.height(); ++y ) { - TQ_UINT8 *p = img.scanLine( y ); + Q_UINT8 *p = img.scanLine( y ); for ( int i=0; i<header.BytesPerLine; ++i ) buf[ i ] = p[ i ]; @@ -441,7 +441,7 @@ static void writeImage8( TQImage &img, TQDataStream &s, PCXHEADER &header ) } // Write palette flag - TQ_UINT8 byte = 12; + Q_UINT8 byte = 12; s << byte; // Write palette @@ -468,9 +468,9 @@ static void writeImage24( TQImage &img, TQDataStream &s, PCXHEADER &header ) for ( unsigned int x=0; x<header.width(); ++x ) { QRgb rgb = *p++; - r_buf[ x ] = tqRed( rgb ); - g_buf[ x ] = tqGreen( rgb ); - b_buf[ x ] = tqBlue( rgb ); + r_buf[ x ] = qRed( rgb ); + g_buf[ x ] = qGreen( rgb ); + b_buf[ x ] = qBlue( rgb ); } writeLine( s, r_buf ); diff --git a/kimgio/pcx.h b/kimgio/pcx.h index 0eacba8c0..eef3293c5 100644 --- a/kimgio/pcx.h +++ b/kimgio/pcx.h @@ -29,14 +29,14 @@ class RGB RGB( const QRgb color ) { - r = tqRed( color ); - g = tqGreen( color ); - b = tqBlue( color ); + r = qRed( color ); + g = qGreen( color ); + b = qBlue( color ); } - TQ_UINT8 r; - TQ_UINT8 g; - TQ_UINT8 b; + Q_UINT8 r; + Q_UINT8 g; + Q_UINT8 b; }; class Palette @@ -51,7 +51,7 @@ class Palette QRgb color( int i ) const { - return tqRgb( rgb[ i ].r, rgb[ i ].g, rgb[ i ].b ); + return qRgb( rgb[ i ].r, rgb[ i ].g, rgb[ i ].b ); } struct RGB rgb[ 16 ]; @@ -66,8 +66,8 @@ class PCXHEADER inline int height() const { return ( YMax-YMin ) + 1; } inline bool isCompressed() const { return ( Encoding==1 ); } - TQ_UINT8 Manufacturer; // Constant Flag, 10 = ZSoft .pcx - TQ_UINT8 Version; // Version informationˇ + Q_UINT8 Manufacturer; // Constant Flag, 10 = ZSoft .pcx + Q_UINT8 Version; // Version informationˇ // 0 = Version 2.5 of PC Paintbrushˇ // 2 = Version 2.8 w/palette informationˇ // 3 = Version 2.8 w/o palette informationˇ @@ -77,26 +77,26 @@ class PCXHEADER // and PC Paintbrush +, includes // Publisher's Paintbrush . Includes // 24-bit .PCX filesˇ - TQ_UINT8 Encoding; // 1 = .PCX run length encoding - TQ_UINT8 Bpp; // Number of bits to represent a pixel + Q_UINT8 Encoding; // 1 = .PCX run length encoding + Q_UINT8 Bpp; // Number of bits to represent a pixel // (per Plane) - 1, 2, 4, or 8ˇ - TQ_UINT16 XMin; - TQ_UINT16 YMin; - TQ_UINT16 XMax; - TQ_UINT16 YMax; - TQ_UINT16 HDpi; - TQ_UINT16 YDpi; + Q_UINT16 XMin; + Q_UINT16 YMin; + Q_UINT16 XMax; + Q_UINT16 YMax; + Q_UINT16 HDpi; + Q_UINT16 YDpi; Palette ColorMap; - TQ_UINT8 Reserved; // Should be set to 0. - TQ_UINT8 NPlanes; // Number of color planes - TQ_UINT16 BytesPerLine; // Number of bytes to allocate for a scanline + Q_UINT8 Reserved; // Should be set to 0. + Q_UINT8 NPlanes; // Number of color planes + Q_UINT16 BytesPerLine; // Number of bytes to allocate for a scanline // plane. MUST be an EVEN number. Do NOT // calculate from Xmax-Xmin.ˇ - TQ_UINT16 PaletteInfo; // How to interpret palette- 1 = Color/BW, + Q_UINT16 PaletteInfo; // How to interpret palette- 1 = Color/BW, // 2 = Grayscale ( ignored in PB IV/ IV + )ˇ - TQ_UINT16 HScreenSize; // Horizontal screen size in pixels. New field + Q_UINT16 HScreenSize; // Horizontal screen size in pixels. New field // found only in PB IV/IV Plus - TQ_UINT16 VScreenSize; // Vertical screen size in pixels. New field + Q_UINT16 VScreenSize; // Vertical screen size in pixels. New field // found only in PB IV/IV Plus } KDE_PACKED; diff --git a/kimgio/psd.cpp b/kimgio/psd.cpp index bf5561c8e..13070a0c2 100644 --- a/kimgio/psd.cpp +++ b/kimgio/psd.cpp @@ -24,9 +24,9 @@ #include <kdebug.h> -typedef TQ_UINT32 uint; -typedef TQ_UINT16 ushort; -typedef TQ_UINT8 uchar; +typedef Q_UINT32 uint; +typedef Q_UINT16 ushort; +typedef Q_UINT8 uchar; namespace { // Private. @@ -145,7 +145,7 @@ namespace { // Private. // Clear the image. if( channel_num < 4 ) { - img.fill(tqRgba(0, 0, 0, 0xFF)); + img.fill(qRgba(0, 0, 0, 0xFF)); } else { // Enable alpha. diff --git a/kimgio/rgb.cpp b/kimgio/rgb.cpp index 806dab389..71976685a 100644 --- a/kimgio/rgb.cpp +++ b/kimgio/rgb.cpp @@ -121,7 +121,7 @@ bool SGIImage::getRow(uchar *dest) bool SGIImage::readData(TQImage& img) { QRgb *c; - TQ_UINT32 *start = m_starttab; + Q_UINT32 *start = m_starttab; TQByteArray lguard(m_xsize); uchar *line = (uchar *)lguard.data(); unsigned x, y; @@ -136,7 +136,7 @@ bool SGIImage::readData(TQImage& img) return false; c = (QRgb *)img.scanLine(m_ysize - y - 1); for (x = 0; x < m_xsize; x++, c++) - *c = tqRgb(line[x], line[x], line[x]); + *c = qRgb(line[x], line[x], line[x]); } if (m_zsize == 1) @@ -150,7 +150,7 @@ bool SGIImage::readData(TQImage& img) return false; c = (QRgb *)img.scanLine(m_ysize - y - 1); for (x = 0; x < m_xsize; x++, c++) - *c = tqRgb(tqRed(*c), line[x], line[x]); + *c = qRgb(qRed(*c), line[x], line[x]); } for (y = 0; y < m_ysize; y++) { @@ -160,7 +160,7 @@ bool SGIImage::readData(TQImage& img) return false; c = (QRgb *)img.scanLine(m_ysize - y - 1); for (x = 0; x < m_xsize; x++, c++) - *c = tqRgb(tqRed(*c), tqGreen(*c), line[x]); + *c = qRgb(qRed(*c), qGreen(*c), line[x]); } if (m_zsize == 3) @@ -174,7 +174,7 @@ bool SGIImage::readData(TQImage& img) return false; c = (QRgb *)img.scanLine(m_ysize - y - 1); for (x = 0; x < m_xsize; x++, c++) - *c = tqRgba(tqRed(*c), tqGreen(*c), tqBlue(*c), line[x]); + *c = qRgba(qRed(*c), qGreen(*c), qBlue(*c), line[x]); } return true; @@ -183,9 +183,9 @@ bool SGIImage::readData(TQImage& img) bool SGIImage::readImage(TQImage& img) { - TQ_INT8 u8; - TQ_INT16 u16; - TQ_INT32 u32; + Q_INT8 u8; + Q_INT16 u16; + Q_INT32 u32; kdDebug(399) << "reading '" << m_io->fileName() << '\'' << endl; @@ -256,13 +256,13 @@ bool SGIImage::readImage(TQImage& img) if (m_rle) { uint l; - m_starttab = new TQ_UINT32[m_numrows]; + m_starttab = new Q_UINT32[m_numrows]; for (l = 0; !m_stream.atEnd() && l < m_numrows; l++) { m_stream >> m_starttab[l]; - m_starttab[l] -= 512 + m_numrows * 2 * sizeof(TQ_UINT32); + m_starttab[l] -= 512 + m_numrows * 2 * sizeof(Q_UINT32); } - m_lengthtab = new TQ_UINT32[m_numrows]; + m_lengthtab = new Q_UINT32[m_numrows]; for (l = 0; l < m_numrows; l++) m_stream >> m_lengthtab[l]; } @@ -323,7 +323,7 @@ bool RLEData::operator<(const RLEData& b) const uint RLEMap::insert(const uchar *d, uint l) { RLEData data = RLEData(d, l, m_offset); - Iterator it = tqfind(data); + Iterator it = find(data); if (it != end()) return it.data(); @@ -389,7 +389,7 @@ uint SGIImage::compact(uchar *d, uchar *s) bool SGIImage::scanData(const TQImage& img) { - TQ_UINT32 *start = m_starttab; + Q_UINT32 *start = m_starttab; TQCString lineguard(m_xsize * 2); TQCString bufguard(m_xsize); uchar *line = (uchar *)lineguard.data(); @@ -401,7 +401,7 @@ bool SGIImage::scanData(const TQImage& img) for (y = 0; y < m_ysize; y++) { c = reinterpret_cast<QRgb *>(img.scanLine(m_ysize - y - 1)); for (x = 0; x < m_xsize; x++) - buf[x] = intensity(tqRed(*c++)); + buf[x] = intensity(qRed(*c++)); len = compact(line, buf); *start++ = m_rlemap.insert(line, len); } @@ -413,7 +413,7 @@ bool SGIImage::scanData(const TQImage& img) for (y = 0; y < m_ysize; y++) { c = reinterpret_cast<QRgb *>(img.scanLine(m_ysize - y - 1)); for (x = 0; x < m_xsize; x++) - buf[x] = intensity(tqGreen(*c++)); + buf[x] = intensity(qGreen(*c++)); len = compact(line, buf); *start++ = m_rlemap.insert(line, len); } @@ -421,7 +421,7 @@ bool SGIImage::scanData(const TQImage& img) for (y = 0; y < m_ysize; y++) { c = reinterpret_cast<QRgb *>(img.scanLine(m_ysize - y - 1)); for (x = 0; x < m_xsize; x++) - buf[x] = intensity(tqBlue(*c++)); + buf[x] = intensity(qBlue(*c++)); len = compact(line, buf); *start++ = m_rlemap.insert(line, len); } @@ -433,7 +433,7 @@ bool SGIImage::scanData(const TQImage& img) for (y = 0; y < m_ysize; y++) { c = reinterpret_cast<QRgb *>(img.scanLine(m_ysize - y - 1)); for (x = 0; x < m_xsize; x++) - buf[x] = intensity(tqAlpha(*c++)); + buf[x] = intensity(qAlpha(*c++)); len = compact(line, buf); *start++ = m_rlemap.insert(line, len); } @@ -444,11 +444,11 @@ bool SGIImage::scanData(const TQImage& img) void SGIImage::writeHeader() { - m_stream << TQ_UINT16(0x01da); + m_stream << Q_UINT16(0x01da); m_stream << m_rle << m_bpc << m_dim; m_stream << m_xsize << m_ysize << m_zsize; m_stream << m_pixmin << m_pixmax; - m_stream << TQ_UINT32(0); + m_stream << Q_UINT32(0); uint i; TQString desc = m_io->description(); @@ -463,7 +463,7 @@ void SGIImage::writeHeader() m_stream << m_colormap; for (i = 0; i < 404; i++) - m_stream << TQ_UINT8(0); + m_stream << Q_UINT8(0); } @@ -476,11 +476,11 @@ void SGIImage::writeRle() // write start table for (i = 0; i < m_numrows; i++) - m_stream << TQ_UINT32(m_rlevector[m_starttab[i]]->offset()); + m_stream << Q_UINT32(m_rlevector[m_starttab[i]]->offset()); // write length table for (i = 0; i < m_numrows; i++) - m_stream << TQ_UINT32(m_rlevector[m_starttab[i]]->size()); + m_stream << Q_UINT32(m_rlevector[m_starttab[i]]->size()); // write data for (i = 0; i < m_rlevector.size(); i++) @@ -500,7 +500,7 @@ void SGIImage::writeVerbatim(const TQImage& img) for (y = 0; y < m_ysize; y++) { c = reinterpret_cast<QRgb *>(img.scanLine(m_ysize - y - 1)); for (x = 0; x < m_xsize; x++) - m_stream << TQ_UINT8(tqRed(*c++)); + m_stream << Q_UINT8(qRed(*c++)); } if (m_zsize == 1) @@ -510,13 +510,13 @@ void SGIImage::writeVerbatim(const TQImage& img) for (y = 0; y < m_ysize; y++) { c = reinterpret_cast<QRgb *>(img.scanLine(m_ysize - y - 1)); for (x = 0; x < m_xsize; x++) - m_stream << TQ_UINT8(tqGreen(*c++)); + m_stream << Q_UINT8(qGreen(*c++)); } for (y = 0; y < m_ysize; y++) { c = reinterpret_cast<QRgb *>(img.scanLine(m_ysize - y - 1)); for (x = 0; x < m_xsize; x++) - m_stream << TQ_UINT8(tqBlue(*c++)); + m_stream << Q_UINT8(qBlue(*c++)); } if (m_zsize == 3) @@ -526,7 +526,7 @@ void SGIImage::writeVerbatim(const TQImage& img) for (y = 0; y < m_ysize; y++) { c = reinterpret_cast<QRgb *>(img.scanLine(m_ysize - y - 1)); for (x = 0; x < m_xsize; x++) - m_stream << TQ_UINT8(tqAlpha(*c++)); + m_stream << Q_UINT8(qAlpha(*c++)); } } @@ -558,8 +558,8 @@ bool SGIImage::writeImage(TQImage& img) m_numrows = m_ysize * m_zsize; - m_starttab = new TQ_UINT32[m_numrows]; - m_rlemap.setBaseOffset(512 + m_numrows * 2 * sizeof(TQ_UINT32)); + m_starttab = new Q_UINT32[m_numrows]; + m_rlemap.setBaseOffset(512 + m_numrows * 2 * sizeof(Q_UINT32)); if (!scanData(img)) { kdDebug(399) << "this can't happen" << endl; @@ -569,7 +569,7 @@ bool SGIImage::writeImage(TQImage& img) m_rlevector = m_rlemap.vector(); long verbatim_size = m_numrows * m_xsize; - long rle_size = m_numrows * 2 * sizeof(TQ_UINT32); + long rle_size = m_numrows * 2 * sizeof(Q_UINT32); for (uint i = 0; i < m_rlevector.size(); i++) rle_size += m_rlevector[i]->size(); diff --git a/kimgio/rgb.h b/kimgio/rgb.h index 424920221..fae42a900 100644 --- a/kimgio/rgb.h +++ b/kimgio/rgb.h @@ -63,19 +63,19 @@ private: QIODevice *m_dev; QDataStream m_stream; - TQ_UINT8 m_rle; - TQ_UINT8 m_bpc; - TQ_UINT16 m_dim; - TQ_UINT16 m_xsize; - TQ_UINT16 m_ysize; - TQ_UINT16 m_zsize; - TQ_UINT32 m_pixmin; - TQ_UINT32 m_pixmax; + Q_UINT8 m_rle; + Q_UINT8 m_bpc; + Q_UINT16 m_dim; + Q_UINT16 m_xsize; + Q_UINT16 m_ysize; + Q_UINT16 m_zsize; + Q_UINT32 m_pixmin; + Q_UINT32 m_pixmax; char m_imagename[80]; - TQ_UINT32 m_colormap; + Q_UINT32 m_colormap; - TQ_UINT32 *m_starttab; - TQ_UINT32 *m_lengthtab; + Q_UINT32 *m_starttab; + Q_UINT32 *m_lengthtab; QByteArray m_data; TQByteArray::Iterator m_pos; RLEMap m_rlemap; diff --git a/kimgio/tga.cpp b/kimgio/tga.cpp index c68dc6a0c..8fb5fbd7f 100644 --- a/kimgio/tga.cpp +++ b/kimgio/tga.cpp @@ -27,9 +27,9 @@ #include <kdebug.h> -typedef TQ_UINT32 uint; -typedef TQ_UINT16 ushort; -typedef TQ_UINT8 uchar; +typedef Q_UINT32 uint; +typedef Q_UINT16 ushort; +typedef Q_UINT8 uchar; namespace { // Private. @@ -268,13 +268,13 @@ namespace { // Private. // Paletted. for( int x = 0; x < tga.width; x++ ) { uchar idx = *src++; - scanline[x] = tqRgb( palette[3*idx+2], palette[3*idx+1], palette[3*idx+0] ); + scanline[x] = qRgb( palette[3*idx+2], palette[3*idx+1], palette[3*idx+0] ); } } else if( info.grey ) { // Greyscale. for( int x = 0; x < tga.width; x++ ) { - scanline[x] = tqRgb( *src, *src, *src ); + scanline[x] = qRgb( *src, *src, *src ); src++; } } @@ -283,13 +283,13 @@ namespace { // Private. if( tga.pixel_size == 16 ) { for( int x = 0; x < tga.width; x++ ) { Color555 c = *reinterpret_cast<Color555 *>(src); - scanline[x] = tqRgb( (c.r << 3) | (c.r >> 2), (c.g << 3) | (c.g >> 2), (c.b << 3) | (c.b >> 2) ); + scanline[x] = qRgb( (c.r << 3) | (c.r >> 2), (c.g << 3) | (c.g >> 2), (c.b << 3) | (c.b >> 2) ); src += 2; } } else if( tga.pixel_size == 24 ) { for( int x = 0; x < tga.width; x++ ) { - scanline[x] = tqRgb( src[2], src[1], src[0] ); + scanline[x] = qRgb( src[2], src[1], src[0] ); src += 3; } } @@ -297,7 +297,7 @@ namespace { // Private. for( int x = 0; x < tga.width; x++ ) { // ### TODO: verify with images having really some alpha data const uchar alpha = ( src[3] << ( 8 - numAlphaBits ) ); - scanline[x] = tqRgba( src[2], src[1], src[0], alpha ); + scanline[x] = qRgba( src[2], src[1], src[0], alpha ); src += 4; } } @@ -370,19 +370,19 @@ KDE_EXPORT void kimgio_tga_write( TQImageIO *io ) s << targaMagic[i]; // write header - s << TQ_UINT16( img.width() ); // width - s << TQ_UINT16( img.height() ); // height - s << TQ_UINT8( hasAlpha ? 32 : 24 ); // depth (24 bit RGB + 8 bit alpha) - s << TQ_UINT8( hasAlpha ? 0x24 : 0x20 ); // top left image (0x20) + 8 bit alpha (0x4) + s << Q_UINT16( img.width() ); // width + s << Q_UINT16( img.height() ); // height + s << Q_UINT8( hasAlpha ? 32 : 24 ); // depth (24 bit RGB + 8 bit alpha) + s << Q_UINT8( hasAlpha ? 0x24 : 0x20 ); // top left image (0x20) + 8 bit alpha (0x4) for( int y = 0; y < img.height(); y++ ) for( int x = 0; x < img.width(); x++ ) { const QRgb color = img.pixel( x, y ); - s << TQ_UINT8( tqBlue( color ) ); - s << TQ_UINT8( tqGreen( color ) ); - s << TQ_UINT8( tqRed( color ) ); + s << Q_UINT8( qBlue( color ) ); + s << Q_UINT8( qGreen( color ) ); + s << Q_UINT8( qRed( color ) ); if( hasAlpha ) - s << TQ_UINT8( tqAlpha( color ) ); + s << Q_UINT8( qAlpha( color ) ); } io->setStatus( 0 ); diff --git a/kimgio/tiffr.cpp b/kimgio/tiffr.cpp index 5f319e6b5..f8022d2dd 100644 --- a/kimgio/tiffr.cpp +++ b/kimgio/tiffr.cpp @@ -133,7 +133,7 @@ KDE_EXPORT void kimgio_tiff_read( TQImageIO *io ) // for( int ctr = (image.numBytes() / sizeof(uint32))+1; ctr ; ctr-- ) { // // TODO: manage alpha with TIFFGetA -// *data = tqRgb( TIFFGetR( *data ), +// *data = qRgb( TIFFGetR( *data ), // TIFFGetG( *data ), TIFFGetB( *data ) ); // data++; // } diff --git a/kimgio/xcf.cpp b/kimgio/xcf.cpp index 327e6eae4..298d17109 100644 --- a/kimgio/xcf.cpp +++ b/kimgio/xcf.cpp @@ -78,9 +78,9 @@ const XCFImageFormat::LayerModes XCFImageFormat::layer_modes[] = { //! Change a QRgb value's alpha only. -inline QRgb tqRgba ( QRgb rgb, int a ) +inline QRgb qRgba ( QRgb rgb, int a ) { - return ((a & 0xff) << 24 | (rgb & TQRGB_MASK)); + return ((a & 0xff) << 24 | (rgb & RGB_MASK)); } @@ -149,10 +149,10 @@ kdDebug() << tag << " " << xcf_image.width << " " << xcf_image.height << " " << // all the data of all layers before beginning to construct the // merged image). - TQValueStack<TQ_INT32> layer_offsets; + TQValueStack<Q_INT32> layer_offsets; while (true) { - TQ_INT32 layer_offset; + Q_INT32 layer_offset; xcf_io >> layer_offset; @@ -176,7 +176,7 @@ kdDebug() << tag << " " << xcf_image.width << " " << xcf_image.height << " " << // Load each layer and add it to the image while (!layer_offsets.isEmpty()) { - TQ_INT32 layer_offset = layer_offsets.pop(); + Q_INT32 layer_offset = layer_offsets.pop(); xcf_io.device()->at(layer_offset); @@ -196,7 +196,7 @@ kdDebug() << tag << " " << xcf_image.width << " " << xcf_image.height << " " << /*! * An XCF file can contain an arbitrary number of properties associated - * with the image (and layer and tqmask). + * with the image (and layer and mask). * \param xcf_io the data stream connected to the XCF image * \param xcf_image XCF image data. * \return true if there were no I/O errors. @@ -233,11 +233,11 @@ bool XCFImageFormat::loadImageProperties(TQDataStream& xcf_io, XCFImage& xcf_ima case PROP_PARASITES: while (!property.atEnd()) { char* tag; - TQ_UINT32 size; + Q_UINT32 size; property.readBytes(tag, size); - TQ_UINT32 flags; + Q_UINT32 flags; char* data=0; property >> flags >> data; @@ -269,7 +269,7 @@ bool XCFImageFormat::loadImageProperties(TQDataStream& xcf_io, XCFImage& xcf_ima for (int i = 0; i < xcf_image.num_colors; i++) { uchar r, g, b; property >> r >> g >> b; - xcf_image.palette.push_back( tqRgb(r,g,b) ); + xcf_image.palette.push_back( qRgb(r,g,b) ); } break; @@ -290,7 +290,7 @@ bool XCFImageFormat::loadImageProperties(TQDataStream& xcf_io, XCFImage& xcf_ima * \return true if there were no IO errors. */ bool XCFImageFormat::loadProperty(TQDataStream& xcf_io, PropType& type, TQByteArray& bytes) { - TQ_UINT32 foo; + Q_UINT32 foo; xcf_io >> foo; type=PropType(foo); // TODO urks @@ -300,7 +300,7 @@ bool XCFImageFormat::loadProperty(TQDataStream& xcf_io, PropType& type, TQByteAr } char* data; - TQ_UINT32 size; + Q_UINT32 size; // The colormap property size is not the correct number of bytes: // The GIMP source xcf.c has size = 4 + ncolors, but it should be @@ -324,7 +324,7 @@ bool XCFImageFormat::loadProperty(TQDataStream& xcf_io, PropType& type, TQByteAr } else if (type == PROP_USER_UNIT) { // The USER UNIT property size is not correct. I'm not sure why, though. float factor; - TQ_INT32 digits; + Q_INT32 digits; char* unit_strings; xcf_io >> size >> factor >> digits; @@ -371,7 +371,7 @@ bool XCFImageFormat::loadProperty(TQDataStream& xcf_io, PropType& type, TQByteAr * Load a layer from the XCF file. The data stream must be positioned at * the beginning of the layer data. * \param xcf_io the image file data stream. - * \param xcf_image tqcontains the layer and the color table + * \param xcf_image contains the layer and the color table * (if the image is indexed). * \return true if there were no I/O errors. */ @@ -404,7 +404,7 @@ bool XCFImageFormat::loadLayer(TQDataStream& xcf_io, XCFImage& xcf_image) // If there are any more layers, merge them into the final TQImage. - xcf_io >> layer.hierarchy_offset >> layer.tqmask_offset; + xcf_io >> layer.hierarchy_offset >> layer.mask_offset; if (xcf_io.device()->status() != IO_Ok) { kdDebug(399) << "XCF: read failure on layer image offsets" << endl; return false; @@ -426,8 +426,8 @@ bool XCFImageFormat::loadLayer(TQDataStream& xcf_io, XCFImage& xcf_image) if (!loadHierarchy(xcf_io, layer)) return false; - if (layer.tqmask_offset != 0) { - xcf_io.device()->at(layer.tqmask_offset); + if (layer.mask_offset != 0) { + xcf_io.device()->at(layer.mask_offset); if (!loadMask(xcf_io, layer)) return false; @@ -494,15 +494,15 @@ bool XCFImageFormat::loadLayerProperties(TQDataStream& xcf_io, Layer& layer) break; case PROP_APPLY_MASK: - property >> layer.apply_tqmask; + property >> layer.apply_mask; break; case PROP_EDIT_MASK: - property >> layer.edit_tqmask; + property >> layer.edit_mask; break; case PROP_SHOW_MASK: - property >> layer.show_tqmask; + property >> layer.show_mask; break; case PROP_OFFSETS: @@ -528,7 +528,7 @@ bool XCFImageFormat::loadLayerProperties(TQDataStream& xcf_io, Layer& layer) /*! * Compute the number of tiles in the current layer and allocate * TQImage structures for each of them. - * \param xcf_image tqcontains the current layer. + * \param xcf_image contains the current layer. */ bool XCFImageFormat::composeTiles(XCFImage& xcf_image) { @@ -542,8 +542,8 @@ bool XCFImageFormat::composeTiles(XCFImage& xcf_image) if (layer.type == GRAYA_GIMAGE || layer.type == INDEXEDA_GIMAGE) layer.alpha_tiles.resize(layer.nrows); - if (layer.tqmask_offset != 0) - layer.tqmask_tiles.resize(layer.nrows); + if (layer.mask_offset != 0) + layer.mask_tiles.resize(layer.nrows); for (uint j = 0; j < layer.nrows; j++) { layer.image_tiles[j].resize(layer.ncols); @@ -551,8 +551,8 @@ bool XCFImageFormat::composeTiles(XCFImage& xcf_image) if (layer.type == GRAYA_GIMAGE || layer.type == INDEXEDA_GIMAGE) layer.alpha_tiles[j].resize(layer.ncols); - if (layer.tqmask_offset != 0) - layer.tqmask_tiles[j].resize(layer.ncols); + if (layer.mask_offset != 0) + layer.mask_tiles[j].resize(layer.ncols); } for (uint j = 0; j < layer.nrows; j++) { @@ -622,11 +622,11 @@ bool XCFImageFormat::composeTiles(XCFImage& xcf_image) setGrayPalette(layer.alpha_tiles[j][i]); } - if (layer.tqmask_offset != 0) { - layer.tqmask_tiles[j][i] = TQImage(tile_width, tile_height, 8, 256); - if( layer.tqmask_tiles[j][i].isNull()) + if (layer.mask_offset != 0) { + layer.mask_tiles[j][i] = TQImage(tile_width, tile_height, 8, 256); + if( layer.mask_tiles[j][i].isNull()) return false; - setGrayPalette(layer.tqmask_tiles[j][i]); + setGrayPalette(layer.mask_tiles[j][i]); } } } @@ -643,7 +643,7 @@ bool XCFImageFormat::composeTiles(XCFImage& xcf_image) void XCFImageFormat::setGrayPalette(TQImage& image) { for (int i = 0; i < 256; i++) - image.setColor(i, tqRgb(i, i, i)); + image.setColor(i, qRgb(i, i, i)); } @@ -675,7 +675,7 @@ void XCFImageFormat::assignImageBytes(Layer& layer, uint i, uint j) for (int l = 0; l < layer.image_tiles[j][i].height(); l++) { for (int k = 0; k < layer.image_tiles[j][i].width(); k++) { layer.image_tiles[j][i].setPixel(k, l, - tqRgb(tile[0], tile[1], tile[2])); + qRgb(tile[0], tile[1], tile[2])); tile += sizeof(QRgb); } } @@ -685,7 +685,7 @@ void XCFImageFormat::assignImageBytes(Layer& layer, uint i, uint j) for ( int l = 0; l < layer.image_tiles[j][i].height(); l++ ) { for ( int k = 0; k < layer.image_tiles[j][i].width(); k++ ) { layer.image_tiles[j][i].setPixel(k, l, - tqRgba(tile[0], tile[1], tile[2], tile[3])); + qRgba(tile[0], tile[1], tile[2], tile[3])); tile += sizeof(QRgb); } } @@ -732,10 +732,10 @@ void XCFImageFormat::assignImageBytes(Layer& layer, uint i, uint j) */ bool XCFImageFormat::loadHierarchy(TQDataStream& xcf_io, Layer& layer) { - TQ_INT32 width; - TQ_INT32 height; - TQ_INT32 bpp; - TQ_UINT32 offset; + Q_INT32 width; + Q_INT32 height; + Q_INT32 bpp; + Q_UINT32 offset; xcf_io >> width >> height >> bpp >> offset; @@ -748,7 +748,7 @@ bool XCFImageFormat::loadHierarchy(TQDataStream& xcf_io, Layer& layer) // increasingly lower resolution). Only the top level is used here, // however. - TQ_UINT32 junk; + Q_UINT32 junk; do { xcf_io >> junk; @@ -777,11 +777,11 @@ bool XCFImageFormat::loadHierarchy(TQDataStream& xcf_io, Layer& layer) * \return true if there were no I/O errors. * \sa loadTileRLE(). */ -bool XCFImageFormat::loadLevel(TQDataStream& xcf_io, Layer& layer, TQ_INT32 bpp) +bool XCFImageFormat::loadLevel(TQDataStream& xcf_io, Layer& layer, Q_INT32 bpp) { - TQ_INT32 width; - TQ_INT32 height; - TQ_UINT32 offset; + Q_INT32 width; + Q_INT32 height; + Q_UINT32 offset; xcf_io >> width >> height >> offset; @@ -802,7 +802,7 @@ bool XCFImageFormat::loadLevel(TQDataStream& xcf_io, Layer& layer, TQ_INT32 bpp) } TQIODevice::Offset saved_pos = xcf_io.device()->at(); - TQ_UINT32 offset2; + Q_UINT32 offset2; xcf_io >> offset2; if (xcf_io.device()->status() != IO_Ok) { @@ -842,21 +842,21 @@ bool XCFImageFormat::loadLevel(TQDataStream& xcf_io, Layer& layer, TQ_INT32 bpp) /*! - * A layer can have a one channel image which is used as a tqmask. + * A layer can have a one channel image which is used as a mask. * \param xcf_io the data stream connected to the XCF image. - * \param layer the layer to collect the tqmask image. + * \param layer the layer to collect the mask image. * \return true if there were no I/O errors. */ bool XCFImageFormat::loadMask(TQDataStream& xcf_io, Layer& layer) { - TQ_INT32 width; - TQ_INT32 height; + Q_INT32 width; + Q_INT32 height; char* name; xcf_io >> width >> height >> name; if (xcf_io.device()->status() != IO_Ok) { - kdDebug(399) << "XCF: read failure on tqmask info" << endl; + kdDebug(399) << "XCF: read failure on mask info" << endl; return false; } @@ -865,11 +865,11 @@ bool XCFImageFormat::loadMask(TQDataStream& xcf_io, Layer& layer) if (!loadChannelProperties(xcf_io, layer)) return false; - TQ_UINT32 hierarchy_offset; + Q_UINT32 hierarchy_offset; xcf_io >> hierarchy_offset; if (xcf_io.device()->status() != IO_Ok) { - kdDebug(399) << "XCF: read failure on tqmask image offset" << endl; + kdDebug(399) << "XCF: read failure on mask image offset" << endl; return false; } @@ -907,7 +907,7 @@ bool XCFImageFormat::loadMask(TQDataStream& xcf_io, Layer& layer) * the RLE data. */ bool XCFImageFormat::loadTileRLE(TQDataStream& xcf_io, uchar* tile, int image_size, - int data_length, TQ_INT32 bpp) + int data_length, Q_INT32 bpp) { uchar* data; @@ -1007,9 +1007,9 @@ bogus_rle: /*! * An XCF file can contain an arbitrary number of properties associated - * with a channel. Note that this routine only reads tqmask channel properties. + * with a channel. Note that this routine only reads mask channel properties. * \param xcf_io the data stream connected to the XCF image. - * \param layer layer containing the tqmask channel to collect the properties. + * \param layer layer containing the mask channel to collect the properties. * \return true if there were no I/O errors. */ bool XCFImageFormat::loadChannelProperties(TQDataStream& xcf_io, Layer& layer) @@ -1030,24 +1030,24 @@ bool XCFImageFormat::loadChannelProperties(TQDataStream& xcf_io, Layer& layer) return true; case PROP_OPACITY: - property >> layer.tqmask_channel.opacity; + property >> layer.mask_channel.opacity; break; case PROP_VISIBLE: - property >> layer.tqmask_channel.visible; + property >> layer.mask_channel.visible; break; case PROP_SHOW_MASKED: - property >> layer.tqmask_channel.show_tqmasked; + property >> layer.mask_channel.show_masked; break; case PROP_COLOR: - property >> layer.tqmask_channel.red >> layer.tqmask_channel.green - >> layer.tqmask_channel.blue; + property >> layer.mask_channel.red >> layer.mask_channel.green + >> layer.mask_channel.blue; break; case PROP_TATTOO: - property >> layer.tqmask_channel.tattoo; + property >> layer.mask_channel.tattoo; break; default: @@ -1059,8 +1059,8 @@ bool XCFImageFormat::loadChannelProperties(TQDataStream& xcf_io, Layer& layer) /*! - * Copy the bytes from the tile buffer into the tqmask tile TQImage. - * \param layer layer containing the tile buffer and the tqmask tile matrix. + * Copy the bytes from the tile buffer into the mask tile TQImage. + * \param layer layer containing the tile buffer and the mask tile matrix. * \param i column index of current tile. * \param j row index of current tile. */ @@ -1070,7 +1070,7 @@ void XCFImageFormat::assignMaskBytes(Layer& layer, uint i, uint j) for (int l = 0; l < layer.image_tiles[j][i].height(); l++) { for (int k = 0; k < layer.image_tiles[j][i].width(); k++) { - layer.tqmask_tiles[j][i].setPixel(k, l, tile[0]); + layer.mask_tiles[j][i].setPixel(k, l, tile[0]); tile += sizeof(QRgb); } } @@ -1103,7 +1103,7 @@ void XCFImageFormat::assignMaskBytes(Layer& layer, uint i, uint j) * the image will not show through if the bottom layer is opaque. * * For indexed images, translucency is an all or nothing effect. - * \param xcf_image tqcontains image info and bottom-most layer. + * \param xcf_image contains image info and bottom-most layer. */ bool XCFImageFormat::initializeImage(XCFImage& xcf_image) { @@ -1117,7 +1117,7 @@ bool XCFImageFormat::initializeImage(XCFImage& xcf_image) image.create( xcf_image.width, xcf_image.height, 32); if( image.isNull()) return false; - image.fill(tqRgb(255, 255, 255)); + image.fill(qRgb(255, 255, 255)); break; } // else, fall through to 32-bit representation @@ -1125,7 +1125,7 @@ bool XCFImageFormat::initializeImage(XCFImage& xcf_image) image.create(xcf_image.width, xcf_image.height, 32); if( image.isNull()) return false; - image.fill(tqRgba(255, 255, 255, 0)); + image.fill(qRgba(255, 255, 255, 0)); // Turning this on prevents fill() from affecting the alpha channel, // by the way. image.setAlphaBuffer(true); @@ -1145,7 +1145,7 @@ bool XCFImageFormat::initializeImage(XCFImage& xcf_image) image.create(xcf_image.width, xcf_image.height, 32); if( image.isNull()) return false; - image.fill(tqRgba(255, 255, 255, 0)); + image.fill(qRgba(255, 255, 255, 0)); image.setAlphaBuffer(true); break; @@ -1157,7 +1157,7 @@ bool XCFImageFormat::initializeImage(XCFImage& xcf_image) // individual colors. // Note: Qt treats a bitmap with a Black and White color palette - // as a tqmask, so only the "on" bits are drawn, regardless of the + // as a mask, so only the "on" bits are drawn, regardless of the // order color table entries. Otherwise (i.e., at least one of the // color table entries is not black or white), it obeys the one- // or two-color palette. Have to ask about this... @@ -1187,7 +1187,7 @@ bool XCFImageFormat::initializeImage(XCFImage& xcf_image) xcf_image.num_colors++; xcf_image.palette.resize(xcf_image.num_colors); xcf_image.palette[1] = xcf_image.palette[0]; - xcf_image.palette[0] = tqRgba(255, 255, 255, 0); + xcf_image.palette[0] = qRgba(255, 255, 255, 0); image.create(xcf_image.width, xcf_image.height, 1, xcf_image.num_colors, @@ -1204,7 +1204,7 @@ bool XCFImageFormat::initializeImage(XCFImage& xcf_image) for (int c = xcf_image.num_colors - 1; c >= 1; c--) xcf_image.palette[c] = xcf_image.palette[c - 1]; - xcf_image.palette[0] = tqRgba(255, 255, 255, 0); + xcf_image.palette[0] = qRgba(255, 255, 255, 0); image.create( xcf_image.width, xcf_image.height, 8, xcf_image.num_colors); if( image.isNull()) @@ -1219,7 +1219,7 @@ bool XCFImageFormat::initializeImage(XCFImage& xcf_image) image.create(xcf_image.width, xcf_image.height, 32); if( image.isNull()) return false; - image.fill(tqRgba(255, 255, 255, 0)); + image.fill(qRgba(255, 255, 255, 0)); image.setAlphaBuffer(true); } break; @@ -1233,8 +1233,8 @@ bool XCFImageFormat::initializeImage(XCFImage& xcf_image) /*! * Copy a layer into an image, taking account of the manifold modes. The - * contents of the image are tqreplaced. - * \param xcf_image tqcontains the layer and image to be tqreplaced. + * contents of the image are replaced. + * \param xcf_image contains the layer and image to be replaced. */ void XCFImageFormat::copyLayerToImage(XCFImage& xcf_image) { @@ -1324,15 +1324,15 @@ void XCFImageFormat::copyRGBToRGB(Layer& layer, uint i, uint j, int k, int l, uchar src_a = layer.opacity; if (layer.type == RGBA_GIMAGE) - src_a = INT_MULT(src_a, tqAlpha(src)); + src_a = INT_MULT(src_a, qAlpha(src)); - // Apply the tqmask (if any) + // Apply the mask (if any) - if (layer.apply_tqmask == 1 && layer.tqmask_tiles.size() > j && - layer.tqmask_tiles[j].size() > i) - src_a = INT_MULT(src_a, layer.tqmask_tiles[j][i].pixelIndex(k, l)); + if (layer.apply_mask == 1 && layer.mask_tiles.size() > j && + layer.mask_tiles[j].size() > i) + src_a = INT_MULT(src_a, layer.mask_tiles[j][i].pixelIndex(k, l)); - image.setPixel(m, n, tqRgba(src, src_a)); + image.setPixel(m, n, qRgba(src, src_a)); } @@ -1373,7 +1373,7 @@ void XCFImageFormat::copyGrayToRGB(Layer& layer, uint i, uint j, int k, int l, { QRgb src = layer.image_tiles[j][i].pixel(k, l); uchar src_a = layer.opacity; - image.setPixel(m, n, tqRgba(src, src_a)); + image.setPixel(m, n, qRgba(src, src_a)); } @@ -1397,13 +1397,13 @@ void XCFImageFormat::copyGrayAToRGB(Layer& layer, uint i, uint j, int k, int l, uchar src_a = layer.alpha_tiles[j][i].pixelIndex(k, l); src_a = INT_MULT(src_a, layer.opacity); - // Apply the tqmask (if any) + // Apply the mask (if any) - if (layer.apply_tqmask == 1 && layer.tqmask_tiles.size() > j && - layer.tqmask_tiles[j].size() > i) - src_a = INT_MULT(src_a, layer.tqmask_tiles[j][i].pixelIndex(k, l)); + if (layer.apply_mask == 1 && layer.mask_tiles.size() > j && + layer.mask_tiles[j].size() > i) + src_a = INT_MULT(src_a, layer.mask_tiles[j][i].pixelIndex(k, l)); - image.setPixel(m, n, tqRgba(src, src_a)); + image.setPixel(m, n, qRgba(src, src_a)); } @@ -1444,10 +1444,10 @@ void XCFImageFormat::copyIndexedAToIndexed(Layer& layer, uint i, uint j, int k, uchar src_a = layer.alpha_tiles[j][i].pixelIndex(k, l); src_a = INT_MULT(src_a, layer.opacity); - if (layer.apply_tqmask == 1 && - layer.tqmask_tiles.size() > j && - layer.tqmask_tiles[j].size() > i) - src_a = INT_MULT(src_a, layer.tqmask_tiles[j][i].pixelIndex(k, l)); + if (layer.apply_mask == 1 && + layer.mask_tiles.size() > j && + layer.mask_tiles[j].size() > i) + src_a = INT_MULT(src_a, layer.mask_tiles[j][i].pixelIndex(k, l)); if (src_a > 127) src++; @@ -1478,10 +1478,10 @@ void XCFImageFormat::copyIndexedAToRGB(Layer& layer, uint i, uint j, int k, int uchar src_a = layer.alpha_tiles[j][i].pixelIndex(k, l); src_a = INT_MULT(src_a, layer.opacity); - // Apply the tqmask (if any) - if (layer.apply_tqmask == 1 && layer.tqmask_tiles.size() > j && - layer.tqmask_tiles[j].size() > i) - src_a = INT_MULT(src_a, layer.tqmask_tiles[j][i].pixelIndex(k, l)); + // Apply the mask (if any) + if (layer.apply_mask == 1 && layer.mask_tiles.size() > j && + layer.mask_tiles[j].size() > i) + src_a = INT_MULT(src_a, layer.mask_tiles[j][i].pixelIndex(k, l)); // This is what appears in the GIMP window if (src_a <= 127) @@ -1489,13 +1489,13 @@ void XCFImageFormat::copyIndexedAToRGB(Layer& layer, uint i, uint j, int k, int else src_a = OPAQUE_OPACITY; - image.setPixel(m, n, tqRgba(src, src_a)); + image.setPixel(m, n, qRgba(src, src_a)); } /*! * Merge a layer into an image, taking account of the manifold modes. - * \param xcf_image tqcontains the layer and image to merge. + * \param xcf_image contains the layer and image to merge. */ void XCFImageFormat::mergeLayerIntoImage(XCFImage& xcf_image) { @@ -1586,15 +1586,15 @@ void XCFImageFormat::mergeRGBToRGB(Layer& layer, uint i, uint j, int k, int l, QRgb src = layer.image_tiles[j][i].pixel(k, l); QRgb dst = image.pixel(m, n); - uchar src_r = tqRed(src); - uchar src_g = tqGreen(src); - uchar src_b = tqBlue(src); - uchar src_a = tqAlpha(src); + uchar src_r = qRed(src); + uchar src_g = qGreen(src); + uchar src_b = qBlue(src); + uchar src_a = qAlpha(src); - uchar dst_r = tqRed(dst); - uchar dst_g = tqGreen(dst); - uchar dst_b = tqBlue(dst); - uchar dst_a = tqAlpha(dst); + uchar dst_r = qRed(dst); + uchar dst_g = qGreen(dst); + uchar dst_b = qBlue(dst); + uchar dst_a = qAlpha(dst); switch (layer.mode) { case MULTIPLY_MODE: { @@ -1737,11 +1737,11 @@ void XCFImageFormat::mergeRGBToRGB(Layer& layer, uint i, uint j, int k, int l, src_a = INT_MULT(src_a, layer.opacity); - // Apply the tqmask (if any) + // Apply the mask (if any) - if (layer.apply_tqmask == 1 && layer.tqmask_tiles.size() > j && - layer.tqmask_tiles[j].size() > i) - src_a = INT_MULT(src_a, layer.tqmask_tiles[j][i].pixelIndex(k, l)); + if (layer.apply_mask == 1 && layer.mask_tiles.size() > j && + layer.mask_tiles[j].size() > i) + src_a = INT_MULT(src_a, layer.mask_tiles[j][i].pixelIndex(k, l)); uchar new_r, new_g, new_b, new_a; new_a = dst_a + INT_MULT(OPAQUE_OPACITY - dst_a, src_a); @@ -1756,7 +1756,7 @@ void XCFImageFormat::mergeRGBToRGB(Layer& layer, uint i, uint j, int k, int l, if (!layer_modes[layer.mode].affect_alpha) new_a = dst_a; - image.setPixel(m, n, tqRgba(new_r, new_g, new_b, new_a)); + image.setPixel(m, n, qRgba(new_r, new_g, new_b, new_a)); } @@ -1793,7 +1793,7 @@ void XCFImageFormat::mergeGrayToGray(Layer& layer, uint i, uint j, int k, int l, void XCFImageFormat::mergeGrayAToGray(Layer& layer, uint i, uint j, int k, int l, TQImage& image, int m, int n) { - int src = tqGray(layer.image_tiles[j][i].pixel(k, l)); + int src = qGray(layer.image_tiles[j][i].pixel(k, l)); int dst = image.pixelIndex(m, n); uchar src_a = layer.alpha_tiles[j][i].pixelIndex(k, l); @@ -1839,11 +1839,11 @@ void XCFImageFormat::mergeGrayAToGray(Layer& layer, uint i, uint j, int k, int l src_a = INT_MULT(src_a, layer.opacity); - // Apply the tqmask (if any) + // Apply the mask (if any) - if (layer.apply_tqmask == 1 && layer.tqmask_tiles.size() > j && - layer.tqmask_tiles[j].size() > i) - src_a = INT_MULT(src_a, layer.tqmask_tiles[j][i].pixelIndex(k, l)); + if (layer.apply_mask == 1 && layer.mask_tiles.size() > j && + layer.mask_tiles[j].size() > i) + src_a = INT_MULT(src_a, layer.mask_tiles[j][i].pixelIndex(k, l)); uchar new_a = OPAQUE_OPACITY; @@ -1874,7 +1874,7 @@ void XCFImageFormat::mergeGrayToRGB(Layer& layer, uint i, uint j, int k, int l, { QRgb src = layer.image_tiles[j][i].pixel(k, l); uchar src_a = layer.opacity; - image.setPixel(m, n, tqRgba(src, src_a)); + image.setPixel(m, n, qRgba(src, src_a)); } @@ -1894,11 +1894,11 @@ void XCFImageFormat::mergeGrayToRGB(Layer& layer, uint i, uint j, int k, int l, void XCFImageFormat::mergeGrayAToRGB(Layer& layer, uint i, uint j, int k, int l, TQImage& image, int m, int n) { - int src = tqGray(layer.image_tiles[j][i].pixel(k, l)); - int dst = tqGray(image.pixel(m, n)); + int src = qGray(layer.image_tiles[j][i].pixel(k, l)); + int dst = qGray(image.pixel(m, n)); uchar src_a = layer.alpha_tiles[j][i].pixelIndex(k, l); - uchar dst_a = tqAlpha(image.pixel(m, n)); + uchar dst_a = qAlpha(image.pixel(m, n)); switch (layer.mode) { case MULTIPLY_MODE: { @@ -1950,10 +1950,10 @@ void XCFImageFormat::mergeGrayAToRGB(Layer& layer, uint i, uint j, int k, int l, src_a = INT_MULT(src_a, layer.opacity); - // Apply the tqmask (if any) - if (layer.apply_tqmask == 1 && layer.tqmask_tiles.size() > j && - layer.tqmask_tiles[j].size() > i) - src_a = INT_MULT(src_a, layer.tqmask_tiles[j][i].pixelIndex(k, l)); + // Apply the mask (if any) + if (layer.apply_mask == 1 && layer.mask_tiles.size() > j && + layer.mask_tiles[j].size() > i) + src_a = INT_MULT(src_a, layer.mask_tiles[j][i].pixelIndex(k, l)); uchar new_a = dst_a + INT_MULT(OPAQUE_OPACITY - dst_a, src_a); @@ -1965,7 +1965,7 @@ void XCFImageFormat::mergeGrayAToRGB(Layer& layer, uint i, uint j, int k, int l, if (!layer_modes[layer.mode].affect_alpha) new_a = dst_a; - image.setPixel(m, n, tqRgba(new_g, new_g, new_g, new_a)); + image.setPixel(m, n, qRgba(new_g, new_g, new_g, new_a)); } @@ -2006,10 +2006,10 @@ void XCFImageFormat::mergeIndexedAToIndexed(Layer& layer, uint i, uint j, int k, uchar src_a = layer.alpha_tiles[j][i].pixelIndex(k, l); src_a = INT_MULT( src_a, layer.opacity ); - if ( layer.apply_tqmask == 1 && - layer.tqmask_tiles.size() > j && - layer.tqmask_tiles[j].size() > i) - src_a = INT_MULT(src_a, layer.tqmask_tiles[j][i].pixelIndex(k, l)); + if ( layer.apply_mask == 1 && + layer.mask_tiles.size() > j && + layer.mask_tiles[j].size() > i) + src_a = INT_MULT(src_a, layer.mask_tiles[j][i].pixelIndex(k, l)); if (src_a > 127) { src++; @@ -2038,10 +2038,10 @@ void XCFImageFormat::mergeIndexedAToRGB(Layer& layer, uint i, uint j, int k, int uchar src_a = layer.alpha_tiles[j][i].pixelIndex(k, l); src_a = INT_MULT(src_a, layer.opacity); - // Apply the tqmask (if any) - if (layer.apply_tqmask == 1 && layer.tqmask_tiles.size() > j && - layer.tqmask_tiles[j].size() > i) - src_a = INT_MULT(src_a, layer.tqmask_tiles[j][i].pixelIndex(k, l)); + // Apply the mask (if any) + if (layer.apply_mask == 1 && layer.mask_tiles.size() > j && + layer.mask_tiles[j].size() > i) + src_a = INT_MULT(src_a, layer.mask_tiles[j][i].pixelIndex(k, l)); // This is what appears in the GIMP window if (src_a <= 127) @@ -2049,7 +2049,7 @@ void XCFImageFormat::mergeIndexedAToRGB(Layer& layer, uint i, uint j, int k, int else src_a = OPAQUE_OPACITY; - image.setPixel(m, n, tqRgba(src, src_a)); + image.setPixel(m, n, qRgba(src, src_a)); } @@ -2075,8 +2075,8 @@ void XCFImageFormat::dissolveRGBPixels ( TQImage& image, int x, int y ) int rand_val = rand() & 0xff; QRgb pixel = image.pixel(k, l); - if (rand_val > tqAlpha(pixel)) { - image.setPixel(k, l, tqRgba(pixel, 0)); + if (rand_val > qAlpha(pixel)) { + image.setPixel(k, l, qRgba(pixel, 0)); } } } diff --git a/kimgio/xcf.h b/kimgio/xcf.h index 4fa9c72ec..3e92f27c2 100644 --- a/kimgio/xcf.h +++ b/kimgio/xcf.h @@ -64,12 +64,12 @@ private: */ class Layer { public: - TQ_UINT32 width; //!< Width of the layer - TQ_UINT32 height; //!< Height of the layer - TQ_INT32 type; //!< Type of the layer (GimpImageType) + Q_UINT32 width; //!< Width of the layer + Q_UINT32 height; //!< Height of the layer + Q_INT32 type; //!< Type of the layer (GimpImageType) char* name; //!< Name of the layer - TQ_UINT32 hierarchy_offset; //!< File position of Tile hierarchy - TQ_UINT32 tqmask_offset; //!< File position of tqmask image + Q_UINT32 hierarchy_offset; //!< File position of Tile hierarchy + Q_UINT32 mask_offset; //!< File position of mask image uint nrows; //!< Number of rows of tiles (y direction) uint ncols; //!< Number of columns of tiles (x direction) @@ -78,36 +78,36 @@ private: //! For Grayscale and Indexed images, the alpha channel is stored //! separately (in this data structure, anyway). Tiles alpha_tiles; - Tiles tqmask_tiles; //!< The layer tqmask (optional) + Tiles mask_tiles; //!< The layer mask (optional) - //! Additional information about a layer tqmask. + //! Additional information about a layer mask. struct { - TQ_UINT32 opacity; - TQ_UINT32 visible; - TQ_UINT32 show_tqmasked; + Q_UINT32 opacity; + Q_UINT32 visible; + Q_UINT32 show_masked; uchar red, green, blue; - TQ_UINT32 tattoo; - } tqmask_channel; + Q_UINT32 tattoo; + } mask_channel; bool active; //!< Is this layer the active layer? - TQ_UINT32 opacity; //!< The opacity of the layer - TQ_UINT32 visible; //!< Is the layer visible? - TQ_UINT32 linked; //!< Is this layer linked (geometrically) - TQ_UINT32 preserve_transparency; //!< Preserve alpha when drawing on layer? - TQ_UINT32 apply_tqmask; //!< Apply the layer tqmask? - TQ_UINT32 edit_tqmask; //!< Is the layer tqmask the being edited? - TQ_UINT32 show_tqmask; //!< Show the layer tqmask rather than the image? - TQ_INT32 x_offset; //!< x offset of the layer relative to the image - TQ_INT32 y_offset; //!< y offset of the layer relative to the image - TQ_UINT32 mode; //!< Combining mode of layer (LayerModeEffects) - TQ_UINT32 tattoo; //!< (unique identifier?) + Q_UINT32 opacity; //!< The opacity of the layer + Q_UINT32 visible; //!< Is the layer visible? + Q_UINT32 linked; //!< Is this layer linked (geometrically) + Q_UINT32 preserve_transparency; //!< Preserve alpha when drawing on layer? + Q_UINT32 apply_mask; //!< Apply the layer mask? + Q_UINT32 edit_mask; //!< Is the layer mask the being edited? + Q_UINT32 show_mask; //!< Show the layer mask rather than the image? + Q_INT32 x_offset; //!< x offset of the layer relative to the image + Q_INT32 y_offset; //!< y offset of the layer relative to the image + Q_UINT32 mode; //!< Combining mode of layer (LayerModeEffects) + Q_UINT32 tattoo; //!< (unique identifier?) //! As each tile is read from the file, it is buffered here. uchar tile[TILE_WIDTH * TILE_HEIGHT * sizeof(QRgb)]; //! The data from tile buffer is copied to the Tile by this //! method. Depending on the type of the tile (RGB, Grayscale, - //! Indexed) and use (image or tqmask), the bytes in the buffer are + //! Indexed) and use (image or mask), the bytes in the buffer are //! copied in different ways. void (*assignBytes)(Layer& layer, uint i, uint j); @@ -117,21 +117,21 @@ private: /*! - * The in-memory representation of the XCF Image. It tqcontains a few + * The in-memory representation of the XCF Image. It contains a few * metadata items, but is mostly a container for the layer information. */ class XCFImage { public: - TQ_UINT32 width; //!< width of the XCF image - TQ_UINT32 height; //!< height of the XCF image - TQ_INT32 type; //!< type of the XCF image (GimpImageBaseType) + Q_UINT32 width; //!< width of the XCF image + Q_UINT32 height; //!< height of the XCF image + Q_INT32 type; //!< type of the XCF image (GimpImageBaseType) - TQ_UINT8 compression; //!< tile compression method (CompressionType) + Q_UINT8 compression; //!< tile compression method (CompressionType) float x_resolution; //!< x resolution in dots per inch float y_resolution; //!< y resolution in dots per inch - TQ_INT32 tattoo; //!< (unique identifier?) - TQ_UINT32 unit; //!< Units of The GIMP (inch, mm, pica, etc...) - TQ_INT32 num_colors; //!< number of colors in an indexed image + Q_INT32 tattoo; //!< (unique identifier?) + Q_UINT32 unit; //!< Units of The GIMP (inch, mm, pica, etc...) + Q_INT32 num_colors; //!< number of colors in an indexed image TQValueVector<QRgb> palette; //!< indexed image color palette int num_layers; //!< number of layers @@ -146,7 +146,7 @@ private: //! In layer DISSOLVE mode, a random number is chosen to compare to a //! pixel's alpha. If the alpha is greater than the random number, the - //! pixel is drawn. This table merely tqcontains the random number seeds + //! pixel is drawn. This table merely contains the random number seeds //! for each ROW of an image. Therefore, the random numbers chosen //! are consistent from run to run. static int random_table[RANDOM_TABLE_SIZE]; @@ -182,13 +182,13 @@ private: void setPalette(XCFImage& xcf_image, TQImage& image); static void assignImageBytes(Layer& layer, uint i, uint j); bool loadHierarchy(TQDataStream& xcf_io, Layer& layer); - bool loadLevel(TQDataStream& xcf_io, Layer& layer, TQ_INT32 bpp); + bool loadLevel(TQDataStream& xcf_io, Layer& layer, Q_INT32 bpp); static void assignMaskBytes(Layer& layer, uint i, uint j); bool loadMask(TQDataStream& xcf_io, Layer& layer); bool loadChannelProperties(TQDataStream& xcf_io, Layer& layer); bool initializeImage(XCFImage& xcf_image); bool loadTileRLE(TQDataStream& xcf_io, uchar* tile, int size, - int data_length, TQ_INT32 bpp); + int data_length, Q_INT32 bpp); static void copyLayerToImage(XCFImage& xcf_image); static void copyRGBToRGB(Layer& layer, uint i, uint j, int k, int l, TQImage& image, int m, int n); diff --git a/kimgio/xview.cpp b/kimgio/xview.cpp index f6391eb85..746ddc6bc 100644 --- a/kimgio/xview.cpp +++ b/kimgio/xview.cpp @@ -84,7 +84,7 @@ KDE_EXPORT void kimgio_xv_read( TQImageIO *_imageio ) r = rg_255_7[((j >> 5) & 0x07)]; g = rg_255_7[((j >> 2) & 0x07)]; b = b_255_3[((j >> 0) & 0x03)]; - image.setColor( j, tqRgb( r, g, b ) ); + image.setColor( j, qRgb( r, g, b ) ); } for ( int py = 0; py < y; py++ ) @@ -145,17 +145,17 @@ KDE_EXPORT void kimgio_xv_write( TQImageIO *imageio ) if ( image.depth() == 32 ) { QRgb *data32 = (QRgb*) data; - r = tqRed( *data32 ) >> 5; - g = tqGreen( *data32 ) >> 5; - b = tqBlue( *data32 ) >> 6; + r = qRed( *data32 ) >> 5; + g = qGreen( *data32 ) >> 5; + b = qBlue( *data32 ) >> 6; data += sizeof( QRgb ); } else { QRgb color = image.color( *data ); - r = tqRed( color ) >> 5; - g = tqGreen( color ) >> 5; - b = tqBlue( color ) >> 6; + r = qRed( color ) >> 5; + g = qGreen( color ) >> 5; + b = qBlue( color ) >> 6; data++; } buffer[ px ] = ( r << 5 ) | ( g << 2 ) | b; |