MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/OpenImageIO / copy_from

Method copy_from

src/libOpenImageIO/imagebuf.cpp:654–675  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

652
653
654void
655ImageBuf::copy_from (const ImageBuf &src)
656{
657 if (this == &src)
658 return;
659 const ImageBufImpl *srcimpl (src.impl());
660 srcimpl->validate_pixels ();
661 const ImageSpec &srcspec (srcimpl->spec());
662 ImageBufImpl *impl (this->impl());
663 const ImageSpec &spec (impl->spec());
664 ASSERT (spec.width == srcspec.width &&
665 spec.height == srcspec.height &&
666 spec.depth == srcspec.depth &&
667 spec.nchannels == srcspec.nchannels);
668 impl->realloc ();
669 if (spec.deep)
670 impl->m_deepdata = srcimpl->m_deepdata;
671 else
672 src.get_pixels (src.xbegin(), src.xend(), src.ybegin(), src.yend(),
673 src.zbegin(), src.zend(), spec.format,
674 impl->m_localpixels);
675}
676
677
678

Callers

nothing calls this directly

Calls 10

implFunction · 0.85
validate_pixelsMethod · 0.80
reallocMethod · 0.80
xbeginMethod · 0.80
xendMethod · 0.80
ybeginMethod · 0.80
yendMethod · 0.80
zbeginMethod · 0.80
zendMethod · 0.80
get_pixelsMethod · 0.45

Tested by

no test coverage detected