3018
|
1 |
--- qt-x11-opensource-src-4.4.3/src/gui/image/qpnghandler.cpp-orig 2010-11-10 17:47:52.203891052 -0600
|
|
2 |
+++ qt-x11-opensource-src-4.4.3/src/gui/image/qpnghandler.cpp 2010-11-10 17:48:12.866370835 -0600
|
|
3 |
@@ -310,7 +310,7 @@ void setup_qt(QImage& image, png_structp
|
|
4 |
image.setColor(i, qRgba(c,c,c,0xff));
|
|
5 |
}
|
|
6 |
if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) {
|
|
7 |
- const int g = info_ptr->trans_values.gray;
|
|
8 |
+ const int g = info_ptr->trans_color.gray;
|
|
9 |
if (g < ncols) {
|
|
10 |
image.setColor(g, 0);
|
|
11 |
}
|
|
12 |
@@ -339,7 +339,7 @@ void setup_qt(QImage& image, png_structp
|
|
13 |
info_ptr->palette[i].red,
|
|
14 |
info_ptr->palette[i].green,
|
|
15 |
info_ptr->palette[i].blue,
|
|
16 |
- info_ptr->trans[i]
|
|
17 |
+ info_ptr->trans_alpha[i]
|
|
18 |
)
|
|
19 |
);
|
|
20 |
i++;
|
|
21 |
@@ -556,13 +556,13 @@ bool Q_INTERNAL_WIN_NO_THROW QPngHandler
|
|
22 |
#if 0 // libpng takes care of this.
|
|
23 |
png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)
|
|
24 |
if (outImage->depth()==32 && png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) {
|
|
25 |
- QRgb trans = 0xFF000000 | qRgb(
|
|
26 |
- (info_ptr->trans_values.red << 8 >> bit_depth)&0xff,
|
|
27 |
- (info_ptr->trans_values.green << 8 >> bit_depth)&0xff,
|
|
28 |
- (info_ptr->trans_values.blue << 8 >> bit_depth)&0xff);
|
|
29 |
+ QRgb trans_alpha = 0xFF000000 | qRgb(
|
|
30 |
+ (info_ptr->trans_color.red << 8 >> bit_depth)&0xff,
|
|
31 |
+ (info_ptr->trans_color.green << 8 >> bit_depth)&0xff,
|
|
32 |
+ (info_ptr->trans_color.blue << 8 >> bit_depth)&0xff);
|
|
33 |
for (uint y=0; y<height; y++) {
|
|
34 |
for (uint x=0; x<info_ptr->width; x++) {
|
|
35 |
- if (((uint**)jt)[y][x] == trans) {
|
|
36 |
+ if (((uint**)jt)[y][x] == trans_alpha) {
|
|
37 |
((uint**)jt)[y][x] &= 0x00FFFFFF;
|
|
38 |
} else {
|
|
39 |
}
|