| 638 | } |
| 639 | |
| 640 | void cv::gpu::GpuMat::convertTo(GpuMat& dst, int rtype, double alpha, double beta) const |
| 641 | { |
| 642 | bool noScale = fabs(alpha - 1) < numeric_limits<double>::epsilon() && fabs(beta) < numeric_limits<double>::epsilon(); |
| 643 | |
| 644 | if (rtype < 0) |
| 645 | rtype = type(); |
| 646 | else |
| 647 | rtype = CV_MAKETYPE(CV_MAT_DEPTH(rtype), channels()); |
| 648 | |
| 649 | int sdepth = depth(); |
| 650 | int ddepth = CV_MAT_DEPTH(rtype); |
| 651 | if (sdepth == ddepth && noScale) |
| 652 | { |
| 653 | copyTo(dst); |
| 654 | return; |
| 655 | } |
| 656 | |
| 657 | GpuMat temp; |
| 658 | const GpuMat* psrc = this; |
| 659 | if (sdepth != ddepth && psrc == &dst) |
| 660 | { |
| 661 | temp = *this; |
| 662 | psrc = &temp; |
| 663 | } |
| 664 | |
| 665 | dst.create(size(), rtype); |
| 666 | |
| 667 | if (noScale) |
| 668 | cv::gpu::convertTo(*psrc, dst); |
| 669 | else |
| 670 | cv::gpu::convertTo(*psrc, dst, alpha, beta); |
| 671 | } |
| 672 | |
| 673 | GpuMat& cv::gpu::GpuMat::setTo(Scalar s, const GpuMat& mask) |
| 674 | { |
no test coverage detected