summaryrefslogtreecommitdiff
path: root/community/amsn/amsn-libpng14.patch
blob: 8b6e8a05db82ee582c4f54e7aec6273c3b5bc05d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
--- utils/TkCximage/src/CxImage/ximapng.cpp	2008-03-07 20:14:37.000000000 +0100
+++ utils/TkCximage/src/CxImage/ximapng.cpp_fixed	2010-01-28 23:08:13.000000000 +0100
@@ -142,9 +142,9 @@
 	if (info_ptr->num_trans!=0){ //palette transparency
 		if (info_ptr->num_trans==1){
 			if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE){
-				info.nBkgndIndex = info_ptr->trans_values.index;
+				info.nBkgndIndex = info_ptr->trans_color.index;
 			} else{
-				info.nBkgndIndex = info_ptr->trans_values.gray>>nshift;
+				info.nBkgndIndex = info_ptr->trans_color.gray>>nshift;
 			}
 		}
 		if (info_ptr->num_trans>1){
@@ -152,7 +152,7 @@
 			if (pal){
 				DWORD ip;
 				for (ip=0;ip<min(head.biClrUsed,(unsigned long)info_ptr->num_trans);ip++)
-					pal[ip].rgbReserved=info_ptr->trans[ip];
+					pal[ip].rgbReserved=info_ptr->trans_alpha[ip];
 				for (ip=info_ptr->num_trans;ip<head.biClrUsed;ip++){
 					pal[ip].rgbReserved=255;
 				}
@@ -166,9 +166,9 @@
 		int num_trans;
 		png_color_16 *image_background;
 		if (png_get_tRNS(png_ptr, info_ptr, &trans, &num_trans, &image_background)){
-			info.nBkgndColor.rgbRed   = (BYTE)(info_ptr->trans_values.red>>nshift);
-			info.nBkgndColor.rgbGreen = (BYTE)(info_ptr->trans_values.green>>nshift);
-			info.nBkgndColor.rgbBlue  = (BYTE)(info_ptr->trans_values.blue>>nshift);
+			info.nBkgndColor.rgbRed   = (BYTE)(info_ptr->trans_color.red>>nshift);
+			info.nBkgndColor.rgbGreen = (BYTE)(info_ptr->trans_color.green>>nshift);
+			info.nBkgndColor.rgbBlue  = (BYTE)(info_ptr->trans_color.blue>>nshift);
 			info.nBkgndColor.rgbReserved = 0;
 			info.nBkgndIndex = 0;
 		}
@@ -417,12 +417,12 @@
 	if (info.nBkgndIndex >= 0){
 		info_ptr->num_trans = 1;
 		info_ptr->valid |= PNG_INFO_tRNS;
-		info_ptr->trans = trans;
-		info_ptr->trans_values.index = (BYTE)info.nBkgndIndex;
-		info_ptr->trans_values.red   = tc.rgbRed;
-		info_ptr->trans_values.green = tc.rgbGreen;
-		info_ptr->trans_values.blue  = tc.rgbBlue;
-		info_ptr->trans_values.gray  = info_ptr->trans_values.index;
+		info_ptr->trans_alpha = trans;
+		info_ptr->trans_color.index = (BYTE)info.nBkgndIndex;
+		info_ptr->trans_color.red   = tc.rgbRed;
+		info_ptr->trans_color.green = tc.rgbGreen;
+		info_ptr->trans_color.blue  = tc.rgbBlue;
+		info_ptr->trans_color.gray  = info_ptr->trans_color.index;
 
 		// the transparency indexes start from 0 for non grayscale palette
 		if (!bGrayScale && head.biClrUsed && info.nBkgndIndex)
@@ -443,7 +443,7 @@
 				trans[ip]=GetPaletteColor((BYTE)ip).rgbReserved;
 			info_ptr->num_trans = (WORD)nc;
 			info_ptr->valid |= PNG_INFO_tRNS;
-			info_ptr->trans = trans;
+			info_ptr->trans_alpha = trans;
 		}
 
 		// copy the palette colors