summaryrefslogtreecommitdiffstats
path: root/kimgio/tga.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-03 04:12:51 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-03 04:12:51 +0000
commit560378aaca1784ba19806a0414a32b20c744de39 (patch)
treece0dfd7c3febf2a1adc7603d1019a8be2083c415 /kimgio/tga.cpp
parentd4d5af1cdbd3cc65d095e0afc5b1f4260091cf5d (diff)
downloadtdelibs-560378aaca1784ba19806a0414a32b20c744de39.tar.gz
tdelibs-560378aaca1784ba19806a0414a32b20c744de39.zip
Automated conversion for enhanced compatibility with TQt for Qt4 3.4.0 TP1
NOTE: This will not compile with Qt4 (yet), however it does compile with Qt3 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1211081 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kimgio/tga.cpp')
-rw-r--r--kimgio/tga.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/kimgio/tga.cpp b/kimgio/tga.cpp
index 8fb5fbd7f..c68dc6a0c 100644
--- a/kimgio/tga.cpp
+++ b/kimgio/tga.cpp
@@ -27,9 +27,9 @@
#include <kdebug.h>
-typedef Q_UINT32 uint;
-typedef Q_UINT16 ushort;
-typedef Q_UINT8 uchar;
+typedef TQ_UINT32 uint;
+typedef TQ_UINT16 ushort;
+typedef TQ_UINT8 uchar;
namespace { // Private.
@@ -268,13 +268,13 @@ namespace { // Private.
// Paletted.
for( int x = 0; x < tga.width; x++ ) {
uchar idx = *src++;
- scanline[x] = qRgb( palette[3*idx+2], palette[3*idx+1], palette[3*idx+0] );
+ scanline[x] = tqRgb( 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] = qRgb( *src, *src, *src );
+ scanline[x] = tqRgb( *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] = qRgb( (c.r << 3) | (c.r >> 2), (c.g << 3) | (c.g >> 2), (c.b << 3) | (c.b >> 2) );
+ scanline[x] = tqRgb( (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] = qRgb( src[2], src[1], src[0] );
+ scanline[x] = tqRgb( 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] = qRgba( src[2], src[1], src[0], alpha );
+ scanline[x] = tqRgba( 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 << 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)
+ 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)
for( int y = 0; y < img.height(); y++ )
for( int x = 0; x < img.width(); x++ ) {
const QRgb color = img.pixel( x, y );
- s << Q_UINT8( qBlue( color ) );
- s << Q_UINT8( qGreen( color ) );
- s << Q_UINT8( qRed( color ) );
+ s << TQ_UINT8( tqBlue( color ) );
+ s << TQ_UINT8( tqGreen( color ) );
+ s << TQ_UINT8( tqRed( color ) );
if( hasAlpha )
- s << Q_UINT8( qAlpha( color ) );
+ s << TQ_UINT8( tqAlpha( color ) );
}
io->setStatus( 0 );