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

Method create

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

Source from the content-addressed store, hash-verified

681}
682
683void cv::gpu::GpuMat::create(int _rows, int _cols, int _type)
684{
685 _type &= TYPE_MASK;
686
687 if (rows == _rows && cols == _cols && type() == _type && data)
688 return;
689
690 if (data)
691 release();
692
693 CV_DbgAssert(_rows >= 0 && _cols >= 0);
694
695 if (_rows > 0 && _cols > 0)
696 {
697 flags = Mat::MAGIC_VAL + _type;
698 rows = _rows;
699 cols = _cols;
700
701 size_t esz = elemSize();
702
703 void* devPtr = NULL;
704 gpuFuncTable()->mallocPitch(&devPtr, &step, esz * cols, rows);
705
706 // Single row must be continuous
707 if (rows == 1)
708 step = esz * cols;
709
710 if (esz * cols == step)
711 flags |= Mat::CONTINUOUS_FLAG;
712
713 int64 _nettosize = static_cast<int64>(step) * rows;
714 size_t nettosize = static_cast<size_t>(_nettosize);
715
716 datastart = data = static_cast<uchar*>(devPtr);
717 dataend = data + nettosize;
718
719 refcount = static_cast<int*>(fastMalloc(sizeof(*refcount)));
720 *refcount = 1;
721 }
722}
723
724void cv::gpu::GpuMat::release()
725{

Callers 15

splitMethod · 0.45
mergeMethod · 0.45
extractChannelMethod · 0.45
convert.cppFile · 0.45
assignMethod · 0.45
invertMethod · 0.45
solveMethod · 0.45
eigenMethod · 0.45
backSubstMethod · 0.45
createContinuousMethod · 0.45
ensureSizeIsEnoughMethod · 0.45
downloadMethod · 0.45

Calls 5

gpuFuncTableFunction · 0.85
fastMallocFunction · 0.85
typeFunction · 0.50
elemSizeFunction · 0.50
mallocPitchMethod · 0.45

Tested by

no test coverage detected