ocl setto fix for windows
authorIlya Lavrenov <ilya.lavrenov@itseez.com>
Tue, 8 Oct 2013 14:25:40 +0000 (18:25 +0400)
committerIlya Lavrenov <ilya.lavrenov@itseez.com>
Tue, 8 Oct 2013 15:11:32 +0000 (19:11 +0400)
modules/ocl/src/matrix_operations.cpp

index ed3a7ef..52250b2 100644 (file)
@@ -362,8 +362,8 @@ static std::vector<uchar> cvt2(const cv::Scalar & s)
 {
     std::vector<uchar> _buf(sizeof(CLT));
     CLT * const buf = reinterpret_cast<CLT *>(&_buf[0]);
-    buf->s0 = saturate_cast<PT>(s[0]);
-    buf->s1 = saturate_cast<PT>(s[1]);
+    buf->s[0] = saturate_cast<PT>(s[0]);
+    buf->s[1] = saturate_cast<PT>(s[1]);
     return _buf;
 }
 
@@ -372,10 +372,10 @@ static std::vector<uchar> cvt4(const cv::Scalar & s)
 {
     std::vector<uchar> _buf(sizeof(CLT));
     CLT * const buf = reinterpret_cast<CLT *>(&_buf[0]);
-    buf->s0 = saturate_cast<PT>(s[0]);
-    buf->s1 = saturate_cast<PT>(s[1]);
-    buf->s2 = saturate_cast<PT>(s[2]);
-    buf->s3 = saturate_cast<PT>(s[3]);
+    buf->s[0] = saturate_cast<PT>(s[0]);
+    buf->s[1] = saturate_cast<PT>(s[1]);
+    buf->s[2] = saturate_cast<PT>(s[2]);
+    buf->s[3] = saturate_cast<PT>(s[3]);
     return _buf;
 }
 
@@ -428,7 +428,7 @@ static void set_to_withoutmask_run(const oclMat &dst, const Scalar &scalar, stri
     // run on OpenCL 1.1 platform if library binaries are compiled with OpenCL 1.2 support
     if (Context::getContext()->supportsFeature(FEATURE_CL_VER_1_2) && dst.isContinuous())
     {
-        std::vector<uchar> p = ::scalarToCLVector(scalar, dst.type());
+        std::vector<uchar> p = ::scalarToCLVector(scalar, CV_MAKE_TYPE(dst.depth(), dst.oclchannels()));
         clEnqueueFillBuffer(getClCommandQueue(dst.clCxt),
                 (cl_mem)dst.data, (void*)&p[0], p.size(),
                 0, dst.step * dst.rows, 0, NULL, NULL);