| 392 | typename background_type |
| 393 | > |
| 394 | void transform_image ( |
| 395 | const image_type1& in_img, |
| 396 | image_type2& out_img, |
| 397 | const interpolation_type& interp, |
| 398 | const point_mapping_type& map_point, |
| 399 | const background_type& set_background, |
| 400 | const rectangle& area |
| 401 | ) |
| 402 | { |
| 403 | // make sure requires clause is not broken |
| 404 | DLIB_ASSERT( get_rect(out_img).contains(area) == true && |
| 405 | is_same_object(in_img, out_img) == false , |
| 406 | "\t void transform_image()" |
| 407 | << "\n\t Invalid inputs were given to this function." |
| 408 | << "\n\t get_rect(out_img).contains(area): " << get_rect(out_img).contains(area) |
| 409 | << "\n\t get_rect(out_img): " << get_rect(out_img) |
| 410 | << "\n\t area: " << area |
| 411 | << "\n\t is_same_object(in_img, out_img): " << is_same_object(in_img, out_img) |
| 412 | ); |
| 413 | |
| 414 | const_image_view<image_type1> imgv(in_img); |
| 415 | image_view<image_type2> out_imgv(out_img); |
| 416 | |
| 417 | for (long r = area.top(); r <= area.bottom(); ++r) |
| 418 | { |
| 419 | for (long c = area.left(); c <= area.right(); ++c) |
| 420 | { |
| 421 | if (!interp(imgv, map_point(dpoint(c,r)), out_imgv[r][c])) |
| 422 | set_background(out_imgv[r][c]); |
| 423 | } |
| 424 | } |
| 425 | } |
| 426 | |
| 427 | // ---------------------------------------------------------------------------------------- |
| 428 |
no test coverage detected