template<typename _Tp> _OutputArray(Mat_<_Tp>& m);
template<typename _Tp, int m, int n> _OutputArray(Matx<_Tp, m, n>& matx);
template<typename _Tp> _OutputArray(_Tp* vec, int n);
+ _OutputArray(gpu::GpuMat& d_mat);
_OutputArray(const Mat& m);
template<typename _Tp> _OutputArray(const vector<_Tp>& vec);
template<typename _Tp> _OutputArray(const Mat_<_Tp>& m);
template<typename _Tp, int m, int n> _OutputArray(const Matx<_Tp, m, n>& matx);
template<typename _Tp> _OutputArray(const _Tp* vec, int n);
+ _OutputArray(const gpu::GpuMat& d_mat);
virtual bool fixedSize() const;
virtual bool fixedType() const;
virtual bool needed() const;
virtual Mat& getMatRef(int i=-1) const;
+ virtual gpu::GpuMat& getGpuMatRef() const;
virtual void create(Size sz, int type, int i=-1, bool allowTransposed=false, int fixedDepthMask=0) const;
virtual void create(int rows, int cols, int type, int i=-1, bool allowTransposed=false, int fixedDepthMask=0) const;
virtual void create(int dims, const int* size, int type, int i=-1, bool allowTransposed=false, int fixedDepthMask=0) const;
enum
{
- SORT_EVERY_ROW=0,
- SORT_EVERY_COLUMN=1,
- SORT_ASCENDING=0,
- SORT_DESCENDING=16
+ SORT_EVERY_ROW=0,
+ SORT_EVERY_COLUMN=1,
+ SORT_ASCENDING=0,
+ SORT_DESCENDING=16
};
//! sorts independently each matrix row or each matrix column
enum
{
- COVAR_SCRAMBLED=0,
- COVAR_NORMAL=1,
- COVAR_USE_AVG=2,
- COVAR_SCALE=4,
- COVAR_ROWS=8,
- COVAR_COLS=16
+ COVAR_SCRAMBLED=0,
+ COVAR_NORMAL=1,
+ COVAR_USE_AVG=2,
+ COVAR_SCALE=4,
+ COVAR_ROWS=8,
+ COVAR_COLS=16
};
//! computes covariation matrix of a set of samples
{
typedef float const_param_type;
typedef float member_type;
-
+
enum { type = Param::FLOAT };
};
-
+
template<> struct ParamType<unsigned>
{
typedef unsigned const_param_type;
typedef unsigned member_type;
-
+
enum { type = Param::UNSIGNED_INT };
};
{
typedef uint64 const_param_type;
typedef uint64 member_type;
-
+
enum { type = Param::UINT64 };
};
getByIndex(index, space_delete, ParamType<T>::type, (void*)&val);
return val;
}
-
+
bool has(const string& name) const;
-
+
bool check() const;
-
+
void about(const string& message);
-
+
void printMessage() const;
void printErrors() const;
protected:
void getByName(const string& name, bool space_delete, int type, void* dst) const;
void getByIndex(int index, bool space_delete, int type, void* dst) const;
-
+
struct Impl;
Impl* impl;
};
~Mutex();
Mutex(const Mutex& m);
Mutex& operator = (const Mutex& m);
-
+
void lock();
bool trylock();
void unlock();
-
+
struct Impl;
protected:
Impl* impl;
class CV_EXPORTS AutoLock
{
-public:
+public:
AutoLock(Mutex& m) : mutex(&m) { mutex->lock(); }
~AutoLock() { mutex->unlock(); }
-protected:
+protected:
Mutex* mutex;
};
_OutputArray::~_OutputArray() {}
_OutputArray::_OutputArray(Mat& m) : _InputArray(m) {}
_OutputArray::_OutputArray(vector<Mat>& vec) : _InputArray(vec) {}
+_OutputArray::_OutputArray(gpu::GpuMat& d_mat) : _InputArray(d_mat) {}
_OutputArray::_OutputArray(const Mat& m) : _InputArray(m) {flags |= FIXED_SIZE|FIXED_TYPE;}
_OutputArray::_OutputArray(const vector<Mat>& vec) : _InputArray(vec) {flags |= FIXED_SIZE;}
+_OutputArray::_OutputArray(const gpu::GpuMat& d_mat) : _InputArray(d_mat) {flags |= FIXED_SIZE|FIXED_TYPE;}
bool _OutputArray::fixedSize() const
((Mat*)obj)->create(_sz, mtype);
return;
}
+ if( k == GPU_MAT && i < 0 && !allowTransposed && fixedDepthMask == 0 )
+ {
+ CV_Assert(!fixedSize() || ((gpu::GpuMat*)obj)->size() == _sz);
+ CV_Assert(!fixedType() || ((gpu::GpuMat*)obj)->type() == mtype);
+ ((gpu::GpuMat*)obj)->create(_sz, mtype);
+ return;
+ }
int sizes[] = {_sz.height, _sz.width};
create(2, sizes, mtype, i, allowTransposed, fixedDepthMask);
}
((Mat*)obj)->create(rows, cols, mtype);
return;
}
+ if( k == GPU_MAT && i < 0 && !allowTransposed && fixedDepthMask == 0 )
+ {
+ CV_Assert(!fixedSize() || ((gpu::GpuMat*)obj)->size() == Size(cols, rows));
+ CV_Assert(!fixedType() || ((gpu::GpuMat*)obj)->type() == mtype);
+ ((gpu::GpuMat*)obj)->create(rows, cols, mtype);
+ return;
+ }
int sizes[] = {rows, cols};
create(2, sizes, mtype, i, allowTransposed, fixedDepthMask);
}
return;
}
+ if( k == GPU_MAT )
+ {
+ ((gpu::GpuMat*)obj)->release();
+ return;
+ }
+
if( k == NONE )
return;
}
}
+gpu::GpuMat& _OutputArray::getGpuMatRef() const
+{
+ int k = kind();
+ CV_Assert( k == GPU_MAT );
+ return *(gpu::GpuMat*)obj;
+}
+
static _OutputArray _none;
OutputArray noArray() { return _none; }