| line |
true |
false |
branch |
|
32
|
0 |
0 |
for (y = 0; y < dst_h; y++) { |
|
34
|
0 |
0 |
if (src_y >= src_h) src_y = src_h - 1; |
|
39
|
0 |
0 |
for (x = 0; x < dst_w; x++) { |
|
41
|
0 |
0 |
if (src_x >= src_w) src_x = src_w - 1; |
|
60
|
0 |
0 |
for (y = 0; y < dst_h; y++) { |
|
62
|
0 |
0 |
if (src_y >= src_h) src_y = src_h - 1; |
|
67
|
0 |
0 |
for (x = 0; x < dst_w; x++) { |
|
69
|
0 |
0 |
if (src_x >= src_w) src_x = src_w - 1; |
|
88
|
0 |
0 |
for (y = 0; y < dst_h; y++) { |
|
90
|
0 |
0 |
if (src_y >= src_h) src_y = src_h - 1; |
|
95
|
0 |
0 |
for (x = 0; x < dst_w; x++) { |
|
97
|
0 |
0 |
if (src_x >= src_w) src_x = src_w - 1; |
|
120
|
0 |
0 |
if (x0 < 0) x0 = 0; |
|
121
|
0 |
0 |
if (y0 < 0) y0 = 0; |
|
122
|
0 |
0 |
if (x1 >= src_w) x1 = src_w - 1; |
|
123
|
0 |
0 |
if (y1 >= src_h) y1 = src_h - 1; |
|
150
|
0 |
0 |
if (dst_w == 1) x_ratio = 0; |
|
151
|
0 |
0 |
if (dst_h == 1) y_ratio = 0; |
|
153
|
0 |
0 |
for (y = 0; y < dst_h; y++) { |
|
157
|
0 |
0 |
for (x = 0; x < dst_w; x++) { |
|
179
|
0 |
0 |
if (dst_w == 1) x_ratio = 0; |
|
180
|
0 |
0 |
if (dst_h == 1) y_ratio = 0; |
|
182
|
0 |
0 |
for (y = 0; y < dst_h; y++) { |
|
186
|
0 |
0 |
if (y0 < 0) y0 = 0; |
|
187
|
0 |
0 |
if (y1 >= src_h) y1 = src_h - 1; |
|
192
|
0 |
0 |
for (x = 0; x < dst_w; x++) { |
|
196
|
0 |
0 |
if (x0 < 0) x0 = 0; |
|
197
|
0 |
0 |
if (x1 >= src_w) x1 = src_w - 1; |
|
200
|
0 |
0 |
for (c = 0; c < 3; c++) { |
|
233
|
0 |
0 |
if (dst_w == 1) x_ratio = 0; |
|
234
|
0 |
0 |
if (dst_h == 1) y_ratio = 0; |
|
236
|
0 |
0 |
for (y = 0; y < dst_h; y++) { |
|
240
|
0 |
0 |
if (y0 < 0) y0 = 0; |
|
241
|
0 |
0 |
if (y1 >= src_h) y1 = src_h - 1; |
|
246
|
0 |
0 |
for (x = 0; x < dst_w; x++) { |
|
250
|
0 |
0 |
if (x0 < 0) x0 = 0; |
|
251
|
0 |
0 |
if (x1 >= src_w) x1 = src_w - 1; |
|
313
|
0 |
0 |
if (x < 1.0) { |
|
317
|
0 |
0 |
} else if (x < 2.0) { |
|
339
|
0 |
0 |
for (dy = 0; dy < dst_h; dy++) { |
|
346
|
0 |
0 |
for (dx = 0; dx < dst_w; dx++) { |
|
355
|
0 |
0 |
for (j = -1; j <= 2; j++) { |
|
357
|
0 |
0 |
if (sy < 0) sy = 0; |
|
358
|
0 |
0 |
if (sy >= src_h) sy = src_h - 1; |
|
362
|
0 |
0 |
for (i = -1; i <= 2; i++) { |
|
364
|
0 |
0 |
if (sx < 0) sx = 0; |
|
365
|
0 |
0 |
if (sx >= src_w) sx = src_w - 1; |
|
375
|
0 |
0 |
if (weight_sum > 0) { |
|
377
|
0 |
0 |
if (val < 0) val = 0; |
|
378
|
0 |
0 |
if (val > 255) val = 255; |
|
404
|
0 |
0 |
for (dy = 0; dy < dst_h; dy++) { |
|
411
|
0 |
0 |
for (dx = 0; dx < dst_w; dx++) { |
|
421
|
0 |
0 |
for (j = -1; j <= 2; j++) { |
|
423
|
0 |
0 |
if (sy < 0) sy = 0; |
|
424
|
0 |
0 |
if (sy >= src_h) sy = src_h - 1; |
|
428
|
0 |
0 |
for (i = -1; i <= 2; i++) { |
|
430
|
0 |
0 |
if (sx < 0) sx = 0; |
|
431
|
0 |
0 |
if (sx >= src_w) sx = src_w - 1; |
|
444
|
0 |
0 |
for (c = 0; c < 3; c++) { |
|
446
|
0 |
0 |
if (weight_sum > 0) { |
|
449
|
0 |
0 |
if (val < 0) val = 0; |
|
450
|
0 |
0 |
if (val > 255) val = 255; |
|
473
|
0 |
0 |
for (dy = 0; dy < dst_h; dy++) { |
|
480
|
0 |
0 |
for (dx = 0; dx < dst_w; dx++) { |
|
491
|
0 |
0 |
for (j = -1; j <= 2; j++) { |
|
493
|
0 |
0 |
if (sy < 0) sy = 0; |
|
494
|
0 |
0 |
if (sy >= src_h) sy = src_h - 1; |
|
498
|
0 |
0 |
for (i = -1; i <= 2; i++) { |
|
500
|
0 |
0 |
if (sx < 0) sx = 0; |
|
501
|
0 |
0 |
if (sx >= src_w) sx = src_w - 1; |
|
519
|
0 |
0 |
if (weight_sum > 0) { |
|
525
|
0 |
0 |
a = (uint8_t)PDFMAKE_CLAMP8(va); |
|
|
0 |
0 |
a = (uint8_t)PDFMAKE_CLAMP8(va); |
|
526
|
0 |
0 |
r = (uint8_t)PDFMAKE_CLAMP8(vr); |
|
|
0 |
0 |
r = (uint8_t)PDFMAKE_CLAMP8(vr); |
|
527
|
0 |
0 |
g = (uint8_t)PDFMAKE_CLAMP8(vg); |
|
|
0 |
0 |
g = (uint8_t)PDFMAKE_CLAMP8(vg); |
|
528
|
0 |
0 |
b = (uint8_t)PDFMAKE_CLAMP8(vb); |
|
|
0 |
0 |
b = (uint8_t)PDFMAKE_CLAMP8(vb); |
|
549
|
0 |
0 |
if (!src || !out) return PDFMAKE_IMGR_ERR_NULL; |
|
|
0 |
0 |
if (!src || !out) return PDFMAKE_IMGR_ERR_NULL; |
|
550
|
0 |
0 |
if (!src->pixels) return PDFMAKE_IMGR_ERR_INVALID; |
|
551
|
0 |
0 |
if (dst_width <= 0 || dst_height <= 0) return PDFMAKE_IMGR_ERR_INVALID; |
|
|
0 |
0 |
if (dst_width <= 0 || dst_height <= 0) return PDFMAKE_IMGR_ERR_INVALID; |
|
557
|
0 |
0 |
if (!dst) return PDFMAKE_IMGR_ERR_MEMORY; |
|
566
|
0 |
0 |
if (src->components == 1) { |
|
582
|
0 |
0 |
} else if (src->components == 3) { |
|
598
|
0 |
0 |
} else if (src->components == 4) { |
|
601
|
0 |
0 |
switch (mode) { |
|
616
|
0 |
0 |
if (src->has_alpha && src->alpha) { |
|
|
0 |
0 |
if (src->has_alpha && src->alpha) { |
|
618
|
0 |
0 |
if (arena) { |
|
624
|
0 |
0 |
if (dst->alpha) { |
|
651
|
0 |
0 |
if (!src || !dst) return PDFMAKE_IMGR_ERR_NULL; |
|
|
0 |
0 |
if (!src || !dst) return PDFMAKE_IMGR_ERR_NULL; |
|
652
|
0 |
0 |
if (src_w <= 0 || src_h <= 0 || dst_w <= 0 || dst_h <= 0) { |
|
|
0 |
0 |
if (src_w <= 0 || src_h <= 0 || dst_w <= 0 || dst_h <= 0) { |
|
|
0 |
0 |
if (src_w <= 0 || src_h <= 0 || dst_w <= 0 || dst_h <= 0) { |
|
|
0 |
0 |
if (src_w <= 0 || src_h <= 0 || dst_w <= 0 || dst_h <= 0) { |
|
686
|
0 |
0 |
if (!img) return PDFMAKE_IMGR_ERR_NULL; |
|
691
|
0 |
0 |
if (err != PDFMAKE_IMGR_OK) return err; |
|
694
|
0 |
0 |
if (!arena && img->owns_data) { |
|
|
0 |
0 |
if (!arena && img->owns_data) { |
|
711
|
0 |
0 |
if (!arena) free(scaled); |