modified kernel setto(), added double type, code has been improved

This commit is contained in:
Andrey Morozov
2010-07-22 12:42:42 +00:00
parent 3f5dd5f1cc
commit 98c8ecf829
4 changed files with 135 additions and 227 deletions

View File

@@ -126,14 +126,14 @@ void cv::gpu::GpuMat::convertTo( GpuMat& dst, int rtype, double alpha, double be
const GpuMat* psrc = this;
if( sdepth != ddepth && psrc == &dst )
psrc = &(temp = *this);
dst.create( size(), rtype );
impl::convert_to(*psrc, sdepth, dst, ddepth, psrc->cols * psrc->channels(), psrc->rows, alpha, beta);
}
GpuMat& GpuMat::operator = (const Scalar& s)
{
cv::gpu::impl::set_to_without_mask(*this, s.val, this->elemSize1(), this->channels());
cv::gpu::impl::set_to_without_mask( *this, this->depth(), s.val, this->channels());
return *this;
}
@@ -145,11 +145,11 @@ GpuMat& GpuMat::setTo(const Scalar& s, const GpuMat& mask)
if (mask.empty())
{
cv::gpu::impl::set_to_without_mask(*this, s.val, this->elemSize1(), this->channels());
cv::gpu::impl::set_to_without_mask( *this, this->depth(), s.val, this->channels());
}
else
{
cv::gpu::impl::set_to_with_mask(*this, s.val, mask, this->elemSize1(), this->channels());
cv::gpu::impl::set_to_with_mask( *this, this->depth(), s.val, mask, this->channels());
}
return *this;