Commit 2a3d7494 authored by Davis King's avatar Davis King

Made the integral image swappable

parent 5dace981
...@@ -94,12 +94,24 @@ namespace dlib ...@@ -94,12 +94,24 @@ namespace dlib
return bottom_right - bottom_left - top_right + top_left; return bottom_right - bottom_left - top_right + top_left;
} }
void swap(integral_image_generic& item)
{
int_img.swap(item.int_img);
}
private: private:
array2d<T> int_img; array2d<T> int_img;
};
}; template <
typename T
>
void swap (
integral_image_generic<T>& a,
integral_image_generic<T>& b
) { a.swap(b); }
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
......
...@@ -83,8 +83,27 @@ namespace dlib ...@@ -83,8 +83,27 @@ namespace dlib
are contained within the given rectangle. are contained within the given rectangle.
!*/ !*/
void swap(
integral_image_generic& item
);
/*!
ensures
- swaps *this and item
!*/
}; };
// ----------------------------------------------------------------------------------------
template < typename T >
void swap (
integral_image_generic<T>& a,
integral_image_generic<T>& b
) { a.swap(b); }
/*!
provides a global swap function
!*/
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
typedef integral_image_generic<long> integral_image; typedef integral_image_generic<long> integral_image;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment