reduced code convert_to by using templates, merged with copyTo

This commit is contained in:
Vladislav Vinogradov
2010-07-22 14:50:31 +00:00
parent a0b1107b3c
commit 26c4859634
3 changed files with 190 additions and 296 deletions

View File

@@ -114,8 +114,6 @@ void cv::gpu::GpuMat::copyTo( GpuMat& mat, const GpuMat& mask ) const
void cv::gpu::GpuMat::convertTo( GpuMat& dst, int rtype, double alpha, double beta ) const
{
//CV_Assert(!"Not implemented");
bool noScale = fabs(alpha-1) < std::numeric_limits<double>::epsilon() && fabs(beta) < std::numeric_limits<double>::epsilon();
if( rtype < 0 )
@@ -124,11 +122,11 @@ void cv::gpu::GpuMat::convertTo( GpuMat& dst, int rtype, double alpha, double be
rtype = CV_MAKETYPE(CV_MAT_DEPTH(rtype), channels());
int sdepth = depth(), ddepth = CV_MAT_DEPTH(rtype);
/*if( sdepth == ddepth && noScale )
if( sdepth == ddepth && noScale )
{
copyTo(dst);
return;
}*/
}
GpuMat temp;
const GpuMat* psrc = this;