… | |
… | |
22 | #include "compat.h" |
22 | #include "compat.h" |
23 | |
23 | |
24 | #include "generate_routines.h" |
24 | #include "generate_routines.h" |
25 | #include "error.h" |
25 | #include "error.h" |
26 | #include "list.h" |
26 | #include "list.h" |
|
|
27 | #include "image.h" |
27 | |
28 | |
28 | #ifdef DMALLOC |
29 | #ifdef DMALLOC |
29 | #include <dmalloc.h> |
30 | #include <dmalloc.h> |
30 | #endif |
31 | #endif |
31 | |
32 | |
32 | typedef psiconv_list psiconv_pixel_bytes; /* psiconv_u8 */ |
|
|
33 | |
|
|
34 | typedef psiconv_list psiconv_pixel_ints; /* of psiconv_u32 */ |
|
|
35 | |
|
|
36 | typedef struct psiconv_pixel_float_s |
|
|
37 | { |
|
|
38 | psiconv_u32 length; |
|
|
39 | float *red; |
|
|
40 | float *green; |
|
|
41 | float *blue; |
|
|
42 | } psiconv_pixel_floats_t; |
|
|
43 | |
33 | |
44 | static int psiconv_collect_pixel_data(psiconv_pixel_ints *pixels, |
34 | static int psiconv_collect_pixel_data(psiconv_pixel_ints *pixels, |
45 | int xsize,int ysize, |
35 | int xsize,int ysize, |
46 | const psiconv_pixel_floats_t data, |
36 | const psiconv_pixel_floats_t data, |
47 | int colordepth,int color, |
37 | int colordepth,int color, |
… | |
… | |
62 | psiconv_pixel_bytes *encoded_bytes); |
52 | psiconv_pixel_bytes *encoded_bytes); |
63 | static int psiconv_encode_rle24(const psiconv_config config, |
53 | static int psiconv_encode_rle24(const psiconv_config config, |
64 | const psiconv_pixel_bytes plain_bytes, |
54 | const psiconv_pixel_bytes plain_bytes, |
65 | psiconv_pixel_bytes *encoded_bytes); |
55 | psiconv_pixel_bytes *encoded_bytes); |
66 | |
56 | |
67 | #define PALET_NONE_LEN 0 |
|
|
68 | |
|
|
69 | psiconv_pixel_floats_t palet_none = |
|
|
70 | { |
|
|
71 | PALET_NONE_LEN, |
|
|
72 | NULL, |
|
|
73 | NULL, |
|
|
74 | NULL |
|
|
75 | }; |
|
|
76 | |
|
|
77 | #define PALET_COLOR_4_LEN 16 |
|
|
78 | float palet_color_4_red[PALET_COLOR_4_LEN] = |
|
|
79 | { 0x00/256.0, 0x55/256.0, 0x80/256.0, 0x80/256.0, /* 0x00 */ |
|
|
80 | 0x00/256.0, 0xff/256.0, 0x00/256.0, 0xff/256.0, /* 0x04 */ |
|
|
81 | 0xff/256.0, 0x00/256.0, 0x00/256.0, 0x80/256.0, /* 0x08 */ |
|
|
82 | 0x00/256.0, 0x00/256.0, 0xaa/256.0, 0xff/256.0 /* 0x0c */ |
|
|
83 | }; |
|
|
84 | |
|
|
85 | float palet_color_4_green[PALET_COLOR_4_LEN] = |
|
|
86 | { 0x00/256.0, 0x55/256.0, 0x00/256.0, 0x80/256.0, /* 0x00 */ |
|
|
87 | 0x80/256.0, 0x00/256.0, 0xff/256.0, 0xff/256.0, /* 0x04 */ |
|
|
88 | 0x00/256.0, 0xff/256.0, 0xff/256.0, 0x00/256.0, /* 0x08 */ |
|
|
89 | 0x00/256.0, 0x80/256.0, 0xaa/256.0, 0xff/256.0 /* 0x0c */ |
|
|
90 | }; |
|
|
91 | |
|
|
92 | float palet_color_4_blue[PALET_COLOR_4_LEN] = |
|
|
93 | { 0x00/256.0, 0x55/256.0, 0x00/256.0, 0x00/256.0, /* 0x00 */ |
|
|
94 | 0x00/256.0, 0x00/256.0, 0x00/256.0, 0x00/256.0, /* 0x04 */ |
|
|
95 | 0xff/256.0, 0x00/256.0, 0xff/256.0, 0x80/256.0, /* 0x08 */ |
|
|
96 | 0x80/256.0, 0x80/256.0, 0xaa/256.0, 0xff/256.0 /* 0x0c */ |
|
|
97 | }; |
|
|
98 | |
|
|
99 | psiconv_pixel_floats_t palet_color_4 = |
|
|
100 | { |
|
|
101 | PALET_COLOR_4_LEN, |
|
|
102 | palet_color_4_red, |
|
|
103 | palet_color_4_green, |
|
|
104 | palet_color_4_blue, |
|
|
105 | }; |
|
|
106 | |
|
|
107 | #define PALET_COLOR_8_LEN 256 |
|
|
108 | float palet_color_8_red[PALET_COLOR_8_LEN] = |
|
|
109 | { 0x00/256.0, 0x33/256.0, 0x66/256.0, 0x99/256.0, /* 0x00 */ |
|
|
110 | 0xcc/256.0, 0xff/256.0, 0x00/256.0, 0x33/256.0, /* 0x04 */ |
|
|
111 | 0x66/256.0, 0x99/256.0, 0xcc/256.0, 0xff/256.0, /* 0x08 */ |
|
|
112 | 0x00/256.0, 0x33/256.0, 0x66/256.0, 0x99/256.0, /* 0x0c */ |
|
|
113 | 0xcc/256.0, 0xff/256.0, 0x00/256.0, 0x33/256.0, /* 0x10 */ |
|
|
114 | 0x66/256.0, 0x99/256.0, 0xcc/256.0, 0xff/256.0, /* 0x14 */ |
|
|
115 | 0x00/256.0, 0x33/256.0, 0x66/256.0, 0x99/256.0, /* 0x18 */ |
|
|
116 | 0xcc/256.0, 0xff/256.0, 0x00/256.0, 0x33/256.0, /* 0x1c */ |
|
|
117 | 0x66/256.0, 0x99/256.0, 0xcc/256.0, 0xff/256.0, /* 0x20 */ |
|
|
118 | 0x00/256.0, 0x33/256.0, 0x66/256.0, 0x99/256.0, /* 0x24 */ |
|
|
119 | 0xcc/256.0, 0xff/256.0, 0x00/256.0, 0x33/256.0, /* 0x28 */ |
|
|
120 | 0x66/256.0, 0x99/256.0, 0xcc/256.0, 0xff/256.0, /* 0x2c */ |
|
|
121 | 0x00/256.0, 0x33/256.0, 0x66/256.0, 0x99/256.0, /* 0x30 */ |
|
|
122 | 0xcc/256.0, 0xff/256.0, 0x00/256.0, 0x33/256.0, /* 0x34 */ |
|
|
123 | 0x66/256.0, 0x99/256.0, 0xcc/256.0, 0xff/256.0, /* 0x38 */ |
|
|
124 | 0x00/256.0, 0x33/256.0, 0x66/256.0, 0x99/256.0, /* 0x3c */ |
|
|
125 | 0xcc/256.0, 0xff/256.0, 0x00/256.0, 0x33/256.0, /* 0x40 */ |
|
|
126 | 0x66/256.0, 0x99/256.0, 0xcc/256.0, 0xff/256.0, /* 0x44 */ |
|
|
127 | 0x00/256.0, 0x33/256.0, 0x66/256.0, 0x99/256.0, /* 0x48 */ |
|
|
128 | 0xcc/256.0, 0xff/256.0, 0x00/256.0, 0x33/256.0, /* 0x4c */ |
|
|
129 | 0x66/256.0, 0x99/256.0, 0xcc/256.0, 0xff/256.0, /* 0x50 */ |
|
|
130 | 0x00/256.0, 0x33/256.0, 0x66/256.0, 0x99/256.0, /* 0x54 */ |
|
|
131 | 0xcc/256.0, 0xff/256.0, 0x00/256.0, 0x33/256.0, /* 0x58 */ |
|
|
132 | 0x66/256.0, 0x99/256.0, 0xcc/256.0, 0xff/256.0, /* 0x5c */ |
|
|
133 | 0x00/256.0, 0x33/256.0, 0x66/256.0, 0x99/256.0, /* 0x60 */ |
|
|
134 | 0xcc/256.0, 0xff/256.0, 0x00/256.0, 0x33/256.0, /* 0x64 */ |
|
|
135 | 0x66/256.0, 0x99/256.0, 0xcc/256.0, 0xff/256.0, /* 0x68 */ |
|
|
136 | 0x11/256.0, 0x22/256.0, 0x44/256.0, 0x55/256.0, /* 0x6c */ |
|
|
137 | 0x77/256.0, 0x11/256.0, 0x22/256.0, 0x44/256.0, /* 0x70 */ |
|
|
138 | 0x55/256.0, 0x77/256.0, 0x00/256.0, 0x00/256.0, /* 0x74 */ |
|
|
139 | 0x00/256.0, 0x00/256.0, 0x00/256.0, 0x00/256.0, /* 0x78 */ |
|
|
140 | 0x00/256.0, 0x00/256.0, 0x00/256.0, 0x00/256.0, /* 0x7c */ |
|
|
141 | 0x00/256.0, 0x00/256.0, 0x00/256.0, 0x00/256.0, /* 0x80 */ |
|
|
142 | 0x00/256.0, 0x00/256.0, 0x00/256.0, 0x00/256.0, /* 0x84 */ |
|
|
143 | 0x00/256.0, 0x00/256.0, 0x88/256.0, 0xaa/256.0, /* 0x88 */ |
|
|
144 | 0xbb/256.0, 0xdd/256.0, 0xee/256.0, 0x88/256.0, /* 0x8c */ |
|
|
145 | 0xaa/256.0, 0xbb/256.0, 0xdd/256.0, 0xee/256.0, /* 0x90 */ |
|
|
146 | 0x00/256.0, 0x33/256.0, 0x66/256.0, 0x99/256.0, /* 0x94 */ |
|
|
147 | 0xcc/256.0, 0xff/256.0, 0x00/256.0, 0x33/256.0, /* 0x98 */ |
|
|
148 | 0x66/256.0, 0x99/256.0, 0xcc/256.0, 0xff/256.0, /* 0x9c */ |
|
|
149 | 0x00/256.0, 0x33/256.0, 0x66/256.0, 0x99/256.0, /* 0xa0 */ |
|
|
150 | 0xcc/256.0, 0xff/256.0, 0x00/256.0, 0x33/256.0, /* 0xa4 */ |
|
|
151 | 0x66/256.0, 0x99/256.0, 0xcc/256.0, 0xff/256.0, /* 0xa8 */ |
|
|
152 | 0x00/256.0, 0x33/256.0, 0x66/256.0, 0x99/256.0, /* 0xac */ |
|
|
153 | 0xcc/256.0, 0xff/256.0, 0x00/256.0, 0x33/256.0, /* 0xb0 */ |
|
|
154 | 0x66/256.0, 0x99/256.0, 0xcc/256.0, 0xff/256.0, /* 0xb4 */ |
|
|
155 | 0x00/256.0, 0x33/256.0, 0x66/256.0, 0x99/256.0, /* 0xb8 */ |
|
|
156 | 0xcc/256.0, 0xff/256.0, 0x00/256.0, 0x33/256.0, /* 0xbc */ |
|
|
157 | 0x66/256.0, 0x99/256.0, 0xcc/256.0, 0xff/256.0, /* 0xc0 */ |
|
|
158 | 0x00/256.0, 0x33/256.0, 0x66/256.0, 0x99/256.0, /* 0xc4 */ |
|
|
159 | 0xcc/256.0, 0xff/256.0, 0x00/256.0, 0x33/256.0, /* 0xc8 */ |
|
|
160 | 0x66/256.0, 0x99/256.0, 0xcc/256.0, 0xff/256.0, /* 0xcc */ |
|
|
161 | 0x00/256.0, 0x33/256.0, 0x66/256.0, 0x99/256.0, /* 0xd0 */ |
|
|
162 | 0xcc/256.0, 0xff/256.0, 0x00/256.0, 0x33/256.0, /* 0xd4 */ |
|
|
163 | 0x66/256.0, 0x99/256.0, 0xcc/256.0, 0xff/256.0, /* 0xd8 */ |
|
|
164 | 0x00/256.0, 0x33/256.0, 0x66/256.0, 0x99/256.0, /* 0xdc */ |
|
|
165 | 0xcc/256.0, 0xff/256.0, 0x00/256.0, 0x33/256.0, /* 0xe0 */ |
|
|
166 | 0x66/256.0, 0x99/256.0, 0xcc/256.0, 0xff/256.0, /* 0xe4 */ |
|
|
167 | 0x00/256.0, 0x33/256.0, 0x66/256.0, 0x99/256.0, /* 0xe8 */ |
|
|
168 | 0xcc/256.0, 0xff/256.0, 0x00/256.0, 0x33/256.0, /* 0xec */ |
|
|
169 | 0x66/256.0, 0x99/256.0, 0xcc/256.0, 0xff/256.0, /* 0xf0 */ |
|
|
170 | 0x00/256.0, 0x33/256.0, 0x66/256.0, 0x99/256.0, /* 0xf4 */ |
|
|
171 | 0xcc/256.0, 0xff/256.0, 0x00/256.0, 0x33/256.0, /* 0xf8 */ |
|
|
172 | 0x66/256.0, 0x99/256.0, 0xcc/256.0, 0xff/256.0 /* 0xfc */ |
|
|
173 | }; |
|
|
174 | |
|
|
175 | float palet_color_8_green[PALET_COLOR_8_LEN] = |
|
|
176 | { 0x00/256.0, 0x00/256.0, 0x00/256.0, 0x00/256.0, /* 0x00 */ |
|
|
177 | 0x00/256.0, 0x00/256.0, 0x33/256.0, 0x33/256.0, /* 0x04 */ |
|
|
178 | 0x33/256.0, 0x33/256.0, 0x33/256.0, 0x33/256.0, /* 0x08 */ |
|
|
179 | 0x66/256.0, 0x66/256.0, 0x66/256.0, 0x66/256.0, /* 0x0c */ |
|
|
180 | 0x66/256.0, 0x66/256.0, 0x99/256.0, 0x99/256.0, /* 0x10 */ |
|
|
181 | 0x99/256.0, 0x99/256.0, 0x99/256.0, 0x99/256.0, /* 0x14 */ |
|
|
182 | 0xcc/256.0, 0xcc/256.0, 0xcc/256.0, 0xcc/256.0, /* 0x18 */ |
|
|
183 | 0xcc/256.0, 0xcc/256.0, 0xff/256.0, 0xff/256.0, /* 0x1c */ |
|
|
184 | 0xff/256.0, 0xff/256.0, 0xff/256.0, 0xff/256.0, /* 0x20 */ |
|
|
185 | 0x00/256.0, 0x00/256.0, 0x00/256.0, 0x00/256.0, /* 0x24 */ |
|
|
186 | 0x00/256.0, 0x00/256.0, 0x33/256.0, 0x33/256.0, /* 0x28 */ |
|
|
187 | 0x33/256.0, 0x33/256.0, 0x33/256.0, 0x33/256.0, /* 0x2c */ |
|
|
188 | 0x66/256.0, 0x66/256.0, 0x66/256.0, 0x66/256.0, /* 0x30 */ |
|
|
189 | 0x66/256.0, 0x66/256.0, 0x99/256.0, 0x99/256.0, /* 0x34 */ |
|
|
190 | 0x99/256.0, 0x99/256.0, 0x99/256.0, 0x99/256.0, /* 0x38 */ |
|
|
191 | 0xcc/256.0, 0xcc/256.0, 0xcc/256.0, 0xcc/256.0, /* 0x3c */ |
|
|
192 | 0xcc/256.0, 0xcc/256.0, 0xff/256.0, 0xff/256.0, /* 0x40 */ |
|
|
193 | 0xff/256.0, 0xff/256.0, 0xff/256.0, 0xff/256.0, /* 0x44 */ |
|
|
194 | 0x00/256.0, 0x00/256.0, 0x00/256.0, 0x00/256.0, /* 0x48 */ |
|
|
195 | 0x00/256.0, 0x00/256.0, 0x33/256.0, 0x33/256.0, /* 0x4c */ |
|
|
196 | 0x33/256.0, 0x33/256.0, 0x33/256.0, 0x33/256.0, /* 0x50 */ |
|
|
197 | 0x66/256.0, 0x66/256.0, 0x66/256.0, 0x66/256.0, /* 0x54 */ |
|
|
198 | 0x66/256.0, 0x66/256.0, 0x99/256.0, 0x99/256.0, /* 0x58 */ |
|
|
199 | 0x99/256.0, 0x99/256.0, 0x99/256.0, 0x99/256.0, /* 0x5c */ |
|
|
200 | 0xcc/256.0, 0xcc/256.0, 0xcc/256.0, 0xcc/256.0, /* 0x60 */ |
|
|
201 | 0xcc/256.0, 0xcc/256.0, 0xff/256.0, 0xff/256.0, /* 0x64 */ |
|
|
202 | 0xff/256.0, 0xff/256.0, 0xff/256.0, 0xff/256.0, /* 0x68 */ |
|
|
203 | 0x11/256.0, 0x22/256.0, 0x44/256.0, 0x55/256.0, /* 0x6c */ |
|
|
204 | 0x77/256.0, 0x00/256.0, 0x00/256.0, 0x00/256.0, /* 0x70 */ |
|
|
205 | 0x00/256.0, 0x00/256.0, 0x11/256.0, 0x22/256.0, /* 0x74 */ |
|
|
206 | 0x44/256.0, 0x55/256.0, 0x77/256.0, 0x00/256.0, /* 0x78 */ |
|
|
207 | 0x00/256.0, 0x00/256.0, 0x00/256.0, 0x00/256.0, /* 0x7c */ |
|
|
208 | 0x00/256.0, 0x00/256.0, 0x00/256.0, 0x00/256.0, /* 0x80 */ |
|
|
209 | 0x00/256.0, 0x88/256.0, 0xaa/256.0, 0xbb/256.0, /* 0x84 */ |
|
|
210 | 0xdd/256.0, 0xee/256.0, 0x00/256.0, 0x00/256.0, /* 0x88 */ |
|
|
211 | 0x00/256.0, 0x00/256.0, 0x00/256.0, 0x88/256.0, /* 0x8c */ |
|
|
212 | 0xaa/256.0, 0xbb/256.0, 0xdd/256.0, 0xee/256.0, /* 0x90 */ |
|
|
213 | 0x00/256.0, 0x00/256.0, 0x00/256.0, 0x00/256.0, /* 0x94 */ |
|
|
214 | 0x00/256.0, 0x00/256.0, 0x33/256.0, 0x33/256.0, /* 0x98 */ |
|
|
215 | 0x33/256.0, 0x33/256.0, 0x33/256.0, 0x33/256.0, /* 0x9c */ |
|
|
216 | 0x66/256.0, 0x66/256.0, 0x66/256.0, 0x66/256.0, /* 0xa0 */ |
|
|
217 | 0x66/256.0, 0x66/256.0, 0x99/256.0, 0x99/256.0, /* 0xa4 */ |
|
|
218 | 0x99/256.0, 0x99/256.0, 0x99/256.0, 0x99/256.0, /* 0xa8 */ |
|
|
219 | 0xcc/256.0, 0xcc/256.0, 0xcc/256.0, 0xcc/256.0, /* 0xac */ |
|
|
220 | 0xcc/256.0, 0xcc/256.0, 0xff/256.0, 0xff/256.0, /* 0xb0 */ |
|
|
221 | 0xff/256.0, 0xff/256.0, 0xff/256.0, 0xff/256.0, /* 0xb4 */ |
|
|
222 | 0x00/256.0, 0x00/256.0, 0x00/256.0, 0x00/256.0, /* 0xb8 */ |
|
|
223 | 0x00/256.0, 0x00/256.0, 0x33/256.0, 0x33/256.0, /* 0xbc */ |
|
|
224 | 0x33/256.0, 0x33/256.0, 0x33/256.0, 0x33/256.0, /* 0xc0 */ |
|
|
225 | 0x66/256.0, 0x66/256.0, 0x66/256.0, 0x66/256.0, /* 0xc4 */ |
|
|
226 | 0x66/256.0, 0x66/256.0, 0x99/256.0, 0x99/256.0, /* 0xc8 */ |
|
|
227 | 0x99/256.0, 0x99/256.0, 0x99/256.0, 0x99/256.0, /* 0xcc */ |
|
|
228 | 0xcc/256.0, 0xcc/256.0, 0xcc/256.0, 0xcc/256.0, /* 0xd0 */ |
|
|
229 | 0xcc/256.0, 0xcc/256.0, 0xff/256.0, 0xff/256.0, /* 0xd4 */ |
|
|
230 | 0xff/256.0, 0xff/256.0, 0xff/256.0, 0xff/256.0, /* 0xd8 */ |
|
|
231 | 0x00/256.0, 0x00/256.0, 0x00/256.0, 0x00/256.0, /* 0xdc */ |
|
|
232 | 0x00/256.0, 0x00/256.0, 0x33/256.0, 0x33/256.0, /* 0xe0 */ |
|
|
233 | 0x33/256.0, 0x33/256.0, 0x33/256.0, 0x33/256.0, /* 0xe4 */ |
|
|
234 | 0x66/256.0, 0x66/256.0, 0x66/256.0, 0x66/256.0, /* 0xe8 */ |
|
|
235 | 0x66/256.0, 0x66/256.0, 0x99/256.0, 0x99/256.0, /* 0xec */ |
|
|
236 | 0x99/256.0, 0x99/256.0, 0x99/256.0, 0x99/256.0, /* 0xf0 */ |
|
|
237 | 0xcc/256.0, 0xcc/256.0, 0xcc/256.0, 0xcc/256.0, /* 0xf4 */ |
|
|
238 | 0xcc/256.0, 0xcc/256.0, 0xff/256.0, 0xff/256.0, /* 0xf8 */ |
|
|
239 | 0xff/256.0, 0xff/256.0, 0xff/256.0, 0xff/256.0, /* 0xfc */ |
|
|
240 | }; |
|
|
241 | |
|
|
242 | float palet_color_8_blue[PALET_COLOR_8_LEN] = |
|
|
243 | { 0x00/256.0, 0x00/256.0, 0x00/256.0, 0x00/256.0, /* 0x00 */ |
|
|
244 | 0x00/256.0, 0x00/256.0, 0x00/256.0, 0x00/256.0, /* 0x04 */ |
|
|
245 | 0x00/256.0, 0x00/256.0, 0x00/256.0, 0x00/256.0, /* 0x08 */ |
|
|
246 | 0x00/256.0, 0x00/256.0, 0x00/256.0, 0x00/256.0, /* 0x0c */ |
|
|
247 | 0x00/256.0, 0x00/256.0, 0x00/256.0, 0x00/256.0, /* 0x10 */ |
|
|
248 | 0x00/256.0, 0x00/256.0, 0x00/256.0, 0x00/256.0, /* 0x14 */ |
|
|
249 | 0x00/256.0, 0x00/256.0, 0x00/256.0, 0x00/256.0, /* 0x18 */ |
|
|
250 | 0x00/256.0, 0x00/256.0, 0x00/256.0, 0x00/256.0, /* 0x1c */ |
|
|
251 | 0x00/256.0, 0x00/256.0, 0x00/256.0, 0x00/256.0, /* 0x20 */ |
|
|
252 | 0x33/256.0, 0x33/256.0, 0x33/256.0, 0x33/256.0, /* 0x24 */ |
|
|
253 | 0x33/256.0, 0x33/256.0, 0x33/256.0, 0x33/256.0, /* 0x28 */ |
|
|
254 | 0x33/256.0, 0x33/256.0, 0x33/256.0, 0x33/256.0, /* 0x2c */ |
|
|
255 | 0x33/256.0, 0x33/256.0, 0x33/256.0, 0x33/256.0, /* 0x30 */ |
|
|
256 | 0x33/256.0, 0x33/256.0, 0x33/256.0, 0x33/256.0, /* 0x34 */ |
|
|
257 | 0x33/256.0, 0x33/256.0, 0x33/256.0, 0x33/256.0, /* 0x38 */ |
|
|
258 | 0x33/256.0, 0x33/256.0, 0x33/256.0, 0x33/256.0, /* 0x3c */ |
|
|
259 | 0x33/256.0, 0x33/256.0, 0x33/256.0, 0x33/256.0, /* 0x40 */ |
|
|
260 | 0x33/256.0, 0x33/256.0, 0x33/256.0, 0x33/256.0, /* 0x44 */ |
|
|
261 | 0x66/256.0, 0x66/256.0, 0x66/256.0, 0x66/256.0, /* 0x48 */ |
|
|
262 | 0x66/256.0, 0x66/256.0, 0x66/256.0, 0x66/256.0, /* 0x4c */ |
|
|
263 | 0x66/256.0, 0x66/256.0, 0x66/256.0, 0x66/256.0, /* 0x50 */ |
|
|
264 | 0x66/256.0, 0x66/256.0, 0x66/256.0, 0x66/256.0, /* 0x54 */ |
|
|
265 | 0x66/256.0, 0x66/256.0, 0x66/256.0, 0x66/256.0, /* 0x58 */ |
|
|
266 | 0x66/256.0, 0x66/256.0, 0x66/256.0, 0x66/256.0, /* 0x5c */ |
|
|
267 | 0x66/256.0, 0x66/256.0, 0x66/256.0, 0x66/256.0, /* 0x60 */ |
|
|
268 | 0x66/256.0, 0x66/256.0, 0x66/256.0, 0x66/256.0, /* 0x64 */ |
|
|
269 | 0x66/256.0, 0x66/256.0, 0x66/256.0, 0x66/256.0, /* 0x68 */ |
|
|
270 | 0x11/256.0, 0x22/256.0, 0x44/256.0, 0x55/256.0, /* 0x6c */ |
|
|
271 | 0x77/256.0, 0x00/256.0, 0x00/256.0, 0x00/256.0, /* 0x70 */ |
|
|
272 | 0x00/256.0, 0x00/256.0, 0x00/256.0, 0x00/256.0, /* 0x74 */ |
|
|
273 | 0x00/256.0, 0x00/256.0, 0x00/256.0, 0x11/256.0, /* 0x78 */ |
|
|
274 | 0x22/256.0, 0x44/256.0, 0x55/256.0, 0x77/256.0, /* 0x7c */ |
|
|
275 | 0x88/256.0, 0xaa/256.0, 0xbb/256.0, 0xdd/256.0, /* 0x80 */ |
|
|
276 | 0xee/256.0, 0x00/256.0, 0x00/256.0, 0x00/256.0, /* 0x84 */ |
|
|
277 | 0x00/256.0, 0x00/256.0, 0x00/256.0, 0x00/256.0, /* 0x88 */ |
|
|
278 | 0x00/256.0, 0x00/256.0, 0x00/256.0, 0x88/256.0, /* 0x8c */ |
|
|
279 | 0xaa/256.0, 0xbb/256.0, 0xdd/256.0, 0xee/256.0, /* 0x90 */ |
|
|
280 | 0x99/256.0, 0x99/256.0, 0x99/256.0, 0x99/256.0, /* 0x94 */ |
|
|
281 | 0x99/256.0, 0x99/256.0, 0x99/256.0, 0x99/256.0, /* 0x98 */ |
|
|
282 | 0x99/256.0, 0x99/256.0, 0x99/256.0, 0x99/256.0, /* 0x9c */ |
|
|
283 | 0x99/256.0, 0x99/256.0, 0x99/256.0, 0x99/256.0, /* 0xa0 */ |
|
|
284 | 0x99/256.0, 0x99/256.0, 0x99/256.0, 0x99/256.0, /* 0xa4 */ |
|
|
285 | 0x99/256.0, 0x99/256.0, 0x99/256.0, 0x99/256.0, /* 0xa8 */ |
|
|
286 | 0x99/256.0, 0x99/256.0, 0x99/256.0, 0x99/256.0, /* 0xac */ |
|
|
287 | 0x99/256.0, 0x99/256.0, 0x99/256.0, 0x99/256.0, /* 0xb0 */ |
|
|
288 | 0x99/256.0, 0x99/256.0, 0x99/256.0, 0x99/256.0, /* 0xb4 */ |
|
|
289 | 0xcc/256.0, 0xcc/256.0, 0xcc/256.0, 0xcc/256.0, /* 0xb8 */ |
|
|
290 | 0xcc/256.0, 0xcc/256.0, 0xcc/256.0, 0xcc/256.0, /* 0xbc */ |
|
|
291 | 0xcc/256.0, 0xcc/256.0, 0xcc/256.0, 0xcc/256.0, /* 0xc0 */ |
|
|
292 | 0xcc/256.0, 0xcc/256.0, 0xcc/256.0, 0xcc/256.0, /* 0xc4 */ |
|
|
293 | 0xcc/256.0, 0xcc/256.0, 0xcc/256.0, 0xcc/256.0, /* 0xc8 */ |
|
|
294 | 0xcc/256.0, 0xcc/256.0, 0xcc/256.0, 0xcc/256.0, /* 0xcc */ |
|
|
295 | 0xcc/256.0, 0xcc/256.0, 0xcc/256.0, 0xcc/256.0, /* 0xd0 */ |
|
|
296 | 0xcc/256.0, 0xcc/256.0, 0xcc/256.0, 0xcc/256.0, /* 0xd4 */ |
|
|
297 | 0xcc/256.0, 0xcc/256.0, 0xcc/256.0, 0xcc/256.0, /* 0xd8 */ |
|
|
298 | 0xff/256.0, 0xff/256.0, 0xff/256.0, 0xff/256.0, /* 0xdc */ |
|
|
299 | 0xff/256.0, 0xff/256.0, 0xff/256.0, 0xff/256.0, /* 0xe0 */ |
|
|
300 | 0xff/256.0, 0xff/256.0, 0xff/256.0, 0xff/256.0, /* 0xe4 */ |
|
|
301 | 0xff/256.0, 0xff/256.0, 0xff/256.0, 0xff/256.0, /* 0xe8 */ |
|
|
302 | 0xff/256.0, 0xff/256.0, 0xff/256.0, 0xff/256.0, /* 0xec */ |
|
|
303 | 0xff/256.0, 0xff/256.0, 0xff/256.0, 0xff/256.0, /* 0xf0 */ |
|
|
304 | 0xff/256.0, 0xff/256.0, 0xff/256.0, 0xff/256.0, /* 0xf4 */ |
|
|
305 | 0xff/256.0, 0xff/256.0, 0xff/256.0, 0xff/256.0, /* 0xf8 */ |
|
|
306 | 0xff/256.0, 0xff/256.0, 0xff/256.0, 0xff/256.0, /* 0xfc */ |
|
|
307 | }; |
|
|
308 | |
|
|
309 | psiconv_pixel_floats_t palet_color_8 = |
|
|
310 | { |
|
|
311 | PALET_COLOR_8_LEN, |
|
|
312 | palet_color_8_red, |
|
|
313 | palet_color_8_green, |
|
|
314 | palet_color_8_blue, |
|
|
315 | }; |
|
|
316 | |
|
|
317 | int psiconv_write_paint_data_section(const psiconv_config config, |
57 | int psiconv_write_paint_data_section(const psiconv_config config, |
318 | psiconv_buffer buf, |
58 | psiconv_buffer buf, |
319 | const psiconv_paint_data_section value, |
59 | const psiconv_paint_data_section value, |
320 | int is_clipart) |
60 | int is_clipart) |
321 | { |
61 | { |
… | |
… | |
373 | floats.red = value->red; |
113 | floats.red = value->red; |
374 | floats.green = value->green; |
114 | floats.green = value->green; |
375 | floats.blue = value->blue; |
115 | floats.blue = value->blue; |
376 | floats.length = value->xsize * value->ysize; |
116 | floats.length = value->xsize * value->ysize; |
377 | |
117 | |
378 | palet = palet_none; |
118 | palet = psiconv_palet_none; |
379 | if ((config->color) && (config->redbits == 0) && (config->greenbits == 0) &&\ |
119 | if ((config->color) && (config->redbits == 0) && (config->greenbits == 0) &&\ |
380 | (config->bluebits == 0)) |
120 | (config->bluebits == 0)) |
381 | switch (config->colordepth) { |
121 | switch (config->colordepth) { |
382 | case 4: palet = palet_color_4; break; |
122 | case 4: palet = psiconv_palet_color_4; break; |
383 | case 8: palet = palet_color_8; break; |
123 | case 8: palet = psiconv_palet_color_8; break; |
384 | default: palet = palet_none; break; |
124 | default: palet = psiconv_palet_none; break; |
385 | } |
125 | } |
386 | |
126 | |
387 | if ((res = psiconv_collect_pixel_data(&ints,value->xsize, |
127 | if ((res = psiconv_collect_pixel_data(&ints,value->xsize, |
388 | value->ysize,floats, |
128 | value->ysize,floats, |
389 | config->colordepth,config->color, |
129 | config->colordepth,config->color, |