|
|
|
@ -36,9 +36,9 @@ See 0005-qpixmap_mitshm.patch for details.
|
|
|
|
|
+ bppc++;
|
|
|
|
|
|
|
|
|
|
-#define GET_RGB \
|
|
|
|
|
- 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 \
|
|
|
|
@ -78,9 +78,9 @@ See 0005-qpixmap_mitshm.patch for details.
|
|
|
|
|
else { \
|
|
|
|
|
- GET_RGB \
|
|
|
|
|
- pixel = (b & blue_mask)|(g & green_mask) | (r & red_mask) \
|
|
|
|
|
+ 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 \
|
|
|
|
@ -93,7 +93,7 @@ See 0005-qpixmap_mitshm.patch for details.
|
|
|
|
|
|
|
|
|
|
+// 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 ) \
|
|
|
|
@ -102,8 +102,8 @@ See 0005-qpixmap_mitshm.patch for details.
|
|
|
|
|
+ ++p;
|
|
|
|
|
+
|
|
|
|
|
#define GET_PIXEL_DITHER_TC \
|
|
|
|
|
int r = qRed ( *p ); \
|
|
|
|
|
int g = qGreen( *p ); \
|
|
|
|
|
int r = tqRed ( *p ); \
|
|
|
|
|
int g = tqGreen( *p ); \
|
|
|
|
|
@@ -1220,91 +1255,177 @@ bool QPixmap::convertFromImage( const QI
|
|
|
|
|
? g << green_shift : g >> -green_shift; \
|
|
|
|
|
b = blue_shift > 0 \
|
|
|
|
@ -125,15 +125,15 @@ See 0005-qpixmap_mitshm.patch for details.
|
|
|
|
|
+#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)); \
|
|
|
|
@ -377,7 +377,7 @@ See 0005-qpixmap_mitshm.patch for details.
|
|
|
|
|
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 );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|