summaryrefslogtreecommitdiffstats
path: root/kimgio
diff options
context:
space:
mode:
Diffstat (limited to 'kimgio')
-rw-r--r--kimgio/dds.cpp48
-rw-r--r--kimgio/eps.cpp10
-rw-r--r--kimgio/exr.cpp4
-rw-r--r--kimgio/hdr.cpp20
-rw-r--r--kimgio/ico.cpp52
-rw-r--r--kimgio/jp2.cpp16
-rw-r--r--kimgio/pcx.cpp68
-rw-r--r--kimgio/pcx.h62
-rw-r--r--kimgio/psd.cpp28
-rw-r--r--kimgio/rgb.cpp82
-rw-r--r--kimgio/rgb.h30
-rw-r--r--kimgio/tga.cpp50
-rw-r--r--kimgio/tiffr.cpp4
-rw-r--r--kimgio/xcf.cpp174
-rw-r--r--kimgio/xcf.h58
-rw-r--r--kimgio/xview.cpp20
16 files changed, 363 insertions, 363 deletions
diff --git a/kimgio/dds.cpp b/kimgio/dds.cpp
index caacb2a3c..bdf1ae750 100644
--- a/kimgio/dds.cpp
+++ b/kimgio/dds.cpp
@@ -33,9 +33,9 @@
#define sqrtf(x) ((float)sqrt(x))
#endif
-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.
@@ -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] = qRgba(r, g, b, a);
+ scanline[x] = tqRgba(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] = qRgb(r, g, b);
+ scanline[x] = tqRgb(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] = qRgba(r, g, b, a);
+ scanline[x] = tqRgba(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] = qRgba(r, g, b, a);
+ scanline[x] = tqRgba(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] = qRgb(r, g, b);
+ scanline[x] = tqRgb(r, g, b);
}
}
@@ -548,7 +548,7 @@ namespace { // Private.
for( uint i = 0; i < 4; i++ ) {
if( img.valid( x+i, y+j ) ) {
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);
+ scanline[j][x+i] = tqRgba(color_array[idx].r, color_array[idx].g, color_array[idx].b, color_array[idx].a);
}
}
}
@@ -592,7 +592,7 @@ namespace { // Private.
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] = qRgba(color_array[idx].r, color_array[idx].g, color_array[idx].b, color_array[idx].a);
+ scanline[j][x+i] = tqRgba(color_array[idx].r, color_array[idx].g, color_array[idx].b, color_array[idx].a);
}
a >>= 4;
}
@@ -648,7 +648,7 @@ namespace { // Private.
if( img.valid( x+i, y+j ) ) {
uint idx = (block.row[j] & masks[i]) >> shift[i];
color_array[idx].a = alpha_array[bit_array[j*4+i]];
- scanline[j][x+i] = qRgba(color_array[idx].r, color_array[idx].g, color_array[idx].b, color_array[idx].a);
+ scanline[j][x+i] = tqRgba(color_array[idx].r, color_array[idx].g, color_array[idx].b, color_array[idx].a);
}
}
}
@@ -703,7 +703,7 @@ namespace { // Private.
if( img.valid( x+i, y+j ) ) {
uint idx = (block.row[j] & masks[i]) >> shift[i];
color_array[idx].a = alpha_array[bit_array[j*4+i]];
- scanline[j][x+i] = qRgb(color_array[idx].a, color_array[idx].g, color_array[idx].b);
+ scanline[j][x+i] = tqRgb(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] = qRgb(nx, ny, nz);
+ scanline[j][x+i] = tqRgb(nx, ny, nz);
}
}
}
@@ -910,7 +910,7 @@ namespace { // Private.
return false;
}
- int offset = s.device()->at();
+ int offset = s.tqdevice()->at();
int size = FaceOffset( header );
for( int i = 0; i < 6; i++ ) {
@@ -921,7 +921,7 @@ namespace { // Private.
}
// Seek device.
- s.device()->at( offset );
+ s.tqdevice()->at( offset );
offset += size;
// Load face from stream.
@@ -963,8 +963,8 @@ KDE_EXPORT void kimgio_dds_read( TQImageIO *io )
s >> fourcc;
if( fourcc != FOURCC_DDS ) {
kdDebug(399) << "This is not a DDS file." << endl;
- io->setImage( 0 );
- io->setStatus( -1 );
+ io->setImage( TQImage() );
+ io->setqStatus( -1 );
return;
}
@@ -975,16 +975,16 @@ KDE_EXPORT void kimgio_dds_read( TQImageIO *io )
// Check image file format.
if( s.atEnd() || !IsValid( header ) ) {
kdDebug(399) << "This DDS file is not valid." << endl;
- io->setImage( 0 );
- io->setStatus( -1 );
+ io->setImage( TQImage() );
+ io->setqStatus( -1 );
return;
}
// Determine image type, by now, we only support 2d textures.
if( !IsSupported( header ) ) {
kdDebug(399) << "This DDS file is not supported." << endl;
- io->setImage( 0 );
- io->setStatus( -1 );
+ io->setImage( TQImage() );
+ io->setqStatus( -1 );
return;
}
@@ -1001,13 +1001,13 @@ KDE_EXPORT void kimgio_dds_read( TQImageIO *io )
if( result == false ) {
kdDebug(399) << "Error loading DDS file." << endl;
- io->setImage( 0 );
- io->setStatus( -1 );
+ io->setImage( TQImage() );
+ io->setqStatus( -1 );
return;
}
io->setImage( img );
- io->setStatus( 0 );
+ io->setqStatus( 0 );
}
diff --git a/kimgio/eps.cpp b/kimgio/eps.cpp
index 5067fb8e1..e5495aaf1 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, Q_UINT32 & ps_offset, Q_UINT32 & ps_size )
+static bool seekToCodeStart( TQIODevice * io, TQ_UINT32 & ps_offset, TQ_UINT32 & ps_size )
{
char buf[4]; // We at most need to read 4 bytes at a time
ps_offset=0L;
@@ -134,7 +134,7 @@ KDE_EXPORT void kimgio_eps_read (TQImageIO *image)
TQString tmp;
TQIODevice* io = image->ioDevice();
- Q_UINT32 ps_offset, ps_size;
+ TQ_UINT32 ps_offset, ps_size;
// find start of PostScript code
if ( !seekToCodeStart(io, ps_offset, ps_size) )
@@ -210,7 +210,7 @@ KDE_EXPORT void kimgio_eps_read (TQImageIO *image)
return;
}
- fprintf (ghostfd, "\n%d %d translate\n", -qRound(x1*xScale), -qRound(y1*yScale));
+ fprintf (ghostfd, "\n%d %d translate\n", -tqRound(x1*xScale), -tqRound(y1*yScale));
if ( needsScaling )
fprintf (ghostfd, "%g %g scale\n", xScale, yScale);
@@ -234,7 +234,7 @@ KDE_EXPORT void kimgio_eps_read (TQImageIO *image)
TQImage myimage;
if( myimage.load (tmpFile.name()) ) {
image->setImage (myimage);
- image->setStatus (0);
+ image->setqStatus (0);
kdDebug(399) << "kimgio EPS: success!" << endl;
}
else
@@ -290,5 +290,5 @@ KDE_EXPORT void kimgio_eps_write( TQImageIO *imageio )
inFile.close();
- imageio->setStatus(0);
+ imageio->setqStatus(0);
}
diff --git a/kimgio/exr.cpp b/kimgio/exr.cpp
index e45812700..2af22b345 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 qRgba( char (Imath::clamp ( r * 84.66f, 0.f, 255.f ) ),
+ return tqRgba( 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 ) ) );
@@ -148,7 +148,7 @@ KDE_EXPORT void kimgio_exr_read( TQImageIO *io )
}
io->setImage( image );
- io->setStatus( 0 );
+ io->setqStatus( 0 );
}
catch (const std::exception &exc)
{
diff --git a/kimgio/hdr.cpp b/kimgio/hdr.cpp
index bf8bc5f03..b96cddcb0 100644
--- a/kimgio/hdr.cpp
+++ b/kimgio/hdr.cpp
@@ -16,7 +16,7 @@
#include <kdebug.h>
#include <kglobal.h>
-typedef Q_UINT8 uchar;
+typedef TQ_UINT8 uchar;
namespace { // Private.
@@ -85,7 +85,7 @@ namespace { // Private.
v = 1.0f / float(1 << -e);
}
- scanline[j] = qRgb( ClipToByte(float(image[0]) * v),
+ scanline[j] = tqRgb( ClipToByte(float(image[0]) * v),
ClipToByte(float(image[1]) * v),
ClipToByte(float(image[2]) * v) );
@@ -127,7 +127,7 @@ namespace { // Private.
if (val != 2)
{
- s.device()->at( s.device()->at() - 1 );
+ s.tqdevice()->at( s.tqdevice()->at() - 1 );
Read_Old_Line(image.data(), width, s);
RGBE_To_QRgbLine(image.data(), scanline, width);
continue;
@@ -224,8 +224,8 @@ KDE_EXPORT void kimgio_hdr_read( TQImageIO * io )
if( /*!validHeader ||*/ !validFormat )
{
kdDebug(399) << "Unknown HDR format." << endl;
- io->setImage( 0 );
- io->setStatus( -1 );
+ io->setImage( TQImage() );
+ io->setqStatus( -1 );
return;
}
@@ -237,8 +237,8 @@ KDE_EXPORT void kimgio_hdr_read( TQImageIO * io )
//if( sscanf(line, "-Y %d +X %d", &height, &width) < 2 )
{
kdDebug(399) << "Invalid HDR file." << endl;
- io->setImage( 0 );
- io->setStatus( -1 );
+ io->setImage( TQImage() );
+ io->setqStatus( -1 );
return;
}
@@ -248,13 +248,13 @@ KDE_EXPORT void kimgio_hdr_read( TQImageIO * io )
if( !LoadHDR(s, width, height, img) )
{
kdDebug(399) << "Error loading HDR file." << endl;
- io->setImage( 0 );
- io->setStatus( -1 );
+ io->setImage( TQImage() );
+ io->setqStatus( -1 );
return;
}
io->setImage( img );
- io->setStatus( 0 );
+ io->setqStatus( 0 );
}
diff --git a/kimgio/ico.cpp b/kimgio/ico.cpp
index 01ee37a1b..daaeb3de7 100644
--- a/kimgio/ico.cpp
+++ b/kimgio/ico.cpp
@@ -29,9 +29,9 @@ namespace
struct IcoHeader
{
enum Type { Icon = 1, Cursor };
- Q_UINT16 reserved;
- Q_UINT16 type;
- Q_UINT16 count;
+ TQ_UINT16 reserved;
+ TQ_UINT16 type;
+ TQ_UINT16 count;
};
inline TQDataStream& operator >>( TQDataStream& s, IcoHeader& h )
@@ -43,21 +43,21 @@ namespace
// (c) 1992-2002 Trolltech AS.
struct BMP_INFOHDR
{
- 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
+ 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
enum Compression { RGB = 0 };
- 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
+ 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
};
- const Q_UINT32 BMP_INFOHDR::Size;
+ const TQ_UINT32 BMP_INFOHDR::Size;
TQDataStream& operator >>( TQDataStream &s, BMP_INFOHDR &bi )
{
@@ -92,11 +92,11 @@ namespace
{
unsigned char width;
unsigned char height;
- Q_UINT16 colors;
- Q_UINT16 hotspotX;
- Q_UINT16 hotspotY;
- Q_UINT32 size;
- Q_UINT32 offset;
+ TQ_UINT16 colors;
+ TQ_UINT16 hotspotX;
+ TQ_UINT16 hotspotY;
+ TQ_UINT32 size;
+ TQ_UINT32 offset;
};
inline TQDataStream& operator >>( TQDataStream& s, IconRec& r )
@@ -177,7 +177,7 @@ namespace
unsigned char rgb[ 4 ];
stream.readRawBytes( reinterpret_cast< char* >( &rgb ),
sizeof( rgb ) );
- colorTable[ i ] = qRgb( rgb[ 2 ], rgb[ 1 ], rgb[ 0 ] );
+ colorTable[ i ] = tqRgb( 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++ = qRgb( pixel[ 3 * x + 2 ],
+ *p++ = tqRgb( pixel[ 3 * x + 2 ],
pixel[ 3 * x + 1 ],
pixel[ 3 * x ] );
break;
case 32:
for ( unsigned x = 0; x < rec.width; ++x )
- *p++ = qRgba( pixel[ 4 * x + 2 ],
+ *p++ = tqRgba( pixel[ 4 * x + 2 ],
pixel[ 4 * x + 1 ],
pixel[ 4 * x ],
pixel[ 4 * x + 3] );
@@ -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 &= RGB_MASK;
+ *p &= TQRGB_MASK;
}
delete[] buf;
}
@@ -306,7 +306,7 @@ extern "C" KDE_EXPORT void kimgio_ico_read( TQImageIO* io )
icon.setText( "X-HotspotY", 0, TQString::number( selected->hotspotY ) );
}
io->setImage(icon);
- io->setStatus(0);
+ io->setqStatus(0);
}
}
diff --git a/kimgio/jp2.cpp b/kimgio/jp2.cpp
index 71b260375..ed5ef99c3 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 );
- Q_LONG size;
+ TQ_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++ = qRgb( v[0], v[1], v[2] );
+ *data++ = tqRgb( v[0], v[1], v[2] );
} // for x
} // for y
return true;
@@ -163,7 +163,7 @@ kimgio_jp2_read( TQImageIO* io )
if( gs.altimage ) jas_image_destroy( gs.altimage );
io->setImage( image );
- io->setStatus( 0 );
+ io->setqStatus( 0 );
} // kimgio_jp2_read
@@ -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, qRed( qi.pixel( x, y ) ) );
+ jas_matrix_set( m, y, x, tqRed( 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, qGreen( qi.pixel( x, y ) ) );
+ jas_matrix_set( m, y, x, tqGreen( 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, qBlue( qi.pixel( x, y ) ) );
+ jas_matrix_set( m, y, x, tqBlue( 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 );
- Q_LONG size;
+ TQ_LONG size;
// seek to the beginning of the file.
if( !in->at( 0 ) ) { delete ktempf; return; }
@@ -309,7 +309,7 @@ kimgio_jp2_write( TQImageIO* io )
// everything went fine
- io->setStatus( IO_Ok );
+ io->setqStatus( IO_Ok );
} // kimgio_jp2_write
#endif // HAVE_JASPER
diff --git a/kimgio/pcx.cpp b/kimgio/pcx.cpp
index 3d866ad0a..37361e848 100644
--- a/kimgio/pcx.cpp
+++ b/kimgio/pcx.cpp
@@ -45,8 +45,8 @@ static TQDataStream &operator>>( TQDataStream &s, PCXHEADER &ph )
s >> ph.VScreenSize;
// Skip the rest of the header
- Q_UINT8 byte;
- while ( s.device()->at() < 128 )
+ TQ_UINT8 byte;
+ while ( s.tqdevice()->at() < 128 )
s >> byte;
return s;
@@ -83,7 +83,7 @@ static TQDataStream &operator<<( TQDataStream &s, const PCXHEADER &ph )
s << ph.HScreenSize;
s << ph.VScreenSize;
- Q_UINT8 byte = 0;
+ TQ_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 )
{
- Q_UINT32 i=0;
- Q_UINT32 size = buf.size();
- Q_UINT8 byte, count;
+ TQ_UINT32 i=0;
+ TQ_UINT32 size = buf.size();
+ TQ_UINT8 byte, count;
if ( header.isCompressed() )
{
@@ -149,14 +149,14 @@ static void readImage1( TQImage &img, TQDataStream &s, const PCXHEADER &header )
readLine( s, buf, header );
uchar *p = img.scanLine( y );
- unsigned int bpl = QMIN((header.width()+7)/8, header.BytesPerLine);
+ unsigned int bpl = TQMIN((header.width()+7)/8, header.BytesPerLine);
for ( unsigned int x=0; x< bpl; ++x )
p[ x ] = buf[x];
}
// Set the color palette
- img.setColor( 0, qRgb( 0, 0, 0 ) );
- img.setColor( 1, qRgb( 255, 255, 255 ) );
+ img.setColor( 0, tqRgb( 0, 0, 0 ) );
+ img.setColor( 1, tqRgb( 255, 255, 255 ) );
}
static void readImage4( TQImage &img, TQDataStream &s, const PCXHEADER &header )
@@ -180,10 +180,10 @@ static void readImage4( TQImage &img, TQDataStream &s, const PCXHEADER &header )
for ( int i=0; i<4; i++ )
{
- Q_UINT32 offset = i*header.BytesPerLine;
+ TQ_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 );
+ pixbuf[ x ] = pixbuf.at(x) + ( 1 << i );
}
uchar *p = img.scanLine( y );
@@ -214,23 +214,23 @@ static void readImage8( TQImage &img, TQDataStream &s, const PCXHEADER &header )
readLine( s, buf, header );
uchar *p = img.scanLine( y );
- unsigned int bpl = QMIN(header.BytesPerLine, header.width());
+ unsigned int bpl = TQMIN(header.BytesPerLine, header.width());
for ( unsigned int x=0; x<bpl; ++x )
p[ x ] = buf[ x ];
}
- Q_UINT8 flag;
+ TQ_UINT8 flag;
s >> flag;
kdDebug( 399 ) << "Palette Flag: " << flag << endl;
if ( flag == 12 && ( header.Version == 5 || header.Version == 2 ) )
{
// Read the palette
- Q_UINT8 r, g, b;
+ TQ_UINT8 r, g, b;
for ( int i=0; i<256; ++i )
{
s >> r >> g >> b;
- img.setColor( i, qRgb( r, g, b ) );
+ img.setColor( i, tqRgb( 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 ] = qRgb( r_buf[ x ], g_buf[ x ], b_buf[ x ] );
+ p[ x ] = tqRgb( r_buf[ x ], g_buf[ x ], b_buf[ x ] );
}
}
@@ -267,9 +267,9 @@ KDE_EXPORT void kimgio_pcx_read( TQImageIO *io )
TQDataStream s( io->ioDevice() );
s.setByteOrder( TQDataStream::LittleEndian );
- if ( s.device()->size() < 128 )
+ if ( s.tqdevice()->size() < 128 )
{
- io->setStatus( -1 );
+ io->setqStatus( -1 );
return;
}
@@ -279,7 +279,7 @@ KDE_EXPORT void kimgio_pcx_read( TQImageIO *io )
if ( header.Manufacturer != 10 || s.atEnd())
{
- io->setStatus( -1 );
+ io->setqStatus( -1 );
return;
}
@@ -323,19 +323,19 @@ KDE_EXPORT void kimgio_pcx_read( TQImageIO *io )
if ( !img.isNull() )
{
io->setImage( img );
- io->setStatus( 0 );
+ io->setqStatus( 0 );
}
else
{
- io->setStatus( -1 );
+ io->setqStatus( -1 );
}
}
static void writeLine( TQDataStream &s, TQByteArray &buf )
{
- Q_UINT32 i = 0;
- Q_UINT32 size = buf.size();
- Q_UINT8 count, data;
+ TQ_UINT32 i = 0;
+ TQ_UINT32 size = buf.size();
+ TQ_UINT8 count, data;
char byte;
while ( i < size )
@@ -343,7 +343,7 @@ static void writeLine( TQDataStream &s, TQByteArray &buf )
count = 1;
byte = buf[ i++ ];
- while ( ( i < size ) && ( byte == buf[ i ] ) && ( count < 63 ) )
+ while ( ( i < size ) && ( byte == buf.at(i) ) && ( count < 63 ) )
{
++i;
++count;
@@ -375,7 +375,7 @@ static void writeImage1( TQImage &img, TQDataStream &s, PCXHEADER &header )
for ( int y=0; y<header.height(); ++y )
{
- Q_UINT8 *p = img.scanLine( y );
+ TQ_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 )
{
- Q_UINT8 *p = img.scanLine( y );
+ TQ_UINT8 *p = img.scanLine( y );
for ( int i=0; i<4; ++i )
buf[ i ].fill( 0 );
@@ -412,7 +412,7 @@ static void writeImage4( TQImage &img, TQDataStream &s, PCXHEADER &header )
{
for ( int i=0; i<4; ++i )
if ( *( p+x ) & ( 1 << i ) )
- buf[ i ][ x/8 ] |= 1 << ( 7-x%8 );
+ buf[ i ][ x/8 ] = buf[ i ].at(x/8) | 1 << ( 7-x%8 );
}
for ( int i=0; i<4; ++i )
@@ -432,7 +432,7 @@ static void writeImage8( TQImage &img, TQDataStream &s, PCXHEADER &header )
for ( int y=0; y<header.height(); ++y )
{
- Q_UINT8 *p = img.scanLine( y );
+ TQ_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
- Q_UINT8 byte = 12;
+ TQ_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 ] = qRed( rgb );
- g_buf[ x ] = qGreen( rgb );
- b_buf[ x ] = qBlue( rgb );
+ r_buf[ x ] = tqRed( rgb );
+ g_buf[ x ] = tqGreen( rgb );
+ b_buf[ x ] = tqBlue( rgb );
}
writeLine( s, r_buf );
@@ -526,7 +526,7 @@ KDE_EXPORT void kimgio_pcx_write( TQImageIO *io )
writeImage24( img, s, header );
}
- io->setStatus( 0 );
+ io->setqStatus( 0 );
}
/* vim: et sw=2 ts=2
diff --git a/kimgio/pcx.h b/kimgio/pcx.h
index eef3293c5..c312979b0 100644
--- a/kimgio/pcx.h
+++ b/kimgio/pcx.h
@@ -29,14 +29,14 @@ class RGB
RGB( const QRgb color )
{
- r = qRed( color );
- g = qGreen( color );
- b = qBlue( color );
+ r = tqRed( color );
+ g = tqGreen( color );
+ b = tqBlue( color );
}
- Q_UINT8 r;
- Q_UINT8 g;
- Q_UINT8 b;
+ TQ_UINT8 r;
+ TQ_UINT8 g;
+ TQ_UINT8 b;
};
class Palette
@@ -51,7 +51,7 @@ class Palette
QRgb color( int i ) const
{
- return qRgb( rgb[ i ].r, rgb[ i ].g, rgb[ i ].b );
+ return tqRgb( rgb[ i ].r, rgb[ i ].g, rgb[ i ].b );
}
struct RGB rgb[ 16 ];
@@ -66,37 +66,37 @@ class PCXHEADER
inline int height() const { return ( YMax-YMin ) + 1; }
inline bool isCompressed() const { return ( Encoding==1 ); }
- 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ˇ
+ TQ_UINT8 Manufacturer; // Constant Flag, 10 = ZSoft .pcx
+ TQ_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
// 4 = PC Paintbrush for Windows(Plus for
- // Windows uses Ver 5)ˇ
+ // Windows uses Ver 5)
// 5 = Version 3.0 and > of PC Paintbrush
// and PC Paintbrush +, includes
// Publisher's Paintbrush . Includes
- // 24-bit .PCX filesˇ
- 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ˇ
- Q_UINT16 XMin;
- Q_UINT16 YMin;
- Q_UINT16 XMax;
- Q_UINT16 YMax;
- Q_UINT16 HDpi;
- Q_UINT16 YDpi;
+ // 24-bit .PCX files
+ TQ_UINT8 Encoding; // 1 = .PCX run length encoding
+ TQ_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;
Palette ColorMap;
- 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
+ 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
// plane. MUST be an EVEN number. Do NOT
- // calculate from Xmax-Xmin.ˇ
- Q_UINT16 PaletteInfo; // How to interpret palette- 1 = Color/BW,
- // 2 = Grayscale ( ignored in PB IV/ IV + )ˇ
- Q_UINT16 HScreenSize; // Horizontal screen size in pixels. New field
+ // calculate from Xmax-Xmin.
+ TQ_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
// found only in PB IV/IV Plus
- Q_UINT16 VScreenSize; // Vertical screen size in pixels. New field
+ TQ_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 13070a0c2..2374b6a97 100644
--- a/kimgio/psd.cpp
+++ b/kimgio/psd.cpp
@@ -24,9 +24,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.
@@ -119,15 +119,15 @@ namespace { // Private.
// Skip mode data.
s >> tmp;
- s.device()->at( s.device()->at() + tmp );
+ s.tqdevice()->at( s.tqdevice()->at() + tmp );
// Skip image resources.
s >> tmp;
- s.device()->at( s.device()->at() + tmp );
+ s.tqdevice()->at( s.tqdevice()->at() + tmp );
// Skip the reserved data.
s >> tmp;
- s.device()->at( s.device()->at() + tmp );
+ s.tqdevice()->at( s.tqdevice()->at() + tmp );
// Find out if the data is compressed.
// Known values:
@@ -145,7 +145,7 @@ namespace { // Private.
// Clear the image.
if( channel_num < 4 ) {
- img.fill(qRgba(0, 0, 0, 0xFF));
+ img.fill(tqRgba(0, 0, 0, 0xFF));
}
else {
// Enable alpha.
@@ -249,29 +249,29 @@ void kimgio_psd_read( TQImageIO *io )
// Check image file format.
if( s.atEnd() || !IsValid( header ) ) {
kdDebug(399) << "This PSD file is not valid." << endl;
- io->setImage( 0 );
- io->setStatus( -1 );
+ io->setImage( TQImage() );
+ io->setqStatus( -1 );
return;
}
// Check if it's a supported format.
if( !IsSupported( header ) ) {
kdDebug(399) << "This PSD file is not supported." << endl;
- io->setImage( 0 );
- io->setStatus( -1 );
+ io->setImage( TQImage() );
+ io->setqStatus( -1 );
return;
}
TQImage img;
if( !LoadPSD(s, header, img) ) {
kdDebug(399) << "Error loading PSD file." << endl;
- io->setImage( 0 );
- io->setStatus( -1 );
+ io->setImage( TQImage() );
+ io->setqStatus( -1 );
return;
}
io->setImage( img );
- io->setStatus( 0 );
+ io->setqStatus( 0 );
}
diff --git a/kimgio/rgb.cpp b/kimgio/rgb.cpp
index 71976685a..da3888c99 100644
--- a/kimgio/rgb.cpp
+++ b/kimgio/rgb.cpp
@@ -37,13 +37,13 @@ KDE_EXPORT void kimgio_rgb_read(TQImageIO *io)
TQImage img;
if (!sgi.readImage(img)) {
- io->setImage(0);
- io->setStatus(-1);
+ io->setImage(TQImage());
+ io->setqStatus(-1);
return;
}
io->setImage(img);
- io->setStatus(0);
+ io->setqStatus(0);
}
@@ -53,9 +53,9 @@ KDE_EXPORT void kimgio_rgb_write(TQImageIO *io)
TQImage img = io->image();
if (!sgi.writeImage(img))
- io->setStatus(-1);
+ io->setqStatus(-1);
- io->setStatus(0);
+ io->setqStatus(0);
}
@@ -121,7 +121,7 @@ bool SGIImage::getRow(uchar *dest)
bool SGIImage::readData(TQImage& img)
{
QRgb *c;
- Q_UINT32 *start = m_starttab;
+ TQ_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 = qRgb(line[x], line[x], line[x]);
+ *c = tqRgb(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 = qRgb(qRed(*c), line[x], line[x]);
+ *c = tqRgb(tqRed(*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 = qRgb(qRed(*c), qGreen(*c), line[x]);
+ *c = tqRgb(tqRed(*c), tqGreen(*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 = qRgba(qRed(*c), qGreen(*c), qBlue(*c), line[x]);
+ *c = tqRgba(tqRed(*c), tqGreen(*c), tqBlue(*c), line[x]);
}
return true;
@@ -183,9 +183,9 @@ bool SGIImage::readData(TQImage& img)
bool SGIImage::readImage(TQImage& img)
{
- Q_INT8 u8;
- Q_INT16 u16;
- Q_INT32 u32;
+ TQ_INT8 u8;
+ TQ_INT16 u16;
+ TQ_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 Q_UINT32[m_numrows];
+ m_starttab = new TQ_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(Q_UINT32);
+ m_starttab[l] -= 512 + m_numrows * 2 * sizeof(TQ_UINT32);
}
- m_lengthtab = new Q_UINT32[m_numrows];
+ m_lengthtab = new TQ_UINT32[m_numrows];
for (l = 0; l < m_numrows; l++)
m_stream >> m_lengthtab[l];
}
@@ -389,7 +389,7 @@ uint SGIImage::compact(uchar *d, uchar *s)
bool SGIImage::scanData(const TQImage& img)
{
- Q_UINT32 *start = m_starttab;
+ TQ_UINT32 *start = m_starttab;
TQCString lineguard(m_xsize * 2);
TQCString bufguard(m_xsize);
uchar *line = (uchar *)lineguard.data();
@@ -399,9 +399,9 @@ bool SGIImage::scanData(const TQImage& img)
uint len;
for (y = 0; y < m_ysize; y++) {
- c = reinterpret_cast<QRgb *>(img.scanLine(m_ysize - y - 1));
+ c = reinterpret_cast<QRgb *>(const_cast<TQImage&>(img).scanLine(m_ysize - y - 1));
for (x = 0; x < m_xsize; x++)
- buf[x] = intensity(qRed(*c++));
+ buf[x] = intensity(tqRed(*c++));
len = compact(line, buf);
*start++ = m_rlemap.insert(line, len);
}
@@ -411,17 +411,17 @@ bool SGIImage::scanData(const TQImage& img)
if (m_zsize != 2) {
for (y = 0; y < m_ysize; y++) {
- c = reinterpret_cast<QRgb *>(img.scanLine(m_ysize - y - 1));
+ c = reinterpret_cast<QRgb *>(const_cast<TQImage&>(img).scanLine(m_ysize - y - 1));
for (x = 0; x < m_xsize; x++)
- buf[x] = intensity(qGreen(*c++));
+ buf[x] = intensity(tqGreen(*c++));
len = compact(line, buf);
*start++ = m_rlemap.insert(line, len);
}
for (y = 0; y < m_ysize; y++) {
- c = reinterpret_cast<QRgb *>(img.scanLine(m_ysize - y - 1));
+ c = reinterpret_cast<QRgb *>(const_cast<TQImage&>(img).scanLine(m_ysize - y - 1));
for (x = 0; x < m_xsize; x++)
- buf[x] = intensity(qBlue(*c++));
+ buf[x] = intensity(tqBlue(*c++));
len = compact(line, buf);
*start++ = m_rlemap.insert(line, len);
}
@@ -431,9 +431,9 @@ bool SGIImage::scanData(const TQImage& img)
}
for (y = 0; y < m_ysize; y++) {
- c = reinterpret_cast<QRgb *>(img.scanLine(m_ysize - y - 1));
+ c = reinterpret_cast<QRgb *>(const_cast<TQImage&>(img).scanLine(m_ysize - y - 1));
for (x = 0; x < m_xsize; x++)
- buf[x] = intensity(qAlpha(*c++));
+ buf[x] = intensity(tqAlpha(*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 << Q_UINT16(0x01da);
+ m_stream << TQ_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 << Q_UINT32(0);
+ m_stream << TQ_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 << Q_UINT8(0);
+ m_stream << TQ_UINT8(0);
}
@@ -476,11 +476,11 @@ void SGIImage::writeRle()
// write start table
for (i = 0; i < m_numrows; i++)
- m_stream << Q_UINT32(m_rlevector[m_starttab[i]]->offset());
+ m_stream << TQ_UINT32(m_rlevector[m_starttab[i]]->offset());
// write length table
for (i = 0; i < m_numrows; i++)
- m_stream << Q_UINT32(m_rlevector[m_starttab[i]]->size());
+ m_stream << TQ_UINT32(m_rlevector[m_starttab[i]]->size());
// write data
for (i = 0; i < m_rlevector.size(); i++)
@@ -498,9 +498,9 @@ void SGIImage::writeVerbatim(const TQImage& img)
unsigned x, y;
for (y = 0; y < m_ysize; y++) {
- c = reinterpret_cast<QRgb *>(img.scanLine(m_ysize - y - 1));
+ c = reinterpret_cast<QRgb *>(const_cast<TQImage&>(img).scanLine(m_ysize - y - 1));
for (x = 0; x < m_xsize; x++)
- m_stream << Q_UINT8(qRed(*c++));
+ m_stream << TQ_UINT8(tqRed(*c++));
}
if (m_zsize == 1)
@@ -508,15 +508,15 @@ void SGIImage::writeVerbatim(const TQImage& img)
if (m_zsize != 2) {
for (y = 0; y < m_ysize; y++) {
- c = reinterpret_cast<QRgb *>(img.scanLine(m_ysize - y - 1));
+ c = reinterpret_cast<QRgb *>(const_cast<TQImage&>(img).scanLine(m_ysize - y - 1));
for (x = 0; x < m_xsize; x++)
- m_stream << Q_UINT8(qGreen(*c++));
+ m_stream << TQ_UINT8(tqGreen(*c++));
}
for (y = 0; y < m_ysize; y++) {
- c = reinterpret_cast<QRgb *>(img.scanLine(m_ysize - y - 1));
+ c = reinterpret_cast<QRgb *>(const_cast<TQImage&>(img).scanLine(m_ysize - y - 1));
for (x = 0; x < m_xsize; x++)
- m_stream << Q_UINT8(qBlue(*c++));
+ m_stream << TQ_UINT8(tqBlue(*c++));
}
if (m_zsize == 3)
@@ -524,9 +524,9 @@ void SGIImage::writeVerbatim(const TQImage& img)
}
for (y = 0; y < m_ysize; y++) {
- c = reinterpret_cast<QRgb *>(img.scanLine(m_ysize - y - 1));
+ c = reinterpret_cast<QRgb *>(const_cast<TQImage&>(img).scanLine(m_ysize - y - 1));
for (x = 0; x < m_xsize; x++)
- m_stream << Q_UINT8(qAlpha(*c++));
+ m_stream << TQ_UINT8(tqAlpha(*c++));
}
}
@@ -558,8 +558,8 @@ bool SGIImage::writeImage(TQImage& img)
m_numrows = m_ysize * m_zsize;
- m_starttab = new Q_UINT32[m_numrows];
- m_rlemap.setBaseOffset(512 + m_numrows * 2 * sizeof(Q_UINT32));
+ m_starttab = new TQ_UINT32[m_numrows];
+ m_rlemap.setBaseOffset(512 + m_numrows * 2 * sizeof(TQ_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(Q_UINT32);
+ long rle_size = m_numrows * 2 * sizeof(TQ_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 fae42a900..4bcc3191a 100644
--- a/kimgio/rgb.h
+++ b/kimgio/rgb.h
@@ -59,23 +59,23 @@ public:
private:
enum { NORMAL, DITHERED, SCREEN, COLORMAP }; // colormap
- QImageIO *m_io;
- QIODevice *m_dev;
- QDataStream m_stream;
-
- 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;
+ TQImageIO *m_io;
+ TQIODevice *m_dev;
+ TQDataStream 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;
char m_imagename[80];
- Q_UINT32 m_colormap;
+ TQ_UINT32 m_colormap;
- Q_UINT32 *m_starttab;
- Q_UINT32 *m_lengthtab;
+ TQ_UINT32 *m_starttab;
+ TQ_UINT32 *m_lengthtab;
QByteArray m_data;
TQByteArray::Iterator m_pos;
RLEMap m_rlemap;
diff --git a/kimgio/tga.cpp b/kimgio/tga.cpp
index 8fb5fbd7f..46ecb0624 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;
}
}
@@ -324,21 +324,21 @@ KDE_EXPORT void kimgio_tga_read( TQImageIO *io )
// Read image header.
TgaHeader tga;
s >> tga;
- s.device()->at( TgaHeader::SIZE + tga.id_length );
+ s.tqdevice()->at( TgaHeader::SIZE + tga.id_length );
// Check image file format.
if( s.atEnd() ) {
kdDebug(399) << "This TGA file is not valid." << endl;
- io->setImage( 0 );
- io->setStatus( -1 );
+ io->setImage( TQImage() );
+ io->setqStatus( -1 );
return;
}
// Check supported file types.
if( !IsSupported(tga) ) {
kdDebug(399) << "This TGA file is not supported." << endl;
- io->setImage( 0 );
- io->setStatus( -1 );
+ io->setImage( TQImage() );
+ io->setqStatus( -1 );
return;
}
@@ -348,14 +348,14 @@ KDE_EXPORT void kimgio_tga_read( TQImageIO *io )
if( result == false ) {
kdDebug(399) << "Error loading TGA file." << endl;
- io->setImage( 0 );
- io->setStatus( -1 );
+ io->setImage( TQImage() );
+ io->setqStatus( -1 );
return;
}
io->setImage( img );
- io->setStatus( 0 );
+ io->setqStatus( 0 );
}
@@ -370,21 +370,21 @@ 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 );
+ io->setqStatus( 0 );
}
diff --git a/kimgio/tiffr.cpp b/kimgio/tiffr.cpp
index f8022d2dd..96b259b39 100644
--- a/kimgio/tiffr.cpp
+++ b/kimgio/tiffr.cpp
@@ -133,14 +133,14 @@ KDE_EXPORT void kimgio_tiff_read( TQImageIO *io )
// for( int ctr = (image.numBytes() / sizeof(uint32))+1; ctr ; ctr-- ) {
// // TODO: manage alpha with TIFFGetA
-// *data = qRgb( TIFFGetR( *data ),
+// *data = tqRgb( TIFFGetR( *data ),
// TIFFGetG( *data ), TIFFGetB( *data ) );
// data++;
// }
TIFFClose( tiff );
io->setImage( image );
- io->setStatus ( 0 );
+ io->setqStatus ( 0 );
}
KDE_EXPORT void kimgio_tiff_write( TQImageIO * )
diff --git a/kimgio/xcf.cpp b/kimgio/xcf.cpp
index 298d17109..64b18f060 100644
--- a/kimgio/xcf.cpp
+++ b/kimgio/xcf.cpp
@@ -42,7 +42,7 @@ KDE_EXPORT void kimgio_xcf_read(TQImageIO *io)
KDE_EXPORT void kimgio_xcf_write(TQImageIO *io)
{
kdDebug(399) << "XCF: write support not implemented" << endl;
- io->setStatus(-1);
+ io->setqStatus(-1);
}
///////////////////////////////////////////////////////////////////////////////
@@ -78,9 +78,9 @@ const XCFImageFormat::LayerModes XCFImageFormat::layer_modes[] = {
//! Change a QRgb value's alpha only.
-inline QRgb qRgba ( QRgb rgb, int a )
+inline QRgb tqRgba ( QRgb rgb, int a )
{
- return ((a & 0xff) << 24 | (rgb & RGB_MASK));
+ return ((a & 0xff) << 24 | (rgb & TQRGB_MASK));
}
@@ -127,14 +127,14 @@ void XCFImageFormat::readXCF(TQImageIO *io)
char tag[14];
xcf_io.readRawBytes(tag, sizeof(tag));
- if (xcf_io.device()->status() != IO_Ok) {
+ if (xcf_io.tqdevice()->status() != IO_Ok) {
kdDebug(399) << "XCF: read failure on header tag" << endl;
return;
}
xcf_io >> xcf_image.width >> xcf_image.height >> xcf_image.type;
- if (xcf_io.device()->status() != IO_Ok) {
+ if (xcf_io.tqdevice()->status() != IO_Ok) {
kdDebug(399) << "XCF: read failure on image info" << endl;
return;
}
@@ -149,14 +149,14 @@ kdDebug() << tag << " " << xcf_image.width << " " << xcf_image.height << " " <<
// all the data of all layers before beginning to construct the
// merged image).
- TQValueStack<Q_INT32> layer_offsets;
+ TQValueStack<TQ_INT32> layer_offsets;
while (true) {
- Q_INT32 layer_offset;
+ TQ_INT32 layer_offset;
xcf_io >> layer_offset;
- if (xcf_io.device()->status() != IO_Ok) {
+ if (xcf_io.tqdevice()->status() != IO_Ok) {
kdDebug(399) << "XCF: read failure on layer offsets" << endl;
return;
}
@@ -176,9 +176,9 @@ kdDebug() << tag << " " << xcf_image.width << " " << xcf_image.height << " " <<
// Load each layer and add it to the image
while (!layer_offsets.isEmpty()) {
- Q_INT32 layer_offset = layer_offsets.pop();
+ TQ_INT32 layer_offset = layer_offsets.pop();
- xcf_io.device()->at(layer_offset);
+ xcf_io.tqdevice()->at(layer_offset);
if (!loadLayer(xcf_io, xcf_image))
return;
@@ -190,7 +190,7 @@ kdDebug() << tag << " " << xcf_image.width << " " << xcf_image.height << " " <<
}
io->setImage(xcf_image.image);
- io->setStatus(0);
+ io->setqStatus(0);
}
@@ -233,11 +233,11 @@ bool XCFImageFormat::loadImageProperties(TQDataStream& xcf_io, XCFImage& xcf_ima
case PROP_PARASITES:
while (!property.atEnd()) {
char* tag;
- Q_UINT32 size;
+ TQ_UINT32 size;
property.readBytes(tag, size);
- Q_UINT32 flags;
+ TQ_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( qRgb(r,g,b) );
+ xcf_image.palette.push_back( tqRgb(r,g,b) );
}
break;
@@ -290,17 +290,17 @@ 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)
{
- Q_UINT32 foo;
+ TQ_UINT32 foo;
xcf_io >> foo;
type=PropType(foo); // TODO urks
- if (xcf_io.device()->status() != IO_Ok) {
+ if (xcf_io.tqdevice()->status() != IO_Ok) {
kdDebug(399) << "XCF: read failure on property type" << type << endl;
return false;
}
char* data;
- Q_UINT32 size;
+ TQ_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
@@ -309,7 +309,7 @@ bool XCFImageFormat::loadProperty(TQDataStream& xcf_io, PropType& type, TQByteAr
if (type == PROP_COLORMAP) {
xcf_io >> size;
- if (xcf_io.device()->status() != IO_Ok) {
+ if (xcf_io.tqdevice()->status() != IO_Ok) {
kdDebug(399) << "XCF: read failure on property " << type << " size" << endl;
return false;
}
@@ -324,12 +324,12 @@ 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;
- Q_INT32 digits;
+ TQ_INT32 digits;
char* unit_strings;
xcf_io >> size >> factor >> digits;
- if (xcf_io.device()->status() != IO_Ok) {
+ if (xcf_io.tqdevice()->status() != IO_Ok) {
kdDebug(399) << "XCF: read failure on property " << type << endl;
return false;
}
@@ -337,7 +337,7 @@ bool XCFImageFormat::loadProperty(TQDataStream& xcf_io, PropType& type, TQByteAr
for (int i = 0; i < 5; i++) {
xcf_io >> unit_strings;
- if (xcf_io.device()->status() != IO_Ok) {
+ if (xcf_io.tqdevice()->status() != IO_Ok) {
kdDebug(399) << "XCF: read failure on property " << type << endl;
return false;
}
@@ -354,7 +354,7 @@ bool XCFImageFormat::loadProperty(TQDataStream& xcf_io, PropType& type, TQByteAr
xcf_io.readRawBytes(data, size);
}
- if (xcf_io.device()->status() != IO_Ok) {
+ if (xcf_io.tqdevice()->status() != IO_Ok) {
kdDebug(399) << "XCF: read failure on property " << type << " data, size " << size << endl;
return false;
}
@@ -382,7 +382,7 @@ bool XCFImageFormat::loadLayer(TQDataStream& xcf_io, XCFImage& xcf_image)
xcf_io >> layer.width >> layer.height >> layer.type >> layer.name;
- if (xcf_io.device()->status() != IO_Ok) {
+ if (xcf_io.tqdevice()->status() != IO_Ok) {
kdDebug(399) << "XCF: read failure on layer" << endl;
return false;
}
@@ -405,7 +405,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.mask_offset;
- if (xcf_io.device()->status() != IO_Ok) {
+ if (xcf_io.tqdevice()->status() != IO_Ok) {
kdDebug(399) << "XCF: read failure on layer image offsets" << endl;
return false;
}
@@ -415,7 +415,7 @@ bool XCFImageFormat::loadLayer(TQDataStream& xcf_io, XCFImage& xcf_image)
if( !composeTiles(xcf_image))
return false;
- xcf_io.device()->at(layer.hierarchy_offset);
+ xcf_io.tqdevice()->at(layer.hierarchy_offset);
// As tiles are loaded, they are copied into the layers tiles by
// this routine. (loadMask(), below, uses a slightly different
@@ -427,7 +427,7 @@ bool XCFImageFormat::loadLayer(TQDataStream& xcf_io, XCFImage& xcf_image)
return false;
if (layer.mask_offset != 0) {
- xcf_io.device()->at(layer.mask_offset);
+ xcf_io.tqdevice()->at(layer.mask_offset);
if (!loadMask(xcf_io, layer))
return false;
@@ -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, qRgb(i, i, i));
+ image.setColor(i, tqRgb(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,
- qRgb(tile[0], tile[1], tile[2]));
+ tqRgb(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,
- qRgba(tile[0], tile[1], tile[2], tile[3]));
+ tqRgba(tile[0], tile[1], tile[2], tile[3]));
tile += sizeof(QRgb);
}
}
@@ -732,14 +732,14 @@ void XCFImageFormat::assignImageBytes(Layer& layer, uint i, uint j)
*/
bool XCFImageFormat::loadHierarchy(TQDataStream& xcf_io, Layer& layer)
{
- Q_INT32 width;
- Q_INT32 height;
- Q_INT32 bpp;
- Q_UINT32 offset;
+ TQ_INT32 width;
+ TQ_INT32 height;
+ TQ_INT32 bpp;
+ TQ_UINT32 offset;
xcf_io >> width >> height >> bpp >> offset;
- if (xcf_io.device()->status() != IO_Ok) {
+ if (xcf_io.tqdevice()->status() != IO_Ok) {
kdDebug(399) << "XCF: read failure on layer " << layer.name << " image header" << endl;
return false;
}
@@ -748,23 +748,23 @@ bool XCFImageFormat::loadHierarchy(TQDataStream& xcf_io, Layer& layer)
// increasingly lower resolution). Only the top level is used here,
// however.
- Q_UINT32 junk;
+ TQ_UINT32 junk;
do {
xcf_io >> junk;
- if (xcf_io.device()->status() != IO_Ok) {
+ if (xcf_io.tqdevice()->status() != IO_Ok) {
kdDebug(399) << "XCF: read failure on layer " << layer.name << " level offsets" << endl;
return false;
}
} while (junk != 0);
- TQIODevice::Offset saved_pos = xcf_io.device()->at();
+ TQIODevice::Offset saved_pos = xcf_io.tqdevice()->at();
- xcf_io.device()->at(offset);
+ xcf_io.tqdevice()->at(offset);
if (!loadLevel(xcf_io, layer, bpp))
return false;
- xcf_io.device()->at(saved_pos);
+ xcf_io.tqdevice()->at(saved_pos);
return true;
}
@@ -777,15 +777,15 @@ 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, Q_INT32 bpp)
+bool XCFImageFormat::loadLevel(TQDataStream& xcf_io, Layer& layer, TQ_INT32 bpp)
{
- Q_INT32 width;
- Q_INT32 height;
- Q_UINT32 offset;
+ TQ_INT32 width;
+ TQ_INT32 height;
+ TQ_UINT32 offset;
xcf_io >> width >> height >> offset;
- if (xcf_io.device()->status() != IO_Ok) {
+ if (xcf_io.tqdevice()->status() != IO_Ok) {
kdDebug(399) << "XCF: read failure on layer " << layer.name << " level info" << endl;
return false;
}
@@ -801,11 +801,11 @@ bool XCFImageFormat::loadLevel(TQDataStream& xcf_io, Layer& layer, Q_INT32 bpp)
return false;
}
- TQIODevice::Offset saved_pos = xcf_io.device()->at();
- Q_UINT32 offset2;
+ TQIODevice::Offset saved_pos = xcf_io.tqdevice()->at();
+ TQ_UINT32 offset2;
xcf_io >> offset2;
- if (xcf_io.device()->status() != IO_Ok) {
+ if (xcf_io.tqdevice()->status() != IO_Ok) {
kdDebug(399) << "XCF: read failure on layer " << layer.name << " level offset look-ahead" << endl;
return false;
}
@@ -815,7 +815,7 @@ bool XCFImageFormat::loadLevel(TQDataStream& xcf_io, Layer& layer, Q_INT32 bpp)
if (offset2 == 0)
offset2 = offset + (uint)(TILE_WIDTH * TILE_HEIGHT * 4 * 1.5);
- xcf_io.device()->at(offset);
+ xcf_io.tqdevice()->at(offset);
int size = layer.image_tiles[j][i].width() * layer.image_tiles[j][i].height();
if (!loadTileRLE(xcf_io, layer.tile, size, offset2 - offset, bpp))
@@ -827,10 +827,10 @@ bool XCFImageFormat::loadLevel(TQDataStream& xcf_io, Layer& layer, Q_INT32 bpp)
layer.assignBytes(layer, i, j);
- xcf_io.device()->at(saved_pos);
+ xcf_io.tqdevice()->at(saved_pos);
xcf_io >> offset;
- if (xcf_io.device()->status() != IO_Ok) {
+ if (xcf_io.tqdevice()->status() != IO_Ok) {
kdDebug(399) << "XCF: read failure on layer " << layer.name << " level offset" << endl;
return false;
}
@@ -849,13 +849,13 @@ bool XCFImageFormat::loadLevel(TQDataStream& xcf_io, Layer& layer, Q_INT32 bpp)
*/
bool XCFImageFormat::loadMask(TQDataStream& xcf_io, Layer& layer)
{
- Q_INT32 width;
- Q_INT32 height;
+ TQ_INT32 width;
+ TQ_INT32 height;
char* name;
xcf_io >> width >> height >> name;
- if (xcf_io.device()->status() != IO_Ok) {
+ if (xcf_io.tqdevice()->status() != IO_Ok) {
kdDebug(399) << "XCF: read failure on mask info" << endl;
return false;
}
@@ -865,15 +865,15 @@ bool XCFImageFormat::loadMask(TQDataStream& xcf_io, Layer& layer)
if (!loadChannelProperties(xcf_io, layer))
return false;
- Q_UINT32 hierarchy_offset;
+ TQ_UINT32 hierarchy_offset;
xcf_io >> hierarchy_offset;
- if (xcf_io.device()->status() != IO_Ok) {
+ if (xcf_io.tqdevice()->status() != IO_Ok) {
kdDebug(399) << "XCF: read failure on mask image offset" << endl;
return false;
}
- xcf_io.device()->at(hierarchy_offset);
+ xcf_io.tqdevice()->at(hierarchy_offset);
layer.assignBytes = assignMaskBytes;
if (!loadHierarchy(xcf_io, layer))
@@ -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, Q_INT32 bpp)
+ int data_length, TQ_INT32 bpp)
{
uchar* data;
@@ -919,7 +919,7 @@ bool XCFImageFormat::loadTileRLE(TQDataStream& xcf_io, uchar* tile, int image_si
xcf_io.readRawBytes((char*)xcfdata, data_length);
- if (xcf_io.device()->status() != IO_Ok) {
+ if (xcf_io.tqdevice()->status() != IO_Ok) {
delete[] xcfodata;
kdDebug(399) << "XCF: read failure on tile" << endl;
return false;
@@ -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(qRgb(255, 255, 255));
+ image.fill(tqRgb(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(qRgba(255, 255, 255, 0));
+ image.fill(tqRgba(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(qRgba(255, 255, 255, 0));
+ image.fill(tqRgba(255, 255, 255, 0));
image.setAlphaBuffer(true);
break;
@@ -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] = qRgba(255, 255, 255, 0);
+ xcf_image.palette[0] = tqRgba(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] = qRgba(255, 255, 255, 0);
+ xcf_image.palette[0] = tqRgba(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(qRgba(255, 255, 255, 0));
+ image.fill(tqRgba(255, 255, 255, 0));
image.setAlphaBuffer(true);
}
break;
@@ -1324,7 +1324,7 @@ 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, qAlpha(src));
+ src_a = INT_MULT(src_a, tqAlpha(src));
// Apply the mask (if any)
@@ -1332,7 +1332,7 @@ void XCFImageFormat::copyRGBToRGB(Layer& layer, uint i, uint j, int k, int l,
layer.mask_tiles[j].size() > i)
src_a = INT_MULT(src_a, layer.mask_tiles[j][i].pixelIndex(k, l));
- image.setPixel(m, n, qRgba(src, src_a));
+ image.setPixel(m, n, tqRgba(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, qRgba(src, src_a));
+ image.setPixel(m, n, tqRgba(src, src_a));
}
@@ -1403,7 +1403,7 @@ void XCFImageFormat::copyGrayAToRGB(Layer& layer, uint i, uint j, int k, int l,
layer.mask_tiles[j].size() > i)
src_a = INT_MULT(src_a, layer.mask_tiles[j][i].pixelIndex(k, l));
- image.setPixel(m, n, qRgba(src, src_a));
+ image.setPixel(m, n, tqRgba(src, src_a));
}
@@ -1489,7 +1489,7 @@ void XCFImageFormat::copyIndexedAToRGB(Layer& layer, uint i, uint j, int k, int
else
src_a = OPAQUE_OPACITY;
- image.setPixel(m, n, qRgba(src, src_a));
+ image.setPixel(m, n, tqRgba(src, src_a));
}
@@ -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 = qRed(src);
- uchar src_g = qGreen(src);
- uchar src_b = qBlue(src);
- uchar src_a = qAlpha(src);
+ uchar src_r = tqRed(src);
+ uchar src_g = tqGreen(src);
+ uchar src_b = tqBlue(src);
+ uchar src_a = tqAlpha(src);
- uchar dst_r = qRed(dst);
- uchar dst_g = qGreen(dst);
- uchar dst_b = qBlue(dst);
- uchar dst_a = qAlpha(dst);
+ uchar dst_r = tqRed(dst);
+ uchar dst_g = tqGreen(dst);
+ uchar dst_b = tqBlue(dst);
+ uchar dst_a = tqAlpha(dst);
switch (layer.mode) {
case MULTIPLY_MODE: {
@@ -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, qRgba(new_r, new_g, new_b, new_a));
+ image.setPixel(m, n, tqRgba(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 = qGray(layer.image_tiles[j][i].pixel(k, l));
+ int src = tqGray(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);
@@ -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, qRgba(src, src_a));
+ image.setPixel(m, n, tqRgba(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 = qGray(layer.image_tiles[j][i].pixel(k, l));
- int dst = qGray(image.pixel(m, n));
+ int src = tqGray(layer.image_tiles[j][i].pixel(k, l));
+ int dst = tqGray(image.pixel(m, n));
uchar src_a = layer.alpha_tiles[j][i].pixelIndex(k, l);
- uchar dst_a = qAlpha(image.pixel(m, n));
+ uchar dst_a = tqAlpha(image.pixel(m, n));
switch (layer.mode) {
case MULTIPLY_MODE: {
@@ -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, qRgba(new_g, new_g, new_g, new_a));
+ image.setPixel(m, n, tqRgba(new_g, new_g, new_g, new_a));
}
@@ -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, qRgba(src, src_a));
+ image.setPixel(m, n, tqRgba(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 > qAlpha(pixel)) {
- image.setPixel(k, l, qRgba(pixel, 0));
+ if (rand_val > tqAlpha(pixel)) {
+ image.setPixel(k, l, tqRgba(pixel, 0));
}
}
}
diff --git a/kimgio/xcf.h b/kimgio/xcf.h
index 3e92f27c2..d3b4302a9 100644
--- a/kimgio/xcf.h
+++ b/kimgio/xcf.h
@@ -64,12 +64,12 @@ private:
*/
class Layer {
public:
- Q_UINT32 width; //!< Width of the layer
- Q_UINT32 height; //!< Height of the layer
- Q_INT32 type; //!< Type of the layer (GimpImageType)
+ TQ_UINT32 width; //!< Width of the layer
+ TQ_UINT32 height; //!< Height of the layer
+ TQ_INT32 type; //!< Type of the layer (GimpImageType)
char* name; //!< Name of the layer
- Q_UINT32 hierarchy_offset; //!< File position of Tile hierarchy
- Q_UINT32 mask_offset; //!< File position of mask image
+ TQ_UINT32 hierarchy_offset; //!< File position of Tile hierarchy
+ TQ_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)
@@ -82,25 +82,25 @@ private:
//! Additional information about a layer mask.
struct {
- Q_UINT32 opacity;
- Q_UINT32 visible;
- Q_UINT32 show_masked;
+ TQ_UINT32 opacity;
+ TQ_UINT32 visible;
+ TQ_UINT32 show_masked;
uchar red, green, blue;
- Q_UINT32 tattoo;
+ TQ_UINT32 tattoo;
} mask_channel;
bool active; //!< Is this layer the active layer?
- 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?)
+ 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_mask; //!< Apply the layer mask?
+ TQ_UINT32 edit_mask; //!< Is the layer mask the being edited?
+ TQ_UINT32 show_mask; //!< Show the layer mask 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?)
//! As each tile is read from the file, it is buffered here.
uchar tile[TILE_WIDTH * TILE_HEIGHT * sizeof(QRgb)];
@@ -122,16 +122,16 @@ private:
*/
class XCFImage {
public:
- 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_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_UINT8 compression; //!< tile compression method (CompressionType)
+ TQ_UINT8 compression; //!< tile compression method (CompressionType)
float x_resolution; //!< x resolution in dots per inch
float y_resolution; //!< y resolution in dots per inch
- 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
+ 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
TQValueVector<QRgb> palette; //!< indexed image color palette
int num_layers; //!< number of layers
@@ -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, Q_INT32 bpp);
+ bool loadLevel(TQDataStream& xcf_io, Layer& layer, TQ_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, Q_INT32 bpp);
+ int data_length, TQ_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 746ddc6bc..00d604cf6 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, qRgb( r, g, b ) );
+ image.setColor( j, tqRgb( r, g, b ) );
}
for ( int py = 0; py < y; py++ )
@@ -94,7 +94,7 @@ KDE_EXPORT void kimgio_xv_read( TQImageIO *_imageio )
}
_imageio->setImage( image );
- _imageio->setStatus( 0 );
+ _imageio->setqStatus( 0 );
free(block);
return;
@@ -138,24 +138,24 @@ KDE_EXPORT void kimgio_xv_write( TQImageIO *imageio )
for ( int py = 0; py < h; py++ )
{
- uchar *data = image.scanLine( py );
+ uchar *data = const_cast<TQImage&>(image).scanLine( py );
for ( int px = 0; px < w; px++ )
{
int r, g, b;
if ( image.depth() == 32 )
{
QRgb *data32 = (QRgb*) data;
- r = qRed( *data32 ) >> 5;
- g = qGreen( *data32 ) >> 5;
- b = qBlue( *data32 ) >> 6;
+ r = tqRed( *data32 ) >> 5;
+ g = tqGreen( *data32 ) >> 5;
+ b = tqBlue( *data32 ) >> 6;
data += sizeof( QRgb );
}
else
{
QRgb color = image.color( *data );
- r = qRed( color ) >> 5;
- g = qGreen( color ) >> 5;
- b = qBlue( color ) >> 6;
+ r = tqRed( color ) >> 5;
+ g = tqGreen( color ) >> 5;
+ b = tqBlue( color ) >> 6;
data++;
}
buffer[ px ] = ( r << 5 ) | ( g << 2 ) | b;
@@ -164,6 +164,6 @@ KDE_EXPORT void kimgio_xv_write( TQImageIO *imageio )
}
delete[] buffer;
- imageio->setStatus( 0 );
+ imageio->setqStatus( 0 );
}