42 #include "private/qxpmhandler_p.h" 44 #ifndef QT_NO_IMAGEFORMAT_XPM 46 #include <private/qcolor_p.h> 54 #include "qplatformdefs.h" 61 unsigned int hashValue = 0;
62 for (
int i = 0; i < str.
size(); ++i) {
64 hashValue += (
unsigned int)str.
at(i).
unicode();
70 unsigned int hashValue = 0;
71 while (*str !=
'\0') {
73 hashValue += (
unsigned int)*str;
82 #define QRGB(r,g,b) (r*65536 + g*256 + b) 90 {
QRGB(240,248,255),
"aliceblue" },
91 {
QRGB(250,235,215),
"antiquewhite" },
92 {
QRGB(255,239,219),
"antiquewhite1" },
93 {
QRGB(238,223,204),
"antiquewhite2" },
94 {
QRGB(205,192,176),
"antiquewhite3" },
95 {
QRGB(139,131,120),
"antiquewhite4" },
96 {
QRGB(127,255,212),
"aquamarine" },
97 {
QRGB(127,255,212),
"aquamarine1" },
98 {
QRGB(118,238,198),
"aquamarine2" },
99 {
QRGB(102,205,170),
"aquamarine3" },
100 {
QRGB( 69,139,116),
"aquamarine4" },
101 {
QRGB(240,255,255),
"azure" },
102 {
QRGB(240,255,255),
"azure1" },
103 {
QRGB(224,238,238),
"azure2" },
104 {
QRGB(193,205,205),
"azure3" },
105 {
QRGB(131,139,139),
"azure4" },
106 {
QRGB(245,245,220),
"beige" },
107 {
QRGB(255,228,196),
"bisque" },
108 {
QRGB(255,228,196),
"bisque1" },
109 {
QRGB(238,213,183),
"bisque2" },
110 {
QRGB(205,183,158),
"bisque3" },
111 {
QRGB(139,125,107),
"bisque4" },
112 {
QRGB( 0, 0, 0),
"black" },
113 {
QRGB(255,235,205),
"blanchedalmond" },
114 {
QRGB( 0, 0,255),
"blue" },
115 {
QRGB( 0, 0,255),
"blue1" },
116 {
QRGB( 0, 0,238),
"blue2" },
117 {
QRGB( 0, 0,205),
"blue3" },
118 {
QRGB( 0, 0,139),
"blue4" },
119 {
QRGB(138, 43,226),
"blueviolet" },
120 {
QRGB(165, 42, 42),
"brown" },
121 {
QRGB(255, 64, 64),
"brown1" },
122 {
QRGB(238, 59, 59),
"brown2" },
123 {
QRGB(205, 51, 51),
"brown3" },
124 {
QRGB(139, 35, 35),
"brown4" },
125 {
QRGB(222,184,135),
"burlywood" },
126 {
QRGB(255,211,155),
"burlywood1" },
127 {
QRGB(238,197,145),
"burlywood2" },
128 {
QRGB(205,170,125),
"burlywood3" },
129 {
QRGB(139,115, 85),
"burlywood4" },
130 {
QRGB( 95,158,160),
"cadetblue" },
131 {
QRGB(152,245,255),
"cadetblue1" },
132 {
QRGB(142,229,238),
"cadetblue2" },
133 {
QRGB(122,197,205),
"cadetblue3" },
134 {
QRGB( 83,134,139),
"cadetblue4" },
135 {
QRGB(127,255, 0),
"chartreuse" },
136 {
QRGB(127,255, 0),
"chartreuse1" },
137 {
QRGB(118,238, 0),
"chartreuse2" },
138 {
QRGB(102,205, 0),
"chartreuse3" },
139 {
QRGB( 69,139, 0),
"chartreuse4" },
140 {
QRGB(210,105, 30),
"chocolate" },
141 {
QRGB(255,127, 36),
"chocolate1" },
142 {
QRGB(238,118, 33),
"chocolate2" },
143 {
QRGB(205,102, 29),
"chocolate3" },
144 {
QRGB(139, 69, 19),
"chocolate4" },
145 {
QRGB(255,127, 80),
"coral" },
146 {
QRGB(255,114, 86),
"coral1" },
147 {
QRGB(238,106, 80),
"coral2" },
148 {
QRGB(205, 91, 69),
"coral3" },
149 {
QRGB(139, 62, 47),
"coral4" },
150 {
QRGB(100,149,237),
"cornflowerblue" },
151 {
QRGB(255,248,220),
"cornsilk" },
152 {
QRGB(255,248,220),
"cornsilk1" },
153 {
QRGB(238,232,205),
"cornsilk2" },
154 {
QRGB(205,200,177),
"cornsilk3" },
155 {
QRGB(139,136,120),
"cornsilk4" },
156 {
QRGB( 0,255,255),
"cyan" },
157 {
QRGB( 0,255,255),
"cyan1" },
158 {
QRGB( 0,238,238),
"cyan2" },
159 {
QRGB( 0,205,205),
"cyan3" },
160 {
QRGB( 0,139,139),
"cyan4" },
161 {
QRGB( 0, 0,139),
"darkblue" },
162 {
QRGB( 0,139,139),
"darkcyan" },
163 {
QRGB(184,134, 11),
"darkgoldenrod" },
164 {
QRGB(255,185, 15),
"darkgoldenrod1" },
165 {
QRGB(238,173, 14),
"darkgoldenrod2" },
166 {
QRGB(205,149, 12),
"darkgoldenrod3" },
167 {
QRGB(139,101, 8),
"darkgoldenrod4" },
168 {
QRGB(169,169,169),
"darkgray" },
169 {
QRGB( 0,100, 0),
"darkgreen" },
170 {
QRGB(169,169,169),
"darkgrey" },
171 {
QRGB(189,183,107),
"darkkhaki" },
172 {
QRGB(139, 0,139),
"darkmagenta" },
173 {
QRGB( 85,107, 47),
"darkolivegreen" },
174 {
QRGB(202,255,112),
"darkolivegreen1" },
175 {
QRGB(188,238,104),
"darkolivegreen2" },
176 {
QRGB(162,205, 90),
"darkolivegreen3" },
177 {
QRGB(110,139, 61),
"darkolivegreen4" },
178 {
QRGB(255,140, 0),
"darkorange" },
179 {
QRGB(255,127, 0),
"darkorange1" },
180 {
QRGB(238,118, 0),
"darkorange2" },
181 {
QRGB(205,102, 0),
"darkorange3" },
182 {
QRGB(139, 69, 0),
"darkorange4" },
183 {
QRGB(153, 50,204),
"darkorchid" },
184 {
QRGB(191, 62,255),
"darkorchid1" },
185 {
QRGB(178, 58,238),
"darkorchid2" },
186 {
QRGB(154, 50,205),
"darkorchid3" },
187 {
QRGB(104, 34,139),
"darkorchid4" },
188 {
QRGB(139, 0, 0),
"darkred" },
189 {
QRGB(233,150,122),
"darksalmon" },
190 {
QRGB(143,188,143),
"darkseagreen" },
191 {
QRGB(193,255,193),
"darkseagreen1" },
192 {
QRGB(180,238,180),
"darkseagreen2" },
193 {
QRGB(155,205,155),
"darkseagreen3" },
194 {
QRGB(105,139,105),
"darkseagreen4" },
195 {
QRGB( 72, 61,139),
"darkslateblue" },
196 {
QRGB( 47, 79, 79),
"darkslategray" },
197 {
QRGB(151,255,255),
"darkslategray1" },
198 {
QRGB(141,238,238),
"darkslategray2" },
199 {
QRGB(121,205,205),
"darkslategray3" },
200 {
QRGB( 82,139,139),
"darkslategray4" },
201 {
QRGB( 47, 79, 79),
"darkslategrey" },
202 {
QRGB( 0,206,209),
"darkturquoise" },
203 {
QRGB(148, 0,211),
"darkviolet" },
204 {
QRGB(255, 20,147),
"deeppink" },
205 {
QRGB(255, 20,147),
"deeppink1" },
206 {
QRGB(238, 18,137),
"deeppink2" },
207 {
QRGB(205, 16,118),
"deeppink3" },
208 {
QRGB(139, 10, 80),
"deeppink4" },
209 {
QRGB( 0,191,255),
"deepskyblue" },
210 {
QRGB( 0,191,255),
"deepskyblue1" },
211 {
QRGB( 0,178,238),
"deepskyblue2" },
212 {
QRGB( 0,154,205),
"deepskyblue3" },
213 {
QRGB( 0,104,139),
"deepskyblue4" },
214 {
QRGB(105,105,105),
"dimgray" },
215 {
QRGB(105,105,105),
"dimgrey" },
216 {
QRGB( 30,144,255),
"dodgerblue" },
217 {
QRGB( 30,144,255),
"dodgerblue1" },
218 {
QRGB( 28,134,238),
"dodgerblue2" },
219 {
QRGB( 24,116,205),
"dodgerblue3" },
220 {
QRGB( 16, 78,139),
"dodgerblue4" },
221 {
QRGB(178, 34, 34),
"firebrick" },
222 {
QRGB(255, 48, 48),
"firebrick1" },
223 {
QRGB(238, 44, 44),
"firebrick2" },
224 {
QRGB(205, 38, 38),
"firebrick3" },
225 {
QRGB(139, 26, 26),
"firebrick4" },
226 {
QRGB(255,250,240),
"floralwhite" },
227 {
QRGB( 34,139, 34),
"forestgreen" },
228 {
QRGB(220,220,220),
"gainsboro" },
229 {
QRGB(248,248,255),
"ghostwhite" },
230 {
QRGB(255,215, 0),
"gold" },
231 {
QRGB(255,215, 0),
"gold1" },
232 {
QRGB(238,201, 0),
"gold2" },
233 {
QRGB(205,173, 0),
"gold3" },
234 {
QRGB(139,117, 0),
"gold4" },
235 {
QRGB(218,165, 32),
"goldenrod" },
236 {
QRGB(255,193, 37),
"goldenrod1" },
237 {
QRGB(238,180, 34),
"goldenrod2" },
238 {
QRGB(205,155, 29),
"goldenrod3" },
239 {
QRGB(139,105, 20),
"goldenrod4" },
240 {
QRGB(190,190,190),
"gray" },
241 {
QRGB( 0, 0, 0),
"gray0" },
242 {
QRGB( 3, 3, 3),
"gray1" },
243 {
QRGB( 26, 26, 26),
"gray10" },
244 {
QRGB(255,255,255),
"gray100" },
245 {
QRGB( 28, 28, 28),
"gray11" },
246 {
QRGB( 31, 31, 31),
"gray12" },
247 {
QRGB( 33, 33, 33),
"gray13" },
248 {
QRGB( 36, 36, 36),
"gray14" },
249 {
QRGB( 38, 38, 38),
"gray15" },
250 {
QRGB( 41, 41, 41),
"gray16" },
251 {
QRGB( 43, 43, 43),
"gray17" },
252 {
QRGB( 46, 46, 46),
"gray18" },
253 {
QRGB( 48, 48, 48),
"gray19" },
254 {
QRGB( 5, 5, 5),
"gray2" },
255 {
QRGB( 51, 51, 51),
"gray20" },
256 {
QRGB( 54, 54, 54),
"gray21" },
257 {
QRGB( 56, 56, 56),
"gray22" },
258 {
QRGB( 59, 59, 59),
"gray23" },
259 {
QRGB( 61, 61, 61),
"gray24" },
260 {
QRGB( 64, 64, 64),
"gray25" },
261 {
QRGB( 66, 66, 66),
"gray26" },
262 {
QRGB( 69, 69, 69),
"gray27" },
263 {
QRGB( 71, 71, 71),
"gray28" },
264 {
QRGB( 74, 74, 74),
"gray29" },
265 {
QRGB( 8, 8, 8),
"gray3" },
266 {
QRGB( 77, 77, 77),
"gray30" },
267 {
QRGB( 79, 79, 79),
"gray31" },
268 {
QRGB( 82, 82, 82),
"gray32" },
269 {
QRGB( 84, 84, 84),
"gray33" },
270 {
QRGB( 87, 87, 87),
"gray34" },
271 {
QRGB( 89, 89, 89),
"gray35" },
272 {
QRGB( 92, 92, 92),
"gray36" },
273 {
QRGB( 94, 94, 94),
"gray37" },
274 {
QRGB( 97, 97, 97),
"gray38" },
275 {
QRGB( 99, 99, 99),
"gray39" },
276 {
QRGB( 10, 10, 10),
"gray4" },
277 {
QRGB(102,102,102),
"gray40" },
278 {
QRGB(105,105,105),
"gray41" },
279 {
QRGB(107,107,107),
"gray42" },
280 {
QRGB(110,110,110),
"gray43" },
281 {
QRGB(112,112,112),
"gray44" },
282 {
QRGB(115,115,115),
"gray45" },
283 {
QRGB(117,117,117),
"gray46" },
284 {
QRGB(120,120,120),
"gray47" },
285 {
QRGB(122,122,122),
"gray48" },
286 {
QRGB(125,125,125),
"gray49" },
287 {
QRGB( 13, 13, 13),
"gray5" },
288 {
QRGB(127,127,127),
"gray50" },
289 {
QRGB(130,130,130),
"gray51" },
290 {
QRGB(133,133,133),
"gray52" },
291 {
QRGB(135,135,135),
"gray53" },
292 {
QRGB(138,138,138),
"gray54" },
293 {
QRGB(140,140,140),
"gray55" },
294 {
QRGB(143,143,143),
"gray56" },
295 {
QRGB(145,145,145),
"gray57" },
296 {
QRGB(148,148,148),
"gray58" },
297 {
QRGB(150,150,150),
"gray59" },
298 {
QRGB( 15, 15, 15),
"gray6" },
299 {
QRGB(153,153,153),
"gray60" },
300 {
QRGB(156,156,156),
"gray61" },
301 {
QRGB(158,158,158),
"gray62" },
302 {
QRGB(161,161,161),
"gray63" },
303 {
QRGB(163,163,163),
"gray64" },
304 {
QRGB(166,166,166),
"gray65" },
305 {
QRGB(168,168,168),
"gray66" },
306 {
QRGB(171,171,171),
"gray67" },
307 {
QRGB(173,173,173),
"gray68" },
308 {
QRGB(176,176,176),
"gray69" },
309 {
QRGB( 18, 18, 18),
"gray7" },
310 {
QRGB(179,179,179),
"gray70" },
311 {
QRGB(181,181,181),
"gray71" },
312 {
QRGB(184,184,184),
"gray72" },
313 {
QRGB(186,186,186),
"gray73" },
314 {
QRGB(189,189,189),
"gray74" },
315 {
QRGB(191,191,191),
"gray75" },
316 {
QRGB(194,194,194),
"gray76" },
317 {
QRGB(196,196,196),
"gray77" },
318 {
QRGB(199,199,199),
"gray78" },
319 {
QRGB(201,201,201),
"gray79" },
320 {
QRGB( 20, 20, 20),
"gray8" },
321 {
QRGB(204,204,204),
"gray80" },
322 {
QRGB(207,207,207),
"gray81" },
323 {
QRGB(209,209,209),
"gray82" },
324 {
QRGB(212,212,212),
"gray83" },
325 {
QRGB(214,214,214),
"gray84" },
326 {
QRGB(217,217,217),
"gray85" },
327 {
QRGB(219,219,219),
"gray86" },
328 {
QRGB(222,222,222),
"gray87" },
329 {
QRGB(224,224,224),
"gray88" },
330 {
QRGB(227,227,227),
"gray89" },
331 {
QRGB( 23, 23, 23),
"gray9" },
332 {
QRGB(229,229,229),
"gray90" },
333 {
QRGB(232,232,232),
"gray91" },
334 {
QRGB(235,235,235),
"gray92" },
335 {
QRGB(237,237,237),
"gray93" },
336 {
QRGB(240,240,240),
"gray94" },
337 {
QRGB(242,242,242),
"gray95" },
338 {
QRGB(245,245,245),
"gray96" },
339 {
QRGB(247,247,247),
"gray97" },
340 {
QRGB(250,250,250),
"gray98" },
341 {
QRGB(252,252,252),
"gray99" },
342 {
QRGB( 0,255, 0),
"green" },
343 {
QRGB( 0,255, 0),
"green1" },
344 {
QRGB( 0,238, 0),
"green2" },
345 {
QRGB( 0,205, 0),
"green3" },
346 {
QRGB( 0,139, 0),
"green4" },
347 {
QRGB(173,255, 47),
"greenyellow" },
348 {
QRGB(190,190,190),
"grey" },
349 {
QRGB( 0, 0, 0),
"grey0" },
350 {
QRGB( 3, 3, 3),
"grey1" },
351 {
QRGB( 26, 26, 26),
"grey10" },
352 {
QRGB(255,255,255),
"grey100" },
353 {
QRGB( 28, 28, 28),
"grey11" },
354 {
QRGB( 31, 31, 31),
"grey12" },
355 {
QRGB( 33, 33, 33),
"grey13" },
356 {
QRGB( 36, 36, 36),
"grey14" },
357 {
QRGB( 38, 38, 38),
"grey15" },
358 {
QRGB( 41, 41, 41),
"grey16" },
359 {
QRGB( 43, 43, 43),
"grey17" },
360 {
QRGB( 46, 46, 46),
"grey18" },
361 {
QRGB( 48, 48, 48),
"grey19" },
362 {
QRGB( 5, 5, 5),
"grey2" },
363 {
QRGB( 51, 51, 51),
"grey20" },
364 {
QRGB( 54, 54, 54),
"grey21" },
365 {
QRGB( 56, 56, 56),
"grey22" },
366 {
QRGB( 59, 59, 59),
"grey23" },
367 {
QRGB( 61, 61, 61),
"grey24" },
368 {
QRGB( 64, 64, 64),
"grey25" },
369 {
QRGB( 66, 66, 66),
"grey26" },
370 {
QRGB( 69, 69, 69),
"grey27" },
371 {
QRGB( 71, 71, 71),
"grey28" },
372 {
QRGB( 74, 74, 74),
"grey29" },
373 {
QRGB( 8, 8, 8),
"grey3" },
374 {
QRGB( 77, 77, 77),
"grey30" },
375 {
QRGB( 79, 79, 79),
"grey31" },
376 {
QRGB( 82, 82, 82),
"grey32" },
377 {
QRGB( 84, 84, 84),
"grey33" },
378 {
QRGB( 87, 87, 87),
"grey34" },
379 {
QRGB( 89, 89, 89),
"grey35" },
380 {
QRGB( 92, 92, 92),
"grey36" },
381 {
QRGB( 94, 94, 94),
"grey37" },
382 {
QRGB( 97, 97, 97),
"grey38" },
383 {
QRGB( 99, 99, 99),
"grey39" },
384 {
QRGB( 10, 10, 10),
"grey4" },
385 {
QRGB(102,102,102),
"grey40" },
386 {
QRGB(105,105,105),
"grey41" },
387 {
QRGB(107,107,107),
"grey42" },
388 {
QRGB(110,110,110),
"grey43" },
389 {
QRGB(112,112,112),
"grey44" },
390 {
QRGB(115,115,115),
"grey45" },
391 {
QRGB(117,117,117),
"grey46" },
392 {
QRGB(120,120,120),
"grey47" },
393 {
QRGB(122,122,122),
"grey48" },
394 {
QRGB(125,125,125),
"grey49" },
395 {
QRGB( 13, 13, 13),
"grey5" },
396 {
QRGB(127,127,127),
"grey50" },
397 {
QRGB(130,130,130),
"grey51" },
398 {
QRGB(133,133,133),
"grey52" },
399 {
QRGB(135,135,135),
"grey53" },
400 {
QRGB(138,138,138),
"grey54" },
401 {
QRGB(140,140,140),
"grey55" },
402 {
QRGB(143,143,143),
"grey56" },
403 {
QRGB(145,145,145),
"grey57" },
404 {
QRGB(148,148,148),
"grey58" },
405 {
QRGB(150,150,150),
"grey59" },
406 {
QRGB( 15, 15, 15),
"grey6" },
407 {
QRGB(153,153,153),
"grey60" },
408 {
QRGB(156,156,156),
"grey61" },
409 {
QRGB(158,158,158),
"grey62" },
410 {
QRGB(161,161,161),
"grey63" },
411 {
QRGB(163,163,163),
"grey64" },
412 {
QRGB(166,166,166),
"grey65" },
413 {
QRGB(168,168,168),
"grey66" },
414 {
QRGB(171,171,171),
"grey67" },
415 {
QRGB(173,173,173),
"grey68" },
416 {
QRGB(176,176,176),
"grey69" },
417 {
QRGB( 18, 18, 18),
"grey7" },
418 {
QRGB(179,179,179),
"grey70" },
419 {
QRGB(181,181,181),
"grey71" },
420 {
QRGB(184,184,184),
"grey72" },
421 {
QRGB(186,186,186),
"grey73" },
422 {
QRGB(189,189,189),
"grey74" },
423 {
QRGB(191,191,191),
"grey75" },
424 {
QRGB(194,194,194),
"grey76" },
425 {
QRGB(196,196,196),
"grey77" },
426 {
QRGB(199,199,199),
"grey78" },
427 {
QRGB(201,201,201),
"grey79" },
428 {
QRGB( 20, 20, 20),
"grey8" },
429 {
QRGB(204,204,204),
"grey80" },
430 {
QRGB(207,207,207),
"grey81" },
431 {
QRGB(209,209,209),
"grey82" },
432 {
QRGB(212,212,212),
"grey83" },
433 {
QRGB(214,214,214),
"grey84" },
434 {
QRGB(217,217,217),
"grey85" },
435 {
QRGB(219,219,219),
"grey86" },
436 {
QRGB(222,222,222),
"grey87" },
437 {
QRGB(224,224,224),
"grey88" },
438 {
QRGB(227,227,227),
"grey89" },
439 {
QRGB( 23, 23, 23),
"grey9" },
440 {
QRGB(229,229,229),
"grey90" },
441 {
QRGB(232,232,232),
"grey91" },
442 {
QRGB(235,235,235),
"grey92" },
443 {
QRGB(237,237,237),
"grey93" },
444 {
QRGB(240,240,240),
"grey94" },
445 {
QRGB(242,242,242),
"grey95" },
446 {
QRGB(245,245,245),
"grey96" },
447 {
QRGB(247,247,247),
"grey97" },
448 {
QRGB(250,250,250),
"grey98" },
449 {
QRGB(252,252,252),
"grey99" },
450 {
QRGB(240,255,240),
"honeydew" },
451 {
QRGB(240,255,240),
"honeydew1" },
452 {
QRGB(224,238,224),
"honeydew2" },
453 {
QRGB(193,205,193),
"honeydew3" },
454 {
QRGB(131,139,131),
"honeydew4" },
455 {
QRGB(255,105,180),
"hotpink" },
456 {
QRGB(255,110,180),
"hotpink1" },
457 {
QRGB(238,106,167),
"hotpink2" },
458 {
QRGB(205, 96,144),
"hotpink3" },
459 {
QRGB(139, 58, 98),
"hotpink4" },
460 {
QRGB(205, 92, 92),
"indianred" },
461 {
QRGB(255,106,106),
"indianred1" },
462 {
QRGB(238, 99, 99),
"indianred2" },
463 {
QRGB(205, 85, 85),
"indianred3" },
464 {
QRGB(139, 58, 58),
"indianred4" },
465 {
QRGB(255,255,240),
"ivory" },
466 {
QRGB(255,255,240),
"ivory1" },
467 {
QRGB(238,238,224),
"ivory2" },
468 {
QRGB(205,205,193),
"ivory3" },
469 {
QRGB(139,139,131),
"ivory4" },
470 {
QRGB(240,230,140),
"khaki" },
471 {
QRGB(255,246,143),
"khaki1" },
472 {
QRGB(238,230,133),
"khaki2" },
473 {
QRGB(205,198,115),
"khaki3" },
474 {
QRGB(139,134, 78),
"khaki4" },
475 {
QRGB(230,230,250),
"lavender" },
476 {
QRGB(255,240,245),
"lavenderblush" },
477 {
QRGB(255,240,245),
"lavenderblush1" },
478 {
QRGB(238,224,229),
"lavenderblush2" },
479 {
QRGB(205,193,197),
"lavenderblush3" },
480 {
QRGB(139,131,134),
"lavenderblush4" },
481 {
QRGB(124,252, 0),
"lawngreen" },
482 {
QRGB(255,250,205),
"lemonchiffon" },
483 {
QRGB(255,250,205),
"lemonchiffon1" },
484 {
QRGB(238,233,191),
"lemonchiffon2" },
485 {
QRGB(205,201,165),
"lemonchiffon3" },
486 {
QRGB(139,137,112),
"lemonchiffon4" },
487 {
QRGB(173,216,230),
"lightblue" },
488 {
QRGB(191,239,255),
"lightblue1" },
489 {
QRGB(178,223,238),
"lightblue2" },
490 {
QRGB(154,192,205),
"lightblue3" },
491 {
QRGB(104,131,139),
"lightblue4" },
492 {
QRGB(240,128,128),
"lightcoral" },
493 {
QRGB(224,255,255),
"lightcyan" },
494 {
QRGB(224,255,255),
"lightcyan1" },
495 {
QRGB(209,238,238),
"lightcyan2" },
496 {
QRGB(180,205,205),
"lightcyan3" },
497 {
QRGB(122,139,139),
"lightcyan4" },
498 {
QRGB(238,221,130),
"lightgoldenrod" },
499 {
QRGB(255,236,139),
"lightgoldenrod1" },
500 {
QRGB(238,220,130),
"lightgoldenrod2" },
501 {
QRGB(205,190,112),
"lightgoldenrod3" },
502 {
QRGB(139,129, 76),
"lightgoldenrod4" },
503 {
QRGB(250,250,210),
"lightgoldenrodyellow" },
504 {
QRGB(211,211,211),
"lightgray" },
505 {
QRGB(144,238,144),
"lightgreen" },
506 {
QRGB(211,211,211),
"lightgrey" },
507 {
QRGB(255,182,193),
"lightpink" },
508 {
QRGB(255,174,185),
"lightpink1" },
509 {
QRGB(238,162,173),
"lightpink2" },
510 {
QRGB(205,140,149),
"lightpink3" },
511 {
QRGB(139, 95,101),
"lightpink4" },
512 {
QRGB(255,160,122),
"lightsalmon" },
513 {
QRGB(255,160,122),
"lightsalmon1" },
514 {
QRGB(238,149,114),
"lightsalmon2" },
515 {
QRGB(205,129, 98),
"lightsalmon3" },
516 {
QRGB(139, 87, 66),
"lightsalmon4" },
517 {
QRGB( 32,178,170),
"lightseagreen" },
518 {
QRGB(135,206,250),
"lightskyblue" },
519 {
QRGB(176,226,255),
"lightskyblue1" },
520 {
QRGB(164,211,238),
"lightskyblue2" },
521 {
QRGB(141,182,205),
"lightskyblue3" },
522 {
QRGB( 96,123,139),
"lightskyblue4" },
523 {
QRGB(132,112,255),
"lightslateblue" },
524 {
QRGB(119,136,153),
"lightslategray" },
525 {
QRGB(119,136,153),
"lightslategrey" },
526 {
QRGB(176,196,222),
"lightsteelblue" },
527 {
QRGB(202,225,255),
"lightsteelblue1" },
528 {
QRGB(188,210,238),
"lightsteelblue2" },
529 {
QRGB(162,181,205),
"lightsteelblue3" },
530 {
QRGB(110,123,139),
"lightsteelblue4" },
531 {
QRGB(255,255,224),
"lightyellow" },
532 {
QRGB(255,255,224),
"lightyellow1" },
533 {
QRGB(238,238,209),
"lightyellow2" },
534 {
QRGB(205,205,180),
"lightyellow3" },
535 {
QRGB(139,139,122),
"lightyellow4" },
536 {
QRGB( 50,205, 50),
"limegreen" },
537 {
QRGB(250,240,230),
"linen" },
538 {
QRGB(255, 0,255),
"magenta" },
539 {
QRGB(255, 0,255),
"magenta1" },
540 {
QRGB(238, 0,238),
"magenta2" },
541 {
QRGB(205, 0,205),
"magenta3" },
542 {
QRGB(139, 0,139),
"magenta4" },
543 {
QRGB(176, 48, 96),
"maroon" },
544 {
QRGB(255, 52,179),
"maroon1" },
545 {
QRGB(238, 48,167),
"maroon2" },
546 {
QRGB(205, 41,144),
"maroon3" },
547 {
QRGB(139, 28, 98),
"maroon4" },
548 {
QRGB(102,205,170),
"mediumaquamarine" },
549 {
QRGB( 0, 0,205),
"mediumblue" },
550 {
QRGB(186, 85,211),
"mediumorchid" },
551 {
QRGB(224,102,255),
"mediumorchid1" },
552 {
QRGB(209, 95,238),
"mediumorchid2" },
553 {
QRGB(180, 82,205),
"mediumorchid3" },
554 {
QRGB(122, 55,139),
"mediumorchid4" },
555 {
QRGB(147,112,219),
"mediumpurple" },
556 {
QRGB(171,130,255),
"mediumpurple1" },
557 {
QRGB(159,121,238),
"mediumpurple2" },
558 {
QRGB(137,104,205),
"mediumpurple3" },
559 {
QRGB( 93, 71,139),
"mediumpurple4" },
560 {
QRGB( 60,179,113),
"mediumseagreen" },
561 {
QRGB(123,104,238),
"mediumslateblue" },
562 {
QRGB( 0,250,154),
"mediumspringgreen" },
563 {
QRGB( 72,209,204),
"mediumturquoise" },
564 {
QRGB(199, 21,133),
"mediumvioletred" },
565 {
QRGB( 25, 25,112),
"midnightblue" },
566 {
QRGB(245,255,250),
"mintcream" },
567 {
QRGB(255,228,225),
"mistyrose" },
568 {
QRGB(255,228,225),
"mistyrose1" },
569 {
QRGB(238,213,210),
"mistyrose2" },
570 {
QRGB(205,183,181),
"mistyrose3" },
571 {
QRGB(139,125,123),
"mistyrose4" },
572 {
QRGB(255,228,181),
"moccasin" },
573 {
QRGB(255,222,173),
"navajowhite" },
574 {
QRGB(255,222,173),
"navajowhite1" },
575 {
QRGB(238,207,161),
"navajowhite2" },
576 {
QRGB(205,179,139),
"navajowhite3" },
577 {
QRGB(139,121, 94),
"navajowhite4" },
578 {
QRGB( 0, 0,128),
"navy" },
579 {
QRGB( 0, 0,128),
"navyblue" },
580 {
QRGB(253,245,230),
"oldlace" },
581 {
QRGB(107,142, 35),
"olivedrab" },
582 {
QRGB(192,255, 62),
"olivedrab1" },
583 {
QRGB(179,238, 58),
"olivedrab2" },
584 {
QRGB(154,205, 50),
"olivedrab3" },
585 {
QRGB(105,139, 34),
"olivedrab4" },
586 {
QRGB(255,165, 0),
"orange" },
587 {
QRGB(255,165, 0),
"orange1" },
588 {
QRGB(238,154, 0),
"orange2" },
589 {
QRGB(205,133, 0),
"orange3" },
590 {
QRGB(139, 90, 0),
"orange4" },
591 {
QRGB(255, 69, 0),
"orangered" },
592 {
QRGB(255, 69, 0),
"orangered1" },
593 {
QRGB(238, 64, 0),
"orangered2" },
594 {
QRGB(205, 55, 0),
"orangered3" },
595 {
QRGB(139, 37, 0),
"orangered4" },
596 {
QRGB(218,112,214),
"orchid" },
597 {
QRGB(255,131,250),
"orchid1" },
598 {
QRGB(238,122,233),
"orchid2" },
599 {
QRGB(205,105,201),
"orchid3" },
600 {
QRGB(139, 71,137),
"orchid4" },
601 {
QRGB(238,232,170),
"palegoldenrod" },
602 {
QRGB(152,251,152),
"palegreen" },
603 {
QRGB(154,255,154),
"palegreen1" },
604 {
QRGB(144,238,144),
"palegreen2" },
605 {
QRGB(124,205,124),
"palegreen3" },
606 {
QRGB( 84,139, 84),
"palegreen4" },
607 {
QRGB(175,238,238),
"paleturquoise" },
608 {
QRGB(187,255,255),
"paleturquoise1" },
609 {
QRGB(174,238,238),
"paleturquoise2" },
610 {
QRGB(150,205,205),
"paleturquoise3" },
611 {
QRGB(102,139,139),
"paleturquoise4" },
612 {
QRGB(219,112,147),
"palevioletred" },
613 {
QRGB(255,130,171),
"palevioletred1" },
614 {
QRGB(238,121,159),
"palevioletred2" },
615 {
QRGB(205,104,137),
"palevioletred3" },
616 {
QRGB(139, 71, 93),
"palevioletred4" },
617 {
QRGB(255,239,213),
"papayawhip" },
618 {
QRGB(255,218,185),
"peachpuff" },
619 {
QRGB(255,218,185),
"peachpuff1" },
620 {
QRGB(238,203,173),
"peachpuff2" },
621 {
QRGB(205,175,149),
"peachpuff3" },
622 {
QRGB(139,119,101),
"peachpuff4" },
623 {
QRGB(205,133, 63),
"peru" },
624 {
QRGB(255,192,203),
"pink" },
625 {
QRGB(255,181,197),
"pink1" },
626 {
QRGB(238,169,184),
"pink2" },
627 {
QRGB(205,145,158),
"pink3" },
628 {
QRGB(139, 99,108),
"pink4" },
629 {
QRGB(221,160,221),
"plum" },
630 {
QRGB(255,187,255),
"plum1" },
631 {
QRGB(238,174,238),
"plum2" },
632 {
QRGB(205,150,205),
"plum3" },
633 {
QRGB(139,102,139),
"plum4" },
634 {
QRGB(176,224,230),
"powderblue" },
635 {
QRGB(160, 32,240),
"purple" },
636 {
QRGB(155, 48,255),
"purple1" },
637 {
QRGB(145, 44,238),
"purple2" },
638 {
QRGB(125, 38,205),
"purple3" },
639 {
QRGB( 85, 26,139),
"purple4" },
640 {
QRGB(255, 0, 0),
"red" },
641 {
QRGB(255, 0, 0),
"red1" },
642 {
QRGB(238, 0, 0),
"red2" },
643 {
QRGB(205, 0, 0),
"red3" },
644 {
QRGB(139, 0, 0),
"red4" },
645 {
QRGB(188,143,143),
"rosybrown" },
646 {
QRGB(255,193,193),
"rosybrown1" },
647 {
QRGB(238,180,180),
"rosybrown2" },
648 {
QRGB(205,155,155),
"rosybrown3" },
649 {
QRGB(139,105,105),
"rosybrown4" },
650 {
QRGB( 65,105,225),
"royalblue" },
651 {
QRGB( 72,118,255),
"royalblue1" },
652 {
QRGB( 67,110,238),
"royalblue2" },
653 {
QRGB( 58, 95,205),
"royalblue3" },
654 {
QRGB( 39, 64,139),
"royalblue4" },
655 {
QRGB(139, 69, 19),
"saddlebrown" },
656 {
QRGB(250,128,114),
"salmon" },
657 {
QRGB(255,140,105),
"salmon1" },
658 {
QRGB(238,130, 98),
"salmon2" },
659 {
QRGB(205,112, 84),
"salmon3" },
660 {
QRGB(139, 76, 57),
"salmon4" },
661 {
QRGB(244,164, 96),
"sandybrown" },
662 {
QRGB( 46,139, 87),
"seagreen" },
663 {
QRGB( 84,255,159),
"seagreen1" },
664 {
QRGB( 78,238,148),
"seagreen2" },
665 {
QRGB( 67,205,128),
"seagreen3" },
666 {
QRGB( 46,139, 87),
"seagreen4" },
667 {
QRGB(255,245,238),
"seashell" },
668 {
QRGB(255,245,238),
"seashell1" },
669 {
QRGB(238,229,222),
"seashell2" },
670 {
QRGB(205,197,191),
"seashell3" },
671 {
QRGB(139,134,130),
"seashell4" },
672 {
QRGB(160, 82, 45),
"sienna" },
673 {
QRGB(255,130, 71),
"sienna1" },
674 {
QRGB(238,121, 66),
"sienna2" },
675 {
QRGB(205,104, 57),
"sienna3" },
676 {
QRGB(139, 71, 38),
"sienna4" },
677 {
QRGB(135,206,235),
"skyblue" },
678 {
QRGB(135,206,255),
"skyblue1" },
679 {
QRGB(126,192,238),
"skyblue2" },
680 {
QRGB(108,166,205),
"skyblue3" },
681 {
QRGB( 74,112,139),
"skyblue4" },
682 {
QRGB(106, 90,205),
"slateblue" },
683 {
QRGB(131,111,255),
"slateblue1" },
684 {
QRGB(122,103,238),
"slateblue2" },
685 {
QRGB(105, 89,205),
"slateblue3" },
686 {
QRGB( 71, 60,139),
"slateblue4" },
687 {
QRGB(112,128,144),
"slategray" },
688 {
QRGB(198,226,255),
"slategray1" },
689 {
QRGB(185,211,238),
"slategray2" },
690 {
QRGB(159,182,205),
"slategray3" },
691 {
QRGB(108,123,139),
"slategray4" },
692 {
QRGB(112,128,144),
"slategrey" },
693 {
QRGB(255,250,250),
"snow" },
694 {
QRGB(255,250,250),
"snow1" },
695 {
QRGB(238,233,233),
"snow2" },
696 {
QRGB(205,201,201),
"snow3" },
697 {
QRGB(139,137,137),
"snow4" },
698 {
QRGB( 0,255,127),
"springgreen" },
699 {
QRGB( 0,255,127),
"springgreen1" },
700 {
QRGB( 0,238,118),
"springgreen2" },
701 {
QRGB( 0,205,102),
"springgreen3" },
702 {
QRGB( 0,139, 69),
"springgreen4" },
703 {
QRGB( 70,130,180),
"steelblue" },
704 {
QRGB( 99,184,255),
"steelblue1" },
705 {
QRGB( 92,172,238),
"steelblue2" },
706 {
QRGB( 79,148,205),
"steelblue3" },
707 {
QRGB( 54,100,139),
"steelblue4" },
708 {
QRGB(210,180,140),
"tan" },
709 {
QRGB(255,165, 79),
"tan1" },
710 {
QRGB(238,154, 73),
"tan2" },
711 {
QRGB(205,133, 63),
"tan3" },
712 {
QRGB(139, 90, 43),
"tan4" },
713 {
QRGB(216,191,216),
"thistle" },
714 {
QRGB(255,225,255),
"thistle1" },
715 {
QRGB(238,210,238),
"thistle2" },
716 {
QRGB(205,181,205),
"thistle3" },
717 {
QRGB(139,123,139),
"thistle4" },
718 {
QRGB(255, 99, 71),
"tomato" },
719 {
QRGB(255, 99, 71),
"tomato1" },
720 {
QRGB(238, 92, 66),
"tomato2" },
721 {
QRGB(205, 79, 57),
"tomato3" },
722 {
QRGB(139, 54, 38),
"tomato4" },
723 {
QRGB( 64,224,208),
"turquoise" },
724 {
QRGB( 0,245,255),
"turquoise1" },
725 {
QRGB( 0,229,238),
"turquoise2" },
726 {
QRGB( 0,197,205),
"turquoise3" },
727 {
QRGB( 0,134,139),
"turquoise4" },
728 {
QRGB(238,130,238),
"violet" },
729 {
QRGB(208, 32,144),
"violetred" },
730 {
QRGB(255, 62,150),
"violetred1" },
731 {
QRGB(238, 58,140),
"violetred2" },
732 {
QRGB(205, 50,120),
"violetred3" },
733 {
QRGB(139, 34, 82),
"violetred4" },
734 {
QRGB(245,222,179),
"wheat" },
735 {
QRGB(255,231,186),
"wheat1" },
736 {
QRGB(238,216,174),
"wheat2" },
737 {
QRGB(205,186,150),
"wheat3" },
738 {
QRGB(139,126,102),
"wheat4" },
739 {
QRGB(255,255,255),
"white" },
740 {
QRGB(245,245,245),
"whitesmoke" },
741 {
QRGB(255,255, 0),
"yellow" },
742 {
QRGB(255,255, 0),
"yellow1" },
743 {
QRGB(238,238, 0),
"yellow2" },
744 {
QRGB(205,205, 0),
"yellow3" },
745 {
QRGB(139,139, 0),
"yellow4" },
746 {
QRGB(154,205, 50),
"yellowgreen" } };
795 buf = source[index++];
800 bool gotQuote =
false;
813 if (state.
at(offset++) ==
'"')
816 char c = state.
at(offset++);
830 return prefix ==
"c" ||
841 int *cpp,
int *ncols,
int *w,
int *h)
848 #if defined(_MSC_VER) && _MSC_VER >= 1400 && !defined(Q_OS_WINCE) 849 if (sscanf_s(buf,
"%d %d %d %d", w, h, ncols, cpp) < 4)
851 if (sscanf(buf,
"%d %d %d %d", w, h, ncols, cpp) < 4)
862 int cpp,
int ncols,
int w,
int h,
QImage& image)
867 if (cpp < 0 || cpp > 15)
885 bool hasTransparency =
false;
887 for(currentColor=0; currentColor < ncols; ++currentColor) {
889 qWarning(
"QImage: XPM color specification missing");
893 index = buf.
left(cpp);
912 qWarning(
"QImage: XPM color value is missing from specification: %s", buf.
constData());
917 hasTransparency =
true;
918 int transparentColor = currentColor;
920 image.
setColor(transparentColor, 0);
927 if (((buf.
length()-1) % 3) && (buf[0] ==
'#')) {
936 image.
setColor(currentColor, 0xff000000 | c_rgb);
949 image =
QImage(w, h, format);
956 for(
int y=0; y<h; y++) {
958 qWarning(
"QImage: XPM pixels missing on image line %d", y);
961 if (image.
depth() == 8) {
969 for (x=0; x<w && d<
end; x++) {
976 for (x=0; x<w && d<
end; x++) {
977 memcpy(b, (
char *)d, cpp);
984 qWarning(
"QImage: XPM pixels missing on image line %d (possibly a C++ trigraph).", y);
994 for (x=0; x<w && d<
end; x++) {
995 memcpy(b, (
char *)d, cpp);
1001 qWarning(
"QImage: XPM pixels missing on image line %d (possibly a C++ trigraph).", y);
1002 memset(p, 0, (w - x)*4);
1009 for (
int i = state.
size() - 1; i >= 0; --i)
1012 while (device->
getChar(&c) && c !=
';') {}
1013 while (device->
getChar(&c) && c !=
'\n') {}
1033 int cpp, ncols, w, h,
index = 0;
1041 if (buf.
indexOf(
"/* XPM") != 0) {
1042 while (readBytes > 0) {
1050 if (!
read_xpm_header(device, source, index, state, &cpp, &ncols, &w, &h))
1053 return read_xpm_body(device, source, index, state, cpp, ncols, w, h, image);
1058 static char returnable[5];
1059 static const char code[] =
".#abcdefghijklmnopqrstuvwxyzABCD" 1060 "EFGHIJKLMNOPQRSTUVWXYZ0123456789";
1065 returnable[3] = code[index % 64];
1068 returnable[3] =
'\0';
1069 returnable[2] = code[index % 64];
1072 returnable[2] =
'\0';
1076 else if (index == 64*44+21)
1078 returnable[1] = code[index % 64];
1081 returnable[1] =
'\0';
1082 returnable[0] = code[
index];
1095 if (sourceImage.
depth() != 32)
1098 image = sourceImage;
1102 int w = image.
width(), h = image.
height(), ncolors = 0;
1106 for(y=0; y<h; y++) {
1108 for(x=0; x<w; x++) {
1109 QRgb color = *(yp + x);
1111 colorMap.
insert(color, ncolors++);
1117 for (
int k = 64; ncolors > k; k *= 64) {
1129 s <<
"/* XPM */" <<
endl 1130 <<
"static char *" <<
fbname(fileName) <<
"[]={" <<
endl 1131 <<
'\"' << w <<
' ' << h <<
' ' << ncolors <<
' ' << cpp <<
'\"';
1135 while (c != colorMap.
end()) {
1141 line.
sprintf(
"\"%s c #%02x%02x%02x\"",
1147 s <<
',' <<
endl << line;
1152 for(y=0; y<h; y++) {
1155 for(x=0; x<w; x++) {
1156 int color = (int)(*(yp + x));
1169 s <<
',' <<
endl <<
'\"' << line <<
'\"';
1176 : state(Ready),
index(0)
1224 qWarning(
"QXpmHandler::canRead() called with no device");
1229 if (device->
peek(head,
sizeof(head)) !=
sizeof(head))
1232 return qstrncmp(head,
"/* XPM", 6) == 0;
1249 return option ==
Name 1256 if (option ==
Name) {
1258 }
else if (option ==
Size) {
1295 #endif // QT_NO_IMAGEFORMAT_XPM The QVariant class acts like a union for the most common Qt data types.
Status status() const
Returns the status of the text stream.
const Key & key() const
Returns the current item's key as a const reference.
Format
The following image formats are available in Qt.
void setFormat(const QByteArray &format)
Sets the format of the QImageIOHandler to format.
QString & sprintf(const char *format,...)
Safely builds a formatted string from the format string cformat and an arbitrary list of arguments...
void truncate(int pos)
Truncates the byte array at index position pos.
static bool qt_get_named_xpm_rgb(const char *name_no_space, QRgb *rgb)
void setColor(int i, QRgb c)
Sets the color at the given index in the color table, to the given to colorValue. ...
#define QT_END_NAMESPACE
This macro expands to.
char * data()
Returns a pointer to the data stored in the byte array.
const QChar at(int i) const
Returns the character at the given index position in the string.
bool isWritable() const
Returns true if data can be written to the device; otherwise returns false.
The QRegExp class provides pattern matching using regular expressions.
ushort unicode() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Q_GUI_EXPORT_INLINE int qAlpha(QRgb rgb)
QByteArray & append(char c)
Appends the character ch to this byte array.
bool isNull() const
Returns true if it is a null image, otherwise returns false.
The QByteArray class provides an array of bytes.
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
int matchedLength() const
Returns the length of the last matched string, or -1 if there was no match.
bool getChar(char *c)
Reads one character from the device and stores it in c.
QByteArray toLower() const
Returns a lowercase copy of the byte array.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
Q_OUTOFLINE_TEMPLATE RandomAccessIterator qBinaryFind(RandomAccessIterator begin, RandomAccessIterator end, const T &value)
bool operator<(const char *name, const XPMRGBData &data)
void ungetChar(char c)
Puts the character c back into the device, and decrements the current position unless the position is...
The QString class provides a Unicode character string.
static const char * xpm_color_name(int cpp, int index)
static const int xpmRgbTblSize
Format format() const
Returns the format of the image.
Q_GUI_EXPORT_INLINE int qRed(QRgb rgb)
qint64 read(char *data, qint64 maxlen)
Reads at most maxSize bytes from the device into data, and returns the number of bytes read...
QByteArray simplified() const
Returns a byte array that has whitespace removed from the start and the end, and which has each seque...
void setColorCount(int)
Resizes the color table to contain colorCount entries.
bool qt_read_xpm_image_or_array(QIODevice *device, const char *const *source, QImage &image)
#define QT_BEGIN_NAMESPACE
This macro expands to.
static bool read_xpm_body(QIODevice *device, const char *const *source, int &index, QByteArray &state, int cpp, int ncols, int w, int h, QImage &image)
static bool is_xpm_color_spec_prefix(const QByteArray &prefix)
void truncate(int pos)
Truncates the string at the given position index.
int indexIn(const QString &str, int offset=0, CaretMode caretMode=CaretAtZero) const
Attempts to find a match in str from position offset (0 by default).
int size() const
Returns the number of characters in this string.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
ImageOption
This enum describes the different options supported by QImageIOHandler.
QByteArray trimmed() const
Returns a byte array that has whitespace removed from the start and the end.
const T & at(int i) const
Returns the item at index position i in the list.
qint64 peek(char *data, qint64 maxlen)
Reads at most maxSize bytes from the device into data, without side effects (i.
Q_CORE_EXPORT void qWarning(const char *,...)
The QImage class provides a hardware-independent image representation that allows direct access to th...
static const char * data(const QByteArray &arr)
int depth() const
Returns the depth of the image.
QByteArray left(int len) const
Returns a byte array that contains the leftmost len bytes of this byte array.
QByteArray mid(int index, int len=-1) const
Returns a byte array containing len bytes from this byte array, starting at position pos...
int indexOf(char c, int from=0) const
Returns the index position of the first occurrence of the character ch in the byte array...
Q_GUI_EXPORT_INLINE int qBlue(QRgb rgb)
bool write(const QImage &image)
Writes the image image to the assigned device.
QSize size() const
Returns the size of the image, i.
iterator begin()
Returns an STL-style iterator pointing to the first item in the map.
int length() const
Same as size().
const char * constData() const
Returns a pointer to the data stored in the byte array.
QString mid(int position, int n=-1) const Q_REQUIRED_RESULT
Returns a string that contains n characters of this string, starting at the specified position index...
QList< QByteArray > split(char sep) const
Splits the byte array into subarrays wherever sep occurs, and returns the list of those arrays...
int width() const
Returns the width of the image.
QImage convertToFormat(Format f, Qt::ImageConversionFlags flags=Qt::AutoColor) const Q_REQUIRED_RESULT
Returns a copy of the image in the given format.
int indexOf(const T &t, int from=0) const
Returns the index position of the first occurrence of value in the list, searching forward from index...
The QMap::iterator class provides an STL-style non-const iterator for QMap and QMultiMap.
The QTextStream class provides a convenient interface for reading and writing text.
qint64 readLine(char *data, qint64 maxlen)
This function reads a line of ASCII characters from the device, up to a maximum of maxSize - 1 bytes...
void clear()
Clears the contents of the string and makes it empty.
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the map...
int lastIndexOf(QChar c, int from=-1, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
QByteArray name() const
Use format() instead.
iterator insert(const Key &key, const T &value)
Inserts a new item with the key key and a value of value.
static const struct XPMRGBData xpmRgbTbl[]
int size() const
Returns the number of items in the list.
static QString fbname(const QString &fileName)
int qstrncmp(const char *str1, const char *str2, uint len)
bool canRead() const
Returns true if an image can be read from the device (i.
QIODevice * device() const
Returns the device currently assigned to the QImageIOHandler.
bool contains(const Key &key) const
Returns true if the map contains an item with key key; otherwise returns false.
bool supportsOption(ImageOption option) const
Returns true if the QImageIOHandler supports the option option; otherwise returns false...
int height() const
Returns the height of the image.
int size() const
Returns the number of bytes in this byte array.
static bool write_xpm_image(const QImage &sourceImage, QIODevice *device, const QString &fileName)
Q_GUI_EXPORT_INLINE int qGreen(QRgb rgb)
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
The QSize class defines the size of a two-dimensional object using integer point precision.
int qstrcmp(const QByteArray &str1, const char *str2)
QVariant option(ImageOption option) const
Returns the value assigned to option as a QVariant.
char at(int i) const
Returns the character at index position i in the byte array.
static const KeyPair *const end
The QIODevice class is the base interface class of all I/O devices in Qt.
static bool read_xpm_string(QByteArray &buf, QIODevice *d, const char *const *source, int &index, QByteArray &state)
static QString fileName(const QString &fileUrl)
void setOption(ImageOption option, const QVariant &value)
Sets the option option with the value value.
bool qt_get_hex_rgb(const char *name, QRgb *rgb)
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
bool read(QImage *image)
Read an image from the device, and stores it in image.
QByteArray & remove(int index, int len)
Removes len bytes from the array, starting at index position pos, and returns a reference to the arra...
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
The QMap class is a template class that provides a skip-list-based dictionary.
static quint64 xpmHash(const QString &str)
bool readImage(QImage *image)
Q_CORE_EXPORT QTextStream & endl(QTextStream &s)
#define forever
This macro is provided for convenience for writing infinite loops.
static bool read_xpm_header(QIODevice *device, const char *const *source, int &index, QByteArray &state, int *cpp, int *ncols, int *w, int *h)