| 449 | } |
| 450 | |
| 451 | void cv::gpu::GpuMat::locateROI(Size& wholeSize, Point& ofs) const |
| 452 | { |
| 453 | size_t esz = elemSize(); |
| 454 | ptrdiff_t delta1 = data - datastart; |
| 455 | ptrdiff_t delta2 = dataend - datastart; |
| 456 | |
| 457 | CV_DbgAssert(step > 0); |
| 458 | |
| 459 | if (delta1 == 0) |
| 460 | ofs.x = ofs.y = 0; |
| 461 | else |
| 462 | { |
| 463 | ofs.y = static_cast<int>(delta1 / step); |
| 464 | ofs.x = static_cast<int>((delta1 - step * ofs.y) / esz); |
| 465 | |
| 466 | CV_DbgAssert(data == datastart + ofs.y * step + ofs.x * esz); |
| 467 | } |
| 468 | |
| 469 | size_t minstep = (ofs.x + cols) * esz; |
| 470 | |
| 471 | wholeSize.height = std::max(static_cast<int>((delta2 - minstep) / step + 1), ofs.y + rows); |
| 472 | wholeSize.width = std::max(static_cast<int>((delta2 - step * (wholeSize.height - 1)) / esz), ofs.x + cols); |
| 473 | } |
| 474 | |
| 475 | GpuMat& cv::gpu::GpuMat::adjustROI(int dtop, int dbottom, int dleft, int dright) |
| 476 | { |
no test coverage detected