made createContinuous & ensureSizeIsEnough generic (OutputArray support)

This commit is contained in:
Vladislav Vinogradov
2013-04-26 10:53:15 +04:00
parent f17b836d24
commit 1db4afac6a
4 changed files with 125 additions and 31 deletions

View File

@@ -252,11 +252,11 @@ public:
};
//! creates continuous GPU matrix
CV_EXPORTS void createContinuous(int rows, int cols, int type, GpuMat& m);
CV_EXPORTS void createContinuous(int rows, int cols, int type, OutputArray arr);
//! ensures that size of the given matrix is not less than (rows, cols) size
//! and matrix type is match specified one too
CV_EXPORTS void ensureSizeIsEnough(int rows, int cols, int type, GpuMat& m);
CV_EXPORTS void ensureSizeIsEnough(int rows, int cols, int type, OutputArray arr);
CV_EXPORTS GpuMat allocMatFromBuf(int rows, int cols, int type, GpuMat& mat);
@@ -296,6 +296,10 @@ public:
void create(int rows, int cols, int type);
void create(Size size, int type);
//! creates alternative CudaMem header for the same data, with different
//! number of channels and/or different number of rows
CudaMem reshape(int cn, int rows = 0) const;
//! decrements reference counter and released memory if needed.
void release();

View File

@@ -347,9 +347,9 @@ GpuMat createContinuous(int rows, int cols, int type)
}
static inline
void createContinuous(Size size, int type, GpuMat& m)
void createContinuous(Size size, int type, OutputArray arr)
{
createContinuous(size.height, size.width, type, m);
createContinuous(size.height, size.width, type, arr);
}
static inline
@@ -361,9 +361,9 @@ GpuMat createContinuous(Size size, int type)
}
static inline
void ensureSizeIsEnough(Size size, int type, GpuMat& m)
void ensureSizeIsEnough(Size size, int type, OutputArray arr)
{
ensureSizeIsEnough(size.height, size.width, type, m);
ensureSizeIsEnough(size.height, size.width, type, arr);
}
static inline