qimage_conversions.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/gui/image/qimage_conversions.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5static const uchar bitflip[256] = {-
6 0, 128, 64, 192, 32, 160, 96, 224, 16, 144, 80, 208, 48, 176, 112, 240,-
7 8, 136, 72, 200, 40, 168, 104, 232, 24, 152, 88, 216, 56, 184, 120, 248,-
8 4, 132, 68, 196, 36, 164, 100, 228, 20, 148, 84, 212, 52, 180, 116, 244,-
9 12, 140, 76, 204, 44, 172, 108, 236, 28, 156, 92, 220, 60, 188, 124, 252,-
10 2, 130, 66, 194, 34, 162, 98, 226, 18, 146, 82, 210, 50, 178, 114, 242,-
11 10, 138, 74, 202, 42, 170, 106, 234, 26, 154, 90, 218, 58, 186, 122, 250,-
12 6, 134, 70, 198, 38, 166, 102, 230, 22, 150, 86, 214, 54, 182, 118, 246,-
13 14, 142, 78, 206, 46, 174, 110, 238, 30, 158, 94, 222, 62, 190, 126, 254,-
14 1, 129, 65, 193, 33, 161, 97, 225, 17, 145, 81, 209, 49, 177, 113, 241,-
15 9, 137, 73, 201, 41, 169, 105, 233, 25, 153, 89, 217, 57, 185, 121, 249,-
16 5, 133, 69, 197, 37, 165, 101, 229, 21, 149, 85, 213, 53, 181, 117, 245,-
17 13, 141, 77, 205, 45, 173, 109, 237, 29, 157, 93, 221, 61, 189, 125, 253,-
18 3, 131, 67, 195, 35, 163, 99, 227, 19, 147, 83, 211, 51, 179, 115, 243,-
19 11, 139, 75, 203, 43, 171, 107, 235, 27, 155, 91, 219, 59, 187, 123, 251,-
20 7, 135, 71, 199, 39, 167, 103, 231, 23, 151, 87, 215, 55, 183, 119, 247,-
21 15, 143, 79, 207, 47, 175, 111, 239, 31, 159, 95, 223, 63, 191, 127, 255-
22};-
23-
24const uchar *qt_get_bitflip_array()-
25{-
26 return
never executed: return bitflip;
bitflip;
never executed: return bitflip;
0
27}-
28-
29void qGamma_correct_back_to_linear_cs(QImage *image)-
30{-
31 const QDrawHelperGammaTables *tables = QGuiApplicationPrivate::instance()->gammaTables();-
32 if (!tables
!tablesDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
33 return;
never executed: return;
0
34 const uchar *gamma = tables->qt_pow_rgb_gamma;-
35-
36 int h = image->height();-
37 int w = image->width();-
38-
39 for (int y=0; y<h
y<hDescription
TRUEnever evaluated
FALSEnever evaluated
; ++y) {
0
40 uint *pixels = (uint *) image->scanLine(y);-
41 for (int x=0; x<w
x<wDescription
TRUEnever evaluated
FALSEnever evaluated
; ++x) {
0
42 uint p = pixels[x];-
43 uint r = gamma[qRed(p)];-
44 uint g = gamma[qGreen(p)];-
45 uint b = gamma[qBlue(p)];-
46 pixels[x] = (r << 16) | (g << 8) | b | 0xff000000;-
47 }
never executed: end of block
0
48 }
never executed: end of block
0
49}
never executed: end of block
0
50-
51-
52-
53-
54-
55-
56static const uint * convertRGB32FromARGB32PM(uint *buffer, const uint *src, int count,-
57 const QPixelLayout *, const QRgb *)-
58{-
59 for (int i = 0; i < count
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
60 buffer[i] = 0xff000000 | qUnpremultiply(src[i]);
never executed: buffer[i] = 0xff000000 | qUnpremultiply(src[i]);
0
61 return
never executed: return buffer;
buffer;
never executed: return buffer;
0
62}-
63-
64static const uint * convertRGB32ToARGB32PM(uint *buffer, const uint *src, int count,-
65 const QPixelLayout *, const QRgb *)-
66{-
67 for (int i = 0; i < count
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
68 buffer[i] = 0xff000000 |src[i];
never executed: buffer[i] = 0xff000000 |src[i];
0
69 return
never executed: return buffer;
buffer;
never executed: return buffer;
0
70}-
71-
72-
73extern const uint * convertRGB32FromARGB32PM_sse4(uint *buffer, const uint *src, int count, const QPixelLayout *, const QRgb *);-
74-
75-
76void convert_generic(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)-
77{-
78-
79 ((!(dest->format > QImage::Format_Indexed8)) ? qt_assert("dest->format > QImage::Format_Indexed8",__FILE__,133) : qt_noop());-
80 ((!(src->format > QImage::Format_Indexed8)) ? qt_assert("src->format > QImage::Format_Indexed8",__FILE__,134) : qt_noop());-
81 const int buffer_size = 2048;-
82 uint buffer[buffer_size];-
83 const QPixelLayout *srcLayout = &qPixelLayouts[src->format];-
84 const QPixelLayout *destLayout = &qPixelLayouts[dest->format];-
85 const uchar *srcData = src->data;-
86 uchar *destData = dest->data;-
87-
88 const FetchPixelsFunc fetch = qFetchPixels[srcLayout->bpp];-
89 const StorePixelsFunc store = qStorePixels[destLayout->bpp];-
90 ConvertFunc convertToARGB32PM = srcLayout->convertToARGB32PM;-
91 ConvertFunc convertFromARGB32PM = destLayout->convertFromARGB32PM;-
92 if (srcLayout->alphaWidth == 0
srcLayout->alphaWidth == 0Description
TRUEnever evaluated
FALSEnever evaluated
&& destLayout->convertFromRGB32
destLayout->convertFromRGB32Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
93-
94 convertFromARGB32PM = destLayout->convertFromRGB32;-
95 }
never executed: end of block
else {
0
96 if (src->format == QImage::Format_RGB32
src->format ==...::Format_RGB32Description
TRUEnever evaluated
FALSEnever evaluated
)
0
97 convertToARGB32PM = convertRGB32ToARGB32PM;
never executed: convertToARGB32PM = convertRGB32ToARGB32PM;
0
98 if (dest->format == QImage::Format_RGB32
dest->format =...::Format_RGB32Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
99-
100 if (((
(qCompilerCpuF...eatureSSE4_1))Description
TRUEnever evaluated
FALSEnever evaluated
qCompilerCpuFeatures & (static_cast<unsigned long long>(1ULL) << CpuFeatureSSE4_1))
(qCompilerCpuF...eatureSSE4_1))Description
TRUEnever evaluated
FALSEnever evaluated
|| (
(qCpuFeatures(...eatureSSE4_1))Description
TRUEnever evaluated
FALSEnever evaluated
qCpuFeatures() & (static_cast<unsigned long long>(1ULL) << CpuFeatureSSE4_1))
(qCpuFeatures(...eatureSSE4_1))Description
TRUEnever evaluated
FALSEnever evaluated
))
0
101 convertFromARGB32PM = convertRGB32FromARGB32PM_sse4;
never executed: convertFromARGB32PM = convertRGB32FromARGB32PM_sse4;
0
102 else-
103-
104 convertFromARGB32PM = convertRGB32FromARGB32PM;
never executed: convertFromARGB32PM = convertRGB32FromARGB32PM;
0
105 }-
106 }
never executed: end of block
0
107-
108 for (int y = 0; y < src->height
y < src->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; ++y) {
0
109 int x = 0;-
110 while (x < src->width
x < src->widthDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
111 int l = qMin(src->width - x, buffer_size);-
112 const uint *ptr = fetch(buffer, srcData, x, l);-
113 ptr = convertToARGB32PM(buffer, ptr, l, srcLayout, 0);-
114 ptr = convertFromARGB32PM(buffer, ptr, l, destLayout, 0);-
115 store(destData, ptr, x, l);-
116 x += l;-
117 }
never executed: end of block
0
118 srcData += src->bytes_per_line;-
119 destData += dest->bytes_per_line;-
120 }
never executed: end of block
0
121}
never executed: end of block
0
122-
123bool convert_generic_inplace(QImageData *data, QImage::Format dst_format, Qt::ImageConversionFlags)-
124{-
125-
126 ((!(dst_format > QImage::Format_Indexed8)) ? qt_assert("dst_format > QImage::Format_Indexed8",__FILE__,180) : qt_noop());-
127 ((!(data->format > QImage::Format_Indexed8)) ? qt_assert("data->format > QImage::Format_Indexed8",__FILE__,181) : qt_noop());-
128 if (data->depth != qt_depthForFormat(dst_format)
data->depth !=...at(dst_format)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
129 return
never executed: return false;
false;
never executed: return false;
0
130-
131 const int buffer_size = 2048;-
132 uint buffer[buffer_size];-
133 const QPixelLayout *srcLayout = &qPixelLayouts[data->format];-
134 const QPixelLayout *destLayout = &qPixelLayouts[dst_format];-
135 uchar *srcData = data->data;-
136-
137 const FetchPixelsFunc fetch = qFetchPixels[srcLayout->bpp];-
138 const StorePixelsFunc store = qStorePixels[destLayout->bpp];-
139 ConvertFunc convertToARGB32PM = srcLayout->convertToARGB32PM;-
140 ConvertFunc convertFromARGB32PM = destLayout->convertFromARGB32PM;-
141 if (srcLayout->alphaWidth == 0
srcLayout->alphaWidth == 0Description
TRUEnever evaluated
FALSEnever evaluated
&& destLayout->convertFromRGB32
destLayout->convertFromRGB32Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
142-
143 convertFromARGB32PM = destLayout->convertFromRGB32;-
144 }
never executed: end of block
else {
0
145 if (data->format == QImage::Format_RGB32
data->format =...::Format_RGB32Description
TRUEnever evaluated
FALSEnever evaluated
)
0
146 convertToARGB32PM = convertRGB32ToARGB32PM;
never executed: convertToARGB32PM = convertRGB32ToARGB32PM;
0
147 if (dst_format == QImage::Format_RGB32
dst_format == ...::Format_RGB32Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
148-
149 if (((
(qCompilerCpuF...eatureSSE4_1))Description
TRUEnever evaluated
FALSEnever evaluated
qCompilerCpuFeatures & (static_cast<unsigned long long>(1ULL) << CpuFeatureSSE4_1))
(qCompilerCpuF...eatureSSE4_1))Description
TRUEnever evaluated
FALSEnever evaluated
|| (
(qCpuFeatures(...eatureSSE4_1))Description
TRUEnever evaluated
FALSEnever evaluated
qCpuFeatures() & (static_cast<unsigned long long>(1ULL) << CpuFeatureSSE4_1))
(qCpuFeatures(...eatureSSE4_1))Description
TRUEnever evaluated
FALSEnever evaluated
))
0
150 convertFromARGB32PM = convertRGB32FromARGB32PM_sse4;
never executed: convertFromARGB32PM = convertRGB32FromARGB32PM_sse4;
0
151 else-
152-
153 convertFromARGB32PM = convertRGB32FromARGB32PM;
never executed: convertFromARGB32PM = convertRGB32FromARGB32PM;
0
154 }-
155 }
never executed: end of block
0
156-
157 for (int y = 0; y < data->height
y < data->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; ++y) {
0
158 int x = 0;-
159 while (x < data->width
x < data->widthDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
160 int l = qMin(data->width - x, buffer_size);-
161 const uint *ptr = fetch(buffer, srcData, x, l);-
162 ptr = convertToARGB32PM(buffer, ptr, l, srcLayout, 0);-
163 ptr = convertFromARGB32PM(buffer, ptr, l, destLayout, 0);-
164-
165 if (srcData != (const uchar*)ptr
srcData != (const uchar*)ptrDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
166 store(srcData, ptr, x, l);
never executed: store(srcData, ptr, x, l);
0
167 x += l;-
168 }
never executed: end of block
0
169 srcData += data->bytes_per_line;-
170 }
never executed: end of block
0
171 data->format = dst_format;-
172 return
never executed: return true;
true;
never executed: return true;
0
173}-
174-
175static void convert_passthrough(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)-
176{-
177 ((!(src->width == dest->width)) ? qt_assert("src->width == dest->width",__FILE__,231) : qt_noop());-
178 ((!(src->height == dest->height)) ? qt_assert("src->height == dest->height",__FILE__,232) : qt_noop());-
179-
180 const int src_pad = (src->bytes_per_line >> 2) - src->width;-
181 const int dest_pad = (dest->bytes_per_line >> 2) - dest->width;-
182 const quint32 *src_data = (quint32 *) src->data;-
183 quint32 *dest_data = (quint32 *) dest->data;-
184-
185 for (int i = 0; i < src->height
i < src->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
186 const quint32 *end = src_data + src->width;-
187 while (src_data < end
src_data < endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
188 *dest_data = *src_data;-
189 ++src_data;-
190 ++dest_data;-
191 }
never executed: end of block
0
192 src_data += src_pad;-
193 dest_data += dest_pad;-
194 }
never executed: end of block
0
195}
never executed: end of block
0
196-
197template<QImage::Format Format>-
198static bool convert_passthrough_inplace(QImageData *data, Qt::ImageConversionFlags)-
199{-
200 data->format = Format;-
201 return
never executed: return true;
true;
never executed: return true;
0
202}-
203-
204static void convert_ARGB_to_ARGB_PM(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)-
205{-
206 ((!(src->format == QImage::Format_ARGB32 || src->format == QImage::Format_RGBA8888)) ? qt_assert("src->format == QImage::Format_ARGB32 || src->format == QImage::Format_RGBA8888",__FILE__,260) : qt_noop());-
207 ((!(dest->format == QImage::Format_ARGB32_Premultiplied || dest->format == QImage::Format_RGBA8888_Premultiplied)) ? qt_assert("dest->format == QImage::Format_ARGB32_Premultiplied || dest->format == QImage::Format_RGBA8888_Premultiplied",__FILE__,261) : qt_noop());-
208 ((!(src->width == dest->width)) ? qt_assert("src->width == dest->width",__FILE__,262) : qt_noop());-
209 ((!(src->height == dest->height)) ? qt_assert("src->height == dest->height",__FILE__,263) : qt_noop());-
210-
211 const int src_pad = (src->bytes_per_line >> 2) - src->width;-
212 const int dest_pad = (dest->bytes_per_line >> 2) - dest->width;-
213 const QRgb *src_data = (QRgb *) src->data;-
214 QRgb *dest_data = (QRgb *) dest->data;-
215-
216 for (int i = 0; i < src->height
i < src->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
217 const QRgb *end = src_data + src->width;-
218 while (src_data < end
src_data < endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
219 *dest_data = qPremultiply(*src_data);-
220 ++src_data;-
221 ++dest_data;-
222 }
never executed: end of block
0
223 src_data += src_pad;-
224 dest_data += dest_pad;-
225 }
never executed: end of block
0
226}
never executed: end of block
0
227-
228__attribute__((visibility("default"))) void qt_convert_rgb888_to_rgb32(quint32 *dest_data, const uchar *src_data, int len)-
229{-
230 int pixel = 0;-
231-
232 while ((
(quintptr(src_data) & 0x3)Description
TRUEnever evaluated
FALSEnever evaluated
quintptr(src_data) & 0x3)
(quintptr(src_data) & 0x3)Description
TRUEnever evaluated
FALSEnever evaluated
&& pixel < len
pixel < lenDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
233 *dest_data = 0xff000000 | (src_data[0] << 16) | (src_data[1] << 8) | (src_data[2]);-
234 src_data += 3;-
235 ++dest_data;-
236 ++pixel;-
237 }
never executed: end of block
0
238-
239-
240 for (; pixel + 3 < len
pixel + 3 < lenDescription
TRUEnever evaluated
FALSEnever evaluated
; pixel += 4) {
0
241 const quint32 *src_packed = (const quint32 *) src_data;-
242 const quint32 src1 = qFromBigEndian(src_packed[0]);-
243 const quint32 src2 = qFromBigEndian(src_packed[1]);-
244 const quint32 src3 = qFromBigEndian(src_packed[2]);-
245-
246 dest_data[0] = 0xff000000 | (src1 >> 8);-
247 dest_data[1] = 0xff000000 | (src1 << 16) | (src2 >> 16);-
248 dest_data[2] = 0xff000000 | (src2 << 8) | (src3 >> 24);-
249 dest_data[3] = 0xff000000 | src3;-
250-
251 src_data += 12;-
252 dest_data += 4;-
253 }
never executed: end of block
0
254-
255-
256 for (; pixel < len
pixel < lenDescription
TRUEnever evaluated
FALSEnever evaluated
; ++pixel) {
0
257 *dest_data = 0xff000000 | (src_data[0] << 16) | (src_data[1] << 8) | (src_data[2]);-
258 src_data += 3;-
259 ++dest_data;-
260 }
never executed: end of block
0
261}
never executed: end of block
0
262-
263__attribute__((visibility("default"))) void qt_convert_rgb888_to_rgbx8888(quint32 *dest_data, const uchar *src_data, int len)-
264{-
265 int pixel = 0;-
266-
267 while ((
(quintptr(src_data) & 0x3)Description
TRUEnever evaluated
FALSEnever evaluated
quintptr(src_data) & 0x3)
(quintptr(src_data) & 0x3)Description
TRUEnever evaluated
FALSEnever evaluated
&& pixel < len
pixel < lenDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
268 *dest_data = ARGB2RGBA(0xff000000 | (src_data[0] << 16) | (src_data[1] << 8) | (src_data[2]));-
269 src_data += 3;-
270 ++dest_data;-
271 ++pixel;-
272 }
never executed: end of block
0
273-
274-
275 for (; pixel + 3 < len
pixel + 3 < lenDescription
TRUEnever evaluated
FALSEnever evaluated
; pixel += 4) {
0
276 const quint32 *src_packed = (const quint32 *) src_data;-
277 const quint32 src1 = src_packed[0];-
278 const quint32 src2 = src_packed[1];-
279 const quint32 src3 = src_packed[2];-
280-
281-
282 dest_data[0] = 0xff000000 | src1;-
283 dest_data[1] = 0xff000000 | (src1 >> 24) | (src2 << 8);-
284 dest_data[2] = 0xff000000 | (src2 >> 16) | (src3 << 16);-
285 dest_data[3] = 0xff000000 | (src3 >> 8);-
286-
287-
288-
289-
290-
291-
292-
293 src_data += 12;-
294 dest_data += 4;-
295 }
never executed: end of block
0
296-
297-
298 for (; pixel < len
pixel < lenDescription
TRUEnever evaluated
FALSEnever evaluated
; ++pixel) {
0
299 *dest_data = ARGB2RGBA(0xff000000 | (src_data[0] << 16) | (src_data[1] << 8) | (src_data[2]));-
300 src_data += 3;-
301 ++dest_data;-
302 }
never executed: end of block
0
303}
never executed: end of block
0
304-
305typedef void ( *Rgb888ToRgbConverter)(quint32 *dst, const uchar *src, int len);-
306-
307template <bool rgbx>-
308static void convert_RGB888_to_RGB(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)-
309{-
310 ((!(src->format == QImage::Format_RGB888)) ? qt_assert("src->format == QImage::Format_RGB888",__FILE__,364) : qt_noop());-
311 if (rgbx
rgbxDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
312 ((
never executed: ((!(dest->format == QImage::Format_RGBX8888 || dest->format == QImage::Format_RGBA8888 || dest->format == QImage::Format_RGBA8888_Premultiplied)) ? qt_assert("dest->format == QImage::Format_RGBX8888 || dest->format == QImage::Format_RGBA8888 || dest->format == QImage::Format_RGBA8888_Premultiplied",__FILE__,366) : qt_noop());
!(dest->format == QImage::Format_RGBX8888 || dest->format == QImage::Format_RGBA8888 || dest->format == QImage::Format_RGBA8888_Premultiplied)) ? qt_assert("dest->format == QImage::Format_RGBX8888 || dest->format == QImage::Format_RGBA8888 || dest->format == QImage::Format_RGBA8888_Premultiplied",__FILE__,366) : qt_noop());
never executed: ((!(dest->format == QImage::Format_RGBX8888 || dest->format == QImage::Format_RGBA8888 || dest->format == QImage::Format_RGBA8888_Premultiplied)) ? qt_assert("dest->format == QImage::Format_RGBX8888 || dest->format == QImage::Format_RGBA8888 || dest->format == QImage::Format_RGBA8888_Premultiplied",__FILE__,366) : qt_noop());
0
313 else-
314 ((
never executed: ((!(dest->format == QImage::Format_RGB32 || dest->format == QImage::Format_ARGB32 || dest->format == QImage::Format_ARGB32_Premultiplied)) ? qt_assert("dest->format == QImage::Format_RGB32 || dest->format == QImage::Format_ARGB32 || dest->format == QImage::Format_ARGB32_Premultiplied",__FILE__,368) : qt_noop());
!(dest->format == QImage::Format_RGB32 || dest->format == QImage::Format_ARGB32 || dest->format == QImage::Format_ARGB32_Premultiplied)) ? qt_assert("dest->format == QImage::Format_RGB32 || dest->format == QImage::Format_ARGB32 || dest->format == QImage::Format_ARGB32_Premultiplied",__FILE__,368) : qt_noop());
never executed: ((!(dest->format == QImage::Format_RGB32 || dest->format == QImage::Format_ARGB32 || dest->format == QImage::Format_ARGB32_Premultiplied)) ? qt_assert("dest->format == QImage::Format_RGB32 || dest->format == QImage::Format_ARGB32 || dest->format == QImage::Format_ARGB32_Premultiplied",__FILE__,368) : qt_noop());
0
315 ((!(src->width == dest->width)) ? qt_assert("src->width == dest->width",__FILE__,369) : qt_noop());-
316 ((!(src->height == dest->height)) ? qt_assert("src->height == dest->height",__FILE__,370) : qt_noop());-
317-
318 const uchar *src_data = (uchar *) src->data;-
319 quint32 *dest_data = (quint32 *) dest->data;-
320-
321 Rgb888ToRgbConverter line_converter= rgbx
rgbxDescription
TRUEnever evaluated
FALSEnever evaluated
? qt_convert_rgb888_to_rgbx8888 : qt_convert_rgb888_to_rgb32;
0
322-
323 for (int i = 0; i < src->height
i < src->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
324 line_converter(dest_data, src_data, src->width);-
325 src_data += src->bytes_per_line;-
326 dest_data = (quint32 *)((uchar*)dest_data + dest->bytes_per_line);-
327 }
never executed: end of block
0
328}
never executed: end of block
0
329-
330-
331extern bool convert_ARGB_to_ARGB_PM_inplace_sse2(QImageData *data, Qt::ImageConversionFlags);-
332static void convert_ARGB_to_RGBx(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)-
333{-
334 ((!(src->format == QImage::Format_ARGB32)) ? qt_assert("src->format == QImage::Format_ARGB32",__FILE__,413) : qt_noop());-
335 ((!(dest->format == QImage::Format_RGBX8888)) ? qt_assert("dest->format == QImage::Format_RGBX8888",__FILE__,414) : qt_noop());-
336 ((!(src->width == dest->width)) ? qt_assert("src->width == dest->width",__FILE__,415) : qt_noop());-
337 ((!(src->height == dest->height)) ? qt_assert("src->height == dest->height",__FILE__,416) : qt_noop());-
338-
339 const int src_pad = (src->bytes_per_line >> 2) - src->width;-
340 const int dest_pad = (dest->bytes_per_line >> 2) - dest->width;-
341 const quint32 *src_data = (quint32 *) src->data;-
342 quint32 *dest_data = (quint32 *) dest->data;-
343-
344 for (int i = 0; i < src->height
i < src->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
345 const quint32 *end = src_data + src->width;-
346 while (src_data < end
src_data < endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
347 *dest_data = ARGB2RGBA(0xff000000 | *src_data);-
348 ++src_data;-
349 ++dest_data;-
350 }
never executed: end of block
0
351 src_data += src_pad;-
352 dest_data += dest_pad;-
353 }
never executed: end of block
0
354}
never executed: end of block
0
355-
356static void convert_ARGB_to_RGBA(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)-
357{-
358 ((!(src->format == QImage::Format_ARGB32 || src->format == QImage::Format_ARGB32_Premultiplied)) ? qt_assert("src->format == QImage::Format_ARGB32 || src->format == QImage::Format_ARGB32_Premultiplied",__FILE__,437) : qt_noop());-
359 ((!(dest->format == QImage::Format_RGBA8888 || dest->format == QImage::Format_RGBA8888_Premultiplied)) ? qt_assert("dest->format == QImage::Format_RGBA8888 || dest->format == QImage::Format_RGBA8888_Premultiplied",__FILE__,438) : qt_noop());-
360 ((!(src->width == dest->width)) ? qt_assert("src->width == dest->width",__FILE__,439) : qt_noop());-
361 ((!(src->height == dest->height)) ? qt_assert("src->height == dest->height",__FILE__,440) : qt_noop());-
362-
363 const int src_pad = (src->bytes_per_line >> 2) - src->width;-
364 const int dest_pad = (dest->bytes_per_line >> 2) - dest->width;-
365 const quint32 *src_data = (quint32 *) src->data;-
366 quint32 *dest_data = (quint32 *) dest->data;-
367-
368 for (int i = 0; i < src->height
i < src->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
369 const quint32 *end = src_data + src->width;-
370 while (src_data < end
src_data < endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
371 *dest_data = ARGB2RGBA(*src_data);-
372 ++src_data;-
373 ++dest_data;-
374 }
never executed: end of block
0
375 src_data += src_pad;-
376 dest_data += dest_pad;-
377 }
never executed: end of block
0
378}
never executed: end of block
0
379-
380template<QImage::Format DestFormat>-
381static bool convert_ARGB_to_RGBA_inplace(QImageData *data, Qt::ImageConversionFlags)-
382{-
383 ((!(data->format == QImage::Format_ARGB32 || data->format == QImage::Format_ARGB32_Premultiplied)) ? qt_assert("data->format == QImage::Format_ARGB32 || data->format == QImage::Format_ARGB32_Premultiplied",__FILE__,462) : qt_noop());-
384-
385 const int pad = (data->bytes_per_line >> 2) - data->width;-
386 quint32 *rgb_data = (quint32 *) data->data;-
387 constexpr uint mask = (DestFormat == QImage::Format_RGBX8888) ? 0xff000000 : 0;-
388-
389 for (int i = 0; i < data->height
i < data->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
390 const quint32 *end = rgb_data + data->width;-
391 while (rgb_data < end
rgb_data < endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
392 *rgb_data = ARGB2RGBA(*rgb_data | mask);-
393 ++rgb_data;-
394 }
never executed: end of block
0
395 rgb_data += pad;-
396 }
never executed: end of block
0
397-
398 data->format = DestFormat;-
399 return
never executed: return true;
true;
never executed: return true;
0
400}-
401-
402static void convert_RGBA_to_ARGB(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)-
403{-
404 ((!(src->format == QImage::Format_RGBX8888 || src->format == QImage::Format_RGBA8888 || src->format == QImage::Format_RGBA8888_Premultiplied)) ? qt_assert("src->format == QImage::Format_RGBX8888 || src->format == QImage::Format_RGBA8888 || src->format == QImage::Format_RGBA8888_Premultiplied",__FILE__,483) : qt_noop());-
405 ((!(dest->format == QImage::Format_ARGB32 || dest->format == QImage::Format_ARGB32_Premultiplied)) ? qt_assert("dest->format == QImage::Format_ARGB32 || dest->format == QImage::Format_ARGB32_Premultiplied",__FILE__,484) : qt_noop());-
406 ((!(src->width == dest->width)) ? qt_assert("src->width == dest->width",__FILE__,485) : qt_noop());-
407 ((!(src->height == dest->height)) ? qt_assert("src->height == dest->height",__FILE__,486) : qt_noop());-
408-
409 const int src_pad = (src->bytes_per_line >> 2) - src->width;-
410 const int dest_pad = (dest->bytes_per_line >> 2) - dest->width;-
411 const quint32 *src_data = (quint32 *) src->data;-
412 quint32 *dest_data = (quint32 *) dest->data;-
413-
414 for (int i = 0; i < src->height
i < src->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
415 const quint32 *end = src_data + src->width;-
416 while (src_data < end
src_data < endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
417 *dest_data = RGBA2ARGB(*src_data);-
418 ++src_data;-
419 ++dest_data;-
420 }
never executed: end of block
0
421 src_data += src_pad;-
422 dest_data += dest_pad;-
423 }
never executed: end of block
0
424}
never executed: end of block
0
425-
426template<QImage::Format DestFormat>-
427static bool convert_RGBA_to_ARGB_inplace(QImageData *data, Qt::ImageConversionFlags)-
428{-
429 ((!(data->format == QImage::Format_RGBX8888 || data->format == QImage::Format_RGBA8888 || data->format == QImage::Format_RGBA8888_Premultiplied)) ? qt_assert("data->format == QImage::Format_RGBX8888 || data->format == QImage::Format_RGBA8888 || data->format == QImage::Format_RGBA8888_Premultiplied",__FILE__,508) : qt_noop());-
430-
431 const int pad = (data->bytes_per_line >> 2) - data->width;-
432 QRgb *rgb_data = (QRgb *) data->data;-
433 constexpr uint mask = (DestFormat == QImage::Format_RGB32) ? 0xff000000 : 0;-
434-
435 for (int i = 0; i < data->height
i < data->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
436 const QRgb *end = rgb_data + data->width;-
437 while (rgb_data < end
rgb_data < endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
438 *rgb_data = mask | RGBA2ARGB(*rgb_data);-
439 ++rgb_data;-
440 }
never executed: end of block
0
441 rgb_data += pad;-
442 }
never executed: end of block
0
443 data->format = DestFormat;-
444 return
never executed: return true;
true;
never executed: return true;
0
445}-
446-
447template<QtPixelOrder PixelOrder>-
448static void convert_RGB_to_RGB30(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)-
449{-
450-
451 ((!(src->format == QImage::Format_RGB32 || src->format == QImage::Format_ARGB32)) ? qt_assert("src->format == QImage::Format_RGB32 || src->format == QImage::Format_ARGB32",__FILE__,530) : qt_noop());-
452 ((!(dest->format == QImage::Format_BGR30 || dest->format == QImage::Format_RGB30)) ? qt_assert("dest->format == QImage::Format_BGR30 || dest->format == QImage::Format_RGB30",__FILE__,531) : qt_noop());-
453 ((!(src->width == dest->width)) ? qt_assert("src->width == dest->width",__FILE__,532) : qt_noop());-
454 ((!(src->height == dest->height)) ? qt_assert("src->height == dest->height",__FILE__,533) : qt_noop());-
455-
456 const int src_pad = (src->bytes_per_line >> 2) - src->width;-
457 const int dest_pad = (dest->bytes_per_line >> 2) - dest->width;-
458 const quint32 *src_data = (quint32 *) src->data;-
459 quint32 *dest_data = (quint32 *) dest->data;-
460-
461 for (int i = 0; i < src->height
i < src->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
462 const quint32 *end = src_data + src->width;-
463 while (src_data < end
src_data < endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
464 *dest_data = qConvertRgb32ToRgb30<PixelOrder>(*src_data);-
465 ++src_data;-
466 ++dest_data;-
467 }
never executed: end of block
0
468 src_data += src_pad;-
469 dest_data += dest_pad;-
470 }
never executed: end of block
0
471}
never executed: end of block
0
472-
473template<QtPixelOrder PixelOrder>-
474static bool convert_RGB_to_RGB30_inplace(QImageData *data, Qt::ImageConversionFlags)-
475{-
476 ((!(data->format == QImage::Format_RGB32 || data->format == QImage::Format_ARGB32)) ? qt_assert("data->format == QImage::Format_RGB32 || data->format == QImage::Format_ARGB32",__FILE__,555) : qt_noop());-
477-
478 const int pad = (data->bytes_per_line >> 2) - data->width;-
479 QRgb *rgb_data = (QRgb *) data->data;-
480-
481 for (int i = 0; i < data->height
i < data->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
482 const QRgb *end = rgb_data + data->width;-
483 while (rgb_data < end
rgb_data < endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
484 *rgb_data = qConvertRgb32ToRgb30<PixelOrder>(*rgb_data);-
485 ++rgb_data;-
486 }
never executed: end of block
0
487 rgb_data += pad;-
488 }
never executed: end of block
0
489-
490 data->format = (
(PixelOrder == PixelOrderRGB)Description
TRUEnever evaluated
FALSEnever evaluated
PixelOrder == PixelOrderRGB)
(PixelOrder == PixelOrderRGB)Description
TRUEnever evaluated
FALSEnever evaluated
? QImage::Format_RGB30 : QImage::Format_BGR30;
0
491 return
never executed: return true;
true;
never executed: return true;
0
492}-
493-
494static inline uint qUnpremultiplyRgb30(uint rgb30)-
495{-
496 const uint a = rgb30 >> 30;-
497 switch (a) {-
498 case
never executed: case 0:
0:
never executed: case 0:
0
499 return
never executed: return 0;
0;
never executed: return 0;
0
500 case
never executed: case 1:
1:
never executed: case 1:
{
0
501 uint rgb = rgb30 & 0x3fffffff;-
502 rgb *= 3;-
503 return
never executed: return (a << 30) | rgb;
(a << 30) | rgb;
never executed: return (a << 30) | rgb;
0
504 }-
505 case
never executed: case 2:
2:
never executed: case 2:
{
0
506 uint rgb = rgb30 & 0x3fffffff;-
507 rgb += (rgb >> 1) & 0x5ff7fdff;-
508 return
never executed: return (a << 30) | rgb;
(a << 30) | rgb;
never executed: return (a << 30) | rgb;
0
509 }-
510 case
never executed: case 3:
3:
never executed: case 3:
0
511 return
never executed: return rgb30;
rgb30;
never executed: return rgb30;
0
512 }-
513 do { ((!(false)) ? qt_assert_x("Q_UNREACHABLE()", "Q_UNREACHABLE was reached",__FILE__,592) : qt_noop()); __builtin_unreachable(); } while (0);-
514 return
never executed: return 0;
0;
never executed: return 0;
0
515}-
516-
517template<bool rgbswap>-
518static void convert_A2RGB30_PM_to_RGB30(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)-
519{-
520 ((!(src->format == QImage::Format_A2RGB30_Premultiplied || src->format == QImage::Format_A2BGR30_Premultiplied)) ? qt_assert("src->format == QImage::Format_A2RGB30_Premultiplied || src->format == QImage::Format_A2BGR30_Premultiplied",__FILE__,599) : qt_noop());-
521 ((!(dest->format == QImage::Format_RGB30 || dest->format == QImage::Format_BGR30)) ? qt_assert("dest->format == QImage::Format_RGB30 || dest->format == QImage::Format_BGR30",__FILE__,600) : qt_noop());-
522 ((!(src->width == dest->width)) ? qt_assert("src->width == dest->width",__FILE__,601) : qt_noop());-
523 ((!(src->height == dest->height)) ? qt_assert("src->height == dest->height",__FILE__,602) : qt_noop());-
524-
525 const int src_pad = (src->bytes_per_line >> 2) - src->width;-
526 const int dest_pad = (dest->bytes_per_line >> 2) - dest->width;-
527 const quint32 *src_data = (quint32 *) src->data;-
528 quint32 *dest_data = (quint32 *) dest->data;-
529-
530 for (int i = 0; i < src->height
i < src->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
531 const quint32 *end = src_data + src->width;-
532 while (src_data < end
src_data < endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
533 const uint p = 0xc0000000 | qUnpremultiplyRgb30(*src_data);-
534 *dest_data = (
(rgbswap)Description
TRUEnever evaluated
FALSEnever evaluated
rgbswap)
(rgbswap)Description
TRUEnever evaluated
FALSEnever evaluated
? qRgbSwapRgb30(p) : p;
0
535 ++src_data;-
536 ++dest_data;-
537 }
never executed: end of block
0
538 src_data += src_pad;-
539 dest_data += dest_pad;-
540 }
never executed: end of block
0
541}
never executed: end of block
0
542-
543template<bool rgbswap>-
544static bool convert_A2RGB30_PM_to_RGB30_inplace(QImageData *data, Qt::ImageConversionFlags)-
545{-
546 ((!(data->format == QImage::Format_A2RGB30_Premultiplied || data->format == QImage::Format_A2BGR30_Premultiplied)) ? qt_assert("data->format == QImage::Format_A2RGB30_Premultiplied || data->format == QImage::Format_A2BGR30_Premultiplied",__FILE__,625) : qt_noop());-
547-
548 const int pad = (data->bytes_per_line >> 2) - data->width;-
549 uint *rgb_data = (uint *) data->data;-
550-
551 for (int i = 0; i < data->height
i < data->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
552 const uint *end = rgb_data + data->width;-
553 while (rgb_data < end
rgb_data < endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
554 const uint p = 0xc0000000 | qUnpremultiplyRgb30(*rgb_data);-
555 *rgb_data = (
(rgbswap)Description
TRUEnever evaluated
FALSEnever evaluated
rgbswap)
(rgbswap)Description
TRUEnever evaluated
FALSEnever evaluated
? qRgbSwapRgb30(p) : p;
0
556 ++rgb_data;-
557 }
never executed: end of block
0
558 rgb_data += pad;-
559 }
never executed: end of block
0
560-
561 if (data->format == QImage::Format_A2RGB30_Premultiplied
data->format =..._PremultipliedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
562 data->format = (
(rgbswap)Description
TRUEnever evaluated
FALSEnever evaluated
rgbswap)
(rgbswap)Description
TRUEnever evaluated
FALSEnever evaluated
? QImage::Format_BGR30 : QImage::Format_RGB30;
never executed: data->format = (rgbswap) ? QImage::Format_BGR30 : QImage::Format_RGB30;
0
563 else-
564 data->format = (
(rgbswap)Description
TRUEnever evaluated
FALSEnever evaluated
rgbswap)
(rgbswap)Description
TRUEnever evaluated
FALSEnever evaluated
? QImage::Format_RGB30 : QImage::Format_BGR30;
never executed: data->format = (rgbswap) ? QImage::Format_RGB30 : QImage::Format_BGR30;
0
565 return
never executed: return true;
true;
never executed: return true;
0
566}-
567-
568static void convert_BGR30_to_RGB30(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)-
569{-
570 ((!(src->format == QImage::Format_RGB30 || src->format == QImage::Format_BGR30 || src->format == QImage::Format_A2RGB30_Premultiplied || src->format == QImage::Format_A2BGR30_Premultiplied)) ? qt_assert("src->format == QImage::Format_RGB30 || src->format == QImage::Format_BGR30 || src->format == QImage::Format_A2RGB30_Premultiplied || src->format == QImage::Format_A2BGR30_Premultiplied",-
571 __FILE__-
572 ,-
573 650-
574 ) : qt_noop())-
575 ;-
576 ((!(dest->format == QImage::Format_RGB30 || dest->format == QImage::Format_BGR30 || dest->format == QImage::Format_A2RGB30_Premultiplied || dest->format == QImage::Format_A2BGR30_Premultiplied)) ? qt_assert("dest->format == QImage::Format_RGB30 || dest->format == QImage::Format_BGR30 || dest->format == QImage::Format_A2RGB30_Premultiplied || dest->format == QImage::Format_A2BGR30_Premultiplied",-
577 __FILE__-
578 ,-
579 652-
580 ) : qt_noop())-
581 ;-
582 ((!(src->width == dest->width)) ? qt_assert("src->width == dest->width",__FILE__,653) : qt_noop());-
583 ((!(src->height == dest->height)) ? qt_assert("src->height == dest->height",__FILE__,654) : qt_noop());-
584-
585 const int src_pad = (src->bytes_per_line >> 2) - src->width;-
586 const int dest_pad = (dest->bytes_per_line >> 2) - dest->width;-
587 const quint32 *src_data = (quint32 *) src->data;-
588 quint32 *dest_data = (quint32 *) dest->data;-
589-
590 for (int i = 0; i < src->height
i < src->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
591 const quint32 *end = src_data + src->width;-
592 while (src_data < end
src_data < endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
593 *dest_data = qRgbSwapRgb30(*src_data);-
594 ++src_data;-
595 ++dest_data;-
596 }
never executed: end of block
0
597 src_data += src_pad;-
598 dest_data += dest_pad;-
599 }
never executed: end of block
0
600}
never executed: end of block
0
601-
602static bool convert_BGR30_to_RGB30_inplace(QImageData *data, Qt::ImageConversionFlags)-
603{-
604 ((!(data->format == QImage::Format_RGB30 || data->format == QImage::Format_BGR30 || data->format == QImage::Format_A2RGB30_Premultiplied || data->format == QImage::Format_A2BGR30_Premultiplied)) ? qt_assert("data->format == QImage::Format_RGB30 || data->format == QImage::Format_BGR30 || data->format == QImage::Format_A2RGB30_Premultiplied || data->format == QImage::Format_A2BGR30_Premultiplied",-
605 __FILE__-
606 ,-
607 676-
608 ) : qt_noop())-
609 ;-
610-
611 const int pad = (data->bytes_per_line >> 2) - data->width;-
612 uint *rgb_data = (uint *) data->data;-
613-
614 for (int i = 0; i < data->height
i < data->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
615 const uint *end = rgb_data + data->width;-
616 while (rgb_data < end
rgb_data < endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
617 *rgb_data = qRgbSwapRgb30(*rgb_data);-
618 ++rgb_data;-
619 }
never executed: end of block
0
620 rgb_data += pad;-
621 }
never executed: end of block
0
622-
623 switch (data->format) {-
624 case
never executed: case QImage::Format_BGR30:
QImage::Format_BGR30:
never executed: case QImage::Format_BGR30:
0
625 data->format = QImage::Format_RGB30;-
626 break;
never executed: break;
0
627 case
never executed: case QImage::Format_A2BGR30_Premultiplied:
QImage::Format_A2BGR30_Premultiplied:
never executed: case QImage::Format_A2BGR30_Premultiplied:
0
628 data->format = QImage::Format_A2RGB30_Premultiplied;-
629 break;
never executed: break;
0
630 case
never executed: case QImage::Format_RGB30:
QImage::Format_RGB30:
never executed: case QImage::Format_RGB30:
0
631 data->format = QImage::Format_BGR30;-
632 break;
never executed: break;
0
633 case
never executed: case QImage::Format_A2RGB30_Premultiplied:
QImage::Format_A2RGB30_Premultiplied:
never executed: case QImage::Format_A2RGB30_Premultiplied:
0
634 data->format = QImage::Format_A2BGR30_Premultiplied;-
635 break;
never executed: break;
0
636 default
never executed: default:
:
never executed: default:
0
637 do { ((!(false)) ? qt_assert_x("Q_UNREACHABLE()", "Q_UNREACHABLE was reached",__FILE__,704) : qt_noop()); __builtin_unreachable(); } while (0);-
638 data->format = QImage::Format_Invalid;-
639 return
never executed: return false;
false;
never executed: return false;
0
640 }-
641 return
never executed: return true;
true;
never executed: return true;
0
642}-
643-
644static bool convert_BGR30_to_A2RGB30_inplace(QImageData *data, Qt::ImageConversionFlags flags)-
645{-
646 ((!(data->format == QImage::Format_RGB30 || data->format == QImage::Format_BGR30)) ? qt_assert("data->format == QImage::Format_RGB30 || data->format == QImage::Format_BGR30",__FILE__,713) : qt_noop());-
647 if (!convert_BGR30_to_RGB30_inplace(data, flags)
!convert_BGR30...e(data, flags)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
648 return
never executed: return false;
false;
never executed: return false;
0
649-
650 if (data->format == QImage::Format_RGB30
data->format =...::Format_RGB30Description
TRUEnever evaluated
FALSEnever evaluated
)
0
651 data->format = QImage::Format_A2RGB30_Premultiplied;
never executed: data->format = QImage::Format_A2RGB30_Premultiplied;
0
652 else-
653 data->format = QImage::Format_A2BGR30_Premultiplied;
never executed: data->format = QImage::Format_A2BGR30_Premultiplied;
0
654 return
never executed: return true;
true;
never executed: return true;
0
655}-
656-
657template<QtPixelOrder PixelOrder>-
658static void convert_A2RGB30_PM_to_ARGB(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)-
659{-
660 ((!(src->format == QImage::Format_A2RGB30_Premultiplied || src->format == QImage::Format_A2BGR30_Premultiplied)) ? qt_assert("src->format == QImage::Format_A2RGB30_Premultiplied || src->format == QImage::Format_A2BGR30_Premultiplied",__FILE__,727) : qt_noop());-
661 ((!(dest->format == QImage::Format_ARGB32)) ? qt_assert("dest->format == QImage::Format_ARGB32",__FILE__,728) : qt_noop());-
662 ((!(src->width == dest->width)) ? qt_assert("src->width == dest->width",__FILE__,729) : qt_noop());-
663 ((!(src->height == dest->height)) ? qt_assert("src->height == dest->height",__FILE__,730) : qt_noop());-
664-
665 const int src_pad = (src->bytes_per_line >> 2) - src->width;-
666 const int dest_pad = (dest->bytes_per_line >> 2) - dest->width;-
667 const quint32 *src_data = (quint32 *) src->data;-
668 quint32 *dest_data = (quint32 *) dest->data;-
669-
670 for (int i = 0; i < src->height
i < src->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
671 const quint32 *end = src_data + src->width;-
672 while (src_data < end
src_data < endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
673 *dest_data = qConvertA2rgb30ToArgb32<PixelOrder>(qUnpremultiplyRgb30(*src_data));-
674 ++src_data;-
675 ++dest_data;-
676 }
never executed: end of block
0
677 src_data += src_pad;-
678 dest_data += dest_pad;-
679 }
never executed: end of block
0
680}
never executed: end of block
0
681-
682template<QtPixelOrder PixelOrder>-
683static bool convert_A2RGB30_PM_to_ARGB_inplace(QImageData *data, Qt::ImageConversionFlags)-
684{-
685 ((!(data->format == QImage::Format_A2RGB30_Premultiplied || data->format == QImage::Format_A2BGR30_Premultiplied)) ? qt_assert("data->format == QImage::Format_A2RGB30_Premultiplied || data->format == QImage::Format_A2BGR30_Premultiplied",__FILE__,752) : qt_noop());-
686-
687 const int pad = (data->bytes_per_line >> 2) - data->width;-
688 uint *rgb_data = (uint *) data->data;-
689-
690 for (int i = 0; i < data->height
i < data->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
691 const uint *end = rgb_data + data->width;-
692 while (rgb_data < end
rgb_data < endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
693 *rgb_data = qConvertA2rgb30ToArgb32<PixelOrder>(qUnpremultiplyRgb30(*rgb_data));-
694 ++rgb_data;-
695 }
never executed: end of block
0
696 rgb_data += pad;-
697 }
never executed: end of block
0
698 data->format = QImage::Format_ARGB32;-
699 return
never executed: return true;
true;
never executed: return true;
0
700}-
701-
702static bool convert_indexed8_to_ARGB_PM_inplace(QImageData *data, Qt::ImageConversionFlags)-
703{-
704 ((!(data->format == QImage::Format_Indexed8)) ? qt_assert("data->format == QImage::Format_Indexed8",__FILE__,771) : qt_noop());-
705 ((!(data->own_data)) ? qt_assert("data->own_data",__FILE__,772) : qt_noop());-
706-
707 const int depth = 32;-
708-
709 const int dst_bytes_per_line = ((data->width * depth + 31) >> 5) << 2;-
710 const int nbytes = dst_bytes_per_line * data->height;-
711 uchar *const newData = (uchar *)realloc(data->data, nbytes);-
712 if (!newData
!newDataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
713 return
never executed: return false;
false;
never executed: return false;
0
714-
715 data->data = newData;-
716-
717-
718 uchar *src_data = newData + data->nbytes;-
719 quint32 *dest_data = (quint32 *) (newData + nbytes);-
720 const int width = data->width;-
721 const int src_pad = data->bytes_per_line - width;-
722 const int dest_pad = (dst_bytes_per_line >> 2) - width;-
723 if (data->colortable.size() == 0
data->colortable.size() == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
724 data->colortable.resize(256);-
725 for (int i = 0; i < 256
i < 256Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
726 data->colortable[i] = qRgb(i, i, i);
never executed: data->colortable[i] = qRgb(i, i, i);
0
727 }
never executed: end of block
else {
0
728 for (int i = 0; i < data->colortable.size()
i < data->colortable.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
729 data->colortable[i] = qPremultiply(data->colortable.at(i));
never executed: data->colortable[i] = qPremultiply(data->colortable.at(i));
0
730-
731-
732 const int oldSize = data->colortable.size();-
733 const QRgb lastColor = data->colortable.at(oldSize - 1);-
734 data->colortable.insert(oldSize, 256 - oldSize, lastColor);-
735 }
never executed: end of block
0
736-
737 for (int i = 0; i < data->height
i < data->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
738 src_data -= src_pad;-
739 dest_data -= dest_pad;-
740 for (int pixI = 0; pixI < width
pixI < widthDescription
TRUEnever evaluated
FALSEnever evaluated
; ++pixI) {
0
741 --src_data;-
742 --dest_data;-
743 *dest_data = data->colortable.at(*src_data);-
744 }
never executed: end of block
0
745 }
never executed: end of block
0
746-
747 data->colortable = QVector<QRgb>();-
748 data->format = QImage::Format_ARGB32_Premultiplied;-
749 data->bytes_per_line = dst_bytes_per_line;-
750 data->depth = depth;-
751 data->nbytes = nbytes;-
752-
753 return
never executed: return true;
true;
never executed: return true;
0
754}-
755-
756static bool convert_indexed8_to_ARGB_inplace(QImageData *data, Qt::ImageConversionFlags)-
757{-
758 ((!(data->format == QImage::Format_Indexed8)) ? qt_assert("data->format == QImage::Format_Indexed8",__FILE__,825) : qt_noop());-
759 ((!(data->own_data)) ? qt_assert("data->own_data",__FILE__,826) : qt_noop());-
760-
761 const int depth = 32;-
762-
763 const int dst_bytes_per_line = ((data->width * depth + 31) >> 5) << 2;-
764 const int nbytes = dst_bytes_per_line * data->height;-
765 uchar *const newData = (uchar *)realloc(data->data, nbytes);-
766 if (!newData
!newDataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
767 return
never executed: return false;
false;
never executed: return false;
0
768-
769 data->data = newData;-
770-
771-
772 uchar *src_data = newData + data->nbytes;-
773 quint32 *dest_data = (quint32 *) (newData + nbytes);-
774 const int width = data->width;-
775 const int src_pad = data->bytes_per_line - width;-
776 const int dest_pad = (dst_bytes_per_line >> 2) - width;-
777 if (data->colortable.size() == 0
data->colortable.size() == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
778 data->colortable.resize(256);-
779 for (int i = 0; i < 256
i < 256Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
780 data->colortable[i] = qRgb(i, i, i);
never executed: data->colortable[i] = qRgb(i, i, i);
0
781 }
never executed: end of block
else {
0
782-
783 const int oldSize = data->colortable.size();-
784 const QRgb lastColor = data->colortable.at(oldSize - 1);-
785 data->colortable.insert(oldSize, 256 - oldSize, lastColor);-
786 }
never executed: end of block
0
787-
788 for (int i = 0; i < data->height
i < data->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
789 src_data -= src_pad;-
790 dest_data -= dest_pad;-
791 for (int pixI = 0; pixI < width
pixI < widthDescription
TRUEnever evaluated
FALSEnever evaluated
; ++pixI) {
0
792 --src_data;-
793 --dest_data;-
794 *dest_data = (quint32) data->colortable.at(*src_data);-
795 }
never executed: end of block
0
796 }
never executed: end of block
0
797-
798 data->colortable = QVector<QRgb>();-
799 data->format = QImage::Format_ARGB32;-
800 data->bytes_per_line = dst_bytes_per_line;-
801 data->depth = depth;-
802 data->nbytes = nbytes;-
803-
804 return
never executed: return true;
true;
never executed: return true;
0
805}-
806-
807static bool convert_indexed8_to_RGB_inplace(QImageData *data, Qt::ImageConversionFlags flags)-
808{-
809 ((!(data->format == QImage::Format_Indexed8)) ? qt_assert("data->format == QImage::Format_Indexed8",__FILE__,876) : qt_noop());-
810 ((!(data->own_data)) ? qt_assert("data->own_data",__FILE__,877) : qt_noop());-
811-
812 if (data->has_alpha_clut
data->has_alpha_clutDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
813 for (int i = 0; i < data->colortable.size()
i < data->colortable.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
814 data->colortable[i] |= 0xff000000;
never executed: data->colortable[i] |= 0xff000000;
0
815 }
never executed: end of block
0
816-
817 if (!convert_indexed8_to_ARGB_inplace(data, flags)
!convert_index...e(data, flags)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
818 return
never executed: return false;
false;
never executed: return false;
0
819-
820 data->format = QImage::Format_RGB32;-
821 return
never executed: return true;
true;
never executed: return true;
0
822}-
823-
824static bool convert_indexed8_to_RGB16_inplace(QImageData *data, Qt::ImageConversionFlags)-
825{-
826 ((!(data->format == QImage::Format_Indexed8)) ? qt_assert("data->format == QImage::Format_Indexed8",__FILE__,893) : qt_noop());-
827 ((!(data->own_data)) ? qt_assert("data->own_data",__FILE__,894) : qt_noop());-
828-
829 const int depth = 16;-
830-
831 const int dst_bytes_per_line = ((data->width * depth + 31) >> 5) << 2;-
832 const int nbytes = dst_bytes_per_line * data->height;-
833 uchar *const newData = (uchar *)realloc(data->data, nbytes);-
834 if (!newData
!newDataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
835 return
never executed: return false;
false;
never executed: return false;
0
836-
837 data->data = newData;-
838-
839-
840 uchar *src_data = newData + data->nbytes;-
841 quint16 *dest_data = (quint16 *) (newData + nbytes);-
842 const int width = data->width;-
843 const int src_pad = data->bytes_per_line - width;-
844 const int dest_pad = (dst_bytes_per_line >> 1) - width;-
845-
846 quint16 colorTableRGB16[256];-
847 const int tableSize = data->colortable.size();-
848 if (tableSize == 0
tableSize == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
849 for (int i = 0; i < 256
i < 256Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
850 colorTableRGB16[i] = qConvertRgb32To16(qRgb(i, i, i));
never executed: colorTableRGB16[i] = qConvertRgb32To16(qRgb(i, i, i));
0
851 }
never executed: end of block
else {
0
852-
853 for (int i = 0; i < tableSize
i < tableSizeDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
854 colorTableRGB16[i] = qConvertRgb32To16(data->colortable.at(i));
never executed: colorTableRGB16[i] = qConvertRgb32To16(data->colortable.at(i));
0
855 data->colortable = QVector<QRgb>();-
856-
857-
858 const quint16 lastColor = colorTableRGB16[tableSize - 1];-
859 for (int i = tableSize; i < 256
i < 256Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
860 colorTableRGB16[i] = lastColor;
never executed: colorTableRGB16[i] = lastColor;
0
861 }
never executed: end of block
0
862-
863 for (int i = 0; i < data->height
i < data->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
864 src_data -= src_pad;-
865 dest_data -= dest_pad;-
866 for (int pixI = 0; pixI < width
pixI < widthDescription
TRUEnever evaluated
FALSEnever evaluated
; ++pixI) {
0
867 --src_data;-
868 --dest_data;-
869 *dest_data = colorTableRGB16[*src_data];-
870 }
never executed: end of block
0
871 }
never executed: end of block
0
872-
873 data->format = QImage::Format_RGB16;-
874 data->bytes_per_line = dst_bytes_per_line;-
875 data->depth = depth;-
876 data->nbytes = nbytes;-
877-
878 return
never executed: return true;
true;
never executed: return true;
0
879}-
880-
881static bool convert_RGB_to_RGB16_inplace(QImageData *data, Qt::ImageConversionFlags)-
882{-
883 ((!(data->format == QImage::Format_RGB32)) ? qt_assert("data->format == QImage::Format_RGB32",__FILE__,950) : qt_noop());-
884 ((!(data->own_data)) ? qt_assert("data->own_data",__FILE__,951) : qt_noop());-
885-
886 const int depth = 16;-
887-
888 const int dst_bytes_per_line = ((data->width * depth + 31) >> 5) << 2;-
889 const int src_bytes_per_line = data->bytes_per_line;-
890 quint32 *src_data = (quint32 *) data->data;-
891 quint16 *dst_data = (quint16 *) data->data;-
892-
893 for (int i = 0; i < data->height
i < data->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
894 for (int j = 0; j < data->width
j < data->widthDescription
TRUEnever evaluated
FALSEnever evaluated
; ++j)
0
895 dst_data[j] = qConvertRgb32To16(src_data[j]);
never executed: dst_data[j] = qConvertRgb32To16(src_data[j]);
0
896 src_data = (quint32 *) (((char*)src_data) + src_bytes_per_line);-
897 dst_data = (quint16 *) (((char*)dst_data) + dst_bytes_per_line);-
898 }
never executed: end of block
0
899 data->format = QImage::Format_RGB16;-
900 data->bytes_per_line = dst_bytes_per_line;-
901 data->depth = depth;-
902 data->nbytes = dst_bytes_per_line * data->height;-
903 uchar *const newData = (uchar *)realloc(data->data, data->nbytes);-
904 if (newData
newDataDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
905 data->data = newData;-
906 return
never executed: return true;
true;
never executed: return true;
0
907 } else {-
908 return
never executed: return false;
false;
never executed: return false;
0
909 }-
910}-
911-
912static void convert_ARGB_PM_to_ARGB(QImageData *dest, const QImageData *src)-
913{-
914 ((!(src->format == QImage::Format_ARGB32_Premultiplied || src->format == QImage::Format_RGBA8888_Premultiplied)) ? qt_assert("src->format == QImage::Format_ARGB32_Premultiplied || src->format == QImage::Format_RGBA8888_Premultiplied",__FILE__,981) : qt_noop());-
915 ((!(dest->format == QImage::Format_ARGB32 || dest->format == QImage::Format_RGBA8888)) ? qt_assert("dest->format == QImage::Format_ARGB32 || dest->format == QImage::Format_RGBA8888",__FILE__,982) : qt_noop());-
916 ((!(src->width == dest->width)) ? qt_assert("src->width == dest->width",__FILE__,983) : qt_noop());-
917 ((!(src->height == dest->height)) ? qt_assert("src->height == dest->height",__FILE__,984) : qt_noop());-
918-
919 const int src_pad = (src->bytes_per_line >> 2) - src->width;-
920 const int dest_pad = (dest->bytes_per_line >> 2) - dest->width;-
921 const QRgb *src_data = (QRgb *) src->data;-
922 QRgb *dest_data = (QRgb *) dest->data;-
923-
924 for (int i = 0; i < src->height
i < src->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
925 const QRgb *end = src_data + src->width;-
926 while (src_data < end
src_data < endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
927 *dest_data = qUnpremultiply(*src_data);-
928 ++src_data;-
929 ++dest_data;-
930 }
never executed: end of block
0
931 src_data += src_pad;-
932 dest_data += dest_pad;-
933 }
never executed: end of block
0
934}
never executed: end of block
0
935-
936static void convert_RGBA_to_RGB(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)-
937{-
938 ((!(src->format == QImage::Format_RGBA8888 || src->format == QImage::Format_RGBX8888)) ? qt_assert("src->format == QImage::Format_RGBA8888 || src->format == QImage::Format_RGBX8888",__FILE__,1005) : qt_noop());-
939 ((!(dest->format == QImage::Format_RGB32)) ? qt_assert("dest->format == QImage::Format_RGB32",__FILE__,1006) : qt_noop());-
940 ((!(src->width == dest->width)) ? qt_assert("src->width == dest->width",__FILE__,1007) : qt_noop());-
941 ((!(src->height == dest->height)) ? qt_assert("src->height == dest->height",__FILE__,1008) : qt_noop());-
942-
943 const int src_pad = (src->bytes_per_line >> 2) - src->width;-
944 const int dest_pad = (dest->bytes_per_line >> 2) - dest->width;-
945 const uint *src_data = (const uint *)src->data;-
946 uint *dest_data = (uint *)dest->data;-
947-
948 for (int i = 0; i < src->height
i < src->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
949 const uint *end = src_data + src->width;-
950 while (src_data < end
src_data < endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
951 *dest_data = RGBA2ARGB(*src_data) | 0xff000000;-
952 ++src_data;-
953 ++dest_data;-
954 }
never executed: end of block
0
955 src_data += src_pad;-
956 dest_data += dest_pad;-
957 }
never executed: end of block
0
958}
never executed: end of block
0
959-
960static void swap_bit_order(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)-
961{-
962 ((!(src->format == QImage::Format_Mono || src->format == QImage::Format_MonoLSB)) ? qt_assert("src->format == QImage::Format_Mono || src->format == QImage::Format_MonoLSB",__FILE__,1029) : qt_noop());-
963 ((!(dest->format == QImage::Format_Mono || dest->format == QImage::Format_MonoLSB)) ? qt_assert("dest->format == QImage::Format_Mono || dest->format == QImage::Format_MonoLSB",__FILE__,1030) : qt_noop());-
964 ((!(src->width == dest->width)) ? qt_assert("src->width == dest->width",__FILE__,1031) : qt_noop());-
965 ((!(src->height == dest->height)) ? qt_assert("src->height == dest->height",__FILE__,1032) : qt_noop());-
966 ((!(src->nbytes == dest->nbytes)) ? qt_assert("src->nbytes == dest->nbytes",__FILE__,1033) : qt_noop());-
967 ((!(src->bytes_per_line == dest->bytes_per_line)) ? qt_assert("src->bytes_per_line == dest->bytes_per_line",__FILE__,1034) : qt_noop());-
968-
969 dest->colortable = src->colortable;-
970-
971 const uchar *src_data = src->data;-
972 const uchar *end = src->data + src->nbytes;-
973 uchar *dest_data = dest->data;-
974 while (src_data < end
src_data < endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
975 *dest_data = bitflip[*src_data];-
976 ++src_data;-
977 ++dest_data;-
978 }
never executed: end of block
0
979}
never executed: end of block
0
980-
981static void mask_alpha_converter(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)-
982{-
983 ((!(src->width == dest->width)) ? qt_assert("src->width == dest->width",__FILE__,1050) : qt_noop());-
984 ((!(src->height == dest->height)) ? qt_assert("src->height == dest->height",__FILE__,1051) : qt_noop());-
985-
986 const int src_pad = (src->bytes_per_line >> 2) - src->width;-
987 const int dest_pad = (dest->bytes_per_line >> 2) - dest->width;-
988 const uint *src_data = (const uint *)src->data;-
989 uint *dest_data = (uint *)dest->data;-
990-
991 for (int i = 0; i < src->height
i < src->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
992 const uint *end = src_data + src->width;-
993 while (src_data < end
src_data < endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
994 *dest_data = *src_data | 0xff000000;-
995 ++src_data;-
996 ++dest_data;-
997 }
never executed: end of block
0
998 src_data += src_pad;-
999 dest_data += dest_pad;-
1000 }
never executed: end of block
0
1001}
never executed: end of block
0
1002-
1003template<QImage::Format DestFormat>-
1004static bool mask_alpha_converter_inplace(QImageData *data, Qt::ImageConversionFlags)-
1005{-
1006 ((!(data->format == QImage::Format_RGB32 || DestFormat == QImage::Format_RGB32 || DestFormat == QImage::Format_RGBX8888)) ? qt_assert("data->format == QImage::Format_RGB32 || DestFormat == QImage::Format_RGB32 || DestFormat == QImage::Format_RGBX8888",-
1007-
1008 __FILE__-
1009 ,-
1010-
1011 1075-
1012 ) : qt_noop())-
1013-
1014 ;-
1015 const int pad = (data->bytes_per_line >> 2) - data->width;-
1016 QRgb *rgb_data = (QRgb *) data->data;-
1017-
1018 for (int i = 0; i < data->height
i < data->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1019 const QRgb *end = rgb_data + data->width;-
1020 while (rgb_data < end
rgb_data < endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1021 *rgb_data = *rgb_data | 0xff000000;-
1022 ++rgb_data;-
1023 }
never executed: end of block
0
1024 rgb_data += pad;-
1025 }
never executed: end of block
0
1026 data->format = DestFormat;-
1027 return
never executed: return true;
true;
never executed: return true;
0
1028}-
1029-
1030static void mask_alpha_converter_RGBx(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags flags)-
1031{-
1032-
1033 return
never executed: return mask_alpha_converter(dest, src, flags);
mask_alpha_converter(dest, src, flags);
never executed: return mask_alpha_converter(dest, src, flags);
0
1034}-
1035-
1036static bool mask_alpha_converter_rgbx_inplace(QImageData *data, Qt::ImageConversionFlags flags)-
1037{-
1038-
1039 return
never executed: return mask_alpha_converter_inplace<QImage::Format_RGBX8888>(data, flags);
mask_alpha_converter_inplace<QImage::Format_RGBX8888>(data, flags);
never executed: return mask_alpha_converter_inplace<QImage::Format_RGBX8888>(data, flags);
0
1040}-
1041-
1042static QVector<QRgb> fix_color_table(const QVector<QRgb> &ctbl, QImage::Format format)-
1043{-
1044 QVector<QRgb> colorTable = ctbl;-
1045 if (format == QImage::Format_RGB32
format == QImage::Format_RGB32Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1046-
1047 for (int i = 0; i < colorTable.size()
i < colorTable.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
1048 if (qAlpha(colorTable.at(i) != 0xff)
qAlpha(colorTa...at(i) != 0xff)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1049 colorTable[i] = colorTable.at(i) | 0xff000000;
never executed: colorTable[i] = colorTable.at(i) | 0xff000000;
0
1050 }
never executed: end of block
else if (format == QImage::Format_ARGB32_Premultiplied
format == QIma..._PremultipliedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1051-
1052 for (int i = 0; i < colorTable.size()
i < colorTable.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
1053 colorTable[i] = qPremultiply(colorTable.at(i));
never executed: colorTable[i] = qPremultiply(colorTable.at(i));
0
1054 }
never executed: end of block
0
1055 return
never executed: return colorTable;
colorTable;
never executed: return colorTable;
0
1056}-
1057-
1058-
1059-
1060-
1061-
1062void dither_to_Mono(QImageData *dst, const QImageData *src,-
1063 Qt::ImageConversionFlags flags, bool fromalpha)-
1064{-
1065 ((!(src->width == dst->width)) ? qt_assert("src->width == dst->width",__FILE__,1164) : qt_noop());-
1066 ((!(src->height == dst->height)) ? qt_assert("src->height == dst->height",__FILE__,1165) : qt_noop());-
1067 ((!(dst->format == QImage::Format_Mono || dst->format == QImage::Format_MonoLSB)) ? qt_assert("dst->format == QImage::Format_Mono || dst->format == QImage::Format_MonoLSB",__FILE__,1166) : qt_noop());-
1068-
1069 dst->colortable.clear();-
1070 dst->colortable.append(0xffffffff);-
1071 dst->colortable.append(0xff000000);-
1072-
1073 enum { Threshold, Ordered, Diffuse } dithermode;-
1074-
1075 if (fromalpha
fromalphaDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1076 if ((
(flags & Qt::A...useAlphaDitherDescription
TRUEnever evaluated
FALSEnever evaluated
flags & Qt::AlphaDither_Mask) == Qt::DiffuseAlphaDither
(flags & Qt::A...useAlphaDitherDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1077 dithermode = Diffuse;
never executed: dithermode = Diffuse;
0
1078 else if ((
(flags & Qt::A...redAlphaDitherDescription
TRUEnever evaluated
FALSEnever evaluated
flags & Qt::AlphaDither_Mask) == Qt::OrderedAlphaDither
(flags & Qt::A...redAlphaDitherDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1079 dithermode = Ordered;
never executed: dithermode = Ordered;
0
1080 else-
1081 dithermode = Threshold;
never executed: dithermode = Threshold;
0
1082 } else {-
1083 if ((
(flags & Qt::D...hresholdDitherDescription
TRUEnever evaluated
FALSEnever evaluated
flags & Qt::Dither_Mask) == Qt::ThresholdDither
(flags & Qt::D...hresholdDitherDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1084 dithermode = Threshold;
never executed: dithermode = Threshold;
0
1085 else if ((
(flags & Qt::D...:OrderedDitherDescription
TRUEnever evaluated
FALSEnever evaluated
flags & Qt::Dither_Mask) == Qt::OrderedDither
(flags & Qt::D...:OrderedDitherDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1086 dithermode = Ordered;
never executed: dithermode = Ordered;
0
1087 else-
1088 dithermode = Diffuse;
never executed: dithermode = Diffuse;
0
1089 }-
1090-
1091 int w = src->width;-
1092 int h = src->height;-
1093 int d = src->depth;-
1094 uchar gray[256];-
1095 bool use_gray = (d == 8);-
1096 if (use_gray
use_grayDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1097 if (fromalpha
fromalphaDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1098-
1099-
1100 for (int i = 0; i < src->colortable.size()
i < src->colortable.size()Description
TRUEnever evaluated
FALSEnever evaluated
; i++)
0
1101 gray[i] = (255 - (src->colortable.at(i) >> 24));
never executed: gray[i] = (255 - (src->colortable.at(i) >> 24));
0
1102 }
never executed: end of block
else {
0
1103-
1104-
1105 for (int i = 0; i < src->colortable.size()
i < src->colortable.size()Description
TRUEnever evaluated
FALSEnever evaluated
; i++)
0
1106 gray[i] = qGray(src->colortable.at(i));
never executed: gray[i] = qGray(src->colortable.at(i));
0
1107 }
never executed: end of block
0
1108 }-
1109-
1110 uchar *dst_data = dst->data;-
1111 int dst_bpl = dst->bytes_per_line;-
1112 const uchar *src_data = src->data;-
1113 int src_bpl = src->bytes_per_line;-
1114-
1115 switch (dithermode) {-
1116 case
never executed: case Diffuse:
Diffuse:
never executed: case Diffuse:
{
0
1117 QScopedArrayPointer<int> lineBuffer(new int[w * 2]);-
1118 int *line1 = lineBuffer.data();-
1119 int *line2 = lineBuffer.data() + w;-
1120 int bmwidth = (w+7)/8;-
1121-
1122 int *b1, *b2;-
1123 int wbytes = w * (d/8);-
1124 const uchar *p = src->data;-
1125 const uchar *end = p + wbytes;-
1126 b2 = line2;-
1127 if (use_gray
use_grayDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1128 while (p < end
p < endDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1129 *
never executed: *b2++ = gray[*p++];
b2++ = gray[*p++];
never executed: *b2++ = gray[*p++];
0
1130 }
never executed: end of block
else {
0
1131 if (fromalpha
fromalphaDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1132 while (p < end
p < endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1133 *b2++ = 255 - (*(const uint*)p >> 24);-
1134 p += 4;-
1135 }
never executed: end of block
0
1136 }
never executed: end of block
else {
0
1137 while (p < end
p < endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1138 *b2++ = qGray(*(const uint*)p);-
1139 p += 4;-
1140 }
never executed: end of block
0
1141 }
never executed: end of block
0
1142 }-
1143 for (int y=0; y<h
y<hDescription
TRUEnever evaluated
FALSEnever evaluated
; y++) {
0
1144 int *tmp = line1; line1 = line2; line2 = tmp;-
1145 bool not_last_line = y < h - 1;-
1146 if (not_last_line
not_last_lineDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1147 p = src->data + (y+1)*src->bytes_per_line;-
1148 end = p + wbytes;-
1149 b2 = line2;-
1150 if (use_gray
use_grayDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1151 while (p < end
p < endDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1152 *
never executed: *b2++ = gray[*p++];
b2++ = gray[*p++];
never executed: *b2++ = gray[*p++];
0
1153 }
never executed: end of block
else {
0
1154 if (fromalpha
fromalphaDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1155 while (p < end
p < endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1156 *b2++ = 255 - (*(const uint*)p >> 24);-
1157 p += 4;-
1158 }
never executed: end of block
0
1159 }
never executed: end of block
else {
0
1160 while (p < end
p < endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1161 *b2++ = qGray(*(const uint*)p);-
1162 p += 4;-
1163 }
never executed: end of block
0
1164 }
never executed: end of block
0
1165 }-
1166 }-
1167-
1168 int err;-
1169 uchar *p = dst->data + y*dst->bytes_per_line;-
1170 memset(p, 0, bmwidth);-
1171 b1 = line1;-
1172 b2 = line2;-
1173 int bit = 7;-
1174 for (int x=1; x<=w
x<=wDescription
TRUEnever evaluated
FALSEnever evaluated
; x++) {
0
1175 if (*
*b1 < 128Description
TRUEnever evaluated
FALSEnever evaluated
b1 < 128
*b1 < 128Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1176 err = *b1++;-
1177 *p |= 1 << bit;-
1178 }
never executed: end of block
else {
0
1179 err = *b1++ - 255;-
1180 }
never executed: end of block
0
1181 if (bit == 0
bit == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1182 p++;-
1183 bit = 7;-
1184 }
never executed: end of block
else {
0
1185 bit--;-
1186 }
never executed: end of block
0
1187 if (x < w
x < wDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1188 *
never executed: *b1 += (err*7)>>4;
b1 += (err*7)>>4;
never executed: *b1 += (err*7)>>4;
0
1189 if (not_last_line
not_last_lineDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1190 b2[0] += (err*5)>>4;-
1191 if (x > 1
x > 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1192 b2[-1] += (err*3)>>4;
never executed: b2[-1] += (err*3)>>4;
0
1193 if (x < w
x < wDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1194 b2[1] += err>>4;
never executed: b2[1] += err>>4;
0
1195 }
never executed: end of block
0
1196 b2++;-
1197 }
never executed: end of block
0
1198 }
never executed: end of block
0
1199 } break;
never executed: break;
0
1200 case
never executed: case Ordered:
Ordered:
never executed: case Ordered:
{
0
1201-
1202 memset(dst->data, 0, dst->nbytes);-
1203 if (d == 32
d == 32Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1204 for (int i=0; i<h
i<hDescription
TRUEnever evaluated
FALSEnever evaluated
; i++) {
0
1205 const uint *p = (const uint *)src_data;-
1206 const uint *end = p + w;-
1207 uchar *m = dst_data;-
1208 int bit = 7;-
1209 int j = 0;-
1210 if (fromalpha
fromalphaDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1211 while (p < end
p < endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1212 if ((*
(*p++ >> 24) >...[j++&15][i&15]Description
TRUEnever evaluated
FALSEnever evaluated
p++ >> 24) >= qt_bayer_matrix[j++&15][i&15]
(*p++ >> 24) >...[j++&15][i&15]Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1213 *
never executed: *m |= 1 << bit;
m |= 1 << bit;
never executed: *m |= 1 << bit;
0
1214 if (bit == 0
bit == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1215 m++;-
1216 bit = 7;-
1217 }
never executed: end of block
else {
0
1218 bit--;-
1219 }
never executed: end of block
0
1220 }-
1221 }
never executed: end of block
else {
0
1222 while (p < end
p < endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1223 if ((
(uint)qGray(*p...[j++&15][i&15]Description
TRUEnever evaluated
FALSEnever evaluated
uint)qGray(*p++) < qt_bayer_matrix[j++&15][i&15]
(uint)qGray(*p...[j++&15][i&15]Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1224 *
never executed: *m |= 1 << bit;
m |= 1 << bit;
never executed: *m |= 1 << bit;
0
1225 if (bit == 0
bit == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1226 m++;-
1227 bit = 7;-
1228 }
never executed: end of block
else {
0
1229 bit--;-
1230 }
never executed: end of block
0
1231 }-
1232 }
never executed: end of block
0
1233 dst_data += dst_bpl;-
1234 src_data += src_bpl;-
1235 }
never executed: end of block
0
1236 }
never executed: end of block
else if (d == 8
d == 8Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1237 for (int i=0; i<h
i<hDescription
TRUEnever evaluated
FALSEnever evaluated
; i++) {
0
1238 const uchar *p = src_data;-
1239 const uchar *end = p + w;-
1240 uchar *m = dst_data;-
1241 int bit = 7;-
1242 int j = 0;-
1243 while (p < end
p < endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1244 if ((
(uint)gray[*p+...[j++&15][i&15]Description
TRUEnever evaluated
FALSEnever evaluated
uint)gray[*p++] < qt_bayer_matrix[j++&15][i&15]
(uint)gray[*p+...[j++&15][i&15]Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1245 *
never executed: *m |= 1 << bit;
m |= 1 << bit;
never executed: *m |= 1 << bit;
0
1246 if (bit == 0
bit == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1247 m++;-
1248 bit = 7;-
1249 }
never executed: end of block
else {
0
1250 bit--;-
1251 }
never executed: end of block
0
1252 }-
1253 dst_data += dst_bpl;-
1254 src_data += src_bpl;-
1255 }
never executed: end of block
0
1256 }
never executed: end of block
0
1257 } break;
never executed: break;
0
1258 default
never executed: default:
:
never executed: default:
{
0
1259 memset(dst->data, 0, dst->nbytes);-
1260 if (d == 32
d == 32Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1261 for (int i=0; i<h
i<hDescription
TRUEnever evaluated
FALSEnever evaluated
; i++) {
0
1262 const uint *p = (const uint *)src_data;-
1263 const uint *end = p + w;-
1264 uchar *m = dst_data;-
1265 int bit = 7;-
1266 if (fromalpha
fromalphaDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1267 while (p < end
p < endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1268 if ((*
(*p++ >> 24) >= 128Description
TRUEnever evaluated
FALSEnever evaluated
p++ >> 24) >= 128
(*p++ >> 24) >= 128Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1269 *
never executed: *m |= 1 << bit;
m |= 1 << bit;
never executed: *m |= 1 << bit;
0
1270 if (bit == 0
bit == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1271 m++;-
1272 bit = 7;-
1273 }
never executed: end of block
else {
0
1274 bit--;-
1275 }
never executed: end of block
0
1276 }-
1277 }
never executed: end of block
else {
0
1278 while (p < end
p < endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1279 if (qGray(*p++) < 128
qGray(*p++) < 128Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1280 *
never executed: *m |= 1 << bit;
m |= 1 << bit;
never executed: *m |= 1 << bit;
0
1281 if (bit == 0
bit == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1282 m++;-
1283 bit = 7;-
1284 }
never executed: end of block
else {
0
1285 bit--;-
1286 }
never executed: end of block
0
1287 }-
1288 }
never executed: end of block
0
1289 dst_data += dst_bpl;-
1290 src_data += src_bpl;-
1291 }
never executed: end of block
0
1292 }
never executed: end of block
else
0
1293 if (d == 8
d == 8Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1294 for (int i=0; i<h
i<hDescription
TRUEnever evaluated
FALSEnever evaluated
; i++) {
0
1295 const uchar *p = src_data;-
1296 const uchar *end = p + w;-
1297 uchar *m = dst_data;-
1298 int bit = 7;-
1299 while (p < end
p < endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1300 if (gray[*p++] < 128
gray[*p++] < 128Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1301 *
never executed: *m |= 1 << bit;
m |= 1 << bit;
never executed: *m |= 1 << bit;
0
1302 if (bit == 0
bit == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1303 m++;-
1304 bit = 7;-
1305 }
never executed: end of block
else {
0
1306 bit--;-
1307 }
never executed: end of block
0
1308 }-
1309 dst_data += dst_bpl;-
1310 src_data += src_bpl;-
1311 }
never executed: end of block
0
1312 }
never executed: end of block
0
1313 }-
1314 }
never executed: end of block
0
1315-
1316 if (dst->format == QImage::Format_MonoLSB
dst->format ==...Format_MonoLSBDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1317-
1318 uchar *sl = dst->data;-
1319 int bpl = (dst->width + 7) * dst->depth / 8;-
1320 int pad = dst->bytes_per_line - bpl;-
1321 for (int y=0; y<dst->height
y<dst->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; ++y) {
0
1322 for (int x=0; x<bpl
x<bplDescription
TRUEnever evaluated
FALSEnever evaluated
; ++x) {
0
1323 *sl = bitflip[*sl];-
1324 ++sl;-
1325 }
never executed: end of block
0
1326 sl += pad;-
1327 }
never executed: end of block
0
1328 }
never executed: end of block
0
1329}
never executed: end of block
0
1330-
1331static void convert_X_to_Mono(QImageData *dst, const QImageData *src, Qt::ImageConversionFlags flags)-
1332{-
1333 dither_to_Mono(dst, src, flags, false);-
1334}
never executed: end of block
0
1335-
1336static void convert_ARGB_PM_to_Mono(QImageData *dst, const QImageData *src, Qt::ImageConversionFlags flags)-
1337{-
1338 QScopedPointer<QImageData> tmp(QImageData::create(QSize(src->width, src->height), QImage::Format_ARGB32));-
1339 convert_ARGB_PM_to_ARGB(tmp.data(), src);-
1340 dither_to_Mono(dst, tmp.data(), flags, false);-
1341}
never executed: end of block
0
1342struct QRgbMap {-
1343 inline QRgbMap() : used(0) { }
never executed: end of block
0
1344 uchar pix;-
1345 uchar used;-
1346 QRgb rgb;-
1347};-
1348-
1349static void convert_RGB_to_Indexed8(QImageData *dst, const QImageData *src, Qt::ImageConversionFlags flags)-
1350{-
1351 ((!(src->format == QImage::Format_RGB32 || src->format == QImage::Format_ARGB32)) ? qt_assert("src->format == QImage::Format_RGB32 || src->format == QImage::Format_ARGB32",__FILE__,1459) : qt_noop());-
1352 ((!(dst->format == QImage::Format_Indexed8)) ? qt_assert("dst->format == QImage::Format_Indexed8",__FILE__,1460) : qt_noop());-
1353 ((!(src->width == dst->width)) ? qt_assert("src->width == dst->width",__FILE__,1461) : qt_noop());-
1354 ((!(src->height == dst->height)) ? qt_assert("src->height == dst->height",__FILE__,1462) : qt_noop());-
1355-
1356 bool do_quant = (
(flags & Qt::D...::PreferDitherDescription
TRUEnever evaluated
FALSEnever evaluated
flags & Qt::DitherMode_Mask) == Qt::PreferDither
(flags & Qt::D...::PreferDitherDescription
TRUEnever evaluated
FALSEnever evaluated
0
1357 || src->format == QImage::Format_ARGB32
src->format ==...:Format_ARGB32Description
TRUEnever evaluated
FALSEnever evaluated
;
0
1358 uint alpha_mask = src->format == QImage::Format_RGB32
src->format ==...::Format_RGB32Description
TRUEnever evaluated
FALSEnever evaluated
? 0xff000000 : 0;
0
1359-
1360 const int tablesize = 997;-
1361 QRgbMap table[tablesize];-
1362 int pix=0;-
1363-
1364 if (!dst->colortable.isEmpty()
!dst->colortable.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1365 QVector<QRgb> ctbl = dst->colortable;-
1366 dst->colortable.resize(256);-
1367-
1368-
1369 for (int i = 0; i < dst->colortable.size()
i < dst->colortable.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1370-
1371 QRgb p = ctbl.at(i) | alpha_mask;-
1372 int hash = p % tablesize;-
1373 for (;;) {-
1374 if (table[hash].used
table[hash].usedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1375 if (table[hash].rgb == p
table[hash].rgb == pDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1376-
1377 break;
never executed: break;
0
1378 } else {-
1379-
1380 if (++
++hash == tablesizeDescription
TRUEnever evaluated
FALSEnever evaluated
hash == tablesize
++hash == tablesizeDescription
TRUEnever evaluated
FALSEnever evaluated
) hash = 0;
never executed: hash = 0;
0
1381 }
never executed: end of block
0
1382 } else {-
1383-
1384 ((!(pix != 256)) ? qt_assert("pix != 256",__FILE__,1492) : qt_noop());-
1385-
1386 dst->colortable[pix] = p;-
1387 table[hash].pix = pix++;-
1388 table[hash].rgb = p;-
1389 table[hash].used = 1;-
1390 break;
never executed: break;
0
1391 }-
1392 }-
1393 }
never executed: end of block
0
1394 }
never executed: end of block
0
1395-
1396 if ((
(flags & Qt::D...::PreferDitherDescription
TRUEnever evaluated
FALSEnever evaluated
flags & Qt::DitherMode_Mask) != Qt::PreferDither
(flags & Qt::D...::PreferDitherDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1397 dst->colortable.resize(256);-
1398 const uchar *src_data = src->data;-
1399 uchar *dest_data = dst->data;-
1400 for (int y = 0; y < src->height
y < src->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; y++) {
0
1401 const QRgb *s = (const QRgb *)src_data;-
1402 uchar *b = dest_data;-
1403 for (int x = 0; x < src->width
x < src->widthDescription
TRUEnever evaluated
FALSEnever evaluated
; ++x) {
0
1404 QRgb p = s[x] | alpha_mask;-
1405 int hash = p % tablesize;-
1406 for (;;) {-
1407 if (table[hash].used
table[hash].usedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1408 if (table[hash].rgb == (p)
table[hash].rgb == (p)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1409-
1410 break;
never executed: break;
0
1411 } else {-
1412-
1413 if (++
++hash == tablesizeDescription
TRUEnever evaluated
FALSEnever evaluated
hash == tablesize
++hash == tablesizeDescription
TRUEnever evaluated
FALSEnever evaluated
) hash = 0;
never executed: hash = 0;
0
1414 }
never executed: end of block
0
1415 } else {-
1416-
1417 if (pix == 256
pix == 256Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1418 do_quant = true;-
1419-
1420 x = src->width;-
1421 y = src->height;-
1422 }
never executed: end of block
else {
0
1423-
1424 dst->colortable[pix] = p;-
1425 table[hash].pix = pix++;-
1426 table[hash].rgb = p;-
1427 table[hash].used = 1;-
1428 }
never executed: end of block
0
1429 break;
never executed: break;
0
1430 }-
1431 }-
1432 *b++ = table[hash].pix;-
1433 }
never executed: end of block
0
1434 src_data += src->bytes_per_line;-
1435 dest_data += dst->bytes_per_line;-
1436 }
never executed: end of block
0
1437 }
never executed: end of block
0
1438 int numColors = do_quant
do_quantDescription
TRUEnever evaluated
FALSEnever evaluated
? 256 : pix;
0
1439-
1440 dst->colortable.resize(numColors);-
1441-
1442 if (do_quant
do_quantDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1443-
1444-
1445-
1446-
1447-
1448-
1449 for (int rc=0; rc<=5
rc<=5Description
TRUEnever evaluated
FALSEnever evaluated
; rc++)
0
1450 for (int gc=0; gc<=5
gc<=5Description
TRUEnever evaluated
FALSEnever evaluated
; gc++)
0
1451 for (int bc=0; bc<=5
bc<=5Description
TRUEnever evaluated
FALSEnever evaluated
; bc++)
0
1452 dst->colortable[(((rc)*(5 +1)+(gc))*(5 +1)+(bc))] = 0xff000000 | qRgb(rc*255/5, gc*255/5, bc*255/5);
never executed: dst->colortable[(((rc)*(5 +1)+(gc))*(5 +1)+(bc))] = 0xff000000 | qRgb(rc*255/5, gc*255/5, bc*255/5);
0
1453-
1454 const uchar *src_data = src->data;-
1455 uchar *dest_data = dst->data;-
1456 if ((
(flags & Qt::D...hresholdDitherDescription
TRUEnever evaluated
FALSEnever evaluated
flags & Qt::Dither_Mask) == Qt::ThresholdDither
(flags & Qt::D...hresholdDitherDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1457 for (int y = 0; y < src->height
y < src->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; y++) {
0
1458 const QRgb *p = (const QRgb *)src_data;-
1459 const QRgb *end = p + src->width;-
1460 uchar *b = dest_data;-
1461-
1462 while (p < end
p < endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1463-
1464 *b++ =-
1465 (((((uchar) ((qRed(*p) * (5) + 127) / 255)))*(5 +1)+(((uchar) ((qGreen(*p) * (5) + 127) / 255))))*(5 +1)+(((uchar) ((qBlue(*p) * (5) + 127) / 255))))-
1466-
1467-
1468-
1469 ;-
1470-
1471 p++;-
1472 }
never executed: end of block
0
1473 src_data += src->bytes_per_line;-
1474 dest_data += dst->bytes_per_line;-
1475 }
never executed: end of block
0
1476 }
never executed: end of block
else if ((
(flags & Qt::D...:DiffuseDitherDescription
TRUEnever evaluated
FALSEnever evaluated
flags & Qt::Dither_Mask) == Qt::DiffuseDither
(flags & Qt::D...:DiffuseDitherDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1477 int* line1[3];-
1478 int* line2[3];-
1479 int* pv[3];-
1480 QScopedArrayPointer<int> lineBuffer(new int[src->width * 9]);-
1481 line1[0] = lineBuffer.data();-
1482 line2[0] = lineBuffer.data() + src->width;-
1483 line1[1] = lineBuffer.data() + src->width * 2;-
1484 line2[1] = lineBuffer.data() + src->width * 3;-
1485 line1[2] = lineBuffer.data() + src->width * 4;-
1486 line2[2] = lineBuffer.data() + src->width * 5;-
1487 pv[0] = lineBuffer.data() + src->width * 6;-
1488 pv[1] = lineBuffer.data() + src->width * 7;-
1489 pv[2] = lineBuffer.data() + src->width * 8;-
1490-
1491 int endian = (QSysInfo::ByteOrder == QSysInfo::BigEndian);-
1492 for (int y = 0; y < src->height
y < src->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; y++) {
0
1493 const uchar* q = src_data;-
1494 const uchar* q2 = y < src->height - 1
y < src->height - 1Description
TRUEnever evaluated
FALSEnever evaluated
? q + src->bytes_per_line : src->data;
0
1495 uchar *b = dest_data;-
1496 for (int chan = 0; chan < 3
chan < 3Description
TRUEnever evaluated
FALSEnever evaluated
; chan++) {
0
1497 int *l1 = (
(y&1)Description
TRUEnever evaluated
FALSEnever evaluated
y&1)
(y&1)Description
TRUEnever evaluated
FALSEnever evaluated
? line2[chan] : line1[chan];
0
1498 int *l2 = (
(y&1)Description
TRUEnever evaluated
FALSEnever evaluated
y&1)
(y&1)Description
TRUEnever evaluated
FALSEnever evaluated
? line1[chan] : line2[chan];
0
1499 if (y == 0
y == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1500 for (int i = 0; i < src->width
i < src->widthDescription
TRUEnever evaluated
FALSEnever evaluated
; i++)
0
1501 l1[i] = q[i*4+chan+endian];
never executed: l1[i] = q[i*4+chan+endian];
0
1502 }
never executed: end of block
0
1503 if (y+1 < src->height
y+1 < src->heightDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1504 for (int i = 0; i < src->width
i < src->widthDescription
TRUEnever evaluated
FALSEnever evaluated
; i++)
0
1505 l2[i] = q2[i*4+chan+endian];
never executed: l2[i] = q2[i*4+chan+endian];
0
1506 }
never executed: end of block
0
1507-
1508 if (y&1
y&1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1509 for (int x = 0; x < src->width
x < src->widthDescription
TRUEnever evaluated
FALSEnever evaluated
; x++) {
0
1510 int pix = qMax(qMin(5, (l1[x] * 5 + 128)/ 255), 0);-
1511 int err = l1[x] - pix * 255 / 5;-
1512 pv[chan][x] = pix;-
1513-
1514-
1515 if (x + 1< src->width
x + 1< src->widthDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1516 l1[x+1] += (err*7)>>4;-
1517 l2[x+1] += err>>4;-
1518 }
never executed: end of block
0
1519 l2[x]+=(err*5)>>4;-
1520 if (x>1
x>1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1521 l2[x-1]+=(err*3)>>4;
never executed: l2[x-1]+=(err*3)>>4;
0
1522 }
never executed: end of block
0
1523 }
never executed: end of block
else {
0
1524 for (int x = src->width; x-- > 0
x-- > 0Description
TRUEnever evaluated
FALSEnever evaluated
;) {
0
1525 int pix = qMax(qMin(5, (l1[x] * 5 + 128)/ 255), 0);-
1526 int err = l1[x] - pix * 255 / 5;-
1527 pv[chan][x] = pix;-
1528-
1529-
1530 if (x > 0
x > 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1531 l1[x-1] += (err*7)>>4;-
1532 l2[x-1] += err>>4;-
1533 }
never executed: end of block
0
1534 l2[x]+=(err*5)>>4;-
1535 if (x + 1 < src->width
x + 1 < src->widthDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1536 l2[x+1]+=(err*3)>>4;
never executed: l2[x+1]+=(err*3)>>4;
0
1537 }
never executed: end of block
0
1538 }
never executed: end of block
0
1539 }-
1540 if (endian
endianDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1541 for (int x = 0; x < src->width
x < src->widthDescription
TRUEnever evaluated
FALSEnever evaluated
; x++) {
0
1542 *b++ = (((pv[0][x])*(5 +1)+(pv[1][x]))*(5 +1)+(pv[2][x]));-
1543 }
never executed: end of block
0
1544 }
never executed: end of block
else {
0
1545 for (int x = 0; x < src->width
x < src->widthDescription
TRUEnever evaluated
FALSEnever evaluated
; x++) {
0
1546 *b++ = (((pv[2][x])*(5 +1)+(pv[1][x]))*(5 +1)+(pv[0][x]));-
1547 }
never executed: end of block
0
1548 }
never executed: end of block
0
1549 src_data += src->bytes_per_line;-
1550 dest_data += dst->bytes_per_line;-
1551 }
never executed: end of block
0
1552 }
never executed: end of block
else {
0
1553 for (int y = 0; y < src->height
y < src->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; y++) {
0
1554 const QRgb *p = (const QRgb *)src_data;-
1555 const QRgb *end = p + src->width;-
1556 uchar *b = dest_data;-
1557-
1558 int x = 0;-
1559 while (p < end
p < endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1560 uint d = qt_bayer_matrix[y & 15][x & 15] << 8;-
1561-
1562-
1563 *b++ =-
1564 (((((uchar) ((((256 * (5) + (5) + 1)) * (qRed(*p)) + (d)) >> 16)))*(5 +1)+(((uchar) ((((256 * (5) + (5) + 1)) * (qGreen(*p)) + (d)) >> 16))))*(5 +1)+(((uchar) ((((256 * (5) + (5) + 1)) * (qBlue(*p)) + (d)) >> 16))))-
1565-
1566-
1567-
1568 ;-
1569-
1570-
1571 p++;-
1572 x++;-
1573 }
never executed: end of block
0
1574 src_data += src->bytes_per_line;-
1575 dest_data += dst->bytes_per_line;-
1576 }
never executed: end of block
0
1577 }
never executed: end of block
0
1578-
1579 if (src->format != QImage::Format_RGB32
src->format !=...::Format_RGB32Description
TRUEnever evaluated
FALSEnever evaluated
0
1580 && src->format != QImage::Format_RGB16
src->format !=...::Format_RGB16Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1581 const int trans = 216;-
1582 ((!(dst->colortable.size() > trans)) ? qt_assert("dst->colortable.size() > trans",__FILE__,1690) : qt_noop());-
1583 dst->colortable[trans] = 0;-
1584 QScopedPointer<QImageData> mask(QImageData::create(QSize(src->width, src->height), QImage::Format_Mono));-
1585 dither_to_Mono(mask.data(), src, flags, true);-
1586 uchar *dst_data = dst->data;-
1587 const uchar *mask_data = mask->data;-
1588 for (int y = 0; y < src->height
y < src->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; y++) {
0
1589 for (int x = 0; x < src->width
x < src->widthDescription
TRUEnever evaluated
FALSEnever evaluated
; x++) {
0
1590 if (!(mask_data[x>>3] & (0x80 >> (x & 7)))
!(mask_data[x>...0 >> (x & 7)))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1591 dst_data[x] = trans;
never executed: dst_data[x] = trans;
0
1592 }
never executed: end of block
0
1593 mask_data += mask->bytes_per_line;-
1594 dst_data += dst->bytes_per_line;-
1595 }
never executed: end of block
0
1596 dst->has_alpha_clut = true;-
1597 }
never executed: end of block
0
1598-
1599-
1600-
1601-
1602-
1603-
1604 }
never executed: end of block
0
1605}
never executed: end of block
0
1606-
1607static void convert_ARGB_PM_to_Indexed8(QImageData *dst, const QImageData *src, Qt::ImageConversionFlags flags)-
1608{-
1609 QScopedPointer<QImageData> tmp(QImageData::create(QSize(src->width, src->height), QImage::Format_ARGB32));-
1610 convert_ARGB_PM_to_ARGB(tmp.data(), src);-
1611 convert_RGB_to_Indexed8(dst, tmp.data(), flags);-
1612}
never executed: end of block
0
1613-
1614static void convert_ARGB_to_Indexed8(QImageData *dst, const QImageData *src, Qt::ImageConversionFlags flags)-
1615{-
1616 convert_RGB_to_Indexed8(dst, src, flags);-
1617}
never executed: end of block
0
1618-
1619static void convert_Indexed8_to_X32(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)-
1620{-
1621 ((!(src->format == QImage::Format_Indexed8)) ? qt_assert("src->format == QImage::Format_Indexed8",__FILE__,1729) : qt_noop());-
1622 ((!(dest->format == QImage::Format_RGB32 || dest->format == QImage::Format_ARGB32 || dest->format == QImage::Format_ARGB32_Premultiplied)) ? qt_assert("dest->format == QImage::Format_RGB32 || dest->format == QImage::Format_ARGB32 || dest->format == QImage::Format_ARGB32_Premultiplied",-
1623-
1624 __FILE__-
1625 ,-
1626-
1627 1732-
1628 ) : qt_noop())-
1629-
1630 ;-
1631 ((!(src->width == dest->width)) ? qt_assert("src->width == dest->width",__FILE__,1733) : qt_noop());-
1632 ((!(src->height == dest->height)) ? qt_assert("src->height == dest->height",__FILE__,1734) : qt_noop());-
1633-
1634 QVector<QRgb> colorTable = src->has_alpha_clut
src->has_alpha_clutDescription
TRUEnever evaluated
FALSEnever evaluated
? fix_color_table(src->colortable, dest->format) : src->colortable;
0
1635 if (colorTable.size() == 0
colorTable.size() == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1636 colorTable.resize(256);-
1637 for (int i=0; i<256
i<256Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
1638 colorTable[i] = qRgb(i, i, i);
never executed: colorTable[i] = qRgb(i, i, i);
0
1639 }
never executed: end of block
0
1640 if (colorTable.size() < 256
colorTable.size() < 256Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1641 int tableSize = colorTable.size();-
1642 colorTable.resize(256);-
1643 for (int i=tableSize; i<256
i<256Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
1644 colorTable[i] = 0;
never executed: colorTable[i] = 0;
0
1645 }
never executed: end of block
0
1646-
1647 int w = src->width;-
1648 const uchar *src_data = src->data;-
1649 uchar *dest_data = dest->data;-
1650 const QRgb *colorTablePtr = colorTable.constData();-
1651 for (int y = 0; y < src->height
y < src->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; y++) {
0
1652 uint *p = reinterpret_cast<uint *>(dest_data);-
1653 const uchar *b = src_data;-
1654 uint *end = p + w;-
1655-
1656 while (p < end
p < endDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1657 *
never executed: *p++ = colorTablePtr[*b++];
p++ = colorTablePtr[*b++];
never executed: *p++ = colorTablePtr[*b++];
0
1658-
1659 src_data += src->bytes_per_line;-
1660 dest_data += dest->bytes_per_line;-
1661 }
never executed: end of block
0
1662}
never executed: end of block
0
1663-
1664static void convert_Mono_to_X32(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)-
1665{-
1666 ((!(src->format == QImage::Format_Mono || src->format == QImage::Format_MonoLSB)) ? qt_assert("src->format == QImage::Format_Mono || src->format == QImage::Format_MonoLSB",__FILE__,1768) : qt_noop());-
1667 ((!(dest->format == QImage::Format_RGB32 || dest->format == QImage::Format_ARGB32 || dest->format == QImage::Format_ARGB32_Premultiplied)) ? qt_assert("dest->format == QImage::Format_RGB32 || dest->format == QImage::Format_ARGB32 || dest->format == QImage::Format_ARGB32_Premultiplied",-
1668-
1669 __FILE__-
1670 ,-
1671-
1672 1771-
1673 ) : qt_noop())-
1674-
1675 ;-
1676 ((!(src->width == dest->width)) ? qt_assert("src->width == dest->width",__FILE__,1772) : qt_noop());-
1677 ((!(src->height == dest->height)) ? qt_assert("src->height == dest->height",__FILE__,1773) : qt_noop());-
1678-
1679 QVector<QRgb> colorTable = fix_color_table(src->colortable, dest->format);-
1680-
1681-
1682 if (colorTable.size() < 2
colorTable.size() < 2Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1683 if (colorTable.size() == 0
colorTable.size() == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1684 colorTable << 0xff000000;
never executed: colorTable << 0xff000000;
0
1685 colorTable << 0xffffffff;-
1686 }
never executed: end of block
0
1687-
1688 const uchar *src_data = src->data;-
1689 uchar *dest_data = dest->data;-
1690 if (src->format == QImage::Format_Mono
src->format ==...e::Format_MonoDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1691 for (int y = 0; y < dest->height
y < dest->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; y++) {
0
1692 uint *p = (uint *)dest_data;-
1693 for (int x = 0; x < dest->width
x < dest->widthDescription
TRUEnever evaluated
FALSEnever evaluated
; x++)
0
1694 *
never executed: *p++ = colorTable.at((src_data[x>>3] >> (7 - (x & 7))) & 1);
p++ = colorTable.at((src_data[x>>3] >> (7 - (x & 7))) & 1);
never executed: *p++ = colorTable.at((src_data[x>>3] >> (7 - (x & 7))) & 1);
0
1695-
1696 src_data += src->bytes_per_line;-
1697 dest_data += dest->bytes_per_line;-
1698 }
never executed: end of block
0
1699 }
never executed: end of block
else {
0
1700 for (int y = 0; y < dest->height
y < dest->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; y++) {
0
1701 uint *p = (uint *)dest_data;-
1702 for (int x = 0; x < dest->width
x < dest->widthDescription
TRUEnever evaluated
FALSEnever evaluated
; x++)
0
1703 *
never executed: *p++ = colorTable.at((src_data[x>>3] >> (x & 7)) & 1);
p++ = colorTable.at((src_data[x>>3] >> (x & 7)) & 1);
never executed: *p++ = colorTable.at((src_data[x>>3] >> (x & 7)) & 1);
0
1704-
1705 src_data += src->bytes_per_line;-
1706 dest_data += dest->bytes_per_line;-
1707 }
never executed: end of block
0
1708 }
never executed: end of block
0
1709}-
1710-
1711-
1712static void convert_Mono_to_Indexed8(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)-
1713{-
1714 ((!(src->format == QImage::Format_Mono || src->format == QImage::Format_MonoLSB)) ? qt_assert("src->format == QImage::Format_Mono || src->format == QImage::Format_MonoLSB",__FILE__,1810) : qt_noop());-
1715 ((!(dest->format == QImage::Format_Indexed8)) ? qt_assert("dest->format == QImage::Format_Indexed8",__FILE__,1811) : qt_noop());-
1716 ((!(src->width == dest->width)) ? qt_assert("src->width == dest->width",__FILE__,1812) : qt_noop());-
1717 ((!(src->height == dest->height)) ? qt_assert("src->height == dest->height",__FILE__,1813) : qt_noop());-
1718-
1719 QVector<QRgb> ctbl = src->colortable;-
1720 if (ctbl.size() > 2
ctbl.size() > 2Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1721 ctbl.resize(2);-
1722 }
never executed: end of block
else if (ctbl.size() < 2
ctbl.size() < 2Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1723 if (ctbl.size() == 0
ctbl.size() == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1724 ctbl << 0xff000000;
never executed: ctbl << 0xff000000;
0
1725 ctbl << 0xffffffff;-
1726 }
never executed: end of block
0
1727 dest->colortable = ctbl;-
1728 dest->has_alpha_clut = src->has_alpha_clut;-
1729-
1730-
1731 const uchar *src_data = src->data;-
1732 uchar *dest_data = dest->data;-
1733 if (src->format == QImage::Format_Mono
src->format ==...e::Format_MonoDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1734 for (int y = 0; y < dest->height
y < dest->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; y++) {
0
1735 uchar *p = dest_data;-
1736 for (int x = 0; x < dest->width
x < dest->widthDescription
TRUEnever evaluated
FALSEnever evaluated
; x++)
0
1737 *
never executed: *p++ = (src_data[x>>3] >> (7 - (x & 7))) & 1;
p++ = (src_data[x>>3] >> (7 - (x & 7))) & 1;
never executed: *p++ = (src_data[x>>3] >> (7 - (x & 7))) & 1;
0
1738 src_data += src->bytes_per_line;-
1739 dest_data += dest->bytes_per_line;-
1740 }
never executed: end of block
0
1741 }
never executed: end of block
else {
0
1742 for (int y = 0; y < dest->height
y < dest->heightDescription
TRUEnever evaluated
FALSEnever evaluated
; y++) {
0
1743 uchar *p = dest_data;-
1744 for (int x = 0; x < dest->width
x < dest->widthDescription
TRUEnever evaluated
FALSEnever evaluated
; x++)
0
1745 *
never executed: *p++ = (src_data[x>>3] >> (x & 7)) & 1;
p++ = (src_data[x>>3] >> (x & 7)) & 1;
never executed: *p++ = (src_data[x>>3] >> (x & 7)) & 1;
0
1746 src_data += src->bytes_per_line;-
1747 dest_data += dest->bytes_per_line;-
1748 }
never executed: end of block
0
1749 }
never executed: end of block
0
1750}-
1751-
1752static void convert_Indexed8_to_Alpha8(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)-
1753{-
1754 ((!(src->format == QImage::Format_Indexed8)) ? qt_assert("src->format == QImage::Format_Indexed8",__FILE__,1850) : qt_noop());-
1755 ((!(dest->format == QImage::Format_Alpha8)) ? qt_assert("dest->format == QImage::Format_Alpha8",__FILE__,1851) : qt_noop());-
1756-
1757 uchar translate[256];-
1758 const QVector<QRgb> &colors = src->colortable;-
1759 bool simpleCase = (colors.size() == 256);-
1760 for (int i = 0; i < colors.size()
i < colors.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1761 uchar alpha = qAlpha(colors[i]);-
1762 translate[i] = alpha;-
1763 simpleCase = simpleCase
simpleCaseDescription
TRUEnever evaluated
FALSEnever evaluated
&& (
(alpha == i)Description
TRUEnever evaluated
FALSEnever evaluated
alpha == i)
(alpha == i)Description
TRUEnever evaluated
FALSEnever evaluated
;
0
1764 }
never executed: end of block
0
1765-
1766 if (simpleCase
simpleCaseDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1767 memcpy(dest->data, src->data, src->bytes_per_line * src->height);
never executed: memcpy(dest->data, src->data, src->bytes_per_line * src->height);
0
1768 else {-
1769 int size = src->bytes_per_line * src->height;-
1770 for (int i = 0; i < size
i < sizeDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1771 dest->data[i] = translate[src->data[i]];-
1772 }
never executed: end of block
0
1773 }
never executed: end of block
0
1774}-
1775-
1776static void convert_Indexed8_to_Grayscale8(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)-
1777{-
1778 ((!(src->format == QImage::Format_Indexed8)) ? qt_assert("src->format == QImage::Format_Indexed8",__FILE__,1874) : qt_noop());-
1779 ((!(dest->format == QImage::Format_Grayscale8)) ? qt_assert("dest->format == QImage::Format_Grayscale8",__FILE__,1875) : qt_noop());-
1780-
1781 uchar translate[256];-
1782 const QVector<QRgb> &colors = src->colortable;-
1783 bool simpleCase = (colors.size() == 256);-
1784 for (int i = 0; i < colors.size()
i < colors.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1785 uchar gray = qGray(colors[i]);-
1786 translate[i] = gray;-
1787 simpleCase = simpleCase
simpleCaseDescription
TRUEnever evaluated
FALSEnever evaluated
&& (
(gray == i)Description
TRUEnever evaluated
FALSEnever evaluated
gray == i)
(gray == i)Description
TRUEnever evaluated
FALSEnever evaluated
;
0
1788 }
never executed: end of block
0
1789-
1790 if (simpleCase
simpleCaseDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1791 memcpy(dest->data, src->data, src->bytes_per_line * src->height);
never executed: memcpy(dest->data, src->data, src->bytes_per_line * src->height);
0
1792 else {-
1793 int size = src->bytes_per_line * src->height;-
1794 for (int i = 0; i < size
i < sizeDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1795 dest->data[i] = translate[src->data[i]];-
1796 }
never executed: end of block
0
1797 }
never executed: end of block
0
1798}-
1799-
1800static bool convert_Indexed8_to_Alpha8_inplace(QImageData *data, Qt::ImageConversionFlags)-
1801{-
1802 ((!(data->format == QImage::Format_Indexed8)) ? qt_assert("data->format == QImage::Format_Indexed8",__FILE__,1898) : qt_noop());-
1803-
1804-
1805 const QVector<QRgb> &colors = data->colortable;-
1806 if (colors.size() != 256
colors.size() != 256Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1807 return
never executed: return false;
false;
never executed: return false;
0
1808 for (int i = 0; i < colors.size()
i < colors.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1809 if (i != qAlpha(colors[i])
i != qAlpha(colors[i])Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1810 return
never executed: return false;
false;
never executed: return false;
0
1811 }
never executed: end of block
0
1812-
1813 data->colortable.clear();-
1814 data->format = QImage::Format_Alpha8;-
1815-
1816 return
never executed: return true;
true;
never executed: return true;
0
1817}-
1818-
1819static bool convert_Indexed8_to_Grayscale8_inplace(QImageData *data, Qt::ImageConversionFlags)-
1820{-
1821 ((!(data->format == QImage::Format_Indexed8)) ? qt_assert("data->format == QImage::Format_Indexed8",__FILE__,1917) : qt_noop());-
1822-
1823-
1824 const QVector<QRgb> &colors = data->colortable;-
1825 if (colors.size() != 256
colors.size() != 256Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1826 return
never executed: return false;
false;
never executed: return false;
0
1827 for (int i = 0; i < colors.size()
i < colors.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1828 if (i != qGray(colors[i])
i != qGray(colors[i])Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1829 return
never executed: return false;
false;
never executed: return false;
0
1830 }
never executed: end of block
0
1831-
1832 data->colortable.clear();-
1833 data->format = QImage::Format_Grayscale8;-
1834-
1835 return
never executed: return true;
true;
never executed: return true;
0
1836}-
1837-
1838static void convert_Alpha8_to_Indexed8(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)-
1839{-
1840 ((!(src->format == QImage::Format_Alpha8)) ? qt_assert("src->format == QImage::Format_Alpha8",__FILE__,1936) : qt_noop());-
1841 ((!(dest->format == QImage::Format_Indexed8)) ? qt_assert("dest->format == QImage::Format_Indexed8",__FILE__,1937) : qt_noop());-
1842-
1843 memcpy(dest->data, src->data, src->bytes_per_line * src->height);-
1844-
1845 QVector<QRgb> colors(256);-
1846 for (int i=0; i<256
i<256Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
1847 colors[i] = qRgba(0, 0, 0, i);
never executed: colors[i] = qRgba(0, 0, 0, i);
0
1848-
1849 dest->colortable = colors;-
1850}
never executed: end of block
0
1851-
1852static void convert_Grayscale8_to_Indexed8(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)-
1853{-
1854 ((!(src->format == QImage::Format_Grayscale8)) ? qt_assert("src->format == QImage::Format_Grayscale8",__FILE__,1950) : qt_noop());-
1855 ((!(dest->format == QImage::Format_Indexed8)) ? qt_assert("dest->format == QImage::Format_Indexed8",__FILE__,1951) : qt_noop());-
1856-
1857 memcpy(dest->data, src->data, src->bytes_per_line * src->height);-
1858-
1859 QVector<QRgb> colors(256);-
1860 for (int i=0; i<256
i<256Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
1861 colors[i] = qRgb(i, i, i);
never executed: colors[i] = qRgb(i, i, i);
0
1862-
1863 dest->colortable = colors;-
1864}
never executed: end of block
0
1865-
1866static bool convert_Alpha8_to_Indexed8_inplace(QImageData *data, Qt::ImageConversionFlags)-
1867{-
1868 ((!(data->format == QImage::Format_Alpha8)) ? qt_assert("data->format == QImage::Format_Alpha8",__FILE__,1964) : qt_noop());-
1869-
1870 QVector<QRgb> colors(256);-
1871 for (int i=0; i<256
i<256Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
1872 colors[i] = qRgba(0, 0, 0, i);
never executed: colors[i] = qRgba(0, 0, 0, i);
0
1873-
1874 data->colortable = colors;-
1875 data->format = QImage::Format_Indexed8;-
1876-
1877 return
never executed: return true;
true;
never executed: return true;
0
1878}-
1879-
1880static bool convert_Grayscale8_to_Indexed8_inplace(QImageData *data, Qt::ImageConversionFlags)-
1881{-
1882 ((!(data->format == QImage::Format_Grayscale8)) ? qt_assert("data->format == QImage::Format_Grayscale8",__FILE__,1978) : qt_noop());-
1883-
1884 QVector<QRgb> colors(256);-
1885 for (int i=0; i<256
i<256Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
1886 colors[i] = qRgb(i, i, i);
never executed: colors[i] = qRgb(i, i, i);
0
1887-
1888 data->colortable = colors;-
1889 data->format = QImage::Format_Indexed8;-
1890-
1891 return
never executed: return true;
true;
never executed: return true;
0
1892}-
1893-
1894-
1895-
1896Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormats] =-
1897{-
1898 {-
1899 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0-
1900 },-
1901 {-
1902 0,-
1903 0,-
1904 swap_bit_order,-
1905 convert_Mono_to_Indexed8,-
1906 convert_Mono_to_X32,-
1907 convert_Mono_to_X32,-
1908 convert_Mono_to_X32,-
1909 0,-
1910 0,-
1911 0,-
1912 0,-
1913 0,-
1914 0,-
1915 0,-
1916 0,-
1917 0,-
1918 0,-
1919 0,-
1920 0, 0, 0, 0, 0, 0, 0-
1921 },-
1922-
1923 {-
1924 0,-
1925 swap_bit_order,-
1926 0,-
1927 convert_Mono_to_Indexed8,-
1928 convert_Mono_to_X32,-
1929 convert_Mono_to_X32,-
1930 convert_Mono_to_X32,-
1931 0,-
1932 0,-
1933 0,-
1934 0,-
1935 0,-
1936 0,-
1937 0,-
1938 0,-
1939 0,-
1940 0,-
1941 0,-
1942 0, 0, 0, 0, 0, 0, 0-
1943 },-
1944-
1945 {-
1946 0,-
1947 convert_X_to_Mono,-
1948 convert_X_to_Mono,-
1949 0,-
1950 convert_Indexed8_to_X32,-
1951 convert_Indexed8_to_X32,-
1952 convert_Indexed8_to_X32,-
1953 0,-
1954 0,-
1955 0,-
1956 0,-
1957 0,-
1958 0,-
1959 0,-
1960 0,-
1961 0,-
1962 0,-
1963 0,-
1964 0, 0, 0, 0, 0,-
1965 convert_Indexed8_to_Alpha8,-
1966 convert_Indexed8_to_Grayscale8,-
1967 },-
1968-
1969 {-
1970 0,-
1971 convert_X_to_Mono,-
1972 convert_X_to_Mono,-
1973 convert_RGB_to_Indexed8,-
1974 0,-
1975 mask_alpha_converter,-
1976 mask_alpha_converter,-
1977 0,-
1978 0,-
1979 0,-
1980 0,-
1981 0,-
1982 0,-
1983 0,-
1984 0,-
1985 0,-
1986 0,-
1987 0,-
1988 0,-
1989 convert_RGB_to_RGB30<PixelOrderBGR>,-
1990 0,-
1991 convert_RGB_to_RGB30<PixelOrderRGB>,-
1992 0,-
1993 0, 0-
1994 },-
1995-
1996 {-
1997 0,-
1998 convert_X_to_Mono,-
1999 convert_X_to_Mono,-
2000 convert_ARGB_to_Indexed8,-
2001 mask_alpha_converter,-
2002 0,-
2003 convert_ARGB_to_ARGB_PM,-
2004 0,-
2005 0,-
2006 0,-
2007 0,-
2008 0,-
2009 0,-
2010 0,-
2011 0,-
2012 0,-
2013 convert_ARGB_to_RGBx,-
2014 convert_ARGB_to_RGBA,-
2015 0,-
2016 convert_RGB_to_RGB30<PixelOrderBGR>,-
2017 0,-
2018 convert_RGB_to_RGB30<PixelOrderRGB>,-
2019 0,-
2020 0, 0-
2021 },-
2022-
2023 {-
2024 0,-
2025 convert_ARGB_PM_to_Mono,-
2026 convert_ARGB_PM_to_Mono,-
2027 convert_ARGB_PM_to_Indexed8,-
2028 0,-
2029 0,-
2030 0,-
2031 0,-
2032 0,-
2033 0,-
2034 0,-
2035 0,-
2036 0,-
2037 0,-
2038 0,-
2039 0,-
2040 0,-
2041 0,-
2042 convert_ARGB_to_RGBA,-
2043 0,-
2044 0,-
2045 0,-
2046 0,-
2047 0, 0-
2048 },-
2049-
2050 {-
2051 0,-
2052 0,-
2053 0,-
2054 0,-
2055 0,-
2056 0,-
2057 0,-
2058 0,-
2059 0,-
2060 0,-
2061 0,-
2062 0,-
2063 0,-
2064 0,-
2065 0,-
2066 0,-
2067 0,-
2068 0,-
2069 0, 0, 0, 0, 0, 0, 0-
2070 },-
2071-
2072 {-
2073 0,-
2074 0,-
2075 0,-
2076 0,-
2077 0,-
2078 0,-
2079 0,-
2080 0,-
2081 0,-
2082 0,-
2083 0,-
2084 0,-
2085 0,-
2086 0,-
2087 0,-
2088 0,-
2089 0,-
2090 0,-
2091 0, 0, 0, 0, 0, 0, 0-
2092 },-
2093-
2094 {-
2095 0,-
2096 0,-
2097 0,-
2098 0,-
2099 0,-
2100 0,-
2101 0,-
2102 0,-
2103 0,-
2104 0,-
2105 0,-
2106 0,-
2107 0,-
2108 0,-
2109 0,-
2110 0,-
2111 0,-
2112 0,-
2113 0, 0, 0, 0, 0, 0, 0-
2114 },-
2115-
2116 {-
2117 0,-
2118 0,-
2119 0,-
2120 0,-
2121 0,-
2122 0,-
2123 0,-
2124 0,-
2125 0,-
2126 0,-
2127 0,-
2128 0,-
2129 0,-
2130 0,-
2131 0,-
2132 0,-
2133 0,-
2134 0,-
2135 0, 0, 0, 0, 0, 0, 0-
2136 },-
2137-
2138 {-
2139 0,-
2140 0,-
2141 0,-
2142 0,-
2143 0,-
2144 0,-
2145 0,-
2146 0,-
2147 0,-
2148 0,-
2149 0,-
2150 0,-
2151 0,-
2152 0,-
2153 0,-
2154 0,-
2155 0,-
2156 0,-
2157 0, 0, 0, 0, 0, 0, 0-
2158 },-
2159-
2160 {-
2161 0,-
2162 0,-
2163 0,-
2164 0,-
2165 0,-
2166 0,-
2167 0,-
2168 0,-
2169 0,-
2170 0,-
2171 0,-
2172 0,-
2173 0,-
2174 0,-
2175 0,-
2176 0,-
2177 0,-
2178 0,-
2179 0, 0, 0, 0, 0, 0, 0-
2180 },-
2181-
2182 {-
2183 0,-
2184 0,-
2185 0,-
2186 0,-
2187 convert_RGB888_to_RGB<false>,-
2188 convert_RGB888_to_RGB<false>,-
2189 convert_RGB888_to_RGB<false>,-
2190 0,-
2191 0,-
2192 0,-
2193 0,-
2194 0,-
2195 0,-
2196 0,-
2197 0,-
2198 0,-
2199 convert_RGB888_to_RGB<true>,-
2200 convert_RGB888_to_RGB<true>,-
2201 convert_RGB888_to_RGB<true>,-
2202 0, 0, 0, 0, 0, 0-
2203 },-
2204-
2205 {-
2206 0,-
2207 0,-
2208 0,-
2209 0,-
2210 0,-
2211 0,-
2212 0,-
2213 0,-
2214 0,-
2215 0,-
2216 0,-
2217 0,-
2218 0,-
2219 0,-
2220 0,-
2221 0,-
2222 0,-
2223 0,-
2224 0, 0, 0, 0, 0, 0, 0-
2225 },-
2226-
2227 {-
2228 0,-
2229 0,-
2230 0,-
2231 0,-
2232 0,-
2233 0,-
2234 0,-
2235 0,-
2236 0,-
2237 0,-
2238 0,-
2239 0,-
2240 0,-
2241 0,-
2242 0,-
2243 0,-
2244 0,-
2245 0, 0, 0, 0, 0, 0, 0-
2246 },-
2247 {-
2248 0,-
2249 0,-
2250 0,-
2251 0,-
2252 convert_RGBA_to_RGB,-
2253 convert_RGBA_to_ARGB,-
2254 convert_RGBA_to_ARGB,-
2255 0,-
2256 0,-
2257 0,-
2258 0,-
2259 0,-
2260 0,-
2261 0,-
2262 0,-
2263 0,-
2264 0,-
2265 mask_alpha_converter_RGBx,-
2266 mask_alpha_converter_RGBx,-
2267 0, 0, 0, 0, 0, 0-
2268 },-
2269 {-
2270 0,-
2271 0,-
2272 0,-
2273 0,-
2274 convert_RGBA_to_RGB,-
2275 convert_RGBA_to_ARGB,-
2276 0,-
2277 0,-
2278 0,-
2279 0,-
2280 0,-
2281 0,-
2282 0,-
2283 0,-
2284 0,-
2285 0,-
2286 mask_alpha_converter_RGBx,-
2287-
2288 0,-
2289 convert_ARGB_to_ARGB_PM,-
2290-
2291-
2292-
2293-
2294 0, 0, 0, 0, 0, 0-
2295 },-
2296-
2297 {-
2298 0,-
2299 0,-
2300 0,-
2301 0,-
2302 0,-
2303 0,-
2304 convert_RGBA_to_ARGB,-
2305 0,-
2306 0,-
2307 0,-
2308 0,-
2309 0,-
2310 0,-
2311 0,-
2312 0,-
2313 0,-
2314 0,-
2315 0,-
2316 0, 0, 0, 0, 0, 0-
2317 },-
2318-
2319 {-
2320 0,-
2321 0,-
2322 0,-
2323 0,-
2324 0,-
2325 0,-
2326 0,-
2327 0,-
2328 0,-
2329 0,-
2330 0,-
2331 0,-
2332 0,-
2333 0,-
2334 0,-
2335 0,-
2336 0,-
2337 0,-
2338 0,-
2339 0,-
2340 convert_passthrough,-
2341 convert_BGR30_to_RGB30,-
2342 convert_BGR30_to_RGB30,-
2343 0, 0-
2344 },-
2345 {-
2346 0,-
2347 0,-
2348 0,-
2349 0,-
2350 0,-
2351 convert_A2RGB30_PM_to_ARGB<PixelOrderBGR>,-
2352 0,-
2353 0,-
2354 0,-
2355 0,-
2356 0,-
2357 0,-
2358 0,-
2359 0,-
2360 0,-
2361 0,-
2362 0,-
2363 0,-
2364 0,-
2365 convert_A2RGB30_PM_to_RGB30<false>,-
2366 0,-
2367 convert_A2RGB30_PM_to_RGB30<true>,-
2368 convert_BGR30_to_RGB30,-
2369 0, 0-
2370 },-
2371 {-
2372 0,-
2373 0,-
2374 0,-
2375 0,-
2376 0,-
2377 0,-
2378 0,-
2379 0,-
2380 0,-
2381 0,-
2382 0,-
2383 0,-
2384 0,-
2385 0,-
2386 0,-
2387 0,-
2388 0,-
2389 0,-
2390 0,-
2391 convert_BGR30_to_RGB30,-
2392 convert_BGR30_to_RGB30,-
2393 0,-
2394 convert_passthrough,-
2395 0, 0-
2396 },-
2397 {-
2398 0,-
2399 0,-
2400 0,-
2401 0,-
2402 0,-
2403 convert_A2RGB30_PM_to_ARGB<PixelOrderRGB>,-
2404 0,-
2405 0,-
2406 0,-
2407 0,-
2408 0,-
2409 0,-
2410 0,-
2411 0,-
2412 0,-
2413 0,-
2414 0,-
2415 0,-
2416 0,-
2417 convert_A2RGB30_PM_to_RGB30<true>,-
2418 convert_BGR30_to_RGB30,-
2419 convert_A2RGB30_PM_to_RGB30<false>,-
2420 0,-
2421 0, 0-
2422 },-
2423 {-
2424 0,-
2425 0,-
2426 0,-
2427 convert_Alpha8_to_Indexed8,-
2428 0,-
2429 0,-
2430 0,-
2431 0,-
2432 0,-
2433 0,-
2434 0,-
2435 0,-
2436 0,-
2437 0,-
2438 0,-
2439 0,-
2440 0,-
2441 0, 0, 0, 0, 0, 0, 0-
2442 },-
2443 {-
2444 0,-
2445 0,-
2446 0,-
2447 convert_Grayscale8_to_Indexed8,-
2448 0,-
2449 0,-
2450 0,-
2451 0,-
2452 0,-
2453 0,-
2454 0,-
2455 0,-
2456 0,-
2457 0,-
2458 0,-
2459 0,-
2460 0,-
2461 0, 0, 0, 0, 0, 0, 0-
2462 }-
2463};-
2464-
2465InPlace_Image_Converter qimage_inplace_converter_map[QImage::NImageFormats][QImage::NImageFormats] =-
2466{-
2467 {-
2468 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0-
2469 },-
2470 {-
2471 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0-
2472 },-
2473 {-
2474 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0-
2475 },-
2476 {-
2477 0,-
2478 0,-
2479 0,-
2480 0,-
2481 convert_indexed8_to_RGB_inplace,-
2482 convert_indexed8_to_ARGB_inplace,-
2483 convert_indexed8_to_ARGB_PM_inplace,-
2484 convert_indexed8_to_RGB16_inplace,-
2485 0,-
2486 0,-
2487 0,-
2488 0,-
2489 0,-
2490 0,-
2491 0,-
2492 0,-
2493 0,-
2494 0,-
2495 0, 0, 0, 0, 0,-
2496 convert_Indexed8_to_Alpha8_inplace,-
2497 convert_Indexed8_to_Grayscale8_inplace,-
2498 },-
2499 {-
2500 0,-
2501 0,-
2502 0,-
2503 0,-
2504 0,-
2505 mask_alpha_converter_inplace<QImage::Format_ARGB32>,-
2506 mask_alpha_converter_inplace<QImage::Format_ARGB32_Premultiplied>,-
2507 convert_RGB_to_RGB16_inplace,-
2508 0,-
2509 0,-
2510 0,-
2511 0,-
2512 0,-
2513 0,-
2514 0,-
2515 0,-
2516 0,-
2517 0,-
2518 0,-
2519 convert_RGB_to_RGB30_inplace<PixelOrderBGR>,-
2520 0,-
2521 convert_RGB_to_RGB30_inplace<PixelOrderRGB>,-
2522 0,-
2523 0, 0-
2524 },-
2525 {-
2526 0,-
2527 0,-
2528 0,-
2529 0,-
2530 mask_alpha_converter_inplace<QImage::Format_RGB32>,-
2531 0,-
2532-
2533 convert_ARGB_to_ARGB_PM_inplace_sse2,-
2534-
2535-
2536-
2537 0,-
2538 0,-
2539 0,-
2540 0,-
2541 0,-
2542 0,-
2543 0,-
2544 0,-
2545 0,-
2546 convert_ARGB_to_RGBA_inplace<QImage::Format_RGBX8888>,-
2547 convert_ARGB_to_RGBA_inplace<QImage::Format_RGBA8888>,-
2548 0,-
2549 convert_RGB_to_RGB30_inplace<PixelOrderBGR>,-
2550 0,-
2551 convert_RGB_to_RGB30_inplace<PixelOrderRGB>,-
2552 0,-
2553 0, 0-
2554 },-
2555 {-
2556 0,-
2557 0,-
2558 0,-
2559 0,-
2560 0,-
2561 0,-
2562 0,-
2563 0,-
2564 0,-
2565 0,-
2566 0,-
2567 0,-
2568 0,-
2569 0,-
2570 0,-
2571 0,-
2572 0,-
2573 0,-
2574 convert_ARGB_to_RGBA_inplace<QImage::Format_RGBA8888_Premultiplied>,-
2575 0,-
2576 0,-
2577 0,-
2578 0,-
2579 0, 0-
2580 },-
2581 {-
2582 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0-
2583 },-
2584 {-
2585 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0-
2586 },-
2587 {-
2588 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0-
2589 },-
2590 {-
2591 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0-
2592 },-
2593 {-
2594 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0-
2595 },-
2596 {-
2597 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0-
2598 },-
2599 {-
2600 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0-
2601 },-
2602 {-
2603 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0-
2604 },-
2605 {-
2606 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0-
2607 },-
2608 {-
2609 0,-
2610 0,-
2611 0,-
2612 0,-
2613 convert_RGBA_to_ARGB_inplace<QImage::Format_RGB32>,-
2614 convert_RGBA_to_ARGB_inplace<QImage::Format_ARGB32>,-
2615 convert_RGBA_to_ARGB_inplace<QImage::Format_ARGB32_Premultiplied>,-
2616 0,-
2617 0,-
2618 0,-
2619 0,-
2620 0,-
2621 0,-
2622 0,-
2623 0,-
2624 0,-
2625 0,-
2626 convert_passthrough_inplace<QImage::Format_RGBA8888>,-
2627 convert_passthrough_inplace<QImage::Format_RGBA8888_Premultiplied>,-
2628 0, 0, 0, 0, 0, 0-
2629 },-
2630 {-
2631 0,-
2632 0,-
2633 0,-
2634 0,-
2635 convert_RGBA_to_ARGB_inplace<QImage::Format_RGB32>,-
2636 convert_RGBA_to_ARGB_inplace<QImage::Format_ARGB32>,-
2637 0,-
2638 0,-
2639 0,-
2640 0,-
2641 0,-
2642 0,-
2643 0,-
2644 0,-
2645 0,-
2646 0,-
2647 mask_alpha_converter_rgbx_inplace,-
2648 0,-
2649-
2650 convert_ARGB_to_ARGB_PM_inplace_sse2,-
2651-
2652-
2653-
2654-
2655-
2656 0, 0, 0, 0, 0, 0-
2657 },-
2658 {-
2659 0,-
2660 0,-
2661 0,-
2662 0,-
2663 0,-
2664 0,-
2665 convert_RGBA_to_ARGB_inplace<QImage::Format_ARGB32_Premultiplied>,-
2666 0,-
2667 0,-
2668 0,-
2669 0,-
2670 0,-
2671 0,-
2672 0,-
2673 0,-
2674 0,-
2675 0,-
2676 0,-
2677 0,-
2678 0, 0, 0, 0, 0, 0-
2679 },-
2680 {-
2681 0,-
2682 0,-
2683 0,-
2684 0,-
2685 0,-
2686 0,-
2687 0,-
2688 0,-
2689 0,-
2690 0,-
2691 0,-
2692 0,-
2693 0,-
2694 0,-
2695 0,-
2696 0,-
2697 0,-
2698 0,-
2699 0,-
2700 0,-
2701 convert_passthrough_inplace<QImage::Format_A2BGR30_Premultiplied>,-
2702 convert_BGR30_to_RGB30_inplace,-
2703 convert_BGR30_to_A2RGB30_inplace,-
2704 0, 0-
2705 },-
2706 {-
2707 0,-
2708 0,-
2709 0,-
2710 0,-
2711 0,-
2712 convert_A2RGB30_PM_to_ARGB_inplace<PixelOrderBGR>,-
2713 0,-
2714 0,-
2715 0,-
2716 0,-
2717 0,-
2718 0,-
2719 0,-
2720 0,-
2721 0,-
2722 0,-
2723 0,-
2724 0,-
2725 0,-
2726 convert_A2RGB30_PM_to_RGB30_inplace<false>,-
2727 0,-
2728 convert_A2RGB30_PM_to_RGB30_inplace<true>,-
2729 convert_BGR30_to_RGB30_inplace,-
2730 0, 0-
2731 },-
2732 {-
2733 0,-
2734 0,-
2735 0,-
2736 0,-
2737 0,-
2738 0,-
2739 0,-
2740 0,-
2741 0,-
2742 0,-
2743 0,-
2744 0,-
2745 0,-
2746 0,-
2747 0,-
2748 0,-
2749 0,-
2750 0,-
2751 0,-
2752 convert_BGR30_to_RGB30_inplace,-
2753 convert_BGR30_to_A2RGB30_inplace,-
2754 0,-
2755 convert_passthrough_inplace<QImage::Format_A2RGB30_Premultiplied>,-
2756 0, 0-
2757 },-
2758 {-
2759 0,-
2760 0,-
2761 0,-
2762 0,-
2763 0,-
2764 convert_A2RGB30_PM_to_ARGB_inplace<PixelOrderRGB>,-
2765 0,-
2766 0,-
2767 0,-
2768 0,-
2769 0,-
2770 0,-
2771 0,-
2772 0,-
2773 0,-
2774 0,-
2775 0,-
2776 0,-
2777 0,-
2778 convert_A2RGB30_PM_to_RGB30_inplace<true>,-
2779 convert_BGR30_to_RGB30_inplace,-
2780 convert_A2RGB30_PM_to_RGB30_inplace<false>,-
2781 0,-
2782 0, 0-
2783 },-
2784 {-
2785 0,-
2786 0,-
2787 0,-
2788 convert_Alpha8_to_Indexed8_inplace,-
2789 0,-
2790 0,-
2791 0,-
2792 0,-
2793 0,-
2794 0,-
2795 0,-
2796 0,-
2797 0,-
2798 0,-
2799 0,-
2800 0,-
2801 0,-
2802 0,-
2803 0,-
2804 0,-
2805 0,-
2806 0,-
2807 0,-
2808 0, 0-
2809 },-
2810 {-
2811 0,-
2812 0,-
2813 0,-
2814 convert_Grayscale8_to_Indexed8_inplace,-
2815 0,-
2816 0,-
2817 0,-
2818 0,-
2819 0,-
2820 0,-
2821 0,-
2822 0,-
2823 0,-
2824 0,-
2825 0,-
2826 0,-
2827 0,-
2828 0,-
2829 0,-
2830 0,-
2831 0,-
2832 0,-
2833 0,-
2834 0, 0-
2835 }-
2836};-
2837-
2838static void qInitImageConversions()-
2839{-
2840-
2841 if (((
(qCompilerCpuF...FeatureSSSE3))Description
TRUEnever evaluated
FALSEnever evaluated
qCompilerCpuFeatures & (static_cast<unsigned long long>(1ULL) << CpuFeatureSSSE3))
(qCompilerCpuF...FeatureSSSE3))Description
TRUEnever evaluated
FALSEnever evaluated
|| (
(qCpuFeatures(...FeatureSSSE3))Description
TRUEnever evaluated
FALSEnever evaluated
qCpuFeatures() & (static_cast<unsigned long long>(1ULL) << CpuFeatureSSSE3))
(qCpuFeatures(...FeatureSSSE3))Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0
2842 extern void convert_RGB888_to_RGB32_ssse3(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags);-
2843 qimage_converter_map[QImage::Format_RGB888][QImage::Format_RGB32] = convert_RGB888_to_RGB32_ssse3;-
2844 qimage_converter_map[QImage::Format_RGB888][QImage::Format_ARGB32] = convert_RGB888_to_RGB32_ssse3;-
2845 qimage_converter_map[QImage::Format_RGB888][QImage::Format_ARGB32_Premultiplied] = convert_RGB888_to_RGB32_ssse3;-
2846 }
never executed: end of block
0
2847-
2848-
2849-
2850 if (((
(qCompilerCpuF...eatureSSE4_1))Description
TRUEnever evaluated
FALSEnever evaluated
qCompilerCpuFeatures & (static_cast<unsigned long long>(1ULL) << CpuFeatureSSE4_1))
(qCompilerCpuF...eatureSSE4_1))Description
TRUEnever evaluated
FALSEnever evaluated
|| (
(qCpuFeatures(...eatureSSE4_1))Description
TRUEnever evaluated
FALSEnever evaluated
qCpuFeatures() & (static_cast<unsigned long long>(1ULL) << CpuFeatureSSE4_1))
(qCpuFeatures(...eatureSSE4_1))Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0
2851 extern void convert_ARGB_to_ARGB_PM_sse4(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags);-
2852 qimage_converter_map[QImage::Format_ARGB32][QImage::Format_ARGB32_Premultiplied] = convert_ARGB_to_ARGB_PM_sse4;-
2853 qimage_converter_map[QImage::Format_RGBA8888][QImage::Format_RGBA8888_Premultiplied] = convert_ARGB_to_ARGB_PM_sse4;-
2854 }
never executed: end of block
0
2855-
2856-
2857-
2858 if (((
(qCompilerCpuF...uFeatureAVX2))Description
TRUEnever evaluated
FALSEnever evaluated
qCompilerCpuFeatures & (static_cast<unsigned long long>(1ULL) << CpuFeatureAVX2))
(qCompilerCpuF...uFeatureAVX2))Description
TRUEnever evaluated
FALSEnever evaluated
|| (
(qCpuFeatures(...uFeatureAVX2))Description
TRUEnever evaluated
FALSEnever evaluated
qCpuFeatures() & (static_cast<unsigned long long>(1ULL) << CpuFeatureAVX2))
(qCpuFeatures(...uFeatureAVX2))Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0
2859 extern void convert_ARGB_to_ARGB_PM_avx2(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags);-
2860 qimage_converter_map[QImage::Format_ARGB32][QImage::Format_ARGB32_Premultiplied] = convert_ARGB_to_ARGB_PM_avx2;-
2861 qimage_converter_map[QImage::Format_RGBA8888][QImage::Format_RGBA8888_Premultiplied] = convert_ARGB_to_ARGB_PM_avx2;-
2862 }
never executed: end of block
0
2863}
never executed: end of block
0
2864-
2865namespace { static const struct qInitImageConversions_ctor_class_ { inline qInitImageConversions_ctor_class_() { qInitImageConversions(); }
never executed: end of block
} qInitImageConversions_ctor_instance_; };
0
2866-
2867-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9