summaryrefslogtreecommitdiffstats
path: root/src/kernel/qpixmap_x11.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-02-27 02:13:42 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-02-27 02:13:42 -0600
commit520c05ef06ce203ad32470730f68402bc7719157 (patch)
tree8d0bb18bbbecb4c837e232848905e5819db84b81 /src/kernel/qpixmap_x11.cpp
parentb82553bf90cb5311cfe8e673b07cf6cffc95fd3c (diff)
downloadtqt3-520c05ef06ce203ad32470730f68402bc7719157.tar.gz
tqt3-520c05ef06ce203ad32470730f68402bc7719157.zip
Automated update from qt3
Diffstat (limited to 'src/kernel/qpixmap_x11.cpp')
-rw-r--r--src/kernel/qpixmap_x11.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/src/kernel/qpixmap_x11.cpp b/src/kernel/qpixmap_x11.cpp
index 2322214cc..cc8da0d3c 100644
--- a/src/kernel/qpixmap_x11.cpp
+++ b/src/kernel/qpixmap_x11.cpp
@@ -393,7 +393,7 @@ extern "C" XftDraw *XftDrawCreateAlpha( Display *, TQt::HANDLE, int );
void TQPixmap::init( int w, int h, int d, bool bitmap, Optimization optim )
{
#if defined(QT_CHECK_STATE)
- if ( qApp->type() == TQApplication::Tty ) {
+ if ( tqApp->type() == TQApplication::Tty ) {
qWarning( "TQPixmap: Cannot create a TQPixmap when no GUI "
"is being used" );
}
@@ -474,7 +474,7 @@ void TQPixmap::deref()
qSafeXDestroyImage( (XImage*)data->ximage );
if ( data->maskgc )
XFreeGC( x11Display(), (GC)data->maskgc );
- if ( qApp && hd) {
+ if ( tqApp && hd) {
#ifndef QT_NO_XFTFREETYPE
if (rendhd) {
@@ -914,17 +914,17 @@ TQImage TQPixmap::convertToImage() const
b = blue_scale_table[b];
if (alf) {
- *dst++ = qRgba(r, g, b, asrc[x]);
+ *dst++ = tqRgba(r, g, b, asrc[x]);
} else if (msk) {
if ( ale ) {
*dst++ = (asrc[x >> 3] & (1 << (x & 7)))
- ? qRgba(r, g, b, 0xff) : qRgba(r, g, b, 0x00);
+ ? tqRgba(r, g, b, 0xff) : tqRgba(r, g, b, 0x00);
} else {
*dst++ = (asrc[x >> 3] & (1 << (7 -(x & 7))))
- ? qRgba(r, g, b, 0xff) : qRgba(r, g, b, 0x00);
+ ? tqRgba(r, g, b, 0xff) : tqRgba(r, g, b, 0x00);
}
} else {
- *dst++ = qRgb(r, g, b);
+ *dst++ = tqRgb(r, g, b);
}
}
}
@@ -953,8 +953,8 @@ TQImage TQPixmap::convertToImage() const
if ( mono ) { // bitmap
image.setNumColors( 2 );
- image.setColor( 0, qRgb(255,255,255) );
- image.setColor( 1, qRgb(0,0,0) );
+ image.setColor( 0, tqRgb(255,255,255) );
+ image.setColor( 1, tqRgb(0,0,0) );
} else if ( !trucol ) { // pixmap with colormap
register uchar *p;
uchar *end;
@@ -1044,7 +1044,7 @@ TQImage TQPixmap::convertToImage() const
if ( use[i] ) {
image.setColor( j++,
( msk ? 0xff000000 : 0 )
- | qRgb( (carr[i].red >> 8) & 255,
+ | tqRgb( (carr[i].red >> 8) & 255,
(carr[i].green >> 8) & 255,
(carr[i].blue >> 8) & 255 ) );
}
@@ -1142,7 +1142,7 @@ bool TQPixmap::convertFromImage( const TQImage &img, int conversion_flags )
if ( image.numColors() == 2 ) {
TQRgb c0 = image.color(0); // Auto: convert to best
TQRgb c1 = image.color(1);
- conv8 = TQMIN(c0,c1) != qRgb(0,0,0) || TQMAX(c0,c1) != qRgb(255,255,255);
+ conv8 = TQMIN(c0,c1) != tqRgb(0,0,0) || TQMAX(c0,c1) != tqRgb(255,255,255);
} else {
// eg. 1-color monochrome images (they do exist).
conv8 = TRUE;
@@ -1263,9 +1263,9 @@ bool TQPixmap::convertFromImage( const TQImage &img, int conversion_flags )
if ( d8 ) { // setup pixel translation
TQRgb *ctable = image.colorTable();
for ( int i=0; i<image.numColors(); i++ ) {
- int r = qRed (ctable[i]);
- int g = qGreen(ctable[i]);
- int b = qBlue (ctable[i]);
+ int r = tqRed (ctable[i]);
+ int g = tqGreen(ctable[i]);
+ int b = tqBlue (ctable[i]);
r = red_shift > 0 ? r << red_shift : r >> -red_shift;
g = green_shift > 0 ? g << green_shift : g >> -green_shift;
b = blue_shift > 0 ? b << blue_shift : b >> -blue_shift;
@@ -1381,9 +1381,9 @@ bool TQPixmap::convertFromImage( const TQImage &img, int conversion_flags )
int pixel; \
if ( d8 ) pixel = pix[*src++]; \
else { \
- int r = qRed ( *p ); \
- int g = qGreen( *p ); \
- int b = qBlue ( *p++ ); \
+ int r = tqRed ( *p ); \
+ int g = tqGreen( *p ); \
+ int b = tqBlue ( *p++ ); \
r = red_shift > 0 \
? r << red_shift : r >> -red_shift; \
g = green_shift > 0 \
@@ -1396,7 +1396,7 @@ bool TQPixmap::convertFromImage( const TQImage &img, int conversion_flags )
// optimized case - no d8 case, shift only once instead of twice, mask only once instead of twice,
// use direct values instead of variables, and use only one statement
-// (*p >> 16), (*p >> 8 ) and (*p) are qRed(),qGreen() and qBlue() without masking
+// (*p >> 16), (*p >> 8 ) and (*p) are tqRed(),tqGreen() and tqBlue() without masking
// shifts have to be passed including the shift operator (e.g. '>>3'), because of the direction
#define GET_PIXEL_OPT(red_shift,green_shift,blue_shift,red_mask,green_mask,blue_mask) \
int pixel = ((( *p >> 16 ) red_shift ) & red_mask ) \
@@ -1405,9 +1405,9 @@ bool TQPixmap::convertFromImage( const TQImage &img, int conversion_flags )
++p;
#define GET_PIXEL_DITHER_TC \
- int r = qRed ( *p ); \
- int g = qGreen( *p ); \
- int b = qBlue ( *p++ ); \
+ int r = tqRed ( *p ); \
+ int g = tqGreen( *p ); \
+ int b = tqBlue ( *p++ ); \
const int thres = D[x%16][y%16]; \
if ( r <= (255-(1<<(8-rbits))) && ((r<<rbits) & 255) \
> thres) \
@@ -1431,15 +1431,15 @@ bool TQPixmap::convertFromImage( const TQImage &img, int conversion_flags )
#define GET_PIXEL_DITHER_TC_OPT(red_shift,green_shift,blue_shift,red_mask,green_mask,blue_mask, \
rbits,gbits,bbits) \
const int thres = D[x%16][y%16]; \
- int r = qRed ( *p ); \
+ int r = tqRed ( *p ); \
if ( r <= (255-(1<<(8-rbits))) && ((r<<rbits) & 255) \
> thres) \
r += (1<<(8-rbits)); \
- int g = qGreen( *p ); \
+ int g = tqGreen( *p ); \
if ( g <= (255-(1<<(8-gbits))) && ((g<<gbits) & 255) \
> thres) \
g += (1<<(8-gbits)); \
- int b = qBlue ( *p++ ); \
+ int b = tqBlue ( *p++ ); \
if ( b <= (255-(1<<(8-bbits))) && ((b<<bbits) & 255) \
> thres) \
b += (1<<(8-bbits)); \
@@ -1655,9 +1655,9 @@ bool TQPixmap::convertFromImage( const TQImage &img, int conversion_flags )
TQRgb* ctable = image.colorTable();
for ( i=0; i<256; i++ ) { // init pixel array
if ( pop[i] > 0 ) {
- px->r = qRed ( ctable[i] );
- px->g = qGreen( ctable[i] );
- px->b = qBlue ( ctable[i] );
+ px->r = tqRed ( ctable[i] );
+ px->g = tqGreen( ctable[i] );
+ px->b = tqBlue ( ctable[i] );
px->n = 0;
px->use = pop[i];
if ( pop[i] > maxpop ) { // select most popular entry
@@ -1830,7 +1830,7 @@ bool TQPixmap::convertFromImage( const TQImage &img, int conversion_flags )
if (image.depth() == 8) {
const TQRgb * const rgb = image.colorTable();
for (int i = 0, count = image.numColors(); i < count; ++i) {
- const int alpha = qAlpha(rgb[i]);
+ const int alpha = tqAlpha(rgb[i]);
if (alpha != 0 && alpha != 0xff) {
alphamap = TRUE;
break;
@@ -1890,7 +1890,7 @@ bool TQPixmap::convertFromImage( const TQImage &img, int conversion_flags )
for (uint y = 0; y < h; ++y) {
const uchar *iptr = image.scanLine(y);
for (uint x = 0; x < w; ++x)
- *aptr++ = qAlpha(rgb[*iptr++]);
+ *aptr++ = tqAlpha(rgb[*iptr++]);
aptr += ( axi->bytes_per_line - w );
}
}