mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 15:23:05 +04:00
Improve the efficiency as suggested by vpisarev.
Alter the Rotation enum to be unambiguous as to direction.
This commit is contained in:
@@ -832,14 +832,16 @@ static bool ocl_rotate(InputArray _src, OutputArray _dst, int rotateMode)
|
||||
{
|
||||
switch (rotateMode)
|
||||
{
|
||||
case ROTATE_90:
|
||||
flip(_src.getUMat().t(), _dst, 1);
|
||||
case ROTATE_90_CLOCKWISE:
|
||||
_dst.getUMat() = _src.getUMat().t();
|
||||
flip(_dst, _dst, 1);
|
||||
break;
|
||||
case ROTATE_180:
|
||||
flip(_src, _dst, -1);
|
||||
break;
|
||||
case ROTATE_270:
|
||||
flip(_src.getUMat().t(), _dst, 0);
|
||||
case ROTATE_90_COUNTERCLOCKWISE:
|
||||
_dst.getUMat() = _src.getUMat().t();
|
||||
flip(_dst, _dst, 0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -856,14 +858,16 @@ void rotate(InputArray _src, OutputArray _dst, int rotateMode)
|
||||
|
||||
switch (rotateMode)
|
||||
{
|
||||
case ROTATE_90:
|
||||
flip(_src.getMat().t(), _dst, 1);
|
||||
case ROTATE_90_CLOCKWISE:
|
||||
_dst.getMat() = _src.getMat().t();
|
||||
flip(_dst, _dst, 1);
|
||||
break;
|
||||
case ROTATE_180:
|
||||
flip(_src, _dst, -1);
|
||||
break;
|
||||
case ROTATE_270:
|
||||
flip(_src.getMat().t(), _dst, 0);
|
||||
case ROTATE_90_COUNTERCLOCKWISE:
|
||||
_dst.getMat() = _src.getMat().t();
|
||||
flip(_dst, _dst, 0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user