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

@@ -3216,36 +3216,37 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )
const uchar* y = src.ptr();
const uchar* uv = y + dstSz.area();
int srcstep = (int)src.step;
// http://www.fourcc.org/yuv.php#NV21 == yuv420sp -> a plane of 8 bit Y samples followed by an interleaved V/U plane containing 8 bit 2x2 subsampled chroma samples
// http://www.fourcc.org/yuv.php#NV12 == yvu420sp -> a plane of 8 bit Y samples followed by an interleaved U/V plane containing 8 bit 2x2 subsampled colour difference samples
if (CV_YUV420sp2RGB == code || COLOR_YUV420sp2RGBA == code)
{
if (dcn == 3)
cvtYUV4202RGB<2, 1>(dst, src.step, y, uv);
cvtYUV4202RGB<2, 1>(dst, srcstep, y, uv);
else
cvtYUV4202RGBA<2, 1>(dst, src.step, y, uv);
cvtYUV4202RGBA<2, 1>(dst, srcstep, y, uv);
}
else if (CV_YUV420sp2BGR == code || CV_YUV420sp2BGRA == code)
{
if (dcn == 3)
cvtYUV4202RGB<0, 1>(dst, src.step, y, uv);
cvtYUV4202RGB<0, 1>(dst, srcstep, y, uv);
else
cvtYUV4202RGBA<0, 1>(dst, src.step, y, uv);
cvtYUV4202RGBA<0, 1>(dst, srcstep, y, uv);
}
else if (CV_YUV2RGB_NV12 == code || CV_YUV2RGBA_NV12 == code)
{
if (dcn == 3)
cvtYUV4202RGB<2, 0>(dst, src.step, y, uv);
cvtYUV4202RGB<2, 0>(dst, srcstep, y, uv);
else
cvtYUV4202RGBA<2, 0>(dst, src.step, y, uv);
cvtYUV4202RGBA<2, 0>(dst, srcstep, y, uv);
}
else //if (CV_YUV2BGR_NV12 == code || CV_YUV2BGRA_NV12 == code)
{
if (dcn == 3)
cvtYUV4202RGB<0, 0>(dst, src.step, y, uv);
cvtYUV4202RGB<0, 0>(dst, srcstep, y, uv);
else
cvtYUV4202RGBA<0, 0>(dst, src.step, y, uv);
cvtYUV4202RGBA<0, 0>(dst, srcstep, y, uv);
}
}
break;

View File

@@ -60,12 +60,12 @@ cv::Mat cv::getGaborKernel( Size ksize, double sigma, double theta,
if( ksize.width > 0 )
xmax = ksize.width/2;
else
xmax = std::max(fabs(nstds*sigma_x*c), fabs(nstds*sigma_y*s));
xmax = cvRound(std::max(fabs(nstds*sigma_x*c), fabs(nstds*sigma_y*s)));
if( ksize.height > 0 )
ymax = ksize.height/2;
else
ymax = std::max(fabs(nstds*sigma_x*s), fabs(nstds*sigma_y*c));
ymax = cvRound(std::max(fabs(nstds*sigma_x*s), fabs(nstds*sigma_y*c)));
xmin = -xmax;
ymin = -ymax;

View File

@@ -439,8 +439,8 @@ static char segSegInt( Point2f a, Point2f b, Point2f c, Point2f d, Point2f& p, P
(0.0 > t) || (t > 1.0) )
code = '0';
p.x = a.x + s * ( b.x - a.x );
p.y = a.y + s * ( b.y - a.y );
p.x = (float)(a.x + s*(b.x - a.x));
p.y = (float)(a.y + s*(b.y - a.y));
return code;
}
@@ -652,7 +652,7 @@ float cv::intersectConvexConvex( InputArray _p1, InputArray _p2, OutputArray _p1
_p12.release();
return 0.f;
}
area = contourArea(_InputArray(result, nr), false);
area = (float)contourArea(_InputArray(result, nr), false);
}
if( _p12.needed() )

View File

@@ -1079,9 +1079,9 @@ public:
int row0 = min(cvRound(range.begin() * src.rows / nStripes), src.rows);
int row1 = min(cvRound(range.end() * src.rows / nStripes), src.rows);
if(0)
/*if(0)
printf("Size = (%d, %d), range[%d,%d), row0 = %d, row1 = %d\n",
src.rows, src.cols, range.begin(), range.end(), row0, row1);
src.rows, src.cols, range.begin(), range.end(), row0, row1);*/
Mat srcStripe = src.rowRange(row0, row1);
Mat dstStripe = dst.rowRange(row0, row1);
@@ -1105,7 +1105,7 @@ private:
Point anchor;
int rowBorderType;
int columnBorderType;
const Scalar& borderValue;
Scalar borderValue;
};
static void morphOp( int op, InputArray _src, OutputArray _dst,

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;
}
}
}

View File

@@ -687,9 +687,9 @@ public:
int row0 = std::min(cvRound(range.begin() * src.rows / nStripes), src.rows);
int row1 = std::min(cvRound(range.end() * src.rows / nStripes), src.rows);
if(0)
/*if(0)
printf("Size = (%d, %d), range[%d,%d), row0 = %d, row1 = %d\n",
src.rows, src.cols, range.begin(), range.end(), row0, row1);
src.rows, src.cols, range.begin(), range.end(), row0, row1);*/
Mat srcStripe = src.rowRange(row0, row1);
Mat dstStripe = dst.rowRange(row0, row1);