From 259e41da73b4aebb8a1275aff3aa0e6e00f0090b Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Tue, 7 Apr 2015 19:34:51 +0300 Subject: [PATCH] reverted "typedef _InputArray InputArray", fixed warning from doxygen --- modules/core/include/opencv2/core.hpp | 4 ++++ modules/core/include/opencv2/core/mat.hpp | 11 +++++------ modules/core/include/opencv2/core/mat.inl.hpp | 10 +++++++--- modules/core/src/matrix.cpp | 2 +- modules/imgproc/src/connectedcomponents.cpp | 14 +++++++------- 5 files changed, 24 insertions(+), 17 deletions(-) diff --git a/modules/core/include/opencv2/core.hpp b/modules/core/include/opencv2/core.hpp index 72cb1a46d9..a9b4a30b4f 100644 --- a/modules/core/include/opencv2/core.hpp +++ b/modules/core/include/opencv2/core.hpp @@ -2958,6 +2958,9 @@ public: /** @brief Loads algorithm from the file + @param filename Name of the file to read. + @param objname The optional name of the node to read (if empty, the first top-level node will be used) + This is static template method of Algorithm. It's usage is following (in the case of SVM): @code Ptr svm = Algorithm::load("my_svm_model.xml"); @@ -2977,6 +2980,7 @@ public: /** @brief Loads algorithm from a String @param strModel The string variable containing the model you want to load. + @param objname The optional name of the node to read (if empty, the first top-level node will be used) This is static template method of Algorithm. It's usage is following (in the case of SVM): @code diff --git a/modules/core/include/opencv2/core/mat.hpp b/modules/core/include/opencv2/core/mat.hpp index fa867fde05..315d498c5a 100644 --- a/modules/core/include/opencv2/core/mat.hpp +++ b/modules/core/include/opencv2/core/mat.hpp @@ -70,7 +70,7 @@ class CV_EXPORTS _OutputArray; It is defined as: @code - class InputArray; // = _InputArray + typedef const _InputArray& InputArray; @endcode where _InputArray is a class that can be constructed from `Mat`, `Mat_`, `Matx`, `std::vector`, `std::vector >` or `std::vector`. It can also be constructed @@ -186,6 +186,7 @@ public: _InputArray(const std::vector& umv); Mat getMat(int idx=-1) const; + Mat getMat_(int idx=-1) const; UMat getUMat(int idx=-1) const; void getMatVector(std::vector& mv) const; void getUMatVector(std::vector& umv) const; @@ -361,15 +362,13 @@ public: template _InputOutputArray(const Matx<_Tp, m, n>& matx); _InputOutputArray(const UMat& m); _InputOutputArray(const std::vector& vec); - - explicit _InputOutputArray(const _OutputArray& o); }; -typedef _InputArray InputArray; +typedef const _InputArray& InputArray; typedef InputArray InputArrayOfArrays; -typedef _OutputArray OutputArray; +typedef const _OutputArray& OutputArray; typedef OutputArray OutputArrayOfArrays; -typedef _InputOutputArray InputOutputArray; +typedef const _InputOutputArray& InputOutputArray; typedef InputOutputArray InputOutputArrayOfArrays; CV_EXPORTS InputOutputArray noArray(); diff --git a/modules/core/include/opencv2/core/mat.inl.hpp b/modules/core/include/opencv2/core/mat.inl.hpp index 057d903c68..535baa156d 100644 --- a/modules/core/include/opencv2/core/mat.inl.hpp +++ b/modules/core/include/opencv2/core/mat.inl.hpp @@ -114,6 +114,13 @@ inline _InputArray::_InputArray(const cuda::HostMem& cuda_mem) inline _InputArray::~_InputArray() {} +inline Mat _InputArray::getMat(int i) const +{ + if( kind() == MAT && i < 0 ) + return *(const Mat*)obj; + return getMat_(i); +} + inline bool _InputArray::isMat() const { return kind() == _InputArray::MAT; } inline bool _InputArray::isUMat() const { return kind() == _InputArray::UMAT; } inline bool _InputArray::isMatVector() const { return kind() == _InputArray::STD_VECTOR_MAT; } @@ -294,9 +301,6 @@ inline _InputOutputArray::_InputOutputArray(const ogl::Buffer& buf) inline _InputOutputArray::_InputOutputArray(const cuda::HostMem& cuda_mem) { init(FIXED_TYPE + FIXED_SIZE + CUDA_HOST_MEM + ACCESS_RW, &cuda_mem); } -inline _InputOutputArray::_InputOutputArray(const _OutputArray& o) -{ init(o.getFlags(), o.getObj(), o.getSz()); } - //////////////////////////////////////////// Mat ////////////////////////////////////////// inline diff --git a/modules/core/src/matrix.cpp b/modules/core/src/matrix.cpp index c1d2c34852..65b93890ec 100644 --- a/modules/core/src/matrix.cpp +++ b/modules/core/src/matrix.cpp @@ -1113,7 +1113,7 @@ void scalarToRawData(const Scalar& s, void* _buf, int type, int unroll_to) Input/Output Array \*************************************************************************************************/ -Mat _InputArray::getMat(int i) const +Mat _InputArray::getMat_(int i) const { int k = kind(); int accessFlags = flags & ACCESS_MASK; diff --git a/modules/imgproc/src/connectedcomponents.cpp b/modules/imgproc/src/connectedcomponents.cpp index afa3647699..523eb14c09 100644 --- a/modules/imgproc/src/connectedcomponents.cpp +++ b/modules/imgproc/src/connectedcomponents.cpp @@ -65,20 +65,20 @@ namespace cv{ }; struct CCStatsOp{ - OutputArray _mstatsv; + const _OutputArray* _mstatsv; cv::Mat statsv; - OutputArray _mcentroidsv; + const _OutputArray* _mcentroidsv; cv::Mat centroidsv; std::vector integrals; - CCStatsOp(OutputArray _statsv, OutputArray _centroidsv): _mstatsv(_statsv), _mcentroidsv(_centroidsv){ + CCStatsOp(OutputArray _statsv, OutputArray _centroidsv): _mstatsv(&_statsv), _mcentroidsv(&_centroidsv){ } inline void init(int nlabels){ - _mstatsv.create(cv::Size(CC_STAT_MAX, nlabels), cv::DataType::type); - statsv = _mstatsv.getMat(); - _mcentroidsv.create(cv::Size(2, nlabels), cv::DataType::type); - centroidsv = _mcentroidsv.getMat(); + _mstatsv->create(cv::Size(CC_STAT_MAX, nlabels), cv::DataType::type); + statsv = _mstatsv->getMat(); + _mcentroidsv->create(cv::Size(2, nlabels), cv::DataType::type); + centroidsv = _mcentroidsv->getMat(); for(int l = 0; l < (int) nlabels; ++l){ int *row = (int *) &statsv.at(l, 0); -- GitLab