diff --git a/egami/Image.cpp b/egami/Image.cpp index ae1974c..0748efe 100644 --- a/egami/Image.cpp +++ b/egami/Image.cpp @@ -56,6 +56,12 @@ egami::Image::Image(const ivec2& _size, enum colorType _type) : configure(_size, _type); } +void egami::Image::swap(egami::Image& _obj) { + ememory::SharedPtr tmp = m_data; + m_data = _obj.m_data; + _obj.m_data = tmp; +} + void egami::Image::configure(const ivec2& _size, enum colorType _type) { switch (_type) { case egami::colorType::undefined: diff --git a/egami/Image.hpp b/egami/Image.hpp index efbc3e1..3901efc 100644 --- a/egami/Image.hpp +++ b/egami/Image.hpp @@ -85,6 +85,7 @@ namespace egami { bool exist() { return m_data != nullptr; } + void swap(egami::Image& _obj); // ----------------------------------------------- // -- basic tools : // -----------------------------------------------