| 16 | namespace doc { |
| 17 | |
| 18 | void copy_bitmaps(Image* dst, const Image* src, gfx::Clip area) |
| 19 | { |
| 20 | if (!area.clip(dst->width(), dst->height(), src->width(), src->height())) |
| 21 | return; |
| 22 | |
| 23 | // Copy process |
| 24 | ImageConstIterator<BitmapTraits> src_it(src, area.srcBounds(), area.src.x, area.src.y); |
| 25 | ImageIterator<BitmapTraits> dst_it(dst, area.dstBounds(), area.dst.x, area.dst.y); |
| 26 | |
| 27 | int end_x = area.dst.x+area.size.w; |
| 28 | |
| 29 | for (int end_y=area.dst.y+area.size.h; |
| 30 | area.dst.y<end_y; |
| 31 | ++area.dst.y, ++area.src.y) { |
| 32 | for (int x=area.dst.x; x<end_x; ++x) { |
| 33 | *dst_it = *src_it; |
| 34 | ++src_it; |
| 35 | ++dst_it; |
| 36 | } |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | } // namespace doc |