Accidentally removed tegra checks were returned;

pull/4135/head
Pavel Vlasov 10 years ago
parent e57609836c
commit e02195b3dc
  1. 41
      modules/imgproc/src/color.cpp

@ -7323,17 +7323,13 @@ static bool ocl_cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )
#endif #endif
}//namespace cv
#ifdef HAVE_IPP #ifdef HAVE_IPP
namespace cv static bool ipp_cvtColor( Mat &src, OutputArray _dst, int code, int dcn )
{
static bool ipp_cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )
{ {
int stype = _src.type(); int stype = src.type();
int scn = CV_MAT_CN(stype), depth = CV_MAT_DEPTH(stype); int scn = CV_MAT_CN(stype), depth = CV_MAT_DEPTH(stype);
Mat src = _src.getMat(), dst; Mat dst;
Size sz = src.size(); Size sz = src.size();
switch( code ) switch( code )
@ -7916,8 +7912,8 @@ static bool ipp_cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )
return false; return false;
} }
} }
}
#endif #endif
}
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// The main function // // The main function //
@ -7933,8 +7929,9 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )
Mat src = _src.getMat(), dst; Mat src = _src.getMat(), dst;
Size sz = src.size(); Size sz = src.size();
CV_Assert( depth == CV_8U || depth == CV_16U || depth == CV_32F );
CV_IPP_RUN(true, ipp_cvtColor(_src, _dst, code, dcn)); CV_IPP_RUN(true, ipp_cvtColor(src, _dst, code, dcn));
switch( code ) switch( code )
{ {
@ -7947,13 +7944,13 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )
_dst.create( sz, CV_MAKETYPE(depth, dcn)); _dst.create( sz, CV_MAKETYPE(depth, dcn));
dst = _dst.getMat(); dst = _dst.getMat();
if( depth == CV_8U ) if( depth == CV_8U )
{ {
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if(!tegra::cvtBGR2RGB(src, dst, bidx)) if(tegra::useTegra() && tegra::cvtBGR2RGB(src, dst, bidx))
break;
#endif #endif
CvtColorLoop(src, dst, RGB2RGB<uchar>(scn, dcn, bidx)); CvtColorLoop(src, dst, RGB2RGB<uchar>(scn, dcn, bidx));
} }
else if( depth == CV_16U ) else if( depth == CV_16U )
CvtColorLoop(src, dst, RGB2RGB<ushort>(scn, dcn, bidx)); CvtColorLoop(src, dst, RGB2RGB<ushort>(scn, dcn, bidx));
@ -7967,10 +7964,9 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )
_dst.create(sz, CV_8UC2); _dst.create(sz, CV_8UC2);
dst = _dst.getMat(); dst = _dst.getMat();
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if(code == CV_BGR2BGR565 || code == CV_BGRA2BGR565 || code == CV_RGB2BGR565 || code == CV_RGBA2BGR565) if(code == CV_BGR2BGR565 || code == CV_BGRA2BGR565 || code == CV_RGB2BGR565 || code == CV_RGBA2BGR565)
if(tegra::cvtRGB2RGB565(src, dst, code == CV_RGB2BGR565 || code == CV_RGBA2BGR565 ? 0 : 2)) if(tegra::useTegra() && tegra::cvtRGB2RGB565(src, dst, code == CV_RGB2BGR565 || code == CV_RGBA2BGR565 ? 0 : 2))
break; break;
#endif #endif
@ -8002,13 +7998,13 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )
_dst.create(sz, CV_MAKETYPE(depth, 1)); _dst.create(sz, CV_MAKETYPE(depth, 1));
dst = _dst.getMat(); dst = _dst.getMat();
bidx = code == CV_BGR2GRAY || code == CV_BGRA2GRAY ? 0 : 2; bidx = code == CV_BGR2GRAY || code == CV_BGRA2GRAY ? 0 : 2;
if( depth == CV_8U ) if( depth == CV_8U )
{ {
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if(!tegra::cvtRGB2Gray(src, dst, bidx)) if(tegra::useTegra() && tegra::cvtRGB2Gray(src, dst, bidx))
break;
#endif #endif
CvtColorLoop(src, dst, RGB2Gray<uchar>(scn, bidx, 0)); CvtColorLoop(src, dst, RGB2Gray<uchar>(scn, bidx, 0));
} }
@ -8032,11 +8028,11 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )
_dst.create(sz, CV_MAKETYPE(depth, dcn)); _dst.create(sz, CV_MAKETYPE(depth, dcn));
dst = _dst.getMat(); dst = _dst.getMat();
if( depth == CV_8U ) if( depth == CV_8U )
{ {
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if(!tegra::cvtGray2RGB(src, dst)) if(tegra::useTegra() && tegra::cvtGray2RGB(src, dst))
break;
#endif #endif
CvtColorLoop(src, dst, Gray2RGB<uchar>(dcn)); CvtColorLoop(src, dst, Gray2RGB<uchar>(dcn));
} }
@ -8070,7 +8066,7 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )
if( depth == CV_8U ) if( depth == CV_8U )
{ {
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if((code == CV_RGB2YCrCb || code == CV_BGR2YCrCb) && tegra::cvtRGB2YCrCb(src, dst, bidx)) if((code == CV_RGB2YCrCb || code == CV_BGR2YCrCb) && tegra::useTegra() && tegra::cvtRGB2YCrCb(src, dst, bidx))
break; break;
#endif #endif
CvtColorLoop(src, dst, RGB2YCrCb_i<uchar>(scn, bidx, coeffs_i)); CvtColorLoop(src, dst, RGB2YCrCb_i<uchar>(scn, bidx, coeffs_i));
@ -8096,7 +8092,6 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )
_dst.create(sz, CV_MAKETYPE(depth, dcn)); _dst.create(sz, CV_MAKETYPE(depth, dcn));
dst = _dst.getMat(); dst = _dst.getMat();
if( depth == CV_8U ) if( depth == CV_8U )
CvtColorLoop(src, dst, YCrCb2RGB_i<uchar>(dcn, bidx, coeffs_i)); CvtColorLoop(src, dst, YCrCb2RGB_i<uchar>(dcn, bidx, coeffs_i));
else if( depth == CV_16U ) else if( depth == CV_16U )
@ -8149,12 +8144,11 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )
_dst.create(sz, CV_MAKETYPE(depth, 3)); _dst.create(sz, CV_MAKETYPE(depth, 3));
dst = _dst.getMat(); dst = _dst.getMat();
if( code == CV_BGR2HSV || code == CV_RGB2HSV || if( code == CV_BGR2HSV || code == CV_RGB2HSV ||
code == CV_BGR2HSV_FULL || code == CV_RGB2HSV_FULL ) code == CV_BGR2HSV_FULL || code == CV_RGB2HSV_FULL )
{ {
#ifdef HAVE_TEGRA_OPTIMIZATION #ifdef HAVE_TEGRA_OPTIMIZATION
if(tegra::cvtRGB2HSV(src, dst, bidx, hrange)) if(tegra::useTegra() && tegra::cvtRGB2HSV(src, dst, bidx, hrange))
break; break;
#endif #endif
if( depth == CV_8U ) if( depth == CV_8U )
@ -8185,7 +8179,6 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )
_dst.create(sz, CV_MAKETYPE(depth, dcn)); _dst.create(sz, CV_MAKETYPE(depth, dcn));
dst = _dst.getMat(); dst = _dst.getMat();
if( code == CV_HSV2BGR || code == CV_HSV2RGB || if( code == CV_HSV2BGR || code == CV_HSV2RGB ||
code == CV_HSV2BGR_FULL || code == CV_HSV2RGB_FULL ) code == CV_HSV2BGR_FULL || code == CV_HSV2RGB_FULL )
{ {
@ -8216,7 +8209,6 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )
_dst.create(sz, CV_MAKETYPE(depth, 3)); _dst.create(sz, CV_MAKETYPE(depth, 3));
dst = _dst.getMat(); dst = _dst.getMat();
if( code == CV_BGR2Lab || code == CV_RGB2Lab || if( code == CV_BGR2Lab || code == CV_RGB2Lab ||
code == CV_LBGR2Lab || code == CV_LRGB2Lab ) code == CV_LBGR2Lab || code == CV_LRGB2Lab )
{ {
@ -8248,7 +8240,6 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn )
_dst.create(sz, CV_MAKETYPE(depth, dcn)); _dst.create(sz, CV_MAKETYPE(depth, dcn));
dst = _dst.getMat(); dst = _dst.getMat();
if( code == CV_Lab2BGR || code == CV_Lab2RGB || if( code == CV_Lab2BGR || code == CV_Lab2RGB ||
code == CV_Lab2LBGR || code == CV_Lab2LRGB ) code == CV_Lab2LBGR || code == CV_Lab2LRGB )
{ {

Loading…
Cancel
Save