EXPR = 6 << KIND_SHIFT,
OPENGL_BUFFER = 7 << KIND_SHIFT,
OPENGL_TEXTURE = 8 << KIND_SHIFT,
- GPU_MAT = 9 << KIND_SHIFT
+ GPU_MAT = 9 << KIND_SHIFT,
+ OCL_MAT =10 << KIND_SHIFT
};
_InputArray();
return !v.empty() ? Mat(size(i), t, (void*)&v[0]) : Mat();
}
+ if( k == OCL_MAT )
+ {
+ CV_Error(-1, "Not implemented");
+ }
+
CV_Assert( k == STD_VECTOR_MAT );
//if( k == STD_VECTOR_MAT )
{
return;
}
+ if( k == OCL_MAT )
+ {
+ CV_Error(-1, "Not implemented");
+ }
+
CV_Assert( k == STD_VECTOR_MAT );
//if( k == STD_VECTOR_MAT )
{
return tex->size();
}
+ if( k == OCL_MAT )
+ {
+ CV_Error(-1, "Not implemented");
+ }
+
CV_Assert( k == GPU_MAT );
//if( k == GPU_MAT )
{
if( k == OPENGL_TEXTURE )
return ((const ogl::Texture2D*)obj)->empty();
+ if( k == OCL_MAT )
+ {
+ CV_Error(-1, "Not implemented");
+ }
+
CV_Assert( k == GPU_MAT );
//if( k == GPU_MAT )
return ((const gpu::GpuMat*)obj)->empty();
return;
}
+ if( k == OCL_MAT )
+ {
+ CV_Error(-1, "Not implemented");
+ }
+
if( k == NONE )
{
CV_Error(CV_StsNullPtr, "create() called for the missing output array" );
return;
}
+ if( k == OCL_MAT )
+ {
+ CV_Error(-1, "Not implemented");
+ }
+
CV_Assert( k == STD_VECTOR_MAT );
//if( k == STD_VECTOR_MAT )
{
operator Mat() const;
void download(cv::Mat &m) const;
+ //! convert to _InputArray
+ operator _InputArray();
+
+ //! convert to _OutputArray
+ operator _OutputArray();
//! returns a new oclMatrix header for the specified row
oclMat row(int y) const;
int wholecols;
};
+ // convert InputArray/OutputArray to oclMat
+ CV_EXPORTS oclMat& getOclMat(InputArray src);
+ CV_EXPORTS oclMat& getOclMat(OutputArray src);
///////////////////// mat split and merge /////////////////////////////////
//! Compose a multi-channel array from several single-channel arrays
}
}
+
////////////////////////////////////////////////////////////////////////
// convert_C3C4
static void convert_C3C4(const cl_mem &src, oclMat &dst)
//download_channels = m.channels();
}
+cv::ocl::oclMat::operator cv::_InputArray()
+{
+ _InputArray newInputArray;
+ newInputArray.flags = cv::_InputArray::OCL_MAT;
+ newInputArray.obj = reinterpret_cast<void *>(this);
+ return newInputArray;
+}
+
+cv::ocl::oclMat::operator cv::_OutputArray()
+{
+ _OutputArray newOutputArray;
+ newOutputArray.flags = cv::_InputArray::OCL_MAT;
+ newOutputArray.obj = reinterpret_cast<void *>(this);
+ return newOutputArray;
+}
+
+cv::ocl::oclMat& cv::ocl::getOclMat(InputArray src)
+{
+ CV_Assert(src.flags & cv::_InputArray::OCL_MAT);
+ return *reinterpret_cast<oclMat*>(src.obj);
+}
+
+cv::ocl::oclMat& cv::ocl::getOclMat(OutputArray src)
+{
+ CV_Assert(src.flags & cv::_InputArray::OCL_MAT);
+ return *reinterpret_cast<oclMat*>(src.obj);
+}
+
void cv::ocl::oclMat::download(cv::Mat &m) const
{
CV_DbgAssert(!this->empty());