Merge pull request #716 from asmorkalov:winrt

This commit is contained in:
Andrey Kamaev
2013-04-03 15:39:57 +04:00
committed by OpenCV Buildbot
30 changed files with 3042 additions and 113 deletions

View File

@@ -322,8 +322,12 @@ CV_INLINE int cvRound( double value )
return (int)lrint(value);
# endif
#else
// while this is not IEEE754-compliant rounding, it's usually a good enough approximation
return (int)(value + (value >= 0 ? 0.5 : -0.5));
double intpart, fractpart;
fractpart = modf(value, &intpart);
if ((abs(fractpart) != 0.5) || ((((int)intpart) % 2) != 0))
return (int)(value + (value >= 0 ? 0.5 : -0.5));
else
return (int)intpart;
#endif
}