painting/qimagescale.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4 -
5namespace QImageScale { -
6 struct QImageScaleInfo; -
7} -
8 -
9typedef void (*qt_qimageScaleFunc)(QImageScale::QImageScaleInfo *isi, unsigned int *dest, -
10 int dxx, int dyy, int dx, int dy, int dw, -
11 int dh, int dow, int sow); -
12 -
13static void qt_qimageScaleAARGB(QImageScale::QImageScaleInfo *isi, unsigned int *dest, -
14 int dxx, int dyy, int dx, int dy, int dw, -
15 int dh, int dow, int sow); -
16 -
17static void qt_qimageScaleAARGBA(QImageScale::QImageScaleInfo *isi, unsigned int *dest, -
18 int dxx, int dyy, int dx, int dy, int dw, -
19 int dh, int dow, int sow); -
20 -
21qt_qimageScaleFunc qt_qimageScaleArgb = qt_qimageScaleAARGBA; -
22qt_qimageScaleFunc qt_qimageScaleRgb = qt_qimageScaleAARGB; -
23namespace QImageScale { -
24 struct QImageScaleInfo { -
25 int *xpoints; -
26 unsigned int **ypoints; -
27 int *xapoints, *yapoints; -
28 int xup_yup; -
29 }; -
30 -
31 unsigned int** qimageCalcYPoints(unsigned int *src, int sw, int sh, -
32 int dh); -
33 int* qimageCalcXPoints(int sw, int dw); -
34 int* qimageCalcApoints(int s, int d, int up); -
35 QImageScaleInfo* qimageFreeScaleInfo(QImageScaleInfo *isi); -
36 QImageScaleInfo *qimageCalcScaleInfo(const QImage &img, int sw, int sh, -
37 int dw, int dh, char aa); -
38} -
39 -
40using namespace QImageScale; -
41unsigned int** QImageScale::qimageCalcYPoints(unsigned int *src, -
42 int sw, int sh, int dh) -
43{ -
44 unsigned int **p; -
45 int i, j = 0; -
46 int val, inc, rv = 0; -
47 -
48 if(dh < 0){
partially evaluated: dh < 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:236
0-236
49 dh = -dh; -
50 rv = 1; -
51 }
never executed: }
0
52 p = new unsigned int* [dh+1]; -
53 -
54 int up = qAbs(dh) >= sh; -
55 val = up ? 0x8000 * sh / dh - 0x8000 : 0;
evaluated: up
TRUEFALSE
yes
Evaluation Count:81
yes
Evaluation Count:155
81-155
56 inc = (sh << 16) / dh; -
57 for(i = 0; i < dh; i++){
evaluated: i < dh
TRUEFALSE
yes
Evaluation Count:66715
yes
Evaluation Count:236
236-66715
58 p[j++] = src + qMax(0, val >> 16) * sw; -
59 val += inc; -
60 }
executed: }
Execution Count:66715
66715
61 if(rv){
partially evaluated: rv
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:236
0-236
62 for(i = dh / 2; --i >= 0; ){
never evaluated: --i >= 0
0
63 unsigned int *tmp = p[i]; -
64 p[i] = p[dh - i - 1]; -
65 p[dh - i - 1] = tmp; -
66 }
never executed: }
0
67 }
never executed: }
0
68 return(p);
executed: return(p);
Execution Count:236
236
69} -
70 -
71int* QImageScale::qimageCalcXPoints(int sw, int dw) -
72{ -
73 int *p, i, j = 0; -
74 int val, inc, rv = 0; -
75 -
76 if(dw < 0){
partially evaluated: dw < 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:236
0-236
77 dw = -dw; -
78 rv = 1; -
79 }
never executed: }
0
80 p = new int[dw+1]; -
81 -
82 int up = qAbs(dw) >= sw; -
83 val = up ? 0x8000 * sw / dw - 0x8000 : 0;
evaluated: up
TRUEFALSE
yes
Evaluation Count:67
yes
Evaluation Count:169
67-169
84 inc = (sw << 16) / dw; -
85 for(i = 0; i < dw; i++){
evaluated: i < dw
TRUEFALSE
yes
Evaluation Count:66659
yes
Evaluation Count:236
236-66659
86 p[j++] = qMax(0, val >> 16); -
87 val += inc; -
88 }
executed: }
Execution Count:66659
66659
89 -
90 if(rv){
partially evaluated: rv
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:236
0-236
91 for(i = dw / 2; --i >= 0; ){
never evaluated: --i >= 0
0
92 int tmp = p[i]; -
93 p[i] = p[dw - i - 1]; -
94 p[dw - i - 1] = tmp; -
95 }
never executed: }
0
96 }
never executed: }
0
97 return(p);
executed: return(p);
Execution Count:236
236
98} -
99 -
100int* QImageScale::qimageCalcApoints(int s, int d, int up) -
101{ -
102 int *p, i, j = 0, rv = 0; -
103 -
104 if(d < 0){
partially evaluated: d < 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:472
0-472
105 rv = 1; -
106 d = -d; -
107 }
never executed: }
0
108 p = new int[d]; -
109 -
110 -
111 if(up){
evaluated: up
TRUEFALSE
yes
Evaluation Count:148
yes
Evaluation Count:324
148-324
112 int val, inc; -
113 -
114 val = 0x8000 * s / d - 0x8000; -
115 inc = (s << 16) / d; -
116 for(i = 0; i < d; i++){
evaluated: i < d
TRUEFALSE
yes
Evaluation Count:20970
yes
Evaluation Count:148
148-20970
117 int pos = val >> 16; -
118 if (pos < 0)
evaluated: pos < 0
TRUEFALSE
yes
Evaluation Count:247
yes
Evaluation Count:20723
247-20723
119 p[j++] = 0;
executed: p[j++] = 0;
Execution Count:247
247
120 else if (pos >= (s - 1))
evaluated: pos >= (s - 1)
TRUEFALSE
yes
Evaluation Count:254
yes
Evaluation Count:20469
254-20469
121 p[j++] = 0;
executed: p[j++] = 0;
Execution Count:254
254
122 else -
123 p[j++] = (val >> 8) - ((val >> 8) & 0xffffff00);
executed: p[j++] = (val >> 8) - ((val >> 8) & 0xffffff00);
Execution Count:20469
20469
124 val += inc; -
125 }
executed: }
Execution Count:20970
20970
126 }
executed: }
Execution Count:148
148
127 -
128 else{ -
129 int val, inc, ap, Cp; -
130 val = 0; -
131 inc = (s << 16) / d; -
132 Cp = ((d << 14) / s) + 1; -
133 for(i = 0; i < d; i++){
evaluated: i < d
TRUEFALSE
yes
Evaluation Count:112404
yes
Evaluation Count:324
324-112404
134 ap = ((0x100 - ((val >> 8) & 0xff)) * Cp) >> 8; -
135 p[j] = ap | (Cp << 16); -
136 j++; -
137 val += inc; -
138 }
executed: }
Execution Count:112404
112404
139 }
executed: }
Execution Count:324
324
140 if(rv){
partially evaluated: rv
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:472
0-472
141 int tmp; -
142 for(i = d / 2; --i >= 0; ){
never evaluated: --i >= 0
0
143 tmp = p[i]; -
144 p[i] = p[d - i - 1]; -
145 p[d - i - 1] = tmp; -
146 }
never executed: }
0
147 }
never executed: }
0
148 return(p);
executed: return(p);
Execution Count:472
472
149} -
150 -
151QImageScaleInfo* QImageScale::qimageFreeScaleInfo(QImageScaleInfo *isi) -
152{ -
153 if(isi){
partially evaluated: isi
TRUEFALSE
yes
Evaluation Count:236
no
Evaluation Count:0
0-236
154 delete[] isi->xpoints; -
155 delete[] isi->ypoints; -
156 delete[] isi->xapoints; -
157 delete[] isi->yapoints; -
158 delete isi; -
159 }
executed: }
Execution Count:236
236
160 return 0;
executed: return 0;
Execution Count:236
236
161} -
162 -
163QImageScaleInfo* QImageScale::qimageCalcScaleInfo(const QImage &img, -
164 int sw, int sh, -
165 int dw, int dh, char aa) -
166{ -
167 QImageScaleInfo *isi; -
168 int scw, sch; -
169 -
170 scw = dw * qlonglong(img.width()) / sw; -
171 sch = dh * qlonglong(img.height()) / sh; -
172 -
173 isi = new QImageScaleInfo; -
174 if(!isi)
partially evaluated: !isi
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:236
0-236
175 return 0;
never executed: return 0;
0
176 memset(isi, 0, sizeof(QImageScaleInfo)); -
177 -
178 isi->xup_yup = (qAbs(dw) >= sw) + ((qAbs(dh) >= sh) << 1); -
179 -
180 isi->xpoints = qimageCalcXPoints(img.width(), scw); -
181 if(!isi->xpoints)
partially evaluated: !isi->xpoints
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:236
0-236
182 return(qimageFreeScaleInfo(isi));
never executed: return(qimageFreeScaleInfo(isi));
0
183 isi->ypoints = qimageCalcYPoints((unsigned int *)img.scanLine(0), -
184 img.bytesPerLine() / 4, img.height(), sch); -
185 if (!isi->ypoints)
partially evaluated: !isi->ypoints
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:236
0-236
186 return(qimageFreeScaleInfo(isi));
never executed: return(qimageFreeScaleInfo(isi));
0
187 if(aa) {
partially evaluated: aa
TRUEFALSE
yes
Evaluation Count:236
no
Evaluation Count:0
0-236
188 isi->xapoints = qimageCalcApoints(img.width(), scw, isi->xup_yup & 1); -
189 if(!isi->xapoints)
partially evaluated: !isi->xapoints
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:236
0-236
190 return(qimageFreeScaleInfo(isi));
never executed: return(qimageFreeScaleInfo(isi));
0
191 isi->yapoints = qimageCalcApoints(img.height(), sch, isi->xup_yup & 2); -
192 if(!isi->yapoints)
partially evaluated: !isi->yapoints
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:236
0-236
193 return(qimageFreeScaleInfo(isi));
never executed: return(qimageFreeScaleInfo(isi));
0
194 }
executed: }
Execution Count:236
236
195 return(isi);
executed: return(isi);
Execution Count:236
236
196} -
197 -
198 -
199 -
200 -
201static void qt_qimageScaleAARGBA(QImageScaleInfo *isi, unsigned int *dest, -
202 int dxx, int dyy, int dx, int dy, int dw, -
203 int dh, int dow, int sow) -
204{ -
205 unsigned int *sptr, *dptr; -
206 int x, y, end; -
207 unsigned int **ypoints = isi->ypoints; -
208 int *xpoints = isi->xpoints; -
209 int *xapoints = isi->xapoints; -
210 int *yapoints = isi->yapoints; -
211 -
212 end = dxx + dw; -
213 -
214 if(isi->xup_yup == 3){
evaluated: isi->xup_yup == 3
TRUEFALSE
yes
Evaluation Count:19
yes
Evaluation Count:123
19-123
215 -
216 for(y = 0; y < dh; y++){
evaluated: y < dh
TRUEFALSE
yes
Evaluation Count:2175
yes
Evaluation Count:19
19-2175
217 -
218 dptr = dest + dx + ((y + dy) * dow); -
219 sptr = ypoints[dyy + y]; -
220 if((yapoints[dyy + y]) > 0){
evaluated: (yapoints[dyy + y]) > 0
TRUEFALSE
yes
Evaluation Count:2006
yes
Evaluation Count:169
169-2006
221 for(x = dxx; x < end; x++){
evaluated: x < end
TRUEFALSE
yes
Evaluation Count:427762
yes
Evaluation Count:2006
2006-427762
222 int r, g, b, a; -
223 int rr, gg, bb, aa; -
224 unsigned int *pix; -
225 -
226 if((xapoints[x]) > 0){
evaluated: (xapoints[x]) > 0
TRUEFALSE
yes
Evaluation Count:423752
yes
Evaluation Count:4010
4010-423752
227 pix = ypoints[dyy + y] + xpoints[x]; -
228 r = (qRed(*pix)) * (256 - xapoints[x]); -
229 g = (qGreen(*pix)) * (256 - xapoints[x]); -
230 b = (qBlue(*pix)) * (256 - xapoints[x]); -
231 a = (qAlpha(*pix)) * (256 - xapoints[x]); -
232 pix++; -
233 r += (qRed(*pix)) * (xapoints[x]); -
234 g += (qGreen(*pix)) * (xapoints[x]); -
235 b += (qBlue(*pix)) * (xapoints[x]); -
236 a += (qAlpha(*pix)) * (xapoints[x]); -
237 pix += sow; -
238 rr = (qRed(*pix)) * (xapoints[x]); -
239 gg = (qGreen(*pix)) * (xapoints[x]); -
240 bb = (qBlue(*pix)) * (xapoints[x]); -
241 aa = (qAlpha(*pix)) * (xapoints[x]); -
242 pix--; -
243 rr += (qRed(*pix)) * (256 - xapoints[x]); -
244 gg += (qGreen(*pix)) * (256 - xapoints[x]); -
245 bb += (qBlue(*pix)) * (256 - xapoints[x]); -
246 aa += (qAlpha(*pix)) * (256 - xapoints[x]); -
247 r = ((rr * (yapoints[dyy + y])) + (r * (256 - yapoints[dyy + y]))) >> 16; -
248 g = ((gg * (yapoints[dyy + y])) + (g * (256 - yapoints[dyy + y]))) >> 16; -
249 b = ((bb * (yapoints[dyy + y])) + (b * (256 - yapoints[dyy + y]))) >> 16; -
250 a = ((aa * (yapoints[dyy + y])) + (a * (256 - yapoints[dyy + y]))) >> 16; -
251 *dptr++ = qRgba(r, g, b, a); -
252 }
executed: }
Execution Count:423752
423752
253 else{ -
254 pix = ypoints[dyy + y] + xpoints[x]; -
255 r = (qRed(*pix)) * (256 - yapoints[dyy + y]); -
256 g = (qGreen(*pix)) * (256 - yapoints[dyy + y]); -
257 b = (qBlue(*pix)) * (256 - yapoints[dyy + y]); -
258 a = (qAlpha(*pix)) * (256 - yapoints[dyy + y]); -
259 pix += sow; -
260 r += (qRed(*pix)) * (yapoints[dyy + y]); -
261 g += (qGreen(*pix)) * (yapoints[dyy + y]); -
262 b += (qBlue(*pix)) * (yapoints[dyy + y]); -
263 a += (qAlpha(*pix)) * (yapoints[dyy + y]); -
264 r >>= 8; -
265 g >>= 8; -
266 b >>= 8; -
267 a >>= 8; -
268 *dptr++ = qRgba(r, g, b, a); -
269 }
executed: }
Execution Count:4010
4010
270 } -
271 }
executed: }
Execution Count:2006
2006
272 else{ -
273 for(x = dxx; x < end; x++){
evaluated: x < end
TRUEFALSE
yes
Evaluation Count:22074
yes
Evaluation Count:169
169-22074
274 int r, g, b, a; -
275 unsigned int *pix; -
276 -
277 if((xapoints[x]) > 0){
evaluated: (xapoints[x]) > 0
TRUEFALSE
yes
Evaluation Count:5610
yes
Evaluation Count:16464
5610-16464
278 pix = ypoints[dyy + y] + xpoints[x]; -
279 r = (qRed(*pix)) * (256 - xapoints[x]); -
280 g = (qGreen(*pix)) * (256 - xapoints[x]); -
281 b = (qBlue(*pix)) * (256 - xapoints[x]); -
282 a = (qAlpha(*pix)) * (256 - xapoints[x]); -
283 pix++; -
284 r += (qRed(*pix)) * (xapoints[x]); -
285 g += (qGreen(*pix)) * (xapoints[x]); -
286 b += (qBlue(*pix)) * (xapoints[x]); -
287 a += (qAlpha(*pix)) * (xapoints[x]); -
288 r >>= 8; -
289 g >>= 8; -
290 b >>= 8; -
291 a >>= 8; -
292 *dptr++ = qRgba(r, g, b, a); -
293 }
executed: }
Execution Count:5610
5610
294 else -
295 *dptr++ = sptr[xpoints[x] ];
executed: *dptr++ = sptr[xpoints[x] ];
Execution Count:16464
16464
296 } -
297 }
executed: }
Execution Count:169
169
298 } -
299 }
executed: }
Execution Count:19
19
300 -
301 else if(isi->xup_yup == 1){
evaluated: isi->xup_yup == 1
TRUEFALSE
yes
Evaluation Count:13
yes
Evaluation Count:110
13-110
302 -
303 int Cy, j; -
304 unsigned int *pix; -
305 int r, g, b, a, rr, gg, bb, aa; -
306 int yap; -
307 -
308 -
309 for(y = 0; y < dh; y++){
evaluated: y < dh
TRUEFALSE
yes
Evaluation Count:50012
yes
Evaluation Count:13
13-50012
310 Cy = (yapoints[dyy + y]) >> 16; -
311 yap = (yapoints[dyy + y]) & 0xffff; -
312 -
313 dptr = dest + dx + ((y + dy) * dow); -
314 for(x = dxx; x < end; x++){
evaluated: x < end
TRUEFALSE
yes
Evaluation Count:201050
yes
Evaluation Count:50012
50012-201050
315 pix = ypoints[dyy + y] + xpoints[x]; -
316 r = (qRed(*pix)) * yap; -
317 g = (qGreen(*pix)) * yap; -
318 b = (qBlue(*pix)) * yap; -
319 a = (qAlpha(*pix)) * yap; -
320 for(j = (1 << 14) - yap; j > Cy; j -= Cy){
evaluated: j > Cy
TRUEFALSE
yes
Evaluation Count:685406
yes
Evaluation Count:201050
201050-685406
321 pix += sow; -
322 r += (qRed(*pix)) * Cy; -
323 g += (qGreen(*pix)) * Cy; -
324 b += (qBlue(*pix)) * Cy; -
325 a += (qAlpha(*pix)) * Cy; -
326 }
executed: }
Execution Count:685406
685406
327 if(j > 0){
partially evaluated: j > 0
TRUEFALSE
yes
Evaluation Count:201050
no
Evaluation Count:0
0-201050
328 pix += sow; -
329 r += (qRed(*pix)) * j; -
330 g += (qGreen(*pix)) * j; -
331 b += (qBlue(*pix)) * j; -
332 a += (qAlpha(*pix)) * j; -
333 }
executed: }
Execution Count:201050
201050
334 if((xapoints[x]) > 0){
evaluated: (xapoints[x]) > 0
TRUEFALSE
yes
Evaluation Count:1026
yes
Evaluation Count:200024
1026-200024
335 pix = ypoints[dyy + y] + xpoints[x] + 1; -
336 rr = (qRed(*pix)) * yap; -
337 gg = (qGreen(*pix)) * yap; -
338 bb = (qBlue(*pix)) * yap; -
339 aa = (qAlpha(*pix)) * yap; -
340 for(j = (1 << 14) - yap; j > Cy; j -= Cy){
evaluated: j > Cy
TRUEFALSE
yes
Evaluation Count:85188
yes
Evaluation Count:1026
1026-85188
341 pix += sow; -
342 rr += (qRed(*pix)) * Cy; -
343 gg += (qGreen(*pix)) * Cy; -
344 bb += (qBlue(*pix)) * Cy; -
345 aa += (qAlpha(*pix)) * Cy; -
346 }
executed: }
Execution Count:85188
85188
347 if(j > 0){
partially evaluated: j > 0
TRUEFALSE
yes
Evaluation Count:1026
no
Evaluation Count:0
0-1026
348 pix += sow; -
349 rr += (qRed(*pix)) * j; -
350 gg += (qGreen(*pix)) * j; -
351 bb += (qBlue(*pix)) * j; -
352 aa += (qAlpha(*pix)) * j; -
353 }
executed: }
Execution Count:1026
1026
354 r = r * (256 - xapoints[x]); -
355 g = g * (256 - xapoints[x]); -
356 b = b * (256 - xapoints[x]); -
357 a = a * (256 - xapoints[x]); -
358 r = (r + ((rr * (xapoints[x])))) >> 12; -
359 g = (g + ((gg * (xapoints[x])))) >> 12; -
360 b = (b + ((bb * (xapoints[x])))) >> 12; -
361 a = (a + ((aa * (xapoints[x])))) >> 12; -
362 }
executed: }
Execution Count:1026
1026
363 else{ -
364 r >>= 4; -
365 g >>= 4; -
366 b >>= 4; -
367 a >>= 4; -
368 }
executed: }
Execution Count:200024
200024
369 *dptr = qRgba(r >> 10, g >> 10, b >> 10, a >> 10); -
370 dptr++; -
371 }
executed: }
Execution Count:201050
201050
372 }
executed: }
Execution Count:50012
50012
373 }
executed: }
Execution Count:13
13
374 -
375 else if(isi->xup_yup == 2){
evaluated: isi->xup_yup == 2
TRUEFALSE
yes
Evaluation Count:16
yes
Evaluation Count:94
16-94
376 -
377 int Cx, j; -
378 unsigned int *pix; -
379 int r, g, b, a, rr, gg, bb, aa; -
380 int xap; -
381 -
382 -
383 for(y = 0; y < dh; y++){
evaluated: y < dh
TRUEFALSE
yes
Evaluation Count:1854
yes
Evaluation Count:16
16-1854
384 dptr = dest + dx + ((y + dy) * dow); -
385 for(x = dxx; x < end; x++){
evaluated: x < end
TRUEFALSE
yes
Evaluation Count:421050
yes
Evaluation Count:1854
1854-421050
386 Cx = (xapoints[x]) >> 16; -
387 xap = (xapoints[x]) & 0xffff; -
388 -
389 pix = ypoints[dyy + y] + xpoints[x]; -
390 r = (qRed(*pix)) * xap; -
391 g = (qGreen(*pix)) * xap; -
392 b = (qBlue(*pix)) * xap; -
393 a = (qAlpha(*pix)) * xap; -
394 for(j = (1 << 14) - xap; j > Cx; j -= Cx){
evaluated: j > Cx
TRUEFALSE
yes
Evaluation Count:813406
yes
Evaluation Count:421050
421050-813406
395 pix++; -
396 r += (qRed(*pix)) * Cx; -
397 g += (qGreen(*pix)) * Cx; -
398 b += (qBlue(*pix)) * Cx; -
399 a += (qAlpha(*pix)) * Cx; -
400 }
executed: }
Execution Count:813406
813406
401 if(j > 0){
partially evaluated: j > 0
TRUEFALSE
yes
Evaluation Count:421050
no
Evaluation Count:0
0-421050
402 pix++; -
403 r += (qRed(*pix)) * j; -
404 g += (qGreen(*pix)) * j; -
405 b += (qBlue(*pix)) * j; -
406 a += (qAlpha(*pix)) * j; -
407 }
executed: }
Execution Count:421050
421050
408 if((yapoints[dyy + y]) > 0){
evaluated: (yapoints[dyy + y]) > 0
TRUEFALSE
yes
Evaluation Count:219426
yes
Evaluation Count:201624
201624-219426
409 pix = ypoints[dyy + y] + xpoints[x] + sow; -
410 rr = (qRed(*pix)) * xap; -
411 gg = (qGreen(*pix)) * xap; -
412 bb = (qBlue(*pix)) * xap; -
413 aa = (qAlpha(*pix)) * xap; -
414 for(j = (1 << 14) - xap; j > Cx; j -= Cx){
evaluated: j > Cx
TRUEFALSE
yes
Evaluation Count:212178
yes
Evaluation Count:219426
212178-219426
415 pix++; -
416 rr += (qRed(*pix)) * Cx; -
417 gg += (qGreen(*pix)) * Cx; -
418 bb += (qBlue(*pix)) * Cx; -
419 aa += (qAlpha(*pix)) * Cx; -
420 }
executed: }
Execution Count:212178
212178
421 if(j > 0){
partially evaluated: j > 0
TRUEFALSE
yes
Evaluation Count:219426
no
Evaluation Count:0
0-219426
422 pix++; -
423 rr += (qRed(*pix)) * j; -
424 gg += (qGreen(*pix)) * j; -
425 bb += (qBlue(*pix)) * j; -
426 aa += (qAlpha(*pix)) * j; -
427 }
executed: }
Execution Count:219426
219426
428 r = r * (256 - yapoints[dyy + y]); -
429 g = g * (256 - yapoints[dyy + y]); -
430 b = b * (256 - yapoints[dyy + y]); -
431 a = a * (256 - yapoints[dyy + y]); -
432 r = (r + ((rr * (yapoints[dyy + y])))) >> 12; -
433 g = (g + ((gg * (yapoints[dyy + y])))) >> 12; -
434 b = (b + ((bb * (yapoints[dyy + y])))) >> 12; -
435 a = (a + ((aa * (yapoints[dyy + y])))) >> 12; -
436 }
executed: }
Execution Count:219426
219426
437 else{ -
438 r >>= 4; -
439 g >>= 4; -
440 b >>= 4; -
441 a >>= 4; -
442 }
executed: }
Execution Count:201624
201624
443 *dptr = qRgba(r >> 10, g >> 10, b >> 10, a >> 10); -
444 dptr++; -
445 }
executed: }
Execution Count:421050
421050
446 }
executed: }
Execution Count:1854
1854
447 }
executed: }
Execution Count:16
16
448 -
449 else{ -
450 -
451 -
452 -
453 -
454 -
455 int Cx, Cy, i, j; -
456 unsigned int *pix; -
457 int a, r, g, b, ax, rx, gx, bx; -
458 int xap, yap; -
459 -
460 for(y = 0; y < dh; y++){
evaluated: y < dh
TRUEFALSE
yes
Evaluation Count:1486
yes
Evaluation Count:94
94-1486
461 Cy = (yapoints[dyy + y]) >> 16; -
462 yap = (yapoints[dyy + y]) & 0xffff; -
463 -
464 dptr = dest + dx + ((y + dy) * dow); -
465 for(x = dxx; x < end; x++){
evaluated: x < end
TRUEFALSE
yes
Evaluation Count:39720
yes
Evaluation Count:1486
1486-39720
466 Cx = (xapoints[x]) >> 16; -
467 xap = (xapoints[x]) & 0xffff; -
468 -
469 sptr = ypoints[dyy + y] + xpoints[x]; -
470 pix = sptr; -
471 sptr += sow; -
472 rx = (qRed(*pix)) * xap; -
473 gx = (qGreen(*pix)) * xap; -
474 bx = (qBlue(*pix)) * xap; -
475 ax = (qAlpha(*pix)) * xap; -
476 -
477 pix++; -
478 for(i = (1 << 14) - xap; i > Cx; i -= Cx){
evaluated: i > Cx
TRUEFALSE
yes
Evaluation Count:18783
yes
Evaluation Count:39720
18783-39720
479 rx += (qRed(*pix)) * Cx; -
480 gx += (qGreen(*pix)) * Cx; -
481 bx += (qBlue(*pix)) * Cx; -
482 ax += (qAlpha(*pix)) * Cx; -
483 pix++; -
484 }
executed: }
Execution Count:18783
18783
485 if(i > 0){
partially evaluated: i > 0
TRUEFALSE
yes
Evaluation Count:39720
no
Evaluation Count:0
0-39720
486 rx += (qRed(*pix)) * i; -
487 gx += (qGreen(*pix)) * i; -
488 bx += (qBlue(*pix)) * i; -
489 ax += (qAlpha(*pix)) * i; -
490 }
executed: }
Execution Count:39720
39720
491 -
492 r = (rx >> 5) * yap; -
493 g = (gx >> 5) * yap; -
494 b = (bx >> 5) * yap; -
495 a = (ax >> 5) * yap; -
496 -
497 for(j = (1 << 14) - yap; j > Cy; j -= Cy){
evaluated: j > Cy
TRUEFALSE
yes
Evaluation Count:18783
yes
Evaluation Count:39720
18783-39720
498 pix = sptr; -
499 sptr += sow; -
500 rx = (qRed(*pix)) * xap; -
501 gx = (qGreen(*pix)) * xap; -
502 bx = (qBlue(*pix)) * xap; -
503 ax = (qAlpha(*pix)) * xap; -
504 pix++; -
505 for(i = (1 << 14) - xap; i > Cx; i -= Cx){
evaluated: i > Cx
TRUEFALSE
yes
Evaluation Count:82501
yes
Evaluation Count:18783
18783-82501
506 rx += (qRed(*pix)) * Cx; -
507 gx += (qGreen(*pix)) * Cx; -
508 bx += (qBlue(*pix)) * Cx; -
509 ax += (qAlpha(*pix)) * Cx; -
510 pix++; -
511 }
executed: }
Execution Count:82501
82501
512 if(i > 0){
partially evaluated: i > 0
TRUEFALSE
yes
Evaluation Count:18783
no
Evaluation Count:0
0-18783
513 rx += (qRed(*pix)) * i; -
514 gx += (qGreen(*pix)) * i; -
515 bx += (qBlue(*pix)) * i; -
516 ax += (qAlpha(*pix)) * i; -
517 }
executed: }
Execution Count:18783
18783
518 -
519 r += (rx >> 5) * Cy; -
520 g += (gx >> 5) * Cy; -
521 b += (bx >> 5) * Cy; -
522 a += (ax >> 5) * Cy; -
523 }
executed: }
Execution Count:18783
18783
524 if(j > 0){
partially evaluated: j > 0
TRUEFALSE
yes
Evaluation Count:39720
no
Evaluation Count:0
0-39720
525 pix = sptr; -
526 sptr += sow; -
527 rx = (qRed(*pix)) * xap; -
528 gx = (qGreen(*pix)) * xap; -
529 bx = (qBlue(*pix)) * xap; -
530 ax = (qAlpha(*pix)) * xap; -
531 pix++; -
532 for(i = (1 << 14) - xap; i > Cx; i -= Cx){
evaluated: i > Cx
TRUEFALSE
yes
Evaluation Count:18783
yes
Evaluation Count:39720
18783-39720
533 rx += (qRed(*pix)) * Cx; -
534 gx += (qGreen(*pix)) * Cx; -
535 bx += (qBlue(*pix)) * Cx; -
536 ax += (qAlpha(*pix)) * Cx; -
537 pix++; -
538 }
executed: }
Execution Count:18783
18783
539 if(i > 0){
partially evaluated: i > 0
TRUEFALSE
yes
Evaluation Count:39720
no
Evaluation Count:0
0-39720
540 rx += (qRed(*pix)) * i; -
541 gx += (qGreen(*pix)) * i; -
542 bx += (qBlue(*pix)) * i; -
543 ax += (qAlpha(*pix)) * i; -
544 }
executed: }
Execution Count:39720
39720
545 -
546 r += (rx >> 5) * j; -
547 g += (gx >> 5) * j; -
548 b += (bx >> 5) * j; -
549 a += (ax >> 5) * j; -
550 }
executed: }
Execution Count:39720
39720
551 -
552 *dptr = qRgba(r >> 23, g >> 23, b >> 23, a >> 23); -
553 dptr++; -
554 }
executed: }
Execution Count:39720
39720
555 }
executed: }
Execution Count:1486
1486
556 }
executed: }
Execution Count:94
94
557} -
558 -
559 -
560static void qt_qimageScaleAARGB(QImageScaleInfo *isi, unsigned int *dest, -
561 int dxx, int dyy, int dx, int dy, int dw, -
562 int dh, int dow, int sow) -
563{ -
564 unsigned int *sptr, *dptr; -
565 int x, y, end; -
566 unsigned int **ypoints = isi->ypoints; -
567 int *xpoints = isi->xpoints; -
568 int *xapoints = isi->xapoints; -
569 int *yapoints = isi->yapoints; -
570 -
571 end = dxx + dw; -
572 -
573 if(isi->xup_yup == 3){
evaluated: isi->xup_yup == 3
TRUEFALSE
yes
Evaluation Count:23
yes
Evaluation Count:71
23-71
574 -
575 for(y = 0; y < dh; y++){
evaluated: y < dh
TRUEFALSE
yes
Evaluation Count:4306
yes
Evaluation Count:23
23-4306
576 -
577 dptr = dest + dx + ((y + dy) * dow); -
578 sptr = ypoints[dyy + y]; -
579 if((yapoints[dyy + y]) > 0){
evaluated: (yapoints[dyy + y]) > 0
TRUEFALSE
yes
Evaluation Count:4128
yes
Evaluation Count:178
178-4128
580 for(x = dxx; x < end; x++){
evaluated: x < end
TRUEFALSE
yes
Evaluation Count:1093904
yes
Evaluation Count:4128
4128-1093904
581 int r = 0, g = 0, b = 0; -
582 int rr = 0, gg = 0, bb = 0; -
583 unsigned int *pix; -
584 -
585 if((xapoints[x]) > 0){
evaluated: (xapoints[x]) > 0
TRUEFALSE
yes
Evaluation Count:1069936
yes
Evaluation Count:23968
23968-1069936
586 pix = ypoints[dyy + y] + xpoints[x]; -
587 r = (qRed(*pix)) * (256 - xapoints[x]); -
588 g = (qGreen(*pix)) * (256 - xapoints[x]); -
589 b = (qBlue(*pix)) * (256 - xapoints[x]); -
590 pix++; -
591 r += (qRed(*pix)) * (xapoints[x]); -
592 g += (qGreen(*pix)) * (xapoints[x]); -
593 b += (qBlue(*pix)) * (xapoints[x]); -
594 pix += sow; -
595 rr = (qRed(*pix)) * (xapoints[x]); -
596 gg = (qGreen(*pix)) * (xapoints[x]); -
597 bb = (qBlue(*pix)) * (xapoints[x]); -
598 pix --; -
599 rr += (qRed(*pix)) * (256 - xapoints[x]); -
600 gg += (qGreen(*pix)) * (256 - xapoints[x]); -
601 bb += (qBlue(*pix)) * (256 - xapoints[x]); -
602 r = ((rr * (yapoints[dyy + y])) + (r * (256 - yapoints[dyy + y]))) >> 16; -
603 g = ((gg * (yapoints[dyy + y])) + (g * (256 - yapoints[dyy + y]))) >> 16; -
604 b = ((bb * (yapoints[dyy + y])) + (b * (256 - yapoints[dyy + y]))) >> 16; -
605 *dptr++ = qRgba(r, g, b, 0xff); -
606 }
executed: }
Execution Count:1069936
1069936
607 else{ -
608 pix = ypoints[dyy + y] + xpoints[x]; -
609 r = (qRed(*pix)) * (256 - yapoints[dyy + y]); -
610 g = (qGreen(*pix)) * (256 - yapoints[dyy + y]); -
611 b = (qBlue(*pix)) * (256 - yapoints[dyy + y]); -
612 pix += sow; -
613 r += (qRed(*pix)) * (yapoints[dyy + y]); -
614 g += (qGreen(*pix)) * (yapoints[dyy + y]); -
615 b += (qBlue(*pix)) * (yapoints[dyy + y]); -
616 r >>= 8; -
617 g >>= 8; -
618 b >>= 8; -
619 *dptr++ = qRgba(r, g, b, 0xff); -
620 }
executed: }
Execution Count:23968
23968
621 } -
622 }
executed: }
Execution Count:4128
4128
623 else{ -
624 for(x = dxx; x < end; x++){
evaluated: x < end
TRUEFALSE
yes
Evaluation Count:48212
yes
Evaluation Count:178
178-48212
625 int r = 0, g = 0, b = 0; -
626 unsigned int *pix; -
627 -
628 if((xapoints[x]) > 0){
evaluated: (xapoints[x]) > 0
TRUEFALSE
yes
Evaluation Count:46168
yes
Evaluation Count:2044
2044-46168
629 pix = ypoints[dyy + y] + xpoints[x]; -
630 r = (qRed(*pix)) * (256 - xapoints[x]); -
631 g = (qGreen(*pix)) * (256 - xapoints[x]); -
632 b = (qBlue(*pix)) * (256 - xapoints[x]); -
633 pix++; -
634 r += (qRed(*pix)) * (xapoints[x]); -
635 g += (qGreen(*pix)) * (xapoints[x]); -
636 b += (qBlue(*pix)) * (xapoints[x]); -
637 r >>= 8; -
638 g >>= 8; -
639 b >>= 8; -
640 *dptr++ = qRgba(r, g, b, 0xff); -
641 }
executed: }
Execution Count:46168
46168
642 else -
643 *dptr++ = sptr[xpoints[x] ];
executed: *dptr++ = sptr[xpoints[x] ];
Execution Count:2044
2044
644 } -
645 }
executed: }
Execution Count:178
178
646 } -
647 }
executed: }
Execution Count:23
23
648 -
649 else if(isi->xup_yup == 1){
evaluated: isi->xup_yup == 1
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:59
12-59
650 -
651 int Cy, j; -
652 unsigned int *pix; -
653 int r, g, b, rr, gg, bb; -
654 int yap; -
655 -
656 -
657 for(y = 0; y < dh; y++){
evaluated: y < dh
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:12
12
658 Cy = (yapoints[dyy + y]) >> 16; -
659 yap = (yapoints[dyy + y]) & 0xffff; -
660 -
661 dptr = dest + dx + ((y + dy) * dow); -
662 for(x = dxx; x < end; x++){
evaluated: x < end
TRUEFALSE
yes
Evaluation Count:1050
yes
Evaluation Count:12
12-1050
663 pix = ypoints[dyy + y] + xpoints[x]; -
664 r = (qRed(*pix)) * yap; -
665 g = (qGreen(*pix)) * yap; -
666 b = (qBlue(*pix)) * yap; -
667 pix += sow; -
668 for(j = (1 << 14) - yap; j > Cy; j -= Cy){
evaluated: j > Cy
TRUEFALSE
yes
Evaluation Count:86190
yes
Evaluation Count:1050
1050-86190
669 r += (qRed(*pix)) * Cy; -
670 g += (qGreen(*pix)) * Cy; -
671 b += (qBlue(*pix)) * Cy; -
672 pix += sow; -
673 }
executed: }
Execution Count:86190
86190
674 if(j > 0){
partially evaluated: j > 0
TRUEFALSE
yes
Evaluation Count:1050
no
Evaluation Count:0
0-1050
675 r += (qRed(*pix)) * j; -
676 g += (qGreen(*pix)) * j; -
677 b += (qBlue(*pix)) * j; -
678 }
executed: }
Execution Count:1050
1050
679 if((xapoints[x]) > 0){
evaluated: (xapoints[x]) > 0
TRUEFALSE
yes
Evaluation Count:1026
yes
Evaluation Count:24
24-1026
680 pix = ypoints[dyy + y] + xpoints[x] + 1; -
681 rr = (qRed(*pix)) * yap; -
682 gg = (qGreen(*pix)) * yap; -
683 bb = (qBlue(*pix)) * yap; -
684 pix += sow; -
685 for(j = (1 << 14) - yap; j > Cy; j -= Cy){
evaluated: j > Cy
TRUEFALSE
yes
Evaluation Count:85188
yes
Evaluation Count:1026
1026-85188
686 rr += (qRed(*pix)) * Cy; -
687 gg += (qGreen(*pix)) * Cy; -
688 bb += (qBlue(*pix)) * Cy; -
689 pix += sow; -
690 }
executed: }
Execution Count:85188
85188
691 if(j > 0){
partially evaluated: j > 0
TRUEFALSE
yes
Evaluation Count:1026
no
Evaluation Count:0
0-1026
692 rr += (qRed(*pix)) * j; -
693 gg += (qGreen(*pix)) * j; -
694 bb += (qBlue(*pix)) * j; -
695 }
executed: }
Execution Count:1026
1026
696 r = r * (256 - xapoints[x]); -
697 g = g * (256 - xapoints[x]); -
698 b = b * (256 - xapoints[x]); -
699 r = (r + ((rr * (xapoints[x])))) >> 12; -
700 g = (g + ((gg * (xapoints[x])))) >> 12; -
701 b = (b + ((bb * (xapoints[x])))) >> 12; -
702 }
executed: }
Execution Count:1026
1026
703 else{ -
704 r >>= 4; -
705 g >>= 4; -
706 b >>= 4; -
707 }
executed: }
Execution Count:24
24
708 *dptr = qRgba(r >> 10, g >> 10, b >> 10, 0xff); -
709 dptr++; -
710 }
executed: }
Execution Count:1050
1050
711 }
executed: }
Execution Count:12
12
712 }
executed: }
Execution Count:12
12
713 -
714 else if(isi->xup_yup == 2){
evaluated: isi->xup_yup == 2
TRUEFALSE
yes
Evaluation Count:23
yes
Evaluation Count:36
23-36
715 -
716 int Cx, j; -
717 unsigned int *pix; -
718 int r, g, b, rr, gg, bb; -
719 int xap; -
720 -
721 -
722 for(y = 0; y < dh; y++){
evaluated: y < dh
TRUEFALSE
yes
Evaluation Count:4050
yes
Evaluation Count:23
23-4050
723 dptr = dest + dx + ((y + dy) * dow); -
724 for(x = dxx; x < end; x++){
evaluated: x < end
TRUEFALSE
yes
Evaluation Count:841050
yes
Evaluation Count:4050
4050-841050
725 Cx = (xapoints[x]) >> 16; -
726 xap = (xapoints[x]) & 0xffff; -
727 -
728 pix = ypoints[dyy + y] + xpoints[x]; -
729 r = (qRed(*pix)) * xap; -
730 g = (qGreen(*pix)) * xap; -
731 b = (qBlue(*pix)) * xap; -
732 pix++; -
733 for(j = (1 << 14) - xap; j > Cx; j -= Cx){
evaluated: j > Cx
TRUEFALSE
yes
Evaluation Count:250790
yes
Evaluation Count:841050
250790-841050
734 r += (qRed(*pix)) * Cx; -
735 g += (qGreen(*pix)) * Cx; -
736 b += (qBlue(*pix)) * Cx; -
737 pix++; -
738 }
executed: }
Execution Count:250790
250790
739 if(j > 0){
partially evaluated: j > 0
TRUEFALSE
yes
Evaluation Count:841050
no
Evaluation Count:0
0-841050
740 r += (qRed(*pix)) * j; -
741 g += (qGreen(*pix)) * j; -
742 b += (qBlue(*pix)) * j; -
743 }
executed: }
Execution Count:841050
841050
744 if((yapoints[dyy + y]) > 0){
evaluated: (yapoints[dyy + y]) > 0
TRUEFALSE
yes
Evaluation Count:751226
yes
Evaluation Count:89824
89824-751226
745 pix = ypoints[dyy + y] + xpoints[x] + sow; -
746 rr = (qRed(*pix)) * xap; -
747 gg = (qGreen(*pix)) * xap; -
748 bb = (qBlue(*pix)) * xap; -
749 pix++; -
750 for(j = (1 << 14) - xap; j > Cx; j -= Cx){
evaluated: j > Cx
TRUEFALSE
yes
Evaluation Count:200485
yes
Evaluation Count:751226
200485-751226
751 rr += (qRed(*pix)) * Cx; -
752 gg += (qGreen(*pix)) * Cx; -
753 bb += (qBlue(*pix)) * Cx; -
754 pix++; -
755 }
executed: }
Execution Count:200485
200485
756 if(j > 0){
partially evaluated: j > 0
TRUEFALSE
yes
Evaluation Count:751226
no
Evaluation Count:0
0-751226
757 rr += (qRed(*pix)) * j; -
758 gg += (qGreen(*pix)) * j; -
759 bb += (qBlue(*pix)) * j; -
760 }
executed: }
Execution Count:751226
751226
761 r = r * (256 - yapoints[dyy + y]); -
762 g = g * (256 - yapoints[dyy + y]); -
763 b = b * (256 - yapoints[dyy + y]); -
764 r = (r + ((rr * (yapoints[dyy + y])))) >> 12; -
765 g = (g + ((gg * (yapoints[dyy + y])))) >> 12; -
766 b = (b + ((bb * (yapoints[dyy + y])))) >> 12; -
767 }
executed: }
Execution Count:751226
751226
768 else{ -
769 r >>= 4; -
770 g >>= 4; -
771 b >>= 4; -
772 }
executed: }
Execution Count:89824
89824
773 *dptr = qRgba(r >> 10, g >> 10, b >> 10, 0xff); -
774 dptr++; -
775 }
executed: }
Execution Count:841050
841050
776 }
executed: }
Execution Count:4050
4050
777 }
executed: }
Execution Count:23
23
778 -
779 -
780 else{ -
781 -
782 int Cx, Cy, i, j; -
783 unsigned int *pix; -
784 int r, g, b, rx, gx, bx; -
785 int xap, yap; -
786 -
787 for(y = 0; y < dh; y++){
evaluated: y < dh
TRUEFALSE
yes
Evaluation Count:2820
yes
Evaluation Count:36
36-2820
788 Cy = (yapoints[dyy + y]) >> 16; -
789 yap = (yapoints[dyy + y]) & 0xffff; -
790 -
791 dptr = dest + dx + ((y + dy) * dow); -
792 for(x = dxx; x < end; x++){
evaluated: x < end
TRUEFALSE
yes
Evaluation Count:588136
yes
Evaluation Count:2820
2820-588136
793 Cx = (xapoints[x]) >> 16; -
794 xap = (xapoints[x]) & 0xffff; -
795 -
796 sptr = ypoints[dyy + y] + xpoints[x]; -
797 pix = sptr; -
798 sptr += sow; -
799 rx = (qRed(*pix)) * xap; -
800 gx = (qGreen(*pix)) * xap; -
801 bx = (qBlue(*pix)) * xap; -
802 pix++; -
803 for(i = (1 << 14) - xap; i > Cx; i -= Cx){
evaluated: i > Cx
TRUEFALSE
yes
Evaluation Count:200484
yes
Evaluation Count:588136
200484-588136
804 rx += (qRed(*pix)) * Cx; -
805 gx += (qGreen(*pix)) * Cx; -
806 bx += (qBlue(*pix)) * Cx; -
807 pix++; -
808 }
executed: }
Execution Count:200484
200484
809 if(i > 0){
partially evaluated: i > 0
TRUEFALSE
yes
Evaluation Count:588136
no
Evaluation Count:0
0-588136
810 rx += (qRed(*pix)) * i; -
811 gx += (qGreen(*pix)) * i; -
812 bx += (qBlue(*pix)) * i; -
813 }
executed: }
Execution Count:588136
588136
814 -
815 r = (rx >> 5) * yap; -
816 g = (gx >> 5) * yap; -
817 b = (bx >> 5) * yap; -
818 -
819 for(j = (1 << 14) - yap; j > Cy; j -= Cy){
evaluated: j > Cy
TRUEFALSE
yes
Evaluation Count:201317
yes
Evaluation Count:588136
201317-588136
820 pix = sptr; -
821 sptr += sow; -
822 rx = (qRed(*pix)) * xap; -
823 gx = (qGreen(*pix)) * xap; -
824 bx = (qBlue(*pix)) * xap; -
825 pix++; -
826 for(i = (1 << 14) - xap; i > Cx; i -= Cx){
evaluated: i > Cx
TRUEFALSE
yes
Evaluation Count:133157
yes
Evaluation Count:201317
133157-201317
827 rx += (qRed(*pix)) * Cx; -
828 gx += (qGreen(*pix)) * Cx; -
829 bx += (qBlue(*pix)) * Cx; -
830 pix++; -
831 }
executed: }
Execution Count:133157
133157
832 if(i > 0){
partially evaluated: i > 0
TRUEFALSE
yes
Evaluation Count:201317
no
Evaluation Count:0
0-201317
833 rx += (qRed(*pix)) * i; -
834 gx += (qGreen(*pix)) * i; -
835 bx += (qBlue(*pix)) * i; -
836 }
executed: }
Execution Count:201317
201317
837 -
838 r += (rx >> 5) * Cy; -
839 g += (gx >> 5) * Cy; -
840 b += (bx >> 5) * Cy; -
841 }
executed: }
Execution Count:201317
201317
842 if(j > 0){
partially evaluated: j > 0
TRUEFALSE
yes
Evaluation Count:588136
no
Evaluation Count:0
0-588136
843 pix = sptr; -
844 sptr += sow; -
845 rx = (qRed(*pix)) * xap; -
846 gx = (qGreen(*pix)) * xap; -
847 bx = (qBlue(*pix)) * xap; -
848 pix++; -
849 for(i = (1 << 14) - xap; i > Cx; i -= Cx){
evaluated: i > Cx
TRUEFALSE
yes
Evaluation Count:200484
yes
Evaluation Count:588136
200484-588136
850 rx += (qRed(*pix)) * Cx; -
851 gx += (qGreen(*pix)) * Cx; -
852 bx += (qBlue(*pix)) * Cx; -
853 pix++; -
854 }
executed: }
Execution Count:200484
200484
855 if(i > 0){
partially evaluated: i > 0
TRUEFALSE
yes
Evaluation Count:588136
no
Evaluation Count:0
0-588136
856 rx += (qRed(*pix)) * i; -
857 gx += (qGreen(*pix)) * i; -
858 bx += (qBlue(*pix)) * i; -
859 }
executed: }
Execution Count:588136
588136
860 -
861 r += (rx >> 5) * j; -
862 g += (gx >> 5) * j; -
863 b += (bx >> 5) * j; -
864 }
executed: }
Execution Count:588136
588136
865 -
866 *dptr = qRgb(r >> 23, g >> 23, b >> 23); -
867 dptr++; -
868 }
executed: }
Execution Count:588136
588136
869 }
executed: }
Execution Count:2820
2820
870 }
executed: }
Execution Count:36
36
871} -
872QImage qSmoothScaleImage(const QImage &src, int dw, int dh) -
873{ -
874 QImage buffer; -
875 if (src.isNull() || dw <= 0 || dh <= 0)
partially evaluated: src.isNull()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:236
partially evaluated: dw <= 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:236
partially evaluated: dh <= 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:236
0-236
876 return buffer;
never executed: return buffer;
0
877 -
878 int w = src.width(); -
879 int h = src.height(); -
880 QImageScaleInfo *scaleinfo = -
881 qimageCalcScaleInfo(src, w, h, dw, dh, true); -
882 if (!scaleinfo)
partially evaluated: !scaleinfo
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:236
0-236
883 return buffer;
never executed: return buffer;
0
884 -
885 buffer = QImage(dw, dh, src.format()); -
886 if (buffer.isNull()) {
partially evaluated: buffer.isNull()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:236
0-236
887 QMessageLogger("painting/qimagescale.cpp", 1015, __PRETTY_FUNCTION__).warning("QImage: out of memory, returning null"); -
888 qimageFreeScaleInfo(scaleinfo); -
889 return QImage();
never executed: return QImage();
0
890 } -
891 -
892 if (src.format() == QImage::Format_ARGB32_Premultiplied)
evaluated: src.format() == QImage::Format_ARGB32_Premultiplied
TRUEFALSE
yes
Evaluation Count:142
yes
Evaluation Count:94
94-142
893 qt_qimageScaleArgb(scaleinfo, (unsigned int *)buffer.scanLine(0), 142
894 0, 0, 0, 0, dw, dh, dw, src.bytesPerLine() / 4);
executed: qt_qimageScaleArgb(scaleinfo, (unsigned int *)buffer.scanLine(0), 0, 0, 0, 0, dw, dh, dw, src.bytesPerLine() / 4);
Execution Count:142
142
895 else -
896 qt_qimageScaleRgb(scaleinfo, (unsigned int *)buffer.scanLine(0), 94
897 0, 0, 0, 0, dw, dh, dw, src.bytesPerLine() / 4);
executed: qt_qimageScaleRgb(scaleinfo, (unsigned int *)buffer.scanLine(0), 0, 0, 0, 0, dw, dh, dw, src.bytesPerLine() / 4);
Execution Count:94
94
898 -
899 qimageFreeScaleInfo(scaleinfo); -
900 return buffer;
executed: return buffer;
Execution Count:236
236
901} -
902 -
903 -
904 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial