fixed hundreds of warnings from MSVC 2010.

This commit is contained in:
Vadim Pisarevsky
2012-03-16 21:21:04 +00:00
parent 20cceb8fdf
commit 4985c1b632
83 changed files with 317 additions and 306 deletions

View File

@@ -571,33 +571,30 @@ void cv::createHanningWindow(OutputArray _dst, cv::Size winSize, int type)
int rows = dst.rows;
int cols = dst.cols;
int step = dst.step/dst.elemSize1();
if(dst.depth() == CV_32F)
{
float* dstData = dst.ptr<float>();
for(int i = 0; i < rows; i++)
{
float* dstData = dst.ptr<float>(i);
double wr = 0.5 * (1.0f - cos(2.0f * CV_PI * (double)i / (double)(rows - 1)));
for(int j = 0; j < cols; j++)
{
double wc = 0.5 * (1.0f - cos(2.0f * CV_PI * (double)j / (double)(cols - 1)));
dstData[i*step + j] = (float)(wr * wc);
dstData[j] = (float)(wr * wc);
}
}
}
else
{
double* dstData = dst.ptr<double>();
for(int i = 0; i < rows; i++)
{
double* dstData = dst.ptr<double>(i);
double wr = 0.5 * (1.0 - cos(2.0 * CV_PI * (double)i / (double)(rows - 1)));
for(int j = 0; j < cols; j++)
{
double wc = 0.5 * (1.0 - cos(2.0 * CV_PI * (double)j / (double)(cols - 1)));
dstData[i*step + j] = wr * wc;
dstData[j] = wr * wc;
}
}
}