From 9d7e51eb4686670a81e455f222abc14d173cbc71 Mon Sep 17 00:00:00 2001 From: Vladislav Vinogradov Date: Wed, 3 Apr 2013 12:39:03 +0400 Subject: [PATCH] fixed SparseMat Iterator compilation error (bug #2921) --- modules/core/include/opencv2/core/core.hpp | 2 ++ modules/core/include/opencv2/core/mat.hpp | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/modules/core/include/opencv2/core/core.hpp b/modules/core/include/opencv2/core/core.hpp index 8ac7138188..7caf7538c5 100644 --- a/modules/core/include/opencv2/core/core.hpp +++ b/modules/core/include/opencv2/core/core.hpp @@ -3767,6 +3767,7 @@ public: SparseMatConstIterator_(); //! the full constructor setting the iterator to the first sparse matrix element SparseMatConstIterator_(const SparseMat_<_Tp>* _m); + SparseMatConstIterator_(const SparseMat* _m); //! the copy constructor SparseMatConstIterator_(const SparseMatConstIterator_& it); @@ -3796,6 +3797,7 @@ public: SparseMatIterator_(); //! the full constructor setting the iterator to the first sparse matrix element SparseMatIterator_(SparseMat_<_Tp>* _m); + SparseMatIterator_(SparseMat* _m); //! the copy constructor SparseMatIterator_(const SparseMatIterator_& it); diff --git a/modules/core/include/opencv2/core/mat.hpp b/modules/core/include/opencv2/core/mat.hpp index c19caf9020..f798d7f4a0 100644 --- a/modules/core/include/opencv2/core/mat.hpp +++ b/modules/core/include/opencv2/core/mat.hpp @@ -2530,6 +2530,13 @@ SparseMatConstIterator_<_Tp>::SparseMatConstIterator_(const SparseMat_<_Tp>* _m) : SparseMatConstIterator(_m) {} +template inline +SparseMatConstIterator_<_Tp>::SparseMatConstIterator_(const SparseMat* _m) +: SparseMatConstIterator(_m) +{ + CV_Assert( _m->type() == DataType<_Tp>::type ); +} + template inline SparseMatConstIterator_<_Tp>::SparseMatConstIterator_(const SparseMatConstIterator_<_Tp>& it) : SparseMatConstIterator(it) @@ -2569,6 +2576,11 @@ SparseMatIterator_<_Tp>::SparseMatIterator_(SparseMat_<_Tp>* _m) : SparseMatConstIterator_<_Tp>(_m) {} +template inline +SparseMatIterator_<_Tp>::SparseMatIterator_(SparseMat* _m) +: SparseMatConstIterator_<_Tp>(_m) +{} + template inline SparseMatIterator_<_Tp>::SparseMatIterator_(const SparseMatIterator_<_Tp>& it) : SparseMatConstIterator_<_Tp>(it) -- GitLab