MCPcopy Create free account
hub / github.com/LibreSprite/LibreSprite / copy_bitmaps

Function copy_bitmaps

src/doc/image_impl.cpp:18–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16namespace doc {
17
18void 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

Callers 1

copyMethod · 0.85

Calls 5

clipMethod · 0.80
srcBoundsMethod · 0.80
dstBoundsMethod · 0.80
widthMethod · 0.45
heightMethod · 0.45

Tested by

no test coverage detected