added ensureSizeIsEnough into gpu module, updated reduction methods

This commit is contained in:
Alexey Spizhevoy
2011-01-18 12:36:01 +00:00
parent f3a2656808
commit cbb132ccb1
6 changed files with 151 additions and 115 deletions

View File

@@ -252,9 +252,13 @@ namespace cv
#include "GpuMat_BetaDeprecated.hpp"
#endif
//! creates continuous GPU matrix
//! Creates continuous GPU matrix
CV_EXPORTS void createContinuous(int rows, int cols, int type, GpuMat& m);
//! 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);
//////////////////////////////// CudaMem ////////////////////////////////
// CudaMem is limited cv::Mat with page locked memory allocation.
// Page locked memory is only needed for async and faster coping to GPU.

View File

@@ -364,6 +364,10 @@ inline GpuMat createContinuous(Size size, int type)
return m;
}
inline void ensureSizeIsEnough(Size size, int type, GpuMat& m)
{
ensureSizeIsEnough(size.height, size.width, type, m);
}
///////////////////////////////////////////////////////////////////////
@@ -401,6 +405,7 @@ inline CudaMem::CudaMem(const Mat& m, int _alloc_type) : flags(0), rows(0), cols
inline CudaMem::~CudaMem()
{
release();
}
inline CudaMem& CudaMem::operator = (const CudaMem& m)