summaryrefslogtreecommitdiffstats
path: root/kdeui/kpixmapio.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-13 08:32:36 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-13 08:32:36 +0000
commitf7e71d47719ab6094cf4a9fafffa5ea351973522 (patch)
tree30834aa632d442019e14f88685001d94657d060b /kdeui/kpixmapio.cpp
parentb31cfd9a1ee986fe2ae9a693f3afd7f171dd897c (diff)
downloadtdelibs-f7e71d47719ab6094cf4a9fafffa5ea351973522.tar.gz
tdelibs-f7e71d47719ab6094cf4a9fafffa5ea351973522.zip
Initial conversion for TQt for Qt4 3.4.0 TP2
This will also compile with TQt for Qt3, and should not cause any problems with dependent modules such as kdebase. If it does then it needs to be fixed! git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1214149 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdeui/kpixmapio.cpp')
-rw-r--r--kdeui/kpixmapio.cpp152
1 files changed, 76 insertions, 76 deletions
diff --git a/kdeui/kpixmapio.cpp b/kdeui/kpixmapio.cpp
index 74c68b82e..4d1e3c06a 100644
--- a/kdeui/kpixmapio.cpp
+++ b/kdeui/kpixmapio.cpp
@@ -468,7 +468,7 @@ TQImage KPixmapIO::convertFromXImage()
cmap, ncells);
image.setNumColors(ncells);
for (i=0; i<ncells; i++)
- image.setColor(i, qRgb(cmap[i].red, cmap[i].green, cmap[i].blue >> 8));
+ image.setColor(i, tqRgb(cmap[i].red, cmap[i].green, cmap[i].blue >> 8));
} else
image.create(width, height, 32);
@@ -485,12 +485,12 @@ TQImage KPixmapIO::convertFromXImage()
case bo16_RGB_565:
case bo16_BGR_565:
{
- Q_INT32 pixel, *src;
- QRgb *dst, val;
+ TQ_INT32 pixel, *src;
+ TQRgb *dst, val;
for (y=0; y<height; y++)
{
- src = (Q_INT32 *) (data + y*bpl);
- dst = (QRgb *) image.scanLine(y);
+ src = (TQ_INT32 *) (data + y*bpl);
+ dst = (TQRgb *) image.scanLine(y);
for (x=0; x<width/2; x++)
{
pixel = *src++;
@@ -516,12 +516,12 @@ TQImage KPixmapIO::convertFromXImage()
case bo16_RGB_555:
case bo16_BGR_555:
{
- Q_INT32 pixel, *src;
- QRgb *dst, val;
+ TQ_INT32 pixel, *src;
+ TQRgb *dst, val;
for (y=0; y<height; y++)
{
- src = (Q_INT32 *) (data + y*bpl);
- dst = (QRgb *) image.scanLine(y);
+ src = (TQ_INT32 *) (data + y*bpl);
+ dst = (TQRgb *) image.scanLine(y);
for (x=0; x<width/2; x++)
{
pixel = *src++;
@@ -547,18 +547,18 @@ TQImage KPixmapIO::convertFromXImage()
case bo24_RGB:
{
char *src;
- QRgb *dst;
+ TQRgb *dst;
int w1 = width/4;
- Q_INT32 d1, d2, d3;
+ TQ_INT32 d1, d2, d3;
for (y=0; y<height; y++)
{
src = data + y*bpl;
- dst = (QRgb *) image.scanLine(y);
+ dst = (TQRgb *) image.scanLine(y);
for (x=0; x<w1; x++)
{
- d1 = *((Q_INT32 *)src);
- d2 = *((Q_INT32 *)src + 1);
- d3 = *((Q_INT32 *)src + 2);
+ d1 = *((TQ_INT32 *)src);
+ d2 = *((TQ_INT32 *)src + 1);
+ d3 = *((TQ_INT32 *)src + 2);
src += 12;
*dst++ = d1;
*dst++ = (d1 >> 24) | (d2 << 8);
@@ -579,18 +579,18 @@ TQImage KPixmapIO::convertFromXImage()
case bo24_BGR:
{
char *src;
- QRgb *dst;
+ TQRgb *dst;
int w1 = width/4;
- Q_INT32 d1, d2, d3;
+ TQ_INT32 d1, d2, d3;
for (y=0; y<height; y++)
{
src = data + y*bpl;
- dst = (QRgb *) image.scanLine(y);
+ dst = (TQRgb *) image.scanLine(y);
for (x=0; x<w1; x++)
{
- d1 = *((Q_INT32 *)src);
- d2 = *((Q_INT32 *)src + 1);
- d3 = *((Q_INT32 *)src + 2);
+ d1 = *((TQ_INT32 *)src);
+ d2 = *((TQ_INT32 *)src + 1);
+ d3 = *((TQ_INT32 *)src + 2);
src += 12;
*dst++ = d1;
*dst++ = (d1 >> 24) | (d2 << 8);
@@ -637,12 +637,12 @@ void KPixmapIO::convertToXImage(const TQImage &img)
if (img.depth() == 32)
{
- QRgb *src, pixel;
- Q_INT32 *dst, val;
+ TQRgb *src, pixel;
+ TQ_INT32 *dst, val;
for (y=0; y<height; y++)
{
- src = (QRgb *) img.scanLine(y);
- dst = (Q_INT32 *) (data + y*bpl);
+ src = (TQRgb *) img.scanLine(y);
+ dst = (TQ_INT32 *) (data + y*bpl);
for (x=0; x<width/2; x++)
{
pixel = *src++;
@@ -656,19 +656,19 @@ void KPixmapIO::convertToXImage(const TQImage &img)
if (width%2)
{
pixel = *src++;
- *((Q_INT16 *)dst) = ((pixel & 0xf80000) >> 9) |
+ *((TQ_INT16 *)dst) = ((pixel & 0xf80000) >> 9) |
((pixel & 0xf800) >> 6) | ((pixel & 0xff) >> 3);
}
}
} else
{
uchar *src;
- Q_INT32 val, *dst;
- QRgb pixel, *clut = img.colorTable();
+ TQ_INT32 val, *dst;
+ TQRgb pixel, *clut = img.tqcolorTable();
for (y=0; y<height; y++)
{
- src = img.scanLine(y);
- dst = (Q_INT32 *) (data + y*bpl);
+ src = const_cast<TQImage&>(img).scanLine(y);
+ dst = (TQ_INT32 *) (data + y*bpl);
for (x=0; x<width/2; x++)
{
pixel = clut[*src++];
@@ -682,7 +682,7 @@ void KPixmapIO::convertToXImage(const TQImage &img)
if (width%2)
{
pixel = clut[*src++];
- *((Q_INT16 *)dst) = ((pixel & 0xf80000) >> 9) |
+ *((TQ_INT16 *)dst) = ((pixel & 0xf80000) >> 9) |
((pixel & 0xf800) >> 6) | ((pixel & 0xff) >> 3);
}
}
@@ -694,12 +694,12 @@ void KPixmapIO::convertToXImage(const TQImage &img)
if (img.depth() == 32)
{
- QRgb *src, pixel;
- Q_INT32 *dst, val;
+ TQRgb *src, pixel;
+ TQ_INT32 *dst, val;
for (y=0; y<height; y++)
{
- src = (QRgb *) img.scanLine(y);
- dst = (Q_INT32 *) (data + y*bpl);
+ src = (TQRgb *) img.scanLine(y);
+ dst = (TQ_INT32 *) (data + y*bpl);
for (x=0; x<width/2; x++)
{
pixel = *src++;
@@ -713,19 +713,19 @@ void KPixmapIO::convertToXImage(const TQImage &img)
if (width%2)
{
pixel = *src++;
- *((Q_INT16 *)dst) = ((pixel & 0xf80000) >> 8) |
+ *((TQ_INT16 *)dst) = ((pixel & 0xf80000) >> 8) |
((pixel & 0xfc00) >> 5) | ((pixel & 0xff) >> 3);
}
}
} else
{
uchar *src;
- Q_INT32 val, *dst;
- QRgb pixel, *clut = img.colorTable();
+ TQ_INT32 val, *dst;
+ TQRgb pixel, *clut = img.tqcolorTable();
for (y=0; y<height; y++)
{
- src = img.scanLine(y);
- dst = (Q_INT32 *) (data + y*bpl);
+ src = const_cast<TQImage&>(img).scanLine(y);
+ dst = (TQ_INT32 *) (data + y*bpl);
for (x=0; x<width/2; x++)
{
pixel = clut[*src++];
@@ -739,7 +739,7 @@ void KPixmapIO::convertToXImage(const TQImage &img)
if (width%2)
{
pixel = clut[*src++];
- *((Q_INT16 *)dst) = ((pixel & 0xf80000) >> 8) |
+ *((TQ_INT16 *)dst) = ((pixel & 0xf80000) >> 8) |
((pixel & 0xfc00) >> 5) | ((pixel & 0xff) >> 3);
}
}
@@ -752,10 +752,10 @@ void KPixmapIO::convertToXImage(const TQImage &img)
{
char *dst;
int w1 = width/4;
- QRgb *src, d1, d2, d3, d4;
+ TQRgb *src, d1, d2, d3, d4;
for (y=0; y<height; y++)
{
- src = (QRgb *) img.scanLine(y);
+ src = (TQRgb *) img.scanLine(y);
dst = data + y*bpl;
for (x=0; x<w1; x++)
{
@@ -763,27 +763,27 @@ void KPixmapIO::convertToXImage(const TQImage &img)
d2 = (*src++ & 0xffffff);
d3 = (*src++ & 0xffffff);
d4 = (*src++ & 0xffffff);
- *((Q_INT32 *)dst) = d1 | (d2 << 24);
- *((Q_INT32 *)dst+1) = (d2 >> 8) | (d3 << 16);
- *((Q_INT32 *)dst+2) = (d4 << 8) | (d3 >> 16);
+ *((TQ_INT32 *)dst) = d1 | (d2 << 24);
+ *((TQ_INT32 *)dst+1) = (d2 >> 8) | (d3 << 16);
+ *((TQ_INT32 *)dst+2) = (d4 << 8) | (d3 >> 16);
dst += 12;
}
for (x=w1*4; x<width; x++)
{
d1 = *src++;
- *dst++ = qRed(d1);
- *dst++ = qGreen(d1);
- *dst++ = qBlue(d1);
+ *dst++ = tqRed(d1);
+ *dst++ = tqGreen(d1);
+ *dst++ = tqBlue(d1);
}
}
} else
{
uchar *src, *dst;
int w1 = width/4;
- QRgb *clut = img.colorTable(), d1, d2, d3, d4;
+ TQRgb *clut = img.tqcolorTable(), d1, d2, d3, d4;
for (y=0; y<height; y++)
{
- src = img.scanLine(y);
+ src = const_cast<TQImage&>(img).scanLine(y);
dst = (uchar *) data + y*bpl;
for (x=0; x<w1; x++)
{
@@ -791,17 +791,17 @@ void KPixmapIO::convertToXImage(const TQImage &img)
d2 = (clut[*src++] & 0xffffff);
d3 = (clut[*src++] & 0xffffff);
d4 = (clut[*src++] & 0xffffff);
- *((Q_INT32 *)dst) = d1 | (d2 << 24);
- *((Q_INT32 *)dst+1) = (d2 >> 8) | (d3 << 16);
- *((Q_INT32 *)dst+2) = (d4 << 8) | (d3 >> 16);
+ *((TQ_INT32 *)dst) = d1 | (d2 << 24);
+ *((TQ_INT32 *)dst+1) = (d2 >> 8) | (d3 << 16);
+ *((TQ_INT32 *)dst+2) = (d4 << 8) | (d3 >> 16);
dst += 12;
}
for (x=w1*4; x<width; x++)
{
d1 = clut[*src++];
- *dst++ = qRed(d1);
- *dst++ = qGreen(d1);
- *dst++ = qBlue(d1);
+ *dst++ = tqRed(d1);
+ *dst++ = tqGreen(d1);
+ *dst++ = tqBlue(d1);
}
}
}
@@ -812,11 +812,11 @@ void KPixmapIO::convertToXImage(const TQImage &img)
if (img.depth() == 32)
{
char *dst;
- QRgb *src, d1, d2, d3, d4;
+ TQRgb *src, d1, d2, d3, d4;
int w1 = width/4;
for (y=0; y<height; y++)
{
- src = (QRgb *) img.scanLine(y);
+ src = (TQRgb *) img.scanLine(y);
dst = data + y*bpl;
for (x=0; x<w1; x++)
{
@@ -824,27 +824,27 @@ void KPixmapIO::convertToXImage(const TQImage &img)
d2 = (*src++ & 0xffffff);
d3 = (*src++ & 0xffffff);
d4 = (*src++ & 0xffffff);
- *((Q_INT32 *)dst) = d1 | (d2 << 24);
- *((Q_INT32 *)dst+1) = (d2 >> 8) | (d3 << 16);
- *((Q_INT32 *)dst+2) = (d4 << 8) | (d3 >> 16);
+ *((TQ_INT32 *)dst) = d1 | (d2 << 24);
+ *((TQ_INT32 *)dst+1) = (d2 >> 8) | (d3 << 16);
+ *((TQ_INT32 *)dst+2) = (d4 << 8) | (d3 >> 16);
dst += 12;
}
for (x=w1*4; x<width; x++)
{
d1 = *src++;
- *dst++ = qBlue(d1);
- *dst++ = qGreen(d1);
- *dst++ = qRed(d1);
+ *dst++ = tqBlue(d1);
+ *dst++ = tqGreen(d1);
+ *dst++ = tqRed(d1);
}
}
} else
{
uchar *src, *dst;
int w1 = width/4;
- QRgb *clut = img.colorTable(), d1, d2, d3, d4;
+ TQRgb *clut = img.tqcolorTable(), d1, d2, d3, d4;
for (y=0; y<height; y++)
{
- src = img.scanLine(y);
+ src = const_cast<TQImage&>(img).scanLine(y);
dst = (uchar *) data + y*bpl;
for (x=0; x<w1; x++)
{
@@ -852,17 +852,17 @@ void KPixmapIO::convertToXImage(const TQImage &img)
d2 = (clut[*src++] & 0xffffff);
d3 = (clut[*src++] & 0xffffff);
d4 = (clut[*src++] & 0xffffff);
- *((Q_INT32 *)dst) = d1 | (d2 << 24);
- *((Q_INT32 *)dst+1) = (d2 >> 8) | (d3 << 16);
- *((Q_INT32 *)dst+2) = (d4 << 8) | (d3 >> 16);
+ *((TQ_INT32 *)dst) = d1 | (d2 << 24);
+ *((TQ_INT32 *)dst+1) = (d2 >> 8) | (d3 << 16);
+ *((TQ_INT32 *)dst+2) = (d4 << 8) | (d3 >> 16);
dst += 12;
}
for (x=w1*4; x<width; x++)
{
d1 = clut[*src++];
- *dst++ = qBlue(d1);
- *dst++ = qGreen(d1);
- *dst++ = qRed(d1);
+ *dst++ = tqBlue(d1);
+ *dst++ = tqGreen(d1);
+ *dst++ = tqRed(d1);
}
}
}
@@ -878,11 +878,11 @@ void KPixmapIO::convertToXImage(const TQImage &img)
} else
{
uchar *src;
- QRgb *dst, *clut = img.colorTable();
+ TQRgb *dst, *clut = img.tqcolorTable();
for (y=0; y<height; y++)
{
- src = img.scanLine(y);
- dst = (QRgb *) (data + y*bpl);
+ src = const_cast<TQImage&>(img).scanLine(y);
+ dst = (TQRgb *) (data + y*bpl);
for (x=0; x<width; x++)
*dst++ = clut[*src++];
}