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

brush up by following the comments

This commit is contained in:
Tomoaki Teshima
2020-09-25 23:57:15 +09:00
parent 220b37144b
commit 234117800f
2 changed files with 10 additions and 5 deletions
+4 -2
View File
@@ -163,10 +163,12 @@ void cv::cuda::flip(InputArray _src, OutputArray _dst, int flipCode, Stream& str
_dst.create(src.size(), src.type());
GpuMat dst = getOutputMat(_dst, src.size(), src.type(), stream);
if (src.data == dst.data && ((src.cols & 1) == 1 || (src.rows & 1) == 1))
bool isInplace = (src.data == dst.data) || (src.refcount == dst.refcount);
bool isSizeOdd = (src.cols & 1) == 1 || (src.rows & 1) == 1;
if (isInplace && isSizeOdd)
CV_Error(Error::BadROISize, "In-place version of flip only accepts even width/height");
if (src.data != dst.data)
if (isInplace == false)
funcs[src.depth()][src.channels() - 1](src, dst, flipCode, StreamAccessor::getStream(stream));
else // in-place
ifuncs[src.depth()][src.channels() - 1](src, flipCode, StreamAccessor::getStream(stream));