Merge pull request #1704 from SpecLad:merge-2.4
authorRoman Donchenko <roman.donchenko@itseez.com>
Tue, 29 Oct 2013 09:13:04 +0000 (13:13 +0400)
committerOpenCV Buildbot <buildbot@opencv.org>
Tue, 29 Oct 2013 09:13:05 +0000 (13:13 +0400)
1  2 
modules/ocl/src/matrix_operations.cpp

@@@ -27,7 -27,7 +27,7 @@@
  //
  //   * Redistribution's in binary form must reproduce the above copyright notice,
  //     this list of conditions and the following disclaimer in the documentation
- //     and/or other oclMaterials provided with the distribution.
+ //     and/or other materials provided with the distribution.
  //
  //   * The name of the copyright holders may not be used to endorse or promote products
  //     derived from this software without specific prior written permission.
@@@ -154,24 -154,30 +154,24 @@@ void cv::ocl::oclMat::upload(const Mat 
  
  cv::ocl::oclMat::operator cv::_InputArray()
  {
 -    _InputArray newInputArray;
 -    newInputArray.flags = cv::_InputArray::OCL_MAT;
 -    newInputArray.obj   = reinterpret_cast<void *>(this);
 -    return newInputArray;
 +    return _InputArray(cv::_InputArray::OCL_MAT, this);
  }
  
  cv::ocl::oclMat::operator cv::_OutputArray()
  {
 -    _OutputArray newOutputArray;
 -    newOutputArray.flags = cv::_InputArray::OCL_MAT;
 -    newOutputArray.obj   = reinterpret_cast<void *>(this);
 -    return newOutputArray;
 +    return _OutputArray(cv::_InputArray::OCL_MAT, this);
  }
  
  cv::ocl::oclMat& cv::ocl::getOclMatRef(InputArray src)
  {
 -    CV_Assert(src.flags & cv::_InputArray::OCL_MAT);
 -    return *reinterpret_cast<oclMat*>(src.obj);
 +    CV_Assert(src.kind() == cv::_InputArray::OCL_MAT);
 +    return *(oclMat*)src.getObj();
  }
  
  cv::ocl::oclMat& cv::ocl::getOclMatRef(OutputArray src)
  {
 -    CV_Assert(src.flags & cv::_InputArray::OCL_MAT);
 -    return *reinterpret_cast<oclMat*>(src.obj);
 +    CV_Assert(src.kind() == cv::_InputArray::OCL_MAT);
 +    return *(oclMat*)src.getObj();
  }
  
  void cv::ocl::oclMat::download(cv::Mat &m) const