[DEV] add swap in image

This commit is contained in:
Edouard DUPIN 2016-11-16 21:07:05 +01:00
parent 927604ad6d
commit 25e6b83253
2 changed files with 7 additions and 0 deletions

View File

@ -56,6 +56,12 @@ egami::Image::Image(const ivec2& _size, enum colorType _type) :
configure(_size, _type); configure(_size, _type);
} }
void egami::Image::swap(egami::Image& _obj) {
ememory::SharedPtr<ImagePrivate> tmp = m_data;
m_data = _obj.m_data;
_obj.m_data = tmp;
}
void egami::Image::configure(const ivec2& _size, enum colorType _type) { void egami::Image::configure(const ivec2& _size, enum colorType _type) {
switch (_type) { switch (_type) {
case egami::colorType::undefined: case egami::colorType::undefined:

View File

@ -85,6 +85,7 @@ namespace egami {
bool exist() { bool exist() {
return m_data != nullptr; return m_data != nullptr;
} }
void swap(egami::Image& _obj);
// ----------------------------------------------- // -----------------------------------------------
// -- basic tools : // -- basic tools :
// ----------------------------------------------- // -----------------------------------------------