File size: 640 Bytes
dffe123
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifdef HAVE_OPENCV_CORE

#include "opencv2/core/mat.hpp"

typedef std::vector<Range> vector_Range;

CV_PY_TO_CLASS(UMat)
CV_PY_FROM_CLASS(UMat)

static bool cv_mappable_to(const Ptr<Mat>& src, Ptr<UMat>& dst)
{
    //dst.reset(new UMat(src->getUMat(ACCESS_RW)));
    dst.reset(new UMat());
    src->copyTo(*dst);
    return true;
}

static void* cv_UMat_queue()
{
    return cv::ocl::Queue::getDefault().ptr();
}

static void* cv_UMat_context()
{
    return cv::ocl::Context::getDefault().ptr();
}

static Mat cv_UMat_get(const UMat* _self)
{
    Mat m;
    m.allocator = &GetNumpyAllocator();
    _self->copyTo(m);
    return m;
}

#endif