summaryrefslogtreecommitdiffstats
path: root/src/kernel/qimage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/qimage.cpp')
-rw-r--r--src/kernel/qimage.cpp228
1 files changed, 114 insertions, 114 deletions
diff --git a/src/kernel/qimage.cpp b/src/kernel/qimage.cpp
index d904b28c7..bb7e1da93 100644
--- a/src/kernel/qimage.cpp
+++ b/src/kernel/qimage.cpp
@@ -98,10 +98,10 @@
setAlphaBuffer() alpha buffer\endlink.
An entry in the color table is an RGB triplet encoded as a \c
- uint. Use the \link ::qRed() qRed()\endlink, \link ::qGreen()
- qGreen()\endlink and \link ::qBlue() qBlue()\endlink functions (\c
- ntqcolor.h) to access the components, and \link ::qRgb()
- qRgb\endlink to make an RGB triplet (see the TQColor class
+ uint. Use the \link ::tqRed() tqRed()\endlink, \link ::tqGreen()
+ tqGreen()\endlink and \link ::tqBlue() tqBlue()\endlink functions (\c
+ ntqcolor.h) to access the components, and \link ::tqRgb()
+ tqRgb\endlink to make an RGB triplet (see the TQColor class
documentation).
1-bpp (monochrome) images have a color table with a most two
@@ -127,7 +127,7 @@
\code
TQImage image;
// set entry 19 in the color table to yellow
- image.setColor( 19, qRgb(255,255,0) );
+ image.setColor( 19, tqRgb(255,255,0) );
// set 8 bit pixel at (x,y) to value yellow (in color table)
*(image.scanLine(y) + x) = 19;
\endcode
@@ -140,7 +140,7 @@
TQImage image;
// sets 32 bit pixel at (x,y) to yellow.
uint *p = (uint *)image.scanLine(y) + x;
- *p = qRgb(255,255,0);
+ *p = tqRgb(255,255,0);
\endcode
On TQt/Embedded, scanlines are aligned to the pixel depth and may
@@ -888,9 +888,9 @@ TQImage TQImage::copy(int x, int y, int w, int h, int conversion_flags) const
Returns the color in the color table at index \a i. The first
color is at index 0.
- A color value is an RGB triplet. Use the \link ::qRed()
- qRed()\endlink, \link ::qGreen() qGreen()\endlink and \link
- ::qBlue() qBlue()\endlink functions (defined in \c ntqcolor.h) to
+ A color value is an RGB triplet. Use the \link ::tqRed()
+ tqRed()\endlink, \link ::tqGreen() tqGreen()\endlink and \link
+ ::tqBlue() tqBlue()\endlink functions (defined in \c ntqcolor.h) to
get the color value components.
\sa setColor() numColors() TQColor
@@ -901,8 +901,8 @@ TQImage TQImage::copy(int x, int y, int w, int h, int conversion_flags) const
Sets a color in the color table at index \a i to \a c.
- A color value is an RGB triplet. Use the \link ::qRgb()
- qRgb()\endlink function (defined in \c ntqcolor.h) to make RGB
+ A color value is an RGB triplet. Use the \link ::tqRgb()
+ tqRgb()\endlink function (defined in \c ntqcolor.h) to make RGB
triplets.
\sa color() setNumColors() numColors()
@@ -920,9 +920,9 @@ TQImage TQImage::copy(int x, int y, int w, int h, int conversion_flags) const
pointer to \c{TQRgb*} (TQRgb has a 32-bit size) and use it to
read/write the pixel value. You cannot use the \c{uchar*} pointer
directly, because the pixel format depends on the byte order on
- the underlying platform. Hint: use \link ::qRed() qRed()\endlink,
- \link ::qGreen() qGreen()\endlink and \link ::qBlue()
- qBlue()\endlink, etc. (ntqcolor.h) to access the pixels.
+ the underlying platform. Hint: use \link ::tqRed() tqRed()\endlink,
+ \link ::tqGreen() tqGreen()\endlink and \link ::tqBlue()
+ tqBlue()\endlink, etc. (ntqcolor.h) to access the pixels.
\warning If you are accessing 16-bpp image data, you must handle
endianness yourself. (TQt/Embedded only)
@@ -1522,7 +1522,7 @@ static bool convert_32_to_8( const TQImage *src, TQImage *dst, int conversion_fl
for ( bc=0; bc<=MAX_B; bc++ ) {
dst->setColor( INDEXOF(rc,gc,bc),
(amask&0xff000000)
- | qRgb( rc*255/MAX_R, gc*255/MAX_G, bc*255/MAX_B ) );
+ | tqRgb( rc*255/MAX_R, gc*255/MAX_G, bc*255/MAX_B ) );
}
int sw = src->width();
@@ -1551,9 +1551,9 @@ static bool convert_32_to_8( const TQImage *src, TQImage *dst, int conversion_fl
if ( ( conversion_flags & TQt::Dither_Mask ) == TQt::ThresholdDither ) {
#define DITHER(p,m) ((uchar) ((p * (m) + 127) / 255))
while ( p < end ) {
- rc = qRed( *p );
- gc = qGreen( *p );
- bc = qBlue( *p );
+ rc = tqRed( *p );
+ gc = tqGreen( *p );
+ bc = tqBlue( *p );
*b++ =
INDEXOF(
@@ -1572,9 +1572,9 @@ static bool convert_32_to_8( const TQImage *src, TQImage *dst, int conversion_fl
while ( p < end ) {
uint d = bm[y&15][x&15];
- rc = qRed( *p );
- gc = qGreen( *p );
- bc = qBlue( *p );
+ rc = tqRed( *p );
+ gc = tqGreen( *p );
+ bc = tqBlue( *p );
*b++ =
INDEXOF(
@@ -1805,8 +1805,8 @@ static bool dither_to_1( const TQImage *src, TQImage *dst,
dithermode = Diffuse;
}
- dst->setColor( 0, qRgb(255, 255, 255) );
- dst->setColor( 1, qRgb( 0, 0, 0) );
+ dst->setColor( 0, tqRgb(255, 255, 255) );
+ dst->setColor( 1, tqRgb( 0, 0, 0) );
int w = src->width();
int h = src->height();
int d = src->depth();
@@ -1822,7 +1822,7 @@ static bool dither_to_1( const TQImage *src, TQImage *dst,
// Pixel 0x00 -> 1 pixels (black)
// Pixel 0xFF -> 0 pixels (white)
for ( int i=0; i<src->numColors(); i++ )
- gray[i] = qGray( src->color(i) & 0x00ffffff );
+ gray[i] = tqGray( src->color(i) & 0x00ffffff );
}
}
@@ -1852,7 +1852,7 @@ static bool dither_to_1( const TQImage *src, TQImage *dst,
}
} else {
while ( p < end ) {
- *b2++ = qGray(*(uint*)p);
+ *b2++ = tqGray(*(uint*)p);
p += 4;
}
}
@@ -1878,7 +1878,7 @@ static bool dither_to_1( const TQImage *src, TQImage *dst,
}
} else {
while ( p < end ) {
- *b2++ = qGray(*(uint*)p);
+ *b2++ = tqGray(*(uint*)p);
p += 4;
}
}
@@ -1970,7 +1970,7 @@ static bool dither_to_1( const TQImage *src, TQImage *dst,
}
} else {
while ( p < end ) {
- if ( (uint)qGray(*p++) < bm[j++&15][i&15] )
+ if ( (uint)tqGray(*p++) < bm[j++&15][i&15] )
*m |= 1 << bit;
if ( bit == 0 ) {
m++;
@@ -2028,7 +2028,7 @@ static bool dither_to_1( const TQImage *src, TQImage *dst,
}
} else {
while ( p < end ) {
- if ( qGray(*p++) < 128 )
+ if ( tqGray(*p++) < 128 )
*m |= 1 << bit; // Set pixel "black"
if ( bit == 0 ) {
m++;
@@ -2241,7 +2241,7 @@ int TQImage::pixelIndex( int x, int y ) const
If (\a x, \a y) is not \link valid() on the image\endlink, the
results are undefined.
- \sa setPixel() qRed() qGreen() qBlue() valid()
+ \sa setPixel() tqRed() tqGreen() tqBlue() valid()
*/
TQRgb TQImage::pixel( int x, int y ) const
@@ -2285,7 +2285,7 @@ TQRgb TQImage::pixel( int x, int y ) const
If the image is a paletted image (depth() \<= 8) and \a
index_or_rgb \>= numColors(), the result is undefined.
- \sa pixelIndex() pixel() qRgb() qRgba() valid()
+ \sa pixelIndex() pixel() tqRgb() tqRgba() valid()
*/
void TQImage::setPixel( int x, int y, uint index_or_rgb )
@@ -2377,8 +2377,8 @@ TQImage TQImage::convertBitOrder( Endian bitOrder ) const
static
bool isGray(TQRgb c)
{
- return qRed(c) == qGreen(c)
- && qRed(c) == qBlue(c);
+ return tqRed(c) == tqGreen(c)
+ && tqRed(c) == tqBlue(c);
}
/*!
@@ -2440,7 +2440,7 @@ bool TQImage::isGrayscale() const
#endif //QT_NO_IMAGE_TRUECOLOR
case 8: {
for (int i=0; i<numColors(); i++)
- if (data->ctbl[i] != qRgb(i,i,i))
+ if (data->ctbl[i] != tqRgb(i,i,i))
return FALSE;
return TRUE;
}
@@ -2532,14 +2532,14 @@ void pnmscale(const TQImage& src, TQImage& dst)
xelrow = (TQRgb*)src.scanLine(rowsread++);
for ( col = 0, xP = xelrow; col < cols; ++col, ++xP ) {
if (as) {
- as[col] += fracrowleft * qAlpha( *xP );
- rs[col] += fracrowleft * qRed( *xP ) * qAlpha( *xP ) / 255;
- gs[col] += fracrowleft * qGreen( *xP ) * qAlpha( *xP ) / 255;
- bs[col] += fracrowleft * qBlue( *xP ) * qAlpha( *xP ) / 255;
+ as[col] += fracrowleft * tqAlpha( *xP );
+ rs[col] += fracrowleft * tqRed( *xP ) * tqAlpha( *xP ) / 255;
+ gs[col] += fracrowleft * tqGreen( *xP ) * tqAlpha( *xP ) / 255;
+ bs[col] += fracrowleft * tqBlue( *xP ) * tqAlpha( *xP ) / 255;
} else {
- rs[col] += fracrowleft * qRed( *xP );
- gs[col] += fracrowleft * qGreen( *xP );
- bs[col] += fracrowleft * qBlue( *xP );
+ rs[col] += fracrowleft * tqRed( *xP );
+ gs[col] += fracrowleft * tqGreen( *xP );
+ bs[col] += fracrowleft * tqBlue( *xP );
}
}
fracrowtofill -= fracrowleft;
@@ -2558,19 +2558,19 @@ void pnmscale(const TQImage& src, TQImage& dst)
register long r, g, b;
if ( as ) {
- r = rs[col] + fracrowtofill * qRed( *xP ) * qAlpha( *xP ) / 255;
- g = gs[col] + fracrowtofill * qGreen( *xP ) * qAlpha( *xP ) / 255;
- b = bs[col] + fracrowtofill * qBlue( *xP ) * qAlpha( *xP ) / 255;
- a = as[col] + fracrowtofill * qAlpha( *xP );
+ r = rs[col] + fracrowtofill * tqRed( *xP ) * tqAlpha( *xP ) / 255;
+ g = gs[col] + fracrowtofill * tqGreen( *xP ) * tqAlpha( *xP ) / 255;
+ b = bs[col] + fracrowtofill * tqBlue( *xP ) * tqAlpha( *xP ) / 255;
+ a = as[col] + fracrowtofill * tqAlpha( *xP );
if ( a ) {
r = r * 255 / a * SCALE;
g = g * 255 / a * SCALE;
b = b * 255 / a * SCALE;
}
} else {
- r = rs[col] + fracrowtofill * qRed( *xP );
- g = gs[col] + fracrowtofill * qGreen( *xP );
- b = bs[col] + fracrowtofill * qBlue( *xP );
+ r = rs[col] + fracrowtofill * tqRed( *xP );
+ g = gs[col] + fracrowtofill * tqGreen( *xP );
+ b = bs[col] + fracrowtofill * tqBlue( *xP );
}
r /= SCALE;
if ( r > maxval ) r = maxval;
@@ -2581,10 +2581,10 @@ void pnmscale(const TQImage& src, TQImage& dst)
if ( as ) {
a /= SCALE;
if ( a > maxval ) a = maxval;
- *nxP = qRgba( (int)r, (int)g, (int)b, (int)a );
+ *nxP = tqRgba( (int)r, (int)g, (int)b, (int)a );
as[col] = HALFSCALE;
} else {
- *nxP = qRgb( (int)r, (int)g, (int)b );
+ *nxP = tqRgb( (int)r, (int)g, (int)b );
}
rs[col] = gs[col] = bs[col] = HALFSCALE;
}
@@ -2617,19 +2617,19 @@ void pnmscale(const TQImage& src, TQImage& dst)
a = r = g = b = HALFSCALE;
}
if ( as ) {
- r += fraccoltofill * qRed( *xP ) * qAlpha( *xP ) / 255;
- g += fraccoltofill * qGreen( *xP ) * qAlpha( *xP ) / 255;
- b += fraccoltofill * qBlue( *xP ) * qAlpha( *xP ) / 255;
- a += fraccoltofill * qAlpha( *xP );
+ r += fraccoltofill * tqRed( *xP ) * tqAlpha( *xP ) / 255;
+ g += fraccoltofill * tqGreen( *xP ) * tqAlpha( *xP ) / 255;
+ b += fraccoltofill * tqBlue( *xP ) * tqAlpha( *xP ) / 255;
+ a += fraccoltofill * tqAlpha( *xP );
if ( a ) {
r = r * 255 / a * SCALE;
g = g * 255 / a * SCALE;
b = b * 255 / a * SCALE;
}
} else {
- r += fraccoltofill * qRed( *xP );
- g += fraccoltofill * qGreen( *xP );
- b += fraccoltofill * qBlue( *xP );
+ r += fraccoltofill * tqRed( *xP );
+ g += fraccoltofill * tqGreen( *xP );
+ b += fraccoltofill * tqBlue( *xP );
}
r /= SCALE;
if ( r > maxval ) r = maxval;
@@ -2640,9 +2640,9 @@ void pnmscale(const TQImage& src, TQImage& dst)
if (as) {
a /= SCALE;
if ( a > maxval ) a = maxval;
- *nxP = qRgba( (int)r, (int)g, (int)b, (int)a );
+ *nxP = tqRgba( (int)r, (int)g, (int)b, (int)a );
} else {
- *nxP = qRgb( (int)r, (int)g, (int)b );
+ *nxP = tqRgb( (int)r, (int)g, (int)b );
}
fraccolleft -= fraccoltofill;
fraccoltofill = SCALE;
@@ -2655,14 +2655,14 @@ void pnmscale(const TQImage& src, TQImage& dst)
needcol = 0;
}
if (as) {
- a += fraccolleft * qAlpha( *xP );
- r += fraccolleft * qRed( *xP ) * qAlpha( *xP ) / 255;
- g += fraccolleft * qGreen( *xP ) * qAlpha( *xP ) / 255;
- b += fraccolleft * qBlue( *xP ) * qAlpha( *xP ) / 255;
+ a += fraccolleft * tqAlpha( *xP );
+ r += fraccolleft * tqRed( *xP ) * tqAlpha( *xP ) / 255;
+ g += fraccolleft * tqGreen( *xP ) * tqAlpha( *xP ) / 255;
+ b += fraccolleft * tqBlue( *xP ) * tqAlpha( *xP ) / 255;
} else {
- r += fraccolleft * qRed( *xP );
- g += fraccolleft * qGreen( *xP );
- b += fraccolleft * qBlue( *xP );
+ r += fraccolleft * tqRed( *xP );
+ g += fraccolleft * tqGreen( *xP );
+ b += fraccolleft * tqBlue( *xP );
}
fraccoltofill -= fraccolleft;
}
@@ -2670,19 +2670,19 @@ void pnmscale(const TQImage& src, TQImage& dst)
if ( fraccoltofill > 0 ) {
--xP;
if (as) {
- a += fraccolleft * qAlpha( *xP );
- r += fraccoltofill * qRed( *xP ) * qAlpha( *xP ) / 255;
- g += fraccoltofill * qGreen( *xP ) * qAlpha( *xP ) / 255;
- b += fraccoltofill * qBlue( *xP ) * qAlpha( *xP ) / 255;
+ a += fraccolleft * tqAlpha( *xP );
+ r += fraccoltofill * tqRed( *xP ) * tqAlpha( *xP ) / 255;
+ g += fraccoltofill * tqGreen( *xP ) * tqAlpha( *xP ) / 255;
+ b += fraccoltofill * tqBlue( *xP ) * tqAlpha( *xP ) / 255;
if ( a ) {
r = r * 255 / a * SCALE;
g = g * 255 / a * SCALE;
b = b * 255 / a * SCALE;
}
} else {
- r += fraccoltofill * qRed( *xP );
- g += fraccoltofill * qGreen( *xP );
- b += fraccoltofill * qBlue( *xP );
+ r += fraccoltofill * tqRed( *xP );
+ g += fraccoltofill * tqGreen( *xP );
+ b += fraccoltofill * tqBlue( *xP );
}
}
if ( ! needcol ) {
@@ -2695,9 +2695,9 @@ void pnmscale(const TQImage& src, TQImage& dst)
if (as) {
a /= SCALE;
if ( a > maxval ) a = maxval;
- *nxP = qRgba( (int)r, (int)g, (int)b, (int)a );
+ *nxP = tqRgba( (int)r, (int)g, (int)b, (int)a );
} else {
- *nxP = qRgb( (int)r, (int)g, (int)b );
+ *nxP = tqRgb( (int)r, (int)g, (int)b );
}
}
}
@@ -4704,7 +4704,7 @@ bool read_dib( TQDataStream& s, int offset, int startpos, TQImage& image )
for ( int i=0; i<ncols; i++ ) {
if ( d->readBlock( (char *)rgb, rgb_len ) != rgb_len )
return FALSE;
- image.setColor( i, qRgb(rgb[2],rgb[1],rgb[0]) );
+ image.setColor( i, tqRgb(rgb[2],rgb[1],rgb[0]) );
if ( d->atEnd() ) // truncated file
return FALSE;
}
@@ -4758,7 +4758,7 @@ bool read_dib( TQDataStream& s, int offset, int startpos, TQImage& image )
d->at(d->at()+pad);
#endif
}
- if ( ncols == 2 && qGray(image.color(0)) < qGray(image.color(1)) )
+ if ( ncols == 2 && tqGray(image.color(0)) < tqGray(image.color(1)) )
swapPixel01( &image ); // pixel 0 is white!
}
@@ -4929,7 +4929,7 @@ bool read_dib( TQDataStream& s, int offset, int startpos, TQImage& image )
c = *(uchar*)b | (*(uchar*)(b+1)<<8);
if (nbits != 16)
c |= *(uchar*)(b+2)<<16;
- *p++ = qRgb(((c & red_mask) >> red_shift) * red_scale,
+ *p++ = tqRgb(((c & red_mask) >> red_shift) * red_scale,
((c & green_mask) >> green_shift) * green_scale,
((c & blue_mask) >> blue_shift) * blue_scale);
b += nbits/8;
@@ -5012,9 +5012,9 @@ bool qt_write_dib( TQDataStream& s, TQImage image )
uchar *rgb = color_table;
TQRgb *c = image.colorTable();
for ( int i=0; i<image.numColors(); i++ ) {
- *rgb++ = qBlue ( c[i] );
- *rgb++ = qGreen( c[i] );
- *rgb++ = qRed ( c[i] );
+ *rgb++ = tqBlue ( c[i] );
+ *rgb++ = tqGreen( c[i] );
+ *rgb++ = tqRed ( c[i] );
*rgb++ = 0;
}
d->writeBlock( (char *)color_table, 4*image.numColors() );
@@ -5062,9 +5062,9 @@ bool qt_write_dib( TQDataStream& s, TQImage image )
TQRgb *end = p + image.width();
b = buf;
while ( p < end ) {
- *b++ = qBlue(*p);
- *b++ = qGreen(*p);
- *b++ = qRed(*p);
+ *b++ = tqBlue(*p);
+ *b++ = tqGreen(*p);
+ *b++ = tqRed(*p);
p++;
}
}
@@ -5216,7 +5216,7 @@ static void read_pbm_image( TQImageIO *iio ) // read PBM image data
end = p + w;
b = buf24;
while ( p < end ) {
- *p++ = qRgb(b[0],b[1],b[2]);
+ *p++ = tqRgb(b[0],b[1],b[2]);
b += 3;
}
}
@@ -5260,7 +5260,7 @@ static void read_pbm_image( TQImageIO *iio ) // read PBM image data
r = read_pbm_int( d );
g = read_pbm_int( d );
b = read_pbm_int( d );
- *((TQRgb*)p) = qRgb( r, g, b );
+ *((TQRgb*)p) = tqRgb( r, g, b );
p += 4;
}
} else {
@@ -5268,7 +5268,7 @@ static void read_pbm_image( TQImageIO *iio ) // read PBM image data
r = read_pbm_int( d ) * maxc / mcc;
g = read_pbm_int( d ) * maxc / mcc;
b = read_pbm_int( d ) * maxc / mcc;
- *((TQRgb*)p) = qRgb( r, g, b );
+ *((TQRgb*)p) = tqRgb( r, g, b );
p += 4;
}
}
@@ -5278,12 +5278,12 @@ static void read_pbm_image( TQImageIO *iio ) // read PBM image data
if ( nbits == 1 ) { // bitmap
image.setNumColors( 2 );
- image.setColor( 0, qRgb(255,255,255) ); // white
- image.setColor( 1, qRgb(0,0,0) ); // black
+ image.setColor( 0, tqRgb(255,255,255) ); // white
+ image.setColor( 1, tqRgb(0,0,0) ); // black
} else if ( nbits == 8 ) { // graymap
image.setNumColors( maxc+1 );
for ( int i=0; i<=maxc; i++ )
- image.setColor( i, qRgb(i*255/maxc,i*255/maxc,i*255/maxc) );
+ image.setColor( i, tqRgb(i*255/maxc,i*255/maxc,i*255/maxc) );
}
iio->setImage( image );
@@ -5308,7 +5308,7 @@ static void write_pbm_image( TQImageIO *iio )
}
if ( image.depth() == 1 && image.numColors() == 2 ) {
- if ( qGray(image.color(0)) < qGray(image.color(1)) ) {
+ if ( tqGray(image.color(0)) < tqGray(image.color(1)) ) {
// 0=dark/black, 1=light/white - invert
image.detach();
for ( int y=0; y<image.height(); y++ ) {
@@ -5359,15 +5359,15 @@ static void write_pbm_image( TQImageIO *iio )
uchar *end = buf+bpl;
if ( gray ) {
while ( p < end ) {
- uchar g = (uchar)qGray(color[*b++]);
+ uchar g = (uchar)tqGray(color[*b++]);
*p++ = g;
}
} else {
while ( p < end ) {
TQRgb rgb = color[*b++];
- *p++ = qRed(rgb);
- *p++ = qGreen(rgb);
- *p++ = qBlue(rgb);
+ *p++ = tqRed(rgb);
+ *p++ = tqGreen(rgb);
+ *p++ = tqBlue(rgb);
}
}
if ( bpl != (uint)out->writeBlock((char*)buf, bpl) ) {
@@ -5394,15 +5394,15 @@ static void write_pbm_image( TQImageIO *iio )
uchar *end = buf+bpl;
if ( gray ) {
while ( p < end ) {
- uchar g = (uchar)qGray(*b++);
+ uchar g = (uchar)tqGray(*b++);
*p++ = g;
}
} else {
while ( p < end ) {
TQRgb rgb = *b++;
- *p++ = qRed(rgb);
- *p++ = qGreen(rgb);
- *p++ = qBlue(rgb);
+ *p++ = tqRed(rgb);
+ *p++ = tqGreen(rgb);
+ *p++ = tqBlue(rgb);
}
}
if ( bpl != (uint)out->writeBlock((char*)buf, bpl) ) {
@@ -5544,8 +5544,8 @@ static void read_xbm_image( TQImageIO *iio )
if ( image.isNull() )
return;
- image.setColor( 0, qRgb(255,255,255) ); // white
- image.setColor( 1, qRgb(0,0,0) ); // black
+ image.setColor( 0, tqRgb(255,255,255) ); // white
+ image.setColor( 1, tqRgb(0,0,0) ); // black
int x = 0, y = 0;
uchar *b = image.scanLine(0);
@@ -5597,7 +5597,7 @@ static void write_xbm_image( TQImageIO *iio )
if ( image.bitOrder() != TQImage::LittleEndian )
image = image.convertBitOrder( TQImage::LittleEndian );
- bool invert = qGray(image.color(0)) < qGray(image.color(1));
+ bool invert = tqGray(image.color(0)) < tqGray(image.color(1));
char hexrep[16];
for ( i=0; i<10; i++ )
hexrep[i] = '0' + i;
@@ -5784,10 +5784,10 @@ static void read_xpm_image_or_array( TQImageIO * iio, const char * const * sourc
int transparentColor = currentColor;
if ( image.depth() == 8 ) {
image.setColor( transparentColor,
- RGB_MASK & qRgb(198,198,198) );
+ TQT_RGB_MASK & tqRgb(198,198,198) );
colorMap.insert( index, transparentColor );
} else {
- TQRgb rgb = RGB_MASK & qRgb(198,198,198);
+ TQRgb rgb = TQT_RGB_MASK & tqRgb(198,198,198);
colorMap.insert( index, rgb );
}
} else {
@@ -5947,15 +5947,15 @@ static void write_xpm_image( TQImageIO * iio )
TQMap<TQRgb, int>::Iterator c = colorMap.begin();
while ( c != colorMap.end() ) {
TQRgb color = c.key();
- if ( image.hasAlphaBuffer() && color == (color & RGB_MASK) )
+ if ( image.hasAlphaBuffer() && color == (color & TQT_RGB_MASK) )
line.sprintf( "\"%s c None\"",
xpm_color_name(cpp, *c) );
else
line.sprintf( "\"%s c #%02x%02x%02x\"",
xpm_color_name(cpp, *c),
- qRed(color),
- qGreen(color),
- qBlue(color) );
+ tqRed(color),
+ tqGreen(color),
+ tqBlue(color) );
++c;
s << "," << endl << line;
}
@@ -6182,17 +6182,17 @@ void bitBlt( TQImage* dst, int dx, int dy, const TQImage* src,
const int ds = src->width() - sw;
while ( sh-- ) {
for ( int t=sw; t--; ) {
- unsigned char a = qAlpha(*s);
+ unsigned char a = tqAlpha(*s);
if ( a == 255 )
*d++ = *s++;
else if ( a == 0 )
++d,++s; // nothing
else {
- unsigned char r = ((qRed(*s)-qRed(*d)) * a) / 256 + qRed(*d);
- unsigned char g = ((qGreen(*s)-qGreen(*d)) * a) / 256 + qGreen(*d);
- unsigned char b = ((qBlue(*s)-qBlue(*d)) * a) / 256 + qBlue(*d);
- a = TQMAX(qAlpha(*d),a); // alternatives...
- *d++ = qRgba(r,g,b,a);
+ unsigned char r = ((tqRed(*s)-tqRed(*d)) * a) / 256 + tqRed(*d);
+ unsigned char g = ((tqGreen(*s)-tqGreen(*d)) * a) / 256 + tqGreen(*d);
+ unsigned char b = ((tqBlue(*s)-tqBlue(*d)) * a) / 256 + tqBlue(*d);
+ a = TQMAX(tqAlpha(*d),a); // alternatives...
+ *d++ = tqRgba(r,g,b,a);
++s;
}
}
@@ -6485,7 +6485,7 @@ TQGfx * TQImage::graphicsContext()
TQRgb * tmp=colorTable();
int nc=numColors();
if(tmp==0) {
- static TQRgb table[2] = { qRgb(255,255,255), qRgb(0,0,0) };
+ static TQRgb table[2] = { tqRgb(255,255,255), tqRgb(0,0,0) };
tmp=table;
nc=2;
}