1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

Add 90 degree rotation methods. This provides a quick simple way of doing 90 degree rotations.

Also fix warnings that show up on other compilers in test builds.
This commit is contained in:
Tetragramm
2016-10-21 20:01:12 -05:00
parent 44e5d26312
commit 6f7bf653f7
2 changed files with 62 additions and 0 deletions
+44
View File
@@ -826,6 +826,50 @@ void flip( InputArray _src, OutputArray _dst, int flip_mode )
flipHoriz( dst.ptr(), dst.step, dst.ptr(), dst.step, dst.size(), esz );
}
#ifdef HAVE_OPENCL
static bool ocl_rotate(InputArray _src, OutputArray _dst, int rotateMode)
{
switch (rotateMode)
{
case ROTATE_90:
flip(_src.getUMat().t(), _dst, 1);
break;
case ROTATE_180:
flip(_src, _dst, -1);
break;
case ROTATE_270:
flip(_src.getUMat().t(), _dst, 0);
break;
default:
break;
}
return true;
}
#endif
void rotate(InputArray _src, OutputArray _dst, int rotateMode)
{
CV_Assert(_src.dims() <= 2);
CV_OCL_RUN(_dst.isUMat(), ocl_rotate(_src, _dst, rotateMode))
switch (rotateMode)
{
case ROTATE_90:
flip(_src.getMat().t(), _dst, 1);
break;
case ROTATE_180:
flip(_src, _dst, -1);
break;
case ROTATE_270:
flip(_src.getMat().t(), _dst, 0);
break;
default:
break;
}
}
#if defined HAVE_OPENCL && !defined __APPLE__
static bool ocl_repeat(InputArray _src, int ny, int nx, OutputArray _dst)