Line | Source Code | Coverage |
---|
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | | - |
12 | static quint64 xpmHash(const QString &str) | - |
13 | { | - |
14 | unsigned int hashValue = 0; | - |
15 | for (int i = 0; i < str.size(); ++i) { evaluated: i < str.size() yes Evaluation Count:87358 | yes Evaluation Count:58228 |
| 58228-87358 |
16 | hashValue <<= 8; | - |
17 | hashValue += (unsigned int)str.at(i).unicode(); | - |
18 | } executed: } Execution Count:87358 | 87358 |
19 | return hashValue; executed: return hashValue; Execution Count:58228 | 58228 |
20 | } | - |
21 | static quint64 xpmHash(char *str) | - |
22 | { | - |
23 | unsigned int hashValue = 0; | - |
24 | while (*str != '\0') { evaluated: *str != '\0' yes Evaluation Count:6100738 | yes Evaluation Count:3679874 |
| 3679874-6100738 |
25 | hashValue <<= 8; | - |
26 | hashValue += (unsigned int)*str; | - |
27 | ++str; | - |
28 | } executed: } Execution Count:6100738 | 6100738 |
29 | return hashValue; executed: return hashValue; Execution Count:3679874 | 3679874 |
30 | } | - |
31 | | - |
32 | | - |
33 | | - |
34 | | - |
35 | | - |
36 | | - |
37 | static const int xpmRgbTblSize = 657; | - |
38 | | - |
39 | static const struct XPMRGBData { | - |
40 | uint value; | - |
41 | const char *name; | - |
42 | } xpmRgbTbl[] = { | - |
43 | { (240*65536 + 248*256 + 255), "aliceblue" }, | - |
44 | { (250*65536 + 235*256 + 215), "antiquewhite" }, | - |
45 | { (255*65536 + 239*256 + 219), "antiquewhite1" }, | - |
46 | { (238*65536 + 223*256 + 204), "antiquewhite2" }, | - |
47 | { (205*65536 + 192*256 + 176), "antiquewhite3" }, | - |
48 | { (139*65536 + 131*256 + 120), "antiquewhite4" }, | - |
49 | { (127*65536 + 255*256 + 212), "aquamarine" }, | - |
50 | { (127*65536 + 255*256 + 212), "aquamarine1" }, | - |
51 | { (118*65536 + 238*256 + 198), "aquamarine2" }, | - |
52 | { (102*65536 + 205*256 + 170), "aquamarine3" }, | - |
53 | { (69*65536 + 139*256 + 116), "aquamarine4" }, | - |
54 | { (240*65536 + 255*256 + 255), "azure" }, | - |
55 | { (240*65536 + 255*256 + 255), "azure1" }, | - |
56 | { (224*65536 + 238*256 + 238), "azure2" }, | - |
57 | { (193*65536 + 205*256 + 205), "azure3" }, | - |
58 | { (131*65536 + 139*256 + 139), "azure4" }, | - |
59 | { (245*65536 + 245*256 + 220), "beige" }, | - |
60 | { (255*65536 + 228*256 + 196), "bisque" }, | - |
61 | { (255*65536 + 228*256 + 196), "bisque1" }, | - |
62 | { (238*65536 + 213*256 + 183), "bisque2" }, | - |
63 | { (205*65536 + 183*256 + 158), "bisque3" }, | - |
64 | { (139*65536 + 125*256 + 107), "bisque4" }, | - |
65 | { (0*65536 + 0*256 + 0), "black" }, | - |
66 | { (255*65536 + 235*256 + 205), "blanchedalmond" }, | - |
67 | { (0*65536 + 0*256 + 255), "blue" }, | - |
68 | { (0*65536 + 0*256 + 255), "blue1" }, | - |
69 | { (0*65536 + 0*256 + 238), "blue2" }, | - |
70 | { (0*65536 + 0*256 + 205), "blue3" }, | - |
71 | { (0*65536 + 0*256 + 139), "blue4" }, | - |
72 | { (138*65536 + 43*256 + 226), "blueviolet" }, | - |
73 | { (165*65536 + 42*256 + 42), "brown" }, | - |
74 | { (255*65536 + 64*256 + 64), "brown1" }, | - |
75 | { (238*65536 + 59*256 + 59), "brown2" }, | - |
76 | { (205*65536 + 51*256 + 51), "brown3" }, | - |
77 | { (139*65536 + 35*256 + 35), "brown4" }, | - |
78 | { (222*65536 + 184*256 + 135), "burlywood" }, | - |
79 | { (255*65536 + 211*256 + 155), "burlywood1" }, | - |
80 | { (238*65536 + 197*256 + 145), "burlywood2" }, | - |
81 | { (205*65536 + 170*256 + 125), "burlywood3" }, | - |
82 | { (139*65536 + 115*256 + 85), "burlywood4" }, | - |
83 | { (95*65536 + 158*256 + 160), "cadetblue" }, | - |
84 | { (152*65536 + 245*256 + 255), "cadetblue1" }, | - |
85 | { (142*65536 + 229*256 + 238), "cadetblue2" }, | - |
86 | { (122*65536 + 197*256 + 205), "cadetblue3" }, | - |
87 | { (83*65536 + 134*256 + 139), "cadetblue4" }, | - |
88 | { (127*65536 + 255*256 + 0), "chartreuse" }, | - |
89 | { (127*65536 + 255*256 + 0), "chartreuse1" }, | - |
90 | { (118*65536 + 238*256 + 0), "chartreuse2" }, | - |
91 | { (102*65536 + 205*256 + 0), "chartreuse3" }, | - |
92 | { (69*65536 + 139*256 + 0), "chartreuse4" }, | - |
93 | { (210*65536 + 105*256 + 30), "chocolate" }, | - |
94 | { (255*65536 + 127*256 + 36), "chocolate1" }, | - |
95 | { (238*65536 + 118*256 + 33), "chocolate2" }, | - |
96 | { (205*65536 + 102*256 + 29), "chocolate3" }, | - |
97 | { (139*65536 + 69*256 + 19), "chocolate4" }, | - |
98 | { (255*65536 + 127*256 + 80), "coral" }, | - |
99 | { (255*65536 + 114*256 + 86), "coral1" }, | - |
100 | { (238*65536 + 106*256 + 80), "coral2" }, | - |
101 | { (205*65536 + 91*256 + 69), "coral3" }, | - |
102 | { (139*65536 + 62*256 + 47), "coral4" }, | - |
103 | { (100*65536 + 149*256 + 237), "cornflowerblue" }, | - |
104 | { (255*65536 + 248*256 + 220), "cornsilk" }, | - |
105 | { (255*65536 + 248*256 + 220), "cornsilk1" }, | - |
106 | { (238*65536 + 232*256 + 205), "cornsilk2" }, | - |
107 | { (205*65536 + 200*256 + 177), "cornsilk3" }, | - |
108 | { (139*65536 + 136*256 + 120), "cornsilk4" }, | - |
109 | { (0*65536 + 255*256 + 255), "cyan" }, | - |
110 | { (0*65536 + 255*256 + 255), "cyan1" }, | - |
111 | { (0*65536 + 238*256 + 238), "cyan2" }, | - |
112 | { (0*65536 + 205*256 + 205), "cyan3" }, | - |
113 | { (0*65536 + 139*256 + 139), "cyan4" }, | - |
114 | { (0*65536 + 0*256 + 139), "darkblue" }, | - |
115 | { (0*65536 + 139*256 + 139), "darkcyan" }, | - |
116 | { (184*65536 + 134*256 + 11), "darkgoldenrod" }, | - |
117 | { (255*65536 + 185*256 + 15), "darkgoldenrod1" }, | - |
118 | { (238*65536 + 173*256 + 14), "darkgoldenrod2" }, | - |
119 | { (205*65536 + 149*256 + 12), "darkgoldenrod3" }, | - |
120 | { (139*65536 + 101*256 + 8), "darkgoldenrod4" }, | - |
121 | { (169*65536 + 169*256 + 169), "darkgray" }, | - |
122 | { (0*65536 + 100*256 + 0), "darkgreen" }, | - |
123 | { (169*65536 + 169*256 + 169), "darkgrey" }, | - |
124 | { (189*65536 + 183*256 + 107), "darkkhaki" }, | - |
125 | { (139*65536 + 0*256 + 139), "darkmagenta" }, | - |
126 | { (85*65536 + 107*256 + 47), "darkolivegreen" }, | - |
127 | { (202*65536 + 255*256 + 112), "darkolivegreen1" }, | - |
128 | { (188*65536 + 238*256 + 104), "darkolivegreen2" }, | - |
129 | { (162*65536 + 205*256 + 90), "darkolivegreen3" }, | - |
130 | { (110*65536 + 139*256 + 61), "darkolivegreen4" }, | - |
131 | { (255*65536 + 140*256 + 0), "darkorange" }, | - |
132 | { (255*65536 + 127*256 + 0), "darkorange1" }, | - |
133 | { (238*65536 + 118*256 + 0), "darkorange2" }, | - |
134 | { (205*65536 + 102*256 + 0), "darkorange3" }, | - |
135 | { (139*65536 + 69*256 + 0), "darkorange4" }, | - |
136 | { (153*65536 + 50*256 + 204), "darkorchid" }, | - |
137 | { (191*65536 + 62*256 + 255), "darkorchid1" }, | - |
138 | { (178*65536 + 58*256 + 238), "darkorchid2" }, | - |
139 | { (154*65536 + 50*256 + 205), "darkorchid3" }, | - |
140 | { (104*65536 + 34*256 + 139), "darkorchid4" }, | - |
141 | { (139*65536 + 0*256 + 0), "darkred" }, | - |
142 | { (233*65536 + 150*256 + 122), "darksalmon" }, | - |
143 | { (143*65536 + 188*256 + 143), "darkseagreen" }, | - |
144 | { (193*65536 + 255*256 + 193), "darkseagreen1" }, | - |
145 | { (180*65536 + 238*256 + 180), "darkseagreen2" }, | - |
146 | { (155*65536 + 205*256 + 155), "darkseagreen3" }, | - |
147 | { (105*65536 + 139*256 + 105), "darkseagreen4" }, | - |
148 | { (72*65536 + 61*256 + 139), "darkslateblue" }, | - |
149 | { (47*65536 + 79*256 + 79), "darkslategray" }, | - |
150 | { (151*65536 + 255*256 + 255), "darkslategray1" }, | - |
151 | { (141*65536 + 238*256 + 238), "darkslategray2" }, | - |
152 | { (121*65536 + 205*256 + 205), "darkslategray3" }, | - |
153 | { (82*65536 + 139*256 + 139), "darkslategray4" }, | - |
154 | { (47*65536 + 79*256 + 79), "darkslategrey" }, | - |
155 | { (0*65536 + 206*256 + 209), "darkturquoise" }, | - |
156 | { (148*65536 + 0*256 + 211), "darkviolet" }, | - |
157 | { (255*65536 + 20*256 + 147), "deeppink" }, | - |
158 | { (255*65536 + 20*256 + 147), "deeppink1" }, | - |
159 | { (238*65536 + 18*256 + 137), "deeppink2" }, | - |
160 | { (205*65536 + 16*256 + 118), "deeppink3" }, | - |
161 | { (139*65536 + 10*256 + 80), "deeppink4" }, | - |
162 | { (0*65536 + 191*256 + 255), "deepskyblue" }, | - |
163 | { (0*65536 + 191*256 + 255), "deepskyblue1" }, | - |
164 | { (0*65536 + 178*256 + 238), "deepskyblue2" }, | - |
165 | { (0*65536 + 154*256 + 205), "deepskyblue3" }, | - |
166 | { (0*65536 + 104*256 + 139), "deepskyblue4" }, | - |
167 | { (105*65536 + 105*256 + 105), "dimgray" }, | - |
168 | { (105*65536 + 105*256 + 105), "dimgrey" }, | - |
169 | { (30*65536 + 144*256 + 255), "dodgerblue" }, | - |
170 | { (30*65536 + 144*256 + 255), "dodgerblue1" }, | - |
171 | { (28*65536 + 134*256 + 238), "dodgerblue2" }, | - |
172 | { (24*65536 + 116*256 + 205), "dodgerblue3" }, | - |
173 | { (16*65536 + 78*256 + 139), "dodgerblue4" }, | - |
174 | { (178*65536 + 34*256 + 34), "firebrick" }, | - |
175 | { (255*65536 + 48*256 + 48), "firebrick1" }, | - |
176 | { (238*65536 + 44*256 + 44), "firebrick2" }, | - |
177 | { (205*65536 + 38*256 + 38), "firebrick3" }, | - |
178 | { (139*65536 + 26*256 + 26), "firebrick4" }, | - |
179 | { (255*65536 + 250*256 + 240), "floralwhite" }, | - |
180 | { (34*65536 + 139*256 + 34), "forestgreen" }, | - |
181 | { (220*65536 + 220*256 + 220), "gainsboro" }, | - |
182 | { (248*65536 + 248*256 + 255), "ghostwhite" }, | - |
183 | { (255*65536 + 215*256 + 0), "gold" }, | - |
184 | { (255*65536 + 215*256 + 0), "gold1" }, | - |
185 | { (238*65536 + 201*256 + 0), "gold2" }, | - |
186 | { (205*65536 + 173*256 + 0), "gold3" }, | - |
187 | { (139*65536 + 117*256 + 0), "gold4" }, | - |
188 | { (218*65536 + 165*256 + 32), "goldenrod" }, | - |
189 | { (255*65536 + 193*256 + 37), "goldenrod1" }, | - |
190 | { (238*65536 + 180*256 + 34), "goldenrod2" }, | - |
191 | { (205*65536 + 155*256 + 29), "goldenrod3" }, | - |
192 | { (139*65536 + 105*256 + 20), "goldenrod4" }, | - |
193 | { (190*65536 + 190*256 + 190), "gray" }, | - |
194 | { (0*65536 + 0*256 + 0), "gray0" }, | - |
195 | { (3*65536 + 3*256 + 3), "gray1" }, | - |
196 | { (26*65536 + 26*256 + 26), "gray10" }, | - |
197 | { (255*65536 + 255*256 + 255), "gray100" }, | - |
198 | { (28*65536 + 28*256 + 28), "gray11" }, | - |
199 | { (31*65536 + 31*256 + 31), "gray12" }, | - |
200 | { (33*65536 + 33*256 + 33), "gray13" }, | - |
201 | { (36*65536 + 36*256 + 36), "gray14" }, | - |
202 | { (38*65536 + 38*256 + 38), "gray15" }, | - |
203 | { (41*65536 + 41*256 + 41), "gray16" }, | - |
204 | { (43*65536 + 43*256 + 43), "gray17" }, | - |
205 | { (46*65536 + 46*256 + 46), "gray18" }, | - |
206 | { (48*65536 + 48*256 + 48), "gray19" }, | - |
207 | { (5*65536 + 5*256 + 5), "gray2" }, | - |
208 | { (51*65536 + 51*256 + 51), "gray20" }, | - |
209 | { (54*65536 + 54*256 + 54), "gray21" }, | - |
210 | { (56*65536 + 56*256 + 56), "gray22" }, | - |
211 | { (59*65536 + 59*256 + 59), "gray23" }, | - |
212 | { (61*65536 + 61*256 + 61), "gray24" }, | - |
213 | { (64*65536 + 64*256 + 64), "gray25" }, | - |
214 | { (66*65536 + 66*256 + 66), "gray26" }, | - |
215 | { (69*65536 + 69*256 + 69), "gray27" }, | - |
216 | { (71*65536 + 71*256 + 71), "gray28" }, | - |
217 | { (74*65536 + 74*256 + 74), "gray29" }, | - |
218 | { (8*65536 + 8*256 + 8), "gray3" }, | - |
219 | { (77*65536 + 77*256 + 77), "gray30" }, | - |
220 | { (79*65536 + 79*256 + 79), "gray31" }, | - |
221 | { (82*65536 + 82*256 + 82), "gray32" }, | - |
222 | { (84*65536 + 84*256 + 84), "gray33" }, | - |
223 | { (87*65536 + 87*256 + 87), "gray34" }, | - |
224 | { (89*65536 + 89*256 + 89), "gray35" }, | - |
225 | { (92*65536 + 92*256 + 92), "gray36" }, | - |
226 | { (94*65536 + 94*256 + 94), "gray37" }, | - |
227 | { (97*65536 + 97*256 + 97), "gray38" }, | - |
228 | { (99*65536 + 99*256 + 99), "gray39" }, | - |
229 | { (10*65536 + 10*256 + 10), "gray4" }, | - |
230 | { (102*65536 + 102*256 + 102), "gray40" }, | - |
231 | { (105*65536 + 105*256 + 105), "gray41" }, | - |
232 | { (107*65536 + 107*256 + 107), "gray42" }, | - |
233 | { (110*65536 + 110*256 + 110), "gray43" }, | - |
234 | { (112*65536 + 112*256 + 112), "gray44" }, | - |
235 | { (115*65536 + 115*256 + 115), "gray45" }, | - |
236 | { (117*65536 + 117*256 + 117), "gray46" }, | - |
237 | { (120*65536 + 120*256 + 120), "gray47" }, | - |
238 | { (122*65536 + 122*256 + 122), "gray48" }, | - |
239 | { (125*65536 + 125*256 + 125), "gray49" }, | - |
240 | { (13*65536 + 13*256 + 13), "gray5" }, | - |
241 | { (127*65536 + 127*256 + 127), "gray50" }, | - |
242 | { (130*65536 + 130*256 + 130), "gray51" }, | - |
243 | { (133*65536 + 133*256 + 133), "gray52" }, | - |
244 | { (135*65536 + 135*256 + 135), "gray53" }, | - |
245 | { (138*65536 + 138*256 + 138), "gray54" }, | - |
246 | { (140*65536 + 140*256 + 140), "gray55" }, | - |
247 | { (143*65536 + 143*256 + 143), "gray56" }, | - |
248 | { (145*65536 + 145*256 + 145), "gray57" }, | - |
249 | { (148*65536 + 148*256 + 148), "gray58" }, | - |
250 | { (150*65536 + 150*256 + 150), "gray59" }, | - |
251 | { (15*65536 + 15*256 + 15), "gray6" }, | - |
252 | { (153*65536 + 153*256 + 153), "gray60" }, | - |
253 | { (156*65536 + 156*256 + 156), "gray61" }, | - |
254 | { (158*65536 + 158*256 + 158), "gray62" }, | - |
255 | { (161*65536 + 161*256 + 161), "gray63" }, | - |
256 | { (163*65536 + 163*256 + 163), "gray64" }, | - |
257 | { (166*65536 + 166*256 + 166), "gray65" }, | - |
258 | { (168*65536 + 168*256 + 168), "gray66" }, | - |
259 | { (171*65536 + 171*256 + 171), "gray67" }, | - |
260 | { (173*65536 + 173*256 + 173), "gray68" }, | - |
261 | { (176*65536 + 176*256 + 176), "gray69" }, | - |
262 | { (18*65536 + 18*256 + 18), "gray7" }, | - |
263 | { (179*65536 + 179*256 + 179), "gray70" }, | - |
264 | { (181*65536 + 181*256 + 181), "gray71" }, | - |
265 | { (184*65536 + 184*256 + 184), "gray72" }, | - |
266 | { (186*65536 + 186*256 + 186), "gray73" }, | - |
267 | { (189*65536 + 189*256 + 189), "gray74" }, | - |
268 | { (191*65536 + 191*256 + 191), "gray75" }, | - |
269 | { (194*65536 + 194*256 + 194), "gray76" }, | - |
270 | { (196*65536 + 196*256 + 196), "gray77" }, | - |
271 | { (199*65536 + 199*256 + 199), "gray78" }, | - |
272 | { (201*65536 + 201*256 + 201), "gray79" }, | - |
273 | { (20*65536 + 20*256 + 20), "gray8" }, | - |
274 | { (204*65536 + 204*256 + 204), "gray80" }, | - |
275 | { (207*65536 + 207*256 + 207), "gray81" }, | - |
276 | { (209*65536 + 209*256 + 209), "gray82" }, | - |
277 | { (212*65536 + 212*256 + 212), "gray83" }, | - |
278 | { (214*65536 + 214*256 + 214), "gray84" }, | - |
279 | { (217*65536 + 217*256 + 217), "gray85" }, | - |
280 | { (219*65536 + 219*256 + 219), "gray86" }, | - |
281 | { (222*65536 + 222*256 + 222), "gray87" }, | - |
282 | { (224*65536 + 224*256 + 224), "gray88" }, | - |
283 | { (227*65536 + 227*256 + 227), "gray89" }, | - |
284 | { (23*65536 + 23*256 + 23), "gray9" }, | - |
285 | { (229*65536 + 229*256 + 229), "gray90" }, | - |
286 | { (232*65536 + 232*256 + 232), "gray91" }, | - |
287 | { (235*65536 + 235*256 + 235), "gray92" }, | - |
288 | { (237*65536 + 237*256 + 237), "gray93" }, | - |
289 | { (240*65536 + 240*256 + 240), "gray94" }, | - |
290 | { (242*65536 + 242*256 + 242), "gray95" }, | - |
291 | { (245*65536 + 245*256 + 245), "gray96" }, | - |
292 | { (247*65536 + 247*256 + 247), "gray97" }, | - |
293 | { (250*65536 + 250*256 + 250), "gray98" }, | - |
294 | { (252*65536 + 252*256 + 252), "gray99" }, | - |
295 | { (0*65536 + 255*256 + 0), "green" }, | - |
296 | { (0*65536 + 255*256 + 0), "green1" }, | - |
297 | { (0*65536 + 238*256 + 0), "green2" }, | - |
298 | { (0*65536 + 205*256 + 0), "green3" }, | - |
299 | { (0*65536 + 139*256 + 0), "green4" }, | - |
300 | { (173*65536 + 255*256 + 47), "greenyellow" }, | - |
301 | { (190*65536 + 190*256 + 190), "grey" }, | - |
302 | { (0*65536 + 0*256 + 0), "grey0" }, | - |
303 | { (3*65536 + 3*256 + 3), "grey1" }, | - |
304 | { (26*65536 + 26*256 + 26), "grey10" }, | - |
305 | { (255*65536 + 255*256 + 255), "grey100" }, | - |
306 | { (28*65536 + 28*256 + 28), "grey11" }, | - |
307 | { (31*65536 + 31*256 + 31), "grey12" }, | - |
308 | { (33*65536 + 33*256 + 33), "grey13" }, | - |
309 | { (36*65536 + 36*256 + 36), "grey14" }, | - |
310 | { (38*65536 + 38*256 + 38), "grey15" }, | - |
311 | { (41*65536 + 41*256 + 41), "grey16" }, | - |
312 | { (43*65536 + 43*256 + 43), "grey17" }, | - |
313 | { (46*65536 + 46*256 + 46), "grey18" }, | - |
314 | { (48*65536 + 48*256 + 48), "grey19" }, | - |
315 | { (5*65536 + 5*256 + 5), "grey2" }, | - |
316 | { (51*65536 + 51*256 + 51), "grey20" }, | - |
317 | { (54*65536 + 54*256 + 54), "grey21" }, | - |
318 | { (56*65536 + 56*256 + 56), "grey22" }, | - |
319 | { (59*65536 + 59*256 + 59), "grey23" }, | - |
320 | { (61*65536 + 61*256 + 61), "grey24" }, | - |
321 | { (64*65536 + 64*256 + 64), "grey25" }, | - |
322 | { (66*65536 + 66*256 + 66), "grey26" }, | - |
323 | { (69*65536 + 69*256 + 69), "grey27" }, | - |
324 | { (71*65536 + 71*256 + 71), "grey28" }, | - |
325 | { (74*65536 + 74*256 + 74), "grey29" }, | - |
326 | { (8*65536 + 8*256 + 8), "grey3" }, | - |
327 | { (77*65536 + 77*256 + 77), "grey30" }, | - |
328 | { (79*65536 + 79*256 + 79), "grey31" }, | - |
329 | { (82*65536 + 82*256 + 82), "grey32" }, | - |
330 | { (84*65536 + 84*256 + 84), "grey33" }, | - |
331 | { (87*65536 + 87*256 + 87), "grey34" }, | - |
332 | { (89*65536 + 89*256 + 89), "grey35" }, | - |
333 | { (92*65536 + 92*256 + 92), "grey36" }, | - |
334 | { (94*65536 + 94*256 + 94), "grey37" }, | - |
335 | { (97*65536 + 97*256 + 97), "grey38" }, | - |
336 | { (99*65536 + 99*256 + 99), "grey39" }, | - |
337 | { (10*65536 + 10*256 + 10), "grey4" }, | - |
338 | { (102*65536 + 102*256 + 102), "grey40" }, | - |
339 | { (105*65536 + 105*256 + 105), "grey41" }, | - |
340 | { (107*65536 + 107*256 + 107), "grey42" }, | - |
341 | { (110*65536 + 110*256 + 110), "grey43" }, | - |
342 | { (112*65536 + 112*256 + 112), "grey44" }, | - |
343 | { (115*65536 + 115*256 + 115), "grey45" }, | - |
344 | { (117*65536 + 117*256 + 117), "grey46" }, | - |
345 | { (120*65536 + 120*256 + 120), "grey47" }, | - |
346 | { (122*65536 + 122*256 + 122), "grey48" }, | - |
347 | { (125*65536 + 125*256 + 125), "grey49" }, | - |
348 | { (13*65536 + 13*256 + 13), "grey5" }, | - |
349 | { (127*65536 + 127*256 + 127), "grey50" }, | - |
350 | { (130*65536 + 130*256 + 130), "grey51" }, | - |
351 | { (133*65536 + 133*256 + 133), "grey52" }, | - |
352 | { (135*65536 + 135*256 + 135), "grey53" }, | - |
353 | { (138*65536 + 138*256 + 138), "grey54" }, | - |
354 | { (140*65536 + 140*256 + 140), "grey55" }, | - |
355 | { (143*65536 + 143*256 + 143), "grey56" }, | - |
356 | { (145*65536 + 145*256 + 145), "grey57" }, | - |
357 | { (148*65536 + 148*256 + 148), "grey58" }, | - |
358 | { (150*65536 + 150*256 + 150), "grey59" }, | - |
359 | { (15*65536 + 15*256 + 15), "grey6" }, | - |
360 | { (153*65536 + 153*256 + 153), "grey60" }, | - |
361 | { (156*65536 + 156*256 + 156), "grey61" }, | - |
362 | { (158*65536 + 158*256 + 158), "grey62" }, | - |
363 | { (161*65536 + 161*256 + 161), "grey63" }, | - |
364 | { (163*65536 + 163*256 + 163), "grey64" }, | - |
365 | { (166*65536 + 166*256 + 166), "grey65" }, | - |
366 | { (168*65536 + 168*256 + 168), "grey66" }, | - |
367 | { (171*65536 + 171*256 + 171), "grey67" }, | - |
368 | { (173*65536 + 173*256 + 173), "grey68" }, | - |
369 | { (176*65536 + 176*256 + 176), "grey69" }, | - |
370 | { (18*65536 + 18*256 + 18), "grey7" }, | - |
371 | { (179*65536 + 179*256 + 179), "grey70" }, | - |
372 | { (181*65536 + 181*256 + 181), "grey71" }, | - |
373 | { (184*65536 + 184*256 + 184), "grey72" }, | - |
374 | { (186*65536 + 186*256 + 186), "grey73" }, | - |
375 | { (189*65536 + 189*256 + 189), "grey74" }, | - |
376 | { (191*65536 + 191*256 + 191), "grey75" }, | - |
377 | { (194*65536 + 194*256 + 194), "grey76" }, | - |
378 | { (196*65536 + 196*256 + 196), "grey77" }, | - |
379 | { (199*65536 + 199*256 + 199), "grey78" }, | - |
380 | { (201*65536 + 201*256 + 201), "grey79" }, | - |
381 | { (20*65536 + 20*256 + 20), "grey8" }, | - |
382 | { (204*65536 + 204*256 + 204), "grey80" }, | - |
383 | { (207*65536 + 207*256 + 207), "grey81" }, | - |
384 | { (209*65536 + 209*256 + 209), "grey82" }, | - |
385 | { (212*65536 + 212*256 + 212), "grey83" }, | - |
386 | { (214*65536 + 214*256 + 214), "grey84" }, | - |
387 | { (217*65536 + 217*256 + 217), "grey85" }, | - |
388 | { (219*65536 + 219*256 + 219), "grey86" }, | - |
389 | { (222*65536 + 222*256 + 222), "grey87" }, | - |
390 | { (224*65536 + 224*256 + 224), "grey88" }, | - |
391 | { (227*65536 + 227*256 + 227), "grey89" }, | - |
392 | { (23*65536 + 23*256 + 23), "grey9" }, | - |
393 | { (229*65536 + 229*256 + 229), "grey90" }, | - |
394 | { (232*65536 + 232*256 + 232), "grey91" }, | - |
395 | { (235*65536 + 235*256 + 235), "grey92" }, | - |
396 | { (237*65536 + 237*256 + 237), "grey93" }, | - |
397 | { (240*65536 + 240*256 + 240), "grey94" }, | - |
398 | { (242*65536 + 242*256 + 242), "grey95" }, | - |
399 | { (245*65536 + 245*256 + 245), "grey96" }, | - |
400 | { (247*65536 + 247*256 + 247), "grey97" }, | - |
401 | { (250*65536 + 250*256 + 250), "grey98" }, | - |
402 | { (252*65536 + 252*256 + 252), "grey99" }, | - |
403 | { (240*65536 + 255*256 + 240), "honeydew" }, | - |
404 | { (240*65536 + 255*256 + 240), "honeydew1" }, | - |
405 | { (224*65536 + 238*256 + 224), "honeydew2" }, | - |
406 | { (193*65536 + 205*256 + 193), "honeydew3" }, | - |
407 | { (131*65536 + 139*256 + 131), "honeydew4" }, | - |
408 | { (255*65536 + 105*256 + 180), "hotpink" }, | - |
409 | { (255*65536 + 110*256 + 180), "hotpink1" }, | - |
410 | { (238*65536 + 106*256 + 167), "hotpink2" }, | - |
411 | { (205*65536 + 96*256 + 144), "hotpink3" }, | - |
412 | { (139*65536 + 58*256 + 98), "hotpink4" }, | - |
413 | { (205*65536 + 92*256 + 92), "indianred" }, | - |
414 | { (255*65536 + 106*256 + 106), "indianred1" }, | - |
415 | { (238*65536 + 99*256 + 99), "indianred2" }, | - |
416 | { (205*65536 + 85*256 + 85), "indianred3" }, | - |
417 | { (139*65536 + 58*256 + 58), "indianred4" }, | - |
418 | { (255*65536 + 255*256 + 240), "ivory" }, | - |
419 | { (255*65536 + 255*256 + 240), "ivory1" }, | - |
420 | { (238*65536 + 238*256 + 224), "ivory2" }, | - |
421 | { (205*65536 + 205*256 + 193), "ivory3" }, | - |
422 | { (139*65536 + 139*256 + 131), "ivory4" }, | - |
423 | { (240*65536 + 230*256 + 140), "khaki" }, | - |
424 | { (255*65536 + 246*256 + 143), "khaki1" }, | - |
425 | { (238*65536 + 230*256 + 133), "khaki2" }, | - |
426 | { (205*65536 + 198*256 + 115), "khaki3" }, | - |
427 | { (139*65536 + 134*256 + 78), "khaki4" }, | - |
428 | { (230*65536 + 230*256 + 250), "lavender" }, | - |
429 | { (255*65536 + 240*256 + 245), "lavenderblush" }, | - |
430 | { (255*65536 + 240*256 + 245), "lavenderblush1" }, | - |
431 | { (238*65536 + 224*256 + 229), "lavenderblush2" }, | - |
432 | { (205*65536 + 193*256 + 197), "lavenderblush3" }, | - |
433 | { (139*65536 + 131*256 + 134), "lavenderblush4" }, | - |
434 | { (124*65536 + 252*256 + 0), "lawngreen" }, | - |
435 | { (255*65536 + 250*256 + 205), "lemonchiffon" }, | - |
436 | { (255*65536 + 250*256 + 205), "lemonchiffon1" }, | - |
437 | { (238*65536 + 233*256 + 191), "lemonchiffon2" }, | - |
438 | { (205*65536 + 201*256 + 165), "lemonchiffon3" }, | - |
439 | { (139*65536 + 137*256 + 112), "lemonchiffon4" }, | - |
440 | { (173*65536 + 216*256 + 230), "lightblue" }, | - |
441 | { (191*65536 + 239*256 + 255), "lightblue1" }, | - |
442 | { (178*65536 + 223*256 + 238), "lightblue2" }, | - |
443 | { (154*65536 + 192*256 + 205), "lightblue3" }, | - |
444 | { (104*65536 + 131*256 + 139), "lightblue4" }, | - |
445 | { (240*65536 + 128*256 + 128), "lightcoral" }, | - |
446 | { (224*65536 + 255*256 + 255), "lightcyan" }, | - |
447 | { (224*65536 + 255*256 + 255), "lightcyan1" }, | - |
448 | { (209*65536 + 238*256 + 238), "lightcyan2" }, | - |
449 | { (180*65536 + 205*256 + 205), "lightcyan3" }, | - |
450 | { (122*65536 + 139*256 + 139), "lightcyan4" }, | - |
451 | { (238*65536 + 221*256 + 130), "lightgoldenrod" }, | - |
452 | { (255*65536 + 236*256 + 139), "lightgoldenrod1" }, | - |
453 | { (238*65536 + 220*256 + 130), "lightgoldenrod2" }, | - |
454 | { (205*65536 + 190*256 + 112), "lightgoldenrod3" }, | - |
455 | { (139*65536 + 129*256 + 76), "lightgoldenrod4" }, | - |
456 | { (250*65536 + 250*256 + 210), "lightgoldenrodyellow" }, | - |
457 | { (211*65536 + 211*256 + 211), "lightgray" }, | - |
458 | { (144*65536 + 238*256 + 144), "lightgreen" }, | - |
459 | { (211*65536 + 211*256 + 211), "lightgrey" }, | - |
460 | { (255*65536 + 182*256 + 193), "lightpink" }, | - |
461 | { (255*65536 + 174*256 + 185), "lightpink1" }, | - |
462 | { (238*65536 + 162*256 + 173), "lightpink2" }, | - |
463 | { (205*65536 + 140*256 + 149), "lightpink3" }, | - |
464 | { (139*65536 + 95*256 + 101), "lightpink4" }, | - |
465 | { (255*65536 + 160*256 + 122), "lightsalmon" }, | - |
466 | { (255*65536 + 160*256 + 122), "lightsalmon1" }, | - |
467 | { (238*65536 + 149*256 + 114), "lightsalmon2" }, | - |
468 | { (205*65536 + 129*256 + 98), "lightsalmon3" }, | - |
469 | { (139*65536 + 87*256 + 66), "lightsalmon4" }, | - |
470 | { (32*65536 + 178*256 + 170), "lightseagreen" }, | - |
471 | { (135*65536 + 206*256 + 250), "lightskyblue" }, | - |
472 | { (176*65536 + 226*256 + 255), "lightskyblue1" }, | - |
473 | { (164*65536 + 211*256 + 238), "lightskyblue2" }, | - |
474 | { (141*65536 + 182*256 + 205), "lightskyblue3" }, | - |
475 | { (96*65536 + 123*256 + 139), "lightskyblue4" }, | - |
476 | { (132*65536 + 112*256 + 255), "lightslateblue" }, | - |
477 | { (119*65536 + 136*256 + 153), "lightslategray" }, | - |
478 | { (119*65536 + 136*256 + 153), "lightslategrey" }, | - |
479 | { (176*65536 + 196*256 + 222), "lightsteelblue" }, | - |
480 | { (202*65536 + 225*256 + 255), "lightsteelblue1" }, | - |
481 | { (188*65536 + 210*256 + 238), "lightsteelblue2" }, | - |
482 | { (162*65536 + 181*256 + 205), "lightsteelblue3" }, | - |
483 | { (110*65536 + 123*256 + 139), "lightsteelblue4" }, | - |
484 | { (255*65536 + 255*256 + 224), "lightyellow" }, | - |
485 | { (255*65536 + 255*256 + 224), "lightyellow1" }, | - |
486 | { (238*65536 + 238*256 + 209), "lightyellow2" }, | - |
487 | { (205*65536 + 205*256 + 180), "lightyellow3" }, | - |
488 | { (139*65536 + 139*256 + 122), "lightyellow4" }, | - |
489 | { (50*65536 + 205*256 + 50), "limegreen" }, | - |
490 | { (250*65536 + 240*256 + 230), "linen" }, | - |
491 | { (255*65536 + 0*256 + 255), "magenta" }, | - |
492 | { (255*65536 + 0*256 + 255), "magenta1" }, | - |
493 | { (238*65536 + 0*256 + 238), "magenta2" }, | - |
494 | { (205*65536 + 0*256 + 205), "magenta3" }, | - |
495 | { (139*65536 + 0*256 + 139), "magenta4" }, | - |
496 | { (176*65536 + 48*256 + 96), "maroon" }, | - |
497 | { (255*65536 + 52*256 + 179), "maroon1" }, | - |
498 | { (238*65536 + 48*256 + 167), "maroon2" }, | - |
499 | { (205*65536 + 41*256 + 144), "maroon3" }, | - |
500 | { (139*65536 + 28*256 + 98), "maroon4" }, | - |
501 | { (102*65536 + 205*256 + 170), "mediumaquamarine" }, | - |
502 | { (0*65536 + 0*256 + 205), "mediumblue" }, | - |
503 | { (186*65536 + 85*256 + 211), "mediumorchid" }, | - |
504 | { (224*65536 + 102*256 + 255), "mediumorchid1" }, | - |
505 | { (209*65536 + 95*256 + 238), "mediumorchid2" }, | - |
506 | { (180*65536 + 82*256 + 205), "mediumorchid3" }, | - |
507 | { (122*65536 + 55*256 + 139), "mediumorchid4" }, | - |
508 | { (147*65536 + 112*256 + 219), "mediumpurple" }, | - |
509 | { (171*65536 + 130*256 + 255), "mediumpurple1" }, | - |
510 | { (159*65536 + 121*256 + 238), "mediumpurple2" }, | - |
511 | { (137*65536 + 104*256 + 205), "mediumpurple3" }, | - |
512 | { (93*65536 + 71*256 + 139), "mediumpurple4" }, | - |
513 | { (60*65536 + 179*256 + 113), "mediumseagreen" }, | - |
514 | { (123*65536 + 104*256 + 238), "mediumslateblue" }, | - |
515 | { (0*65536 + 250*256 + 154), "mediumspringgreen" }, | - |
516 | { (72*65536 + 209*256 + 204), "mediumturquoise" }, | - |
517 | { (199*65536 + 21*256 + 133), "mediumvioletred" }, | - |
518 | { (25*65536 + 25*256 + 112), "midnightblue" }, | - |
519 | { (245*65536 + 255*256 + 250), "mintcream" }, | - |
520 | { (255*65536 + 228*256 + 225), "mistyrose" }, | - |
521 | { (255*65536 + 228*256 + 225), "mistyrose1" }, | - |
522 | { (238*65536 + 213*256 + 210), "mistyrose2" }, | - |
523 | { (205*65536 + 183*256 + 181), "mistyrose3" }, | - |
524 | { (139*65536 + 125*256 + 123), "mistyrose4" }, | - |
525 | { (255*65536 + 228*256 + 181), "moccasin" }, | - |
526 | { (255*65536 + 222*256 + 173), "navajowhite" }, | - |
527 | { (255*65536 + 222*256 + 173), "navajowhite1" }, | - |
528 | { (238*65536 + 207*256 + 161), "navajowhite2" }, | - |
529 | { (205*65536 + 179*256 + 139), "navajowhite3" }, | - |
530 | { (139*65536 + 121*256 + 94), "navajowhite4" }, | - |
531 | { (0*65536 + 0*256 + 128), "navy" }, | - |
532 | { (0*65536 + 0*256 + 128), "navyblue" }, | - |
533 | { (253*65536 + 245*256 + 230), "oldlace" }, | - |
534 | { (107*65536 + 142*256 + 35), "olivedrab" }, | - |
535 | { (192*65536 + 255*256 + 62), "olivedrab1" }, | - |
536 | { (179*65536 + 238*256 + 58), "olivedrab2" }, | - |
537 | { (154*65536 + 205*256 + 50), "olivedrab3" }, | - |
538 | { (105*65536 + 139*256 + 34), "olivedrab4" }, | - |
539 | { (255*65536 + 165*256 + 0), "orange" }, | - |
540 | { (255*65536 + 165*256 + 0), "orange1" }, | - |
541 | { (238*65536 + 154*256 + 0), "orange2" }, | - |
542 | { (205*65536 + 133*256 + 0), "orange3" }, | - |
543 | { (139*65536 + 90*256 + 0), "orange4" }, | - |
544 | { (255*65536 + 69*256 + 0), "orangered" }, | - |
545 | { (255*65536 + 69*256 + 0), "orangered1" }, | - |
546 | { (238*65536 + 64*256 + 0), "orangered2" }, | - |
547 | { (205*65536 + 55*256 + 0), "orangered3" }, | - |
548 | { (139*65536 + 37*256 + 0), "orangered4" }, | - |
549 | { (218*65536 + 112*256 + 214), "orchid" }, | - |
550 | { (255*65536 + 131*256 + 250), "orchid1" }, | - |
551 | { (238*65536 + 122*256 + 233), "orchid2" }, | - |
552 | { (205*65536 + 105*256 + 201), "orchid3" }, | - |
553 | { (139*65536 + 71*256 + 137), "orchid4" }, | - |
554 | { (238*65536 + 232*256 + 170), "palegoldenrod" }, | - |
555 | { (152*65536 + 251*256 + 152), "palegreen" }, | - |
556 | { (154*65536 + 255*256 + 154), "palegreen1" }, | - |
557 | { (144*65536 + 238*256 + 144), "palegreen2" }, | - |
558 | { (124*65536 + 205*256 + 124), "palegreen3" }, | - |
559 | { (84*65536 + 139*256 + 84), "palegreen4" }, | - |
560 | { (175*65536 + 238*256 + 238), "paleturquoise" }, | - |
561 | { (187*65536 + 255*256 + 255), "paleturquoise1" }, | - |
562 | { (174*65536 + 238*256 + 238), "paleturquoise2" }, | - |
563 | { (150*65536 + 205*256 + 205), "paleturquoise3" }, | - |
564 | { (102*65536 + 139*256 + 139), "paleturquoise4" }, | - |
565 | { (219*65536 + 112*256 + 147), "palevioletred" }, | - |
566 | { (255*65536 + 130*256 + 171), "palevioletred1" }, | - |
567 | { (238*65536 + 121*256 + 159), "palevioletred2" }, | - |
568 | { (205*65536 + 104*256 + 137), "palevioletred3" }, | - |
569 | { (139*65536 + 71*256 + 93), "palevioletred4" }, | - |
570 | { (255*65536 + 239*256 + 213), "papayawhip" }, | - |
571 | { (255*65536 + 218*256 + 185), "peachpuff" }, | - |
572 | { (255*65536 + 218*256 + 185), "peachpuff1" }, | - |
573 | { (238*65536 + 203*256 + 173), "peachpuff2" }, | - |
574 | { (205*65536 + 175*256 + 149), "peachpuff3" }, | - |
575 | { (139*65536 + 119*256 + 101), "peachpuff4" }, | - |
576 | { (205*65536 + 133*256 + 63), "peru" }, | - |
577 | { (255*65536 + 192*256 + 203), "pink" }, | - |
578 | { (255*65536 + 181*256 + 197), "pink1" }, | - |
579 | { (238*65536 + 169*256 + 184), "pink2" }, | - |
580 | { (205*65536 + 145*256 + 158), "pink3" }, | - |
581 | { (139*65536 + 99*256 + 108), "pink4" }, | - |
582 | { (221*65536 + 160*256 + 221), "plum" }, | - |
583 | { (255*65536 + 187*256 + 255), "plum1" }, | - |
584 | { (238*65536 + 174*256 + 238), "plum2" }, | - |
585 | { (205*65536 + 150*256 + 205), "plum3" }, | - |
586 | { (139*65536 + 102*256 + 139), "plum4" }, | - |
587 | { (176*65536 + 224*256 + 230), "powderblue" }, | - |
588 | { (160*65536 + 32*256 + 240), "purple" }, | - |
589 | { (155*65536 + 48*256 + 255), "purple1" }, | - |
590 | { (145*65536 + 44*256 + 238), "purple2" }, | - |
591 | { (125*65536 + 38*256 + 205), "purple3" }, | - |
592 | { (85*65536 + 26*256 + 139), "purple4" }, | - |
593 | { (255*65536 + 0*256 + 0), "red" }, | - |
594 | { (255*65536 + 0*256 + 0), "red1" }, | - |
595 | { (238*65536 + 0*256 + 0), "red2" }, | - |
596 | { (205*65536 + 0*256 + 0), "red3" }, | - |
597 | { (139*65536 + 0*256 + 0), "red4" }, | - |
598 | { (188*65536 + 143*256 + 143), "rosybrown" }, | - |
599 | { (255*65536 + 193*256 + 193), "rosybrown1" }, | - |
600 | { (238*65536 + 180*256 + 180), "rosybrown2" }, | - |
601 | { (205*65536 + 155*256 + 155), "rosybrown3" }, | - |
602 | { (139*65536 + 105*256 + 105), "rosybrown4" }, | - |
603 | { (65*65536 + 105*256 + 225), "royalblue" }, | - |
604 | { (72*65536 + 118*256 + 255), "royalblue1" }, | - |
605 | { (67*65536 + 110*256 + 238), "royalblue2" }, | - |
606 | { (58*65536 + 95*256 + 205), "royalblue3" }, | - |
607 | { (39*65536 + 64*256 + 139), "royalblue4" }, | - |
608 | { (139*65536 + 69*256 + 19), "saddlebrown" }, | - |
609 | { (250*65536 + 128*256 + 114), "salmon" }, | - |
610 | { (255*65536 + 140*256 + 105), "salmon1" }, | - |
611 | { (238*65536 + 130*256 + 98), "salmon2" }, | - |
612 | { (205*65536 + 112*256 + 84), "salmon3" }, | - |
613 | { (139*65536 + 76*256 + 57), "salmon4" }, | - |
614 | { (244*65536 + 164*256 + 96), "sandybrown" }, | - |
615 | { (46*65536 + 139*256 + 87), "seagreen" }, | - |
616 | { (84*65536 + 255*256 + 159), "seagreen1" }, | - |
617 | { (78*65536 + 238*256 + 148), "seagreen2" }, | - |
618 | { (67*65536 + 205*256 + 128), "seagreen3" }, | - |
619 | { (46*65536 + 139*256 + 87), "seagreen4" }, | - |
620 | { (255*65536 + 245*256 + 238), "seashell" }, | - |
621 | { (255*65536 + 245*256 + 238), "seashell1" }, | - |
622 | { (238*65536 + 229*256 + 222), "seashell2" }, | - |
623 | { (205*65536 + 197*256 + 191), "seashell3" }, | - |
624 | { (139*65536 + 134*256 + 130), "seashell4" }, | - |
625 | { (160*65536 + 82*256 + 45), "sienna" }, | - |
626 | { (255*65536 + 130*256 + 71), "sienna1" }, | - |
627 | { (238*65536 + 121*256 + 66), "sienna2" }, | - |
628 | { (205*65536 + 104*256 + 57), "sienna3" }, | - |
629 | { (139*65536 + 71*256 + 38), "sienna4" }, | - |
630 | { (135*65536 + 206*256 + 235), "skyblue" }, | - |
631 | { (135*65536 + 206*256 + 255), "skyblue1" }, | - |
632 | { (126*65536 + 192*256 + 238), "skyblue2" }, | - |
633 | { (108*65536 + 166*256 + 205), "skyblue3" }, | - |
634 | { (74*65536 + 112*256 + 139), "skyblue4" }, | - |
635 | { (106*65536 + 90*256 + 205), "slateblue" }, | - |
636 | { (131*65536 + 111*256 + 255), "slateblue1" }, | - |
637 | { (122*65536 + 103*256 + 238), "slateblue2" }, | - |
638 | { (105*65536 + 89*256 + 205), "slateblue3" }, | - |
639 | { (71*65536 + 60*256 + 139), "slateblue4" }, | - |
640 | { (112*65536 + 128*256 + 144), "slategray" }, | - |
641 | { (198*65536 + 226*256 + 255), "slategray1" }, | - |
642 | { (185*65536 + 211*256 + 238), "slategray2" }, | - |
643 | { (159*65536 + 182*256 + 205), "slategray3" }, | - |
644 | { (108*65536 + 123*256 + 139), "slategray4" }, | - |
645 | { (112*65536 + 128*256 + 144), "slategrey" }, | - |
646 | { (255*65536 + 250*256 + 250), "snow" }, | - |
647 | { (255*65536 + 250*256 + 250), "snow1" }, | - |
648 | { (238*65536 + 233*256 + 233), "snow2" }, | - |
649 | { (205*65536 + 201*256 + 201), "snow3" }, | - |
650 | { (139*65536 + 137*256 + 137), "snow4" }, | - |
651 | { (0*65536 + 255*256 + 127), "springgreen" }, | - |
652 | { (0*65536 + 255*256 + 127), "springgreen1" }, | - |
653 | { (0*65536 + 238*256 + 118), "springgreen2" }, | - |
654 | { (0*65536 + 205*256 + 102), "springgreen3" }, | - |
655 | { (0*65536 + 139*256 + 69), "springgreen4" }, | - |
656 | { (70*65536 + 130*256 + 180), "steelblue" }, | - |
657 | { (99*65536 + 184*256 + 255), "steelblue1" }, | - |
658 | { (92*65536 + 172*256 + 238), "steelblue2" }, | - |
659 | { (79*65536 + 148*256 + 205), "steelblue3" }, | - |
660 | { (54*65536 + 100*256 + 139), "steelblue4" }, | - |
661 | { (210*65536 + 180*256 + 140), "tan" }, | - |
662 | { (255*65536 + 165*256 + 79), "tan1" }, | - |
663 | { (238*65536 + 154*256 + 73), "tan2" }, | - |
664 | { (205*65536 + 133*256 + 63), "tan3" }, | - |
665 | { (139*65536 + 90*256 + 43), "tan4" }, | - |
666 | { (216*65536 + 191*256 + 216), "thistle" }, | - |
667 | { (255*65536 + 225*256 + 255), "thistle1" }, | - |
668 | { (238*65536 + 210*256 + 238), "thistle2" }, | - |
669 | { (205*65536 + 181*256 + 205), "thistle3" }, | - |
670 | { (139*65536 + 123*256 + 139), "thistle4" }, | - |
671 | { (255*65536 + 99*256 + 71), "tomato" }, | - |
672 | { (255*65536 + 99*256 + 71), "tomato1" }, | - |
673 | { (238*65536 + 92*256 + 66), "tomato2" }, | - |
674 | { (205*65536 + 79*256 + 57), "tomato3" }, | - |
675 | { (139*65536 + 54*256 + 38), "tomato4" }, | - |
676 | { (64*65536 + 224*256 + 208), "turquoise" }, | - |
677 | { (0*65536 + 245*256 + 255), "turquoise1" }, | - |
678 | { (0*65536 + 229*256 + 238), "turquoise2" }, | - |
679 | { (0*65536 + 197*256 + 205), "turquoise3" }, | - |
680 | { (0*65536 + 134*256 + 139), "turquoise4" }, | - |
681 | { (238*65536 + 130*256 + 238), "violet" }, | - |
682 | { (208*65536 + 32*256 + 144), "violetred" }, | - |
683 | { (255*65536 + 62*256 + 150), "violetred1" }, | - |
684 | { (238*65536 + 58*256 + 140), "violetred2" }, | - |
685 | { (205*65536 + 50*256 + 120), "violetred3" }, | - |
686 | { (139*65536 + 34*256 + 82), "violetred4" }, | - |
687 | { (245*65536 + 222*256 + 179), "wheat" }, | - |
688 | { (255*65536 + 231*256 + 186), "wheat1" }, | - |
689 | { (238*65536 + 216*256 + 174), "wheat2" }, | - |
690 | { (205*65536 + 186*256 + 150), "wheat3" }, | - |
691 | { (139*65536 + 126*256 + 102), "wheat4" }, | - |
692 | { (255*65536 + 255*256 + 255), "white" }, | - |
693 | { (245*65536 + 245*256 + 245), "whitesmoke" }, | - |
694 | { (255*65536 + 255*256 + 0), "yellow" }, | - |
695 | { (255*65536 + 255*256 + 0), "yellow1" }, | - |
696 | { (238*65536 + 238*256 + 0), "yellow2" }, | - |
697 | { (205*65536 + 205*256 + 0), "yellow3" }, | - |
698 | { (139*65536 + 139*256 + 0), "yellow4" }, | - |
699 | { (154*65536 + 205*256 + 50), "yellowgreen" } }; | - |
700 | | - |
701 | inline bool operator<(const char *name, const XPMRGBData &data) | - |
702 | { return qstrcmp(name, data.name) < 0; } executed: return qstrcmp(name, data.name) < 0; Execution Count:202 | 202 |
703 | inline bool operator<(const XPMRGBData &data, const char *name) | - |
704 | { return qstrcmp(data.name, name) < 0; } executed: return qstrcmp(data.name, name) < 0; Execution Count:2020 | 2020 |
705 | | - |
706 | static inline bool qt_get_named_xpm_rgb(const char *name_no_space, QRgb *rgb) | - |
707 | { | - |
708 | const XPMRGBData *r = qBinaryFind(xpmRgbTbl, xpmRgbTbl + xpmRgbTblSize, name_no_space); | - |
709 | if (r != xpmRgbTbl + xpmRgbTblSize) { partially evaluated: r != xpmRgbTbl + xpmRgbTblSize yes Evaluation Count:202 | no Evaluation Count:0 |
| 0-202 |
710 | *rgb = r->value; | - |
711 | return true; executed: return true; Execution Count:202 | 202 |
712 | } else { | - |
713 | return false; never executed: return false; | 0 |
714 | } | - |
715 | } | - |
716 | | - |
717 | | - |
718 | | - |
719 | | - |
720 | static QString fbname(const QString &fileName) | - |
721 | { | - |
722 | QString s = fileName; | - |
723 | if (!s.isEmpty()) { partially evaluated: !s.isEmpty() no Evaluation Count:0 | yes Evaluation Count:290 |
| 0-290 |
724 | int i; | - |
725 | if ((i = s.lastIndexOf(QLatin1Char('/'))) >= 0) never evaluated: (i = s.lastIndexOf(QLatin1Char('/'))) >= 0 | 0 |
726 | s = s.mid(i); never executed: s = s.mid(i); | 0 |
727 | if ((i = s.lastIndexOf(QLatin1Char('\\'))) >= 0) never evaluated: (i = s.lastIndexOf(QLatin1Char('\\'))) >= 0 | 0 |
728 | s = s.mid(i); never executed: s = s.mid(i); | 0 |
729 | QRegExp r(QLatin1String("[a-zA-Z][a-zA-Z0-9_]*")); | - |
730 | int p = r.indexIn(s); | - |
731 | if (p == -1) | 0 |
732 | s.clear(); never executed: s.clear(); | 0 |
733 | else | - |
734 | s = s.mid(p, r.matchedLength()); never executed: s = s.mid(p, r.matchedLength()); | 0 |
735 | } | - |
736 | if (s.isEmpty()) partially evaluated: s.isEmpty() yes Evaluation Count:290 | no Evaluation Count:0 |
| 0-290 |
737 | s = QString::fromLatin1("dummy"); executed: s = QString::fromLatin1("dummy"); Execution Count:290 | 290 |
738 | return s; executed: return s; Execution Count:290 | 290 |
739 | } | - |
740 | | - |
741 | | - |
742 | | - |
743 | | - |
744 | static bool read_xpm_string(QByteArray &buf, QIODevice *d, const char * const *source, int &index, | - |
745 | QByteArray &state) | - |
746 | { | - |
747 | if (source) { evaluated: source yes Evaluation Count:55281 | yes Evaluation Count:45309 |
| 45309-55281 |
748 | buf = source[index++]; | - |
749 | return true; executed: return true; Execution Count:55281 | 55281 |
750 | } | - |
751 | | - |
752 | buf = ""; | - |
753 | bool gotQuote = false; | - |
754 | int offset = 0; | - |
755 | for(;;) { | - |
756 | if (offset == state.size() || state.isEmpty()) { evaluated: offset == state.size() yes Evaluation Count:3205 | yes Evaluation Count:6327911 |
partially evaluated: state.isEmpty() no Evaluation Count:0 | yes Evaluation Count:6327911 |
| 0-6327911 |
757 | char buf[2048]; | - |
758 | qint64 bytesRead = d->read(buf, sizeof(buf)); | - |
759 | if (bytesRead <= 0) evaluated: bytesRead <= 0 yes Evaluation Count:13 | yes Evaluation Count:3192 |
| 13-3192 |
760 | return false; executed: return false; Execution Count:13 | 13 |
761 | state = QByteArray(buf, int(bytesRead)); | - |
762 | offset = 0; | - |
763 | } executed: } Execution Count:3192 | 3192 |
764 | | - |
765 | if (!gotQuote) { evaluated: !gotQuote yes Evaluation Count:154031 | yes Evaluation Count:6177072 |
| 154031-6177072 |
766 | if (state.at(offset++) == '"') evaluated: state.at(offset++) == '"' yes Evaluation Count:45296 | yes Evaluation Count:108735 |
| 45296-108735 |
767 | gotQuote = true; executed: gotQuote = true; Execution Count:45296 | 45296 |
768 | } else { executed: } Execution Count:154031 | 154031 |
769 | char c = state.at(offset++); | - |
770 | if (c == '"') evaluated: c == '"' yes Evaluation Count:45296 | yes Evaluation Count:6131776 |
| 45296-6131776 |
771 | break; executed: break; Execution Count:45296 | 45296 |
772 | buf += c; | - |
773 | } executed: } Execution Count:6131776 | 6131776 |
774 | } | - |
775 | state.remove(0, offset); | - |
776 | return true; executed: return true; Execution Count:45296 | 45296 |
777 | } | - |
778 | | - |
779 | | - |
780 | | - |
781 | static bool is_xpm_color_spec_prefix(const QByteArray& prefix) | - |
782 | { | - |
783 | return prefix == "c" || | 58516 |
784 | prefix == "g" || | 58516 |
785 | prefix == "g4" || | 58516 |
786 | prefix == "m" || | 58516 |
787 | prefix == "s"; executed: return prefix == "c" || prefix == "g" || prefix == "g4" || prefix == "m" || prefix == "s"; Execution Count:58516 | 58516 |
788 | } | - |
789 | | - |
790 | | - |
791 | | - |
792 | static bool read_xpm_header( | - |
793 | QIODevice *device, const char * const * source, int& index, QByteArray &state, | - |
794 | int *cpp, int *ncols, int *w, int *h) | - |
795 | { | - |
796 | QByteArray buf(200, 0); | - |
797 | | - |
798 | if (!read_xpm_string(buf, device, source, index, state)) partially evaluated: !read_xpm_string(buf, device, source, index, state) no Evaluation Count:0 | yes Evaluation Count:2237 |
| 0-2237 |
799 | return false; never executed: return false; | 0 |
800 | | - |
801 | | - |
802 | | - |
803 | | - |
804 | if (sscanf(buf, "%d %d %d %d", w, h, ncols, cpp) < 4) evaluated: sscanf(buf, "%d %d %d %d", w, h, ncols, cpp) < 4 yes Evaluation Count:1 | yes Evaluation Count:2236 |
| 1-2236 |
805 | | - |
806 | return false; executed: return false; Execution Count:1 | 1 |
807 | | - |
808 | return true; executed: return true; Execution Count:2236 | 2236 |
809 | } | - |
810 | | - |
811 | | - |
812 | | - |
813 | static bool read_xpm_body( | - |
814 | QIODevice *device, const char * const * source, int& index, QByteArray& state, | - |
815 | int cpp, int ncols, int w, int h, QImage& image) | - |
816 | { | - |
817 | QByteArray buf(200, 0); | - |
818 | int i; | - |
819 | | - |
820 | if (cpp < 0 || cpp > 15) evaluated: cpp < 0 yes Evaluation Count:6 | yes Evaluation Count:2228 |
partially evaluated: cpp > 15 no Evaluation Count:0 | yes Evaluation Count:2228 |
| 0-2228 |
821 | return false; executed: return false; Execution Count:6 | 6 |
822 | | - |
823 | | - |
824 | | - |
825 | | - |
826 | | - |
827 | if (ncols <= 256) { evaluated: ncols <= 256 yes Evaluation Count:2202 | yes Evaluation Count:26 |
| 26-2202 |
828 | if (image.size() != QSize(w, h) || image.format() != QImage::Format_Indexed8) { partially evaluated: image.size() != QSize(w, h) yes Evaluation Count:2202 | no Evaluation Count:0 |
never evaluated: image.format() != QImage::Format_Indexed8 | 0-2202 |
829 | image = QImage(w, h, QImage::Format_Indexed8); | - |
830 | if (image.isNull()) partially evaluated: image.isNull() no Evaluation Count:0 | yes Evaluation Count:2202 |
| 0-2202 |
831 | return false; never executed: return false; | 0 |
832 | } executed: } Execution Count:2202 | 2202 |
833 | image.setColorCount(ncols); | - |
834 | } executed: } Execution Count:2202 | 2202 |
835 | | - |
836 | QMap<quint64, int> colorMap; | - |
837 | int currentColor; | - |
838 | bool hasTransparency = false; | - |
839 | | - |
840 | for(currentColor=0; currentColor < ncols; ++currentColor) { evaluated: currentColor < ncols yes Evaluation Count:58241 | yes Evaluation Count:2215 |
| 2215-58241 |
841 | if (!read_xpm_string(buf, device, source, index, state)) { partially evaluated: !read_xpm_string(buf, device, source, index, state) no Evaluation Count:0 | yes Evaluation Count:58241 |
| 0-58241 |
842 | QMessageLogger("image/qxpmhandler.cpp", 889, __PRETTY_FUNCTION__).warning("QImage: XPM color specification missing"); | - |
843 | return false; never executed: return false; | 0 |
844 | } | - |
845 | QByteArray index; | - |
846 | index = buf.left(cpp); | - |
847 | buf = buf.mid(cpp).simplified().trimmed().toLower(); | - |
848 | QList<QByteArray> tokens = buf.split(' '); | - |
849 | i = tokens.indexOf("c"); | - |
850 | if (i < 0) evaluated: i < 0 yes Evaluation Count:13 | yes Evaluation Count:58228 |
| 13-58228 |
851 | i = tokens.indexOf("g"); executed: i = tokens.indexOf("g"); Execution Count:13 | 13 |
852 | if (i < 0) evaluated: i < 0 yes Evaluation Count:13 | yes Evaluation Count:58228 |
| 13-58228 |
853 | i = tokens.indexOf("g4"); executed: i = tokens.indexOf("g4"); Execution Count:13 | 13 |
854 | if (i < 0) evaluated: i < 0 yes Evaluation Count:13 | yes Evaluation Count:58228 |
| 13-58228 |
855 | i = tokens.indexOf("m"); executed: i = tokens.indexOf("m"); Execution Count:13 | 13 |
856 | if (i < 0) { evaluated: i < 0 yes Evaluation Count:13 | yes Evaluation Count:58228 |
| 13-58228 |
857 | QMessageLogger("image/qxpmhandler.cpp", 904, __PRETTY_FUNCTION__).warning("QImage: XPM color specification is missing: %s", buf.constData()); | - |
858 | return false; executed: return false; Execution Count:13 | 13 |
859 | } | - |
860 | QByteArray color; | - |
861 | while ((++i < tokens.size()) && !is_xpm_color_spec_prefix(tokens.at(i))) { evaluated: (++i < tokens.size()) yes Evaluation Count:58516 | yes Evaluation Count:58018 |
evaluated: !is_xpm_color_spec_prefix(tokens.at(i)) yes Evaluation Count:58306 | yes Evaluation Count:210 |
| 210-58516 |
862 | color.append(tokens.at(i)); | - |
863 | } executed: } Execution Count:58306 | 58306 |
864 | if (color.isEmpty()) { partially evaluated: color.isEmpty() no Evaluation Count:0 | yes Evaluation Count:58228 |
| 0-58228 |
865 | QMessageLogger("image/qxpmhandler.cpp", 912, __PRETTY_FUNCTION__).warning("QImage: XPM color value is missing from specification: %s", buf.constData()); | - |
866 | return false; never executed: return false; | 0 |
867 | } | - |
868 | buf = color; | - |
869 | if (buf == "none") { evaluated: buf == "none" yes Evaluation Count:2152 | yes Evaluation Count:56076 |
| 2152-56076 |
870 | hasTransparency = true; | - |
871 | int transparentColor = currentColor; | - |
872 | if (ncols <= 256) { evaluated: ncols <= 256 yes Evaluation Count:2139 | yes Evaluation Count:13 |
| 13-2139 |
873 | image.setColor(transparentColor, 0); | - |
874 | colorMap.insert(xpmHash(QLatin1String(index.constData())), transparentColor); | - |
875 | } else { executed: } Execution Count:2139 | 2139 |
876 | colorMap.insert(xpmHash(QLatin1String(index.constData())), 0); | - |
877 | } executed: } Execution Count:13 | 13 |
878 | } else { | - |
879 | QRgb c_rgb; | - |
880 | if (((buf.length()-1) % 3) && (buf[0] == '#')) { evaluated: ((buf.length()-1) % 3) yes Evaluation Count:131 | yes Evaluation Count:55945 |
partially evaluated: (buf[0] == '#') no Evaluation Count:0 | yes Evaluation Count:131 |
| 0-55945 |
881 | buf.truncate(((buf.length()-1) / 4 * 3) + 1); | - |
882 | } | 0 |
883 | if (buf[0] == '#') { evaluated: buf[0] == '#' yes Evaluation Count:55874 | yes Evaluation Count:202 |
| 202-55874 |
884 | qt_get_hex_rgb(buf, &c_rgb); | - |
885 | } else { executed: } Execution Count:55874 | 55874 |
886 | qt_get_named_xpm_rgb(buf, &c_rgb); | - |
887 | } executed: } Execution Count:202 | 202 |
888 | if (ncols <= 256) { evaluated: ncols <= 256 yes Evaluation Count:35887 | yes Evaluation Count:20189 |
| 20189-35887 |
889 | image.setColor(currentColor, 0xff000000 | c_rgb); | - |
890 | colorMap.insert(xpmHash(QLatin1String(index.constData())), currentColor); | - |
891 | } else { executed: } Execution Count:35887 | 35887 |
892 | colorMap.insert(xpmHash(QLatin1String(index.constData())), 0xff000000 | c_rgb); | - |
893 | } executed: } Execution Count:20189 | 20189 |
894 | } | - |
895 | } | - |
896 | | - |
897 | if (ncols > 256) { evaluated: ncols > 256 yes Evaluation Count:26 | yes Evaluation Count:2189 |
| 26-2189 |
898 | | - |
899 | QImage::Format format = hasTransparency ? evaluated: hasTransparency yes Evaluation Count:13 | yes Evaluation Count:13 |
| 13 |
900 | QImage::Format_ARGB32 : QImage::Format_RGB32; | - |
901 | if (image.size() != QSize(w, h) || image.format() != format) { partially evaluated: image.size() != QSize(w, h) yes Evaluation Count:26 | no Evaluation Count:0 |
never evaluated: image.format() != format | 0-26 |
902 | image = QImage(w, h, format); | - |
903 | if (image.isNull()) partially evaluated: image.isNull() no Evaluation Count:0 | yes Evaluation Count:26 |
| 0-26 |
904 | return false; never executed: return false; | 0 |
905 | } executed: } Execution Count:26 | 26 |
906 | } executed: } Execution Count:26 | 26 |
907 | | - |
908 | | - |
909 | for(int y=0; y<h; y++) { evaluated: y<h yes Evaluation Count:40112 | yes Evaluation Count:2202 |
| 2202-40112 |
910 | if (!read_xpm_string(buf, device, source, index, state)) { evaluated: !read_xpm_string(buf, device, source, index, state) yes Evaluation Count:13 | yes Evaluation Count:40099 |
| 13-40099 |
911 | QMessageLogger("image/qxpmhandler.cpp", 958, __PRETTY_FUNCTION__).warning("QImage: XPM pixels missing on image line %d", y); | - |
912 | return false; executed: return false; Execution Count:13 | 13 |
913 | } | - |
914 | if (image.depth() == 8) { evaluated: image.depth() == 8 yes Evaluation Count:39891 | yes Evaluation Count:208 |
| 208-39891 |
915 | uchar *p = image.scanLine(y); | - |
916 | uchar *d = (uchar *)buf.data(); | - |
917 | uchar *end = d + buf.length(); | - |
918 | int x; | - |
919 | if (cpp == 1) { evaluated: cpp == 1 yes Evaluation Count:29811 | yes Evaluation Count:10080 |
| 10080-29811 |
920 | char b[2]; | - |
921 | b[1] = '\0'; | - |
922 | for (x=0; x<w && d<end; x++) { evaluated: x<w yes Evaluation Count:1259023 | yes Evaluation Count:29798 |
evaluated: d<end yes Evaluation Count:1259010 | yes Evaluation Count:13 |
| 13-1259023 |
923 | b[0] = *d++; | - |
924 | *p++ = (uchar)colorMap[xpmHash(b)]; | - |
925 | } executed: } Execution Count:1259010 | 1259010 |
926 | } else { executed: } Execution Count:29811 | 29811 |
927 | char b[16]; | - |
928 | b[cpp] = '\0'; | - |
929 | for (x=0; x<w && d<end; x++) { evaluated: x<w yes Evaluation Count:2419200 | yes Evaluation Count:10080 |
partially evaluated: d<end yes Evaluation Count:2419200 | no Evaluation Count:0 |
| 0-2419200 |
930 | memcpy(b, (char *)d, cpp); | - |
931 | *p++ = (uchar)colorMap[xpmHash(b)]; | - |
932 | d += cpp; | - |
933 | } executed: } Execution Count:2419200 | 2419200 |
934 | } executed: } Execution Count:10080 | 10080 |
935 | | - |
936 | if (x < w) { evaluated: x < w yes Evaluation Count:13 | yes Evaluation Count:39878 |
| 13-39878 |
937 | QMessageLogger("image/qxpmhandler.cpp", 984, __PRETTY_FUNCTION__).warning("QImage: XPM pixels missing on image line %d (possibly a C++ trigraph).", y); | - |
938 | memset(p, 0, w - x); | - |
939 | } executed: } Execution Count:13 | 13 |
940 | } else { executed: } Execution Count:39891 | 39891 |
941 | QRgb *p = (QRgb*)image.scanLine(y); | - |
942 | uchar *d = (uchar *)buf.data(); | - |
943 | uchar *end = d + buf.length(); | - |
944 | int x; | - |
945 | char b[16]; | - |
946 | b[cpp] = '\0'; | - |
947 | for (x=0; x<w && d<end; x++) { evaluated: x<w yes Evaluation Count:1664 | yes Evaluation Count:208 |
partially evaluated: d<end yes Evaluation Count:1664 | no Evaluation Count:0 |
| 0-1664 |
948 | memcpy(b, (char *)d, cpp); | - |
949 | *p++ = (QRgb)colorMap[xpmHash(b)]; | - |
950 | d += cpp; | - |
951 | } executed: } Execution Count:1664 | 1664 |
952 | | - |
953 | if (x < w) { partially evaluated: x < w no Evaluation Count:0 | yes Evaluation Count:208 |
| 0-208 |
954 | QMessageLogger("image/qxpmhandler.cpp", 1001, __PRETTY_FUNCTION__).warning("QImage: XPM pixels missing on image line %d (possibly a C++ trigraph).", y); | - |
955 | memset(p, 0, (w - x)*4); | - |
956 | } | 0 |
957 | } executed: } Execution Count:208 | 208 |
958 | } | - |
959 | | - |
960 | if (device) { evaluated: device yes Evaluation Count:132 | yes Evaluation Count:2070 |
| 132-2070 |
961 | | - |
962 | for (int i = state.size() - 1; i >= 0; --i) evaluated: i >= 0 yes Evaluation Count:2851 | yes Evaluation Count:132 |
| 132-2851 |
963 | device->ungetChar(state[i]); executed: device->ungetChar(state[i]); Execution Count:2851 | 2851 |
964 | char c; | - |
965 | while (device->getChar(&c) && c != ';') {} partially evaluated: device->getChar(&c) yes Evaluation Count:314 | no Evaluation Count:0 |
evaluated: c != ';' yes Evaluation Count:182 | yes Evaluation Count:132 |
executed: } Execution Count:182 | 0-314 |
966 | while (device->getChar(&c) && c != '\n') {} partially evaluated: device->getChar(&c) yes Evaluation Count:132 | no Evaluation Count:0 |
partially evaluated: c != '\n' no Evaluation Count:0 | yes Evaluation Count:132 |
| 0-132 |
967 | } executed: } Execution Count:132 | 132 |
968 | return true; executed: return true; Execution Count:2202 | 2202 |
969 | } | - |
970 | bool qt_read_xpm_image_or_array(QIODevice *device, const char * const * source, QImage &image) | - |
971 | { | - |
972 | if (!source) partially evaluated: !source no Evaluation Count:0 | yes Evaluation Count:2071 |
| 0-2071 |
973 | return true; never executed: return true; | 0 |
974 | | - |
975 | QByteArray buf(200, 0); | - |
976 | QByteArray state; | - |
977 | | - |
978 | int cpp, ncols, w, h, index = 0; | - |
979 | | - |
980 | if (device) { partially evaluated: device no Evaluation Count:0 | yes Evaluation Count:2071 |
| 0-2071 |
981 | | - |
982 | int readBytes; | - |
983 | if ((readBytes = device->readLine(buf.data(), buf.size())) < 0) never evaluated: (readBytes = device->readLine(buf.data(), buf.size())) < 0 | 0 |
984 | return false; never executed: return false; | 0 |
985 | | - |
986 | if (buf.indexOf("/* XPM") != 0) { never evaluated: buf.indexOf("/* XPM") != 0 | 0 |
987 | while (readBytes > 0) { never evaluated: readBytes > 0 | 0 |
988 | device->ungetChar(buf.at(readBytes - 1)); | - |
989 | --readBytes; | - |
990 | } | 0 |
991 | return false; never executed: return false; | 0 |
992 | } | - |
993 | } | 0 |
994 | | - |
995 | if (!read_xpm_header(device, source, index, state, &cpp, &ncols, &w, &h)) evaluated: !read_xpm_header(device, source, index, state, &cpp, &ncols, &w, &h) yes Evaluation Count:1 | yes Evaluation Count:2070 |
| 1-2070 |
996 | return false; executed: return false; Execution Count:1 | 1 |
997 | | - |
998 | return read_xpm_body(device, source, index, state, cpp, ncols, w, h, image); executed: return read_xpm_body(device, source, index, state, cpp, ncols, w, h, image); Execution Count:2070 | 2070 |
999 | } | - |
1000 | | - |
1001 | static const char* xpm_color_name(int cpp, int index) | - |
1002 | { | - |
1003 | static char returnable[5]; | - |
1004 | static const char code[] = ".#abcdefghijklmnopqrstuvwxyzABCD" | - |
1005 | "EFGHIJKLMNOPQRSTUVWXYZ0123456789"; | - |
1006 | | - |
1007 | if (cpp > 1) { evaluated: cpp > 1 yes Evaluation Count:230744 | yes Evaluation Count:325512 |
| 230744-325512 |
1008 | if (cpp > 2) { partially evaluated: cpp > 2 no Evaluation Count:0 | yes Evaluation Count:230744 |
| 0-230744 |
1009 | if (cpp > 3) { | 0 |
1010 | returnable[3] = code[index % 64]; | - |
1011 | index /= 64; | - |
1012 | } else | 0 |
1013 | returnable[3] = '\0'; never executed: returnable[3] = '\0'; | 0 |
1014 | returnable[2] = code[index % 64]; | - |
1015 | index /= 64; | - |
1016 | } else | 0 |
1017 | returnable[2] = '\0'; executed: returnable[2] = '\0'; Execution Count:230744 | 230744 |
1018 | | - |
1019 | if (index == 0) evaluated: index == 0 yes Evaluation Count:19140 | yes Evaluation Count:211604 |
| 19140-211604 |
1020 | index = 64*44+21; executed: index = 64*44+21; Execution Count:19140 | 19140 |
1021 | else if (index == 64*44+21) partially evaluated: index == 64*44+21 no Evaluation Count:0 | yes Evaluation Count:211604 |
| 0-211604 |
1022 | index = 0; never executed: index = 0; | 0 |
1023 | returnable[1] = code[index % 64]; | - |
1024 | index /= 64; | - |
1025 | } else executed: } Execution Count:230744 | 230744 |
1026 | returnable[1] = '\0'; executed: returnable[1] = '\0'; Execution Count:325512 | 325512 |
1027 | returnable[0] = code[index]; | - |
1028 | | - |
1029 | return returnable; executed: return returnable; Execution Count:556256 | 556256 |
1030 | } | - |
1031 | | - |
1032 | | - |
1033 | | - |
1034 | static bool write_xpm_image(const QImage &sourceImage, QIODevice *device, const QString &fileName) | - |
1035 | { | - |
1036 | if (!device->isWritable()) partially evaluated: !device->isWritable() no Evaluation Count:0 | yes Evaluation Count:290 |
| 0-290 |
1037 | return false; never executed: return false; | 0 |
1038 | | - |
1039 | QImage image; | - |
1040 | if (sourceImage.depth() != 32) evaluated: sourceImage.depth() != 32 yes Evaluation Count:194 | yes Evaluation Count:96 |
| 96-194 |
1041 | image = sourceImage.convertToFormat(QImage::Format_RGB32); executed: image = sourceImage.convertToFormat(QImage::Format_RGB32); Execution Count:194 | 194 |
1042 | else | - |
1043 | image = sourceImage; executed: image = sourceImage; Execution Count:96 | 96 |
1044 | | - |
1045 | QMap<QRgb, int> colorMap; | - |
1046 | | - |
1047 | int w = image.width(), h = image.height(), ncolors = 0; | - |
1048 | int x, y; | - |
1049 | | - |
1050 | | - |
1051 | for(y=0; y<h; y++) { evaluated: y<h yes Evaluation Count:10444 | yes Evaluation Count:290 |
| 290-10444 |
1052 | QRgb * yp = (QRgb *)image.scanLine(y); | - |
1053 | for(x=0; x<w; x++) { evaluated: x<w yes Evaluation Count:555624 | yes Evaluation Count:10444 |
| 10444-555624 |
1054 | QRgb color = *(yp + x); | - |
1055 | if (!colorMap.contains(color)) evaluated: !colorMap.contains(color) yes Evaluation Count:632 | yes Evaluation Count:554992 |
| 632-554992 |
1056 | colorMap.insert(color, ncolors++); executed: colorMap.insert(color, ncolors++); Execution Count:632 | 632 |
1057 | } executed: } Execution Count:555624 | 555624 |
1058 | } executed: } Execution Count:10444 | 10444 |
1059 | | - |
1060 | | - |
1061 | int cpp = 1; | - |
1062 | for (int k = 64; ncolors > k; k *= 64) { evaluated: ncolors > k yes Evaluation Count:4 | yes Evaluation Count:290 |
| 4-290 |
1063 | ++cpp; | - |
1064 | | - |
1065 | | - |
1066 | if (cpp > 4) partially evaluated: cpp > 4 no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
1067 | break; | 0 |
1068 | } executed: } Execution Count:4 | 4 |
1069 | | - |
1070 | QString line; | - |
1071 | | - |
1072 | | - |
1073 | QTextStream s(device); | - |
1074 | s << "/* XPM */" << endl | - |
1075 | << "static char *" << fbname(fileName) << "[]={" << endl | - |
1076 | << '\"' << w << ' ' << h << ' ' << ncolors << ' ' << cpp << '\"'; | - |
1077 | | - |
1078 | | - |
1079 | QMap<QRgb, int>::Iterator c = colorMap.begin(); | - |
1080 | while (c != colorMap.end()) { evaluated: c != colorMap.end() yes Evaluation Count:632 | yes Evaluation Count:290 |
| 290-632 |
1081 | QRgb color = c.key(); | - |
1082 | if (image.format() != QImage::Format_RGB32 && !qAlpha(color)) evaluated: image.format() != QImage::Format_RGB32 yes Evaluation Count:71 | yes Evaluation Count:561 |
evaluated: !qAlpha(color) yes Evaluation Count:1 | yes Evaluation Count:70 |
| 1-561 |
1083 | line.sprintf("\"%s c None\"", | 1 |
1084 | xpm_color_name(cpp, *c)); executed: line.sprintf("\"%s c None\"", xpm_color_name(cpp, *c)); Execution Count:1 | 1 |
1085 | else | - |
1086 | line.sprintf("\"%s c #%02x%02x%02x\"", | 631 |
1087 | xpm_color_name(cpp, *c), | 631 |
1088 | qRed(color), | 631 |
1089 | qGreen(color), | 631 |
1090 | qBlue(color)); executed: line.sprintf("\"%s c #%02x%02x%02x\"", xpm_color_name(cpp, *c), qRed(color), qGreen(color), qBlue(color)); Execution Count:631 | 631 |
1091 | ++c; | - |
1092 | s << ',' << endl << line; | - |
1093 | } executed: } Execution Count:632 | 632 |
1094 | | - |
1095 | | - |
1096 | line.truncate(cpp*w); | - |
1097 | for(y=0; y<h; y++) { evaluated: y<h yes Evaluation Count:10444 | yes Evaluation Count:290 |
| 290-10444 |
1098 | QRgb * yp = (QRgb *) image.scanLine(y); | - |
1099 | int cc = 0; | - |
1100 | for(x=0; x<w; x++) { evaluated: x<w yes Evaluation Count:555624 | yes Evaluation Count:10444 |
| 10444-555624 |
1101 | int color = (int)(*(yp + x)); | - |
1102 | QByteArray chars(xpm_color_name(cpp, colorMap[color])); | - |
1103 | line[cc++] = QLatin1Char(chars[0]); | - |
1104 | if (cpp > 1) { evaluated: cpp > 1 yes Evaluation Count:230400 | yes Evaluation Count:325224 |
| 230400-325224 |
1105 | line[cc++] = QLatin1Char(chars[1]); | - |
1106 | if (cpp > 2) { partially evaluated: cpp > 2 no Evaluation Count:0 | yes Evaluation Count:230400 |
| 0-230400 |
1107 | line[cc++] = QLatin1Char(chars[2]); | - |
1108 | if (cpp > 3) { | 0 |
1109 | line[cc++] = QLatin1Char(chars[3]); | - |
1110 | } | 0 |
1111 | } | 0 |
1112 | } executed: } Execution Count:230400 | 230400 |
1113 | } executed: } Execution Count:555624 | 555624 |
1114 | s << ',' << endl << '\"' << line << '\"'; | - |
1115 | } executed: } Execution Count:10444 | 10444 |
1116 | s << "};" << endl; | - |
1117 | return (s.status() == QTextStream::Ok); executed: return (s.status() == QTextStream::Ok); Execution Count:290 | 290 |
1118 | } | - |
1119 | | - |
1120 | QXpmHandler::QXpmHandler() | - |
1121 | : state(Ready), index(0) | - |
1122 | { | - |
1123 | } executed: } Execution Count:462 | 462 |
1124 | | - |
1125 | bool QXpmHandler::readHeader() | - |
1126 | { | - |
1127 | state = Error; | - |
1128 | if (!read_xpm_header(device(), 0, index, buffer, &cpp, &ncols, &width, &height)) partially evaluated: !read_xpm_header(device(), 0, index, buffer, &cpp, &ncols, &width, &height) no Evaluation Count:0 | yes Evaluation Count:166 |
| 0-166 |
1129 | return false; never executed: return false; | 0 |
1130 | state = ReadHeader; | - |
1131 | return true; executed: return true; Execution Count:166 | 166 |
1132 | } | - |
1133 | | - |
1134 | bool QXpmHandler::readImage(QImage *image) | - |
1135 | { | - |
1136 | if (state == Error) partially evaluated: state == Error no Evaluation Count:0 | yes Evaluation Count:164 |
| 0-164 |
1137 | return false; never executed: return false; | 0 |
1138 | | - |
1139 | if (state == Ready && !readHeader()) { evaluated: state == Ready yes Evaluation Count:163 | yes Evaluation Count:1 |
partially evaluated: !readHeader() no Evaluation Count:0 | yes Evaluation Count:163 |
| 0-163 |
1140 | state = Error; | - |
1141 | return false; never executed: return false; | 0 |
1142 | } | - |
1143 | | - |
1144 | if (!read_xpm_body(device(), 0, index, buffer, cpp, ncols, width, height, *image)) { evaluated: !read_xpm_body(device(), 0, index, buffer, cpp, ncols, width, height, *image) yes Evaluation Count:32 | yes Evaluation Count:132 |
| 32-132 |
1145 | state = Error; | - |
1146 | return false; executed: return false; Execution Count:32 | 32 |
1147 | } | - |
1148 | | - |
1149 | state = Ready; | - |
1150 | return true; executed: return true; Execution Count:132 | 132 |
1151 | } | - |
1152 | | - |
1153 | bool QXpmHandler::canRead() const | - |
1154 | { | - |
1155 | if (state == Ready && !canRead(device())) evaluated: state == Ready yes Evaluation Count:195 | yes Evaluation Count:3 |
evaluated: !canRead(device()) yes Evaluation Count:6 | yes Evaluation Count:189 |
| 3-195 |
1156 | return false; executed: return false; Execution Count:6 | 6 |
1157 | | - |
1158 | if (state != Error) { partially evaluated: state != Error yes Evaluation Count:192 | no Evaluation Count:0 |
| 0-192 |
1159 | setFormat("xpm"); | - |
1160 | return true; executed: return true; Execution Count:192 | 192 |
1161 | } | - |
1162 | | - |
1163 | return false; never executed: return false; | 0 |
1164 | } | - |
1165 | | - |
1166 | bool QXpmHandler::canRead(QIODevice *device) | - |
1167 | { | - |
1168 | if (!device) { partially evaluated: !device no Evaluation Count:0 | yes Evaluation Count:224 |
| 0-224 |
1169 | QMessageLogger("image/qxpmhandler.cpp", 1224, __PRETTY_FUNCTION__).warning("QXpmHandler::canRead() called with no device"); | - |
1170 | return false; never executed: return false; | 0 |
1171 | } | - |
1172 | | - |
1173 | char head[6]; | - |
1174 | if (device->peek(head, sizeof(head)) != sizeof(head)) evaluated: device->peek(head, sizeof(head)) != sizeof(head) yes Evaluation Count:7 | yes Evaluation Count:217 |
| 7-217 |
1175 | return false; executed: return false; Execution Count:7 | 7 |
1176 | | - |
1177 | return qstrncmp(head, "/* XPM", 6) == 0; executed: return qstrncmp(head, "/* XPM", 6) == 0; Execution Count:217 | 217 |
1178 | } | - |
1179 | | - |
1180 | bool QXpmHandler::read(QImage *image) | - |
1181 | { | - |
1182 | if (!canRead()) evaluated: !canRead() yes Evaluation Count:2 | yes Evaluation Count:164 |
| 2-164 |
1183 | return false; executed: return false; Execution Count:2 | 2 |
1184 | return readImage(image); executed: return readImage(image); Execution Count:164 | 164 |
1185 | } | - |
1186 | | - |
1187 | bool QXpmHandler::write(const QImage &image) | - |
1188 | { | - |
1189 | return write_xpm_image(image, device(), fileName); executed: return write_xpm_image(image, device(), fileName); Execution Count:290 | 290 |
1190 | } | - |
1191 | | - |
1192 | bool QXpmHandler::supportsOption(ImageOption option) const | - |
1193 | { | - |
1194 | return option == Name | 1938 |
1195 | || option == Size | 1938 |
1196 | || option == ImageFormat; executed: return option == Name || option == Size || option == ImageFormat; Execution Count:1938 | 1938 |
1197 | } | - |
1198 | | - |
1199 | QVariant QXpmHandler::option(ImageOption option) const | - |
1200 | { | - |
1201 | if (option == Name) { partially evaluated: option == Name no Evaluation Count:0 | yes Evaluation Count:3 |
| 0-3 |
1202 | return fileName; never executed: return fileName; | 0 |
1203 | } else if (option == Size) { evaluated: option == Size yes Evaluation Count:2 | yes Evaluation Count:1 |
| 1-2 |
1204 | if (state == Error) partially evaluated: state == Error no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
1205 | return QVariant(); never executed: return QVariant(); | 0 |
1206 | if (state == Ready && !const_cast<QXpmHandler*>(this)->readHeader()) partially evaluated: state == Ready yes Evaluation Count:2 | no Evaluation Count:0 |
partially evaluated: !const_cast<QXpmHandler*>(this)->readHeader() no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
1207 | return QVariant(); never executed: return QVariant(); | 0 |
1208 | return QSize(width, height); executed: return QSize(width, height); Execution Count:2 | 2 |
1209 | } else if (option == ImageFormat) { partially evaluated: option == ImageFormat yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
1210 | if (state == Error) partially evaluated: state == Error no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
1211 | return QVariant(); never executed: return QVariant(); | 0 |
1212 | if (state == Ready && !const_cast<QXpmHandler*>(this)->readHeader()) partially evaluated: state == Ready yes Evaluation Count:1 | no Evaluation Count:0 |
partially evaluated: !const_cast<QXpmHandler*>(this)->readHeader() no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
1213 | return QVariant(); never executed: return QVariant(); | 0 |
1214 | | - |
1215 | | - |
1216 | | - |
1217 | | - |
1218 | if (ncols <= 256) partially evaluated: ncols <= 256 yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
1219 | return QImage::Format_Indexed8; executed: return QImage::Format_Indexed8; Execution Count:1 | 1 |
1220 | else | - |
1221 | return QImage::Format_Invalid; never executed: return QImage::Format_Invalid; | 0 |
1222 | } | - |
1223 | | - |
1224 | return QVariant(); never executed: return QVariant(); | 0 |
1225 | } | - |
1226 | | - |
1227 | void QXpmHandler::setOption(ImageOption option, const QVariant &value) | - |
1228 | { | - |
1229 | if (option == Name) never evaluated: option == Name | 0 |
1230 | fileName = value.toString(); never executed: fileName = value.toString(); | 0 |
1231 | } | 0 |
1232 | | - |
1233 | QByteArray QXpmHandler::name() const | - |
1234 | { | - |
1235 | return "xpm"; never executed: return "xpm"; | 0 |
1236 | } | - |
1237 | | - |
1238 | | - |
1239 | | - |
| | |