MCPcopy Create free account
hub / github.com/creatale/node-dv / locateROI

Method locateROI

deps/opencv/modules/core/src/gpumat.cpp:451–473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

449}
450
451void 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
475GpuMat& cv::gpu::GpuMat::adjustROI(int dtop, int dbottom, int dleft, int dright)
476{

Callers 3

startMethod · 0.45
crossCorrFunction · 0.45
copyMakeBorderMethod · 0.45

Calls 2

maxFunction · 0.70
elemSizeFunction · 0.50

Tested by

no test coverage detected