Commit f2cc77aa authored by Davis King's avatar Davis King

Added convenience overloads of pyramid_up() that work in place.

parent 13058b1b
......@@ -7,6 +7,7 @@
#include "../pixel.h"
#include "../matrix.h"
#include "assign_image.h"
#include "image_pyramid.h"
#include "../simd.h"
namespace dlib
......@@ -1251,6 +1252,35 @@ namespace dlib
pyramid_up(in_img, out_img, pyr, interpolate_bilinear());
}
// ----------------------------------------------------------------------------------------
template <
typename image_type,
typename pyramid_type
>
void pyramid_up (
image_type& img,
const pyramid_type& pyr
)
{
image_type temp;
pyramid_up(img, temp, pyr);
temp.swap(img);
}
// ----------------------------------------------------------------------------------------
template <
typename image_type
>
void pyramid_up (
image_type& img
)
{
pyramid_down<2> pyr;
pyramid_up(img, pyr);
}
// ----------------------------------------------------------------------------------------
}
......
......@@ -745,6 +745,44 @@ namespace dlib
- performs: pyramid_up(in_img, out_img, pyr, interpolate_bilinear());
!*/
// ----------------------------------------------------------------------------------------
template <
typename image_type,
typename pyramid_type
>
void pyramid_up (
image_type& img,
const pyramid_type& pyr
);
/*!
requires
- image_type == is an implementation of array2d/array2d_kernel_abstract.h
- pyramid_type == a type compatible with the image pyramid objects defined
in dlib/image_transforms/image_pyramid_abstract.h
ensures
- Performs an in-place version of pyramid_up() on the given image. In
particular, this function is equivalent to:
pyramid_up(img, temp, pyr);
temp.swap(img);
!*/
// ----------------------------------------------------------------------------------------
template <
typename image_type
>
void pyramid_up (
image_type& img
);
/*!
requires
- image_type == is an implementation of array2d/array2d_kernel_abstract.h
ensures
- performs: pyramid_up(img, pyramid_down<2>());
(i.e. it upsamples the given image and doubles it in size.)
!*/
// ----------------------------------------------------------------------------------------
}
......
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