1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

core: remove constructors from C API structures

POD structures can't have constructors.
This commit is contained in:
Alexander Alekhin
2018-05-30 16:59:52 +03:00
parent 66d15e89df
commit ad146e5a6b
3 changed files with 424 additions and 113 deletions
+11 -7
View File
@@ -4,20 +4,24 @@
// glue
CvMatND::CvMatND(const cv::Mat& m)
CvMatND cvMatND(const cv::Mat& m)
{
cvInitMatNDHeader(this, m.dims, m.size, m.type(), m.data );
CvMatND self;
cvInitMatNDHeader(&self, m.dims, m.size, m.type(), m.data );
int i, d = m.dims;
for( i = 0; i < d; i++ )
dim[i].step = (int)m.step[i];
type |= m.flags & cv::Mat::CONTINUOUS_FLAG;
self.dim[i].step = (int)m.step[i];
self.type |= m.flags & cv::Mat::CONTINUOUS_FLAG;
return self;
}
_IplImage::_IplImage(const cv::Mat& m)
_IplImage cvIplImage(const cv::Mat& m)
{
_IplImage self;
CV_Assert( m.dims <= 2 );
cvInitImageHeader(this, m.size(), cvIplDepth(m.flags), m.channels());
cvSetData(this, m.data, (int)m.step[0]);
cvInitImageHeader(&self, cvSize(m.size()), cvIplDepth(m.flags), m.channels());
cvSetData(&self, m.data, (int)m.step[0]);
return self;
}
namespace cv {