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