some formal changes (generally adding constness)
This commit is contained in:
@@ -261,8 +261,8 @@ public:
|
||||
int* refcount;
|
||||
|
||||
//! helper fields used in locateROI and adjustROI
|
||||
uchar* datastart;
|
||||
uchar* dataend;
|
||||
const uchar* datastart;
|
||||
const uchar* dataend;
|
||||
|
||||
//! allocator
|
||||
Allocator* allocator;
|
||||
@@ -349,8 +349,8 @@ public:
|
||||
uchar* data;
|
||||
int* refcount;
|
||||
|
||||
uchar* datastart;
|
||||
uchar* dataend;
|
||||
const uchar* datastart;
|
||||
const uchar* dataend;
|
||||
|
||||
AllocType alloc_type;
|
||||
};
|
||||
|
@@ -395,7 +395,7 @@ struct CV_EXPORTS UMatData
|
||||
|
||||
struct CV_EXPORTS UMatDataAutoLock
|
||||
{
|
||||
UMatDataAutoLock(UMatData* u);
|
||||
explicit UMatDataAutoLock(UMatData* u);
|
||||
~UMatDataAutoLock();
|
||||
UMatData* u;
|
||||
};
|
||||
@@ -403,7 +403,7 @@ struct CV_EXPORTS UMatDataAutoLock
|
||||
|
||||
struct CV_EXPORTS MatSize
|
||||
{
|
||||
MatSize(int* _p);
|
||||
explicit MatSize(int* _p);
|
||||
Size operator()() const;
|
||||
const int& operator[](int i) const;
|
||||
int& operator[](int i);
|
||||
@@ -417,7 +417,7 @@ struct CV_EXPORTS MatSize
|
||||
struct CV_EXPORTS MatStep
|
||||
{
|
||||
MatStep();
|
||||
MatStep(size_t s);
|
||||
explicit MatStep(size_t s);
|
||||
const size_t& operator[](int i) const;
|
||||
size_t& operator[](int i);
|
||||
operator size_t() const;
|
||||
@@ -918,9 +918,9 @@ public:
|
||||
uchar* data;
|
||||
|
||||
//! helper fields used in locateROI and adjustROI
|
||||
uchar* datastart;
|
||||
uchar* dataend;
|
||||
uchar* datalimit;
|
||||
const uchar* datastart;
|
||||
const uchar* dataend;
|
||||
const uchar* datalimit;
|
||||
|
||||
//! custom allocator
|
||||
MatAllocator* allocator;
|
||||
@@ -1804,9 +1804,9 @@ public:
|
||||
//! copy operator
|
||||
MatConstIterator& operator = (const MatConstIterator& it);
|
||||
//! returns the current matrix element
|
||||
uchar* operator *() const;
|
||||
const uchar* operator *() const;
|
||||
//! returns the i-th matrix element, relative to the current
|
||||
uchar* operator [](ptrdiff_t i) const;
|
||||
const uchar* operator [](ptrdiff_t i) const;
|
||||
|
||||
//! shifts the iterator forward by the specified number of elements
|
||||
MatConstIterator& operator += (ptrdiff_t ofs);
|
||||
@@ -1831,9 +1831,9 @@ public:
|
||||
|
||||
const Mat* m;
|
||||
size_t elemSize;
|
||||
uchar* ptr;
|
||||
uchar* sliceStart;
|
||||
uchar* sliceEnd;
|
||||
const uchar* ptr;
|
||||
const uchar* sliceStart;
|
||||
const uchar* sliceEnd;
|
||||
};
|
||||
|
||||
|
||||
@@ -1917,9 +1917,9 @@ public:
|
||||
//! constructor that sets the iterator to the specified element of the matrix
|
||||
MatIterator_(Mat_<_Tp>* _m, int _row, int _col=0);
|
||||
//! constructor that sets the iterator to the specified element of the matrix
|
||||
MatIterator_(const Mat_<_Tp>* _m, Point _pt);
|
||||
MatIterator_(Mat_<_Tp>* _m, Point _pt);
|
||||
//! constructor that sets the iterator to the specified element of the matrix
|
||||
MatIterator_(const Mat_<_Tp>* _m, const int* _idx);
|
||||
MatIterator_(Mat_<_Tp>* _m, const int* _idx);
|
||||
//! copy constructor
|
||||
MatIterator_(const MatIterator_& it);
|
||||
//! copy operator
|
||||
|
@@ -438,7 +438,7 @@ Mat::Mat(const std::vector<_Tp>& vec, bool copyData)
|
||||
if( !copyData )
|
||||
{
|
||||
step[0] = step[1] = sizeof(_Tp);
|
||||
data = datastart = (uchar*)&vec[0];
|
||||
datastart = data = (uchar*)&vec[0];
|
||||
datalimit = dataend = datastart + rows * step[0];
|
||||
}
|
||||
else
|
||||
@@ -453,7 +453,7 @@ Mat::Mat(const Vec<_Tp, n>& vec, bool copyData)
|
||||
if( !copyData )
|
||||
{
|
||||
step[0] = step[1] = sizeof(_Tp);
|
||||
data = datastart = (uchar*)vec.val;
|
||||
datastart = data = (uchar*)vec.val;
|
||||
datalimit = dataend = datastart + rows * step[0];
|
||||
}
|
||||
else
|
||||
@@ -470,7 +470,7 @@ Mat::Mat(const Matx<_Tp,m,n>& M, bool copyData)
|
||||
{
|
||||
step[0] = cols * sizeof(_Tp);
|
||||
step[1] = sizeof(_Tp);
|
||||
data = datastart = (uchar*)M.val;
|
||||
datastart = data = (uchar*)M.val;
|
||||
datalimit = dataend = datastart + rows * step[0];
|
||||
}
|
||||
else
|
||||
@@ -485,7 +485,7 @@ Mat::Mat(const Point_<_Tp>& pt, bool copyData)
|
||||
if( !copyData )
|
||||
{
|
||||
step[0] = step[1] = sizeof(_Tp);
|
||||
data = datastart = (uchar*)&pt.x;
|
||||
datastart = data = (uchar*)&pt.x;
|
||||
datalimit = dataend = datastart + rows * step[0];
|
||||
}
|
||||
else
|
||||
@@ -642,7 +642,7 @@ inline void Mat::release()
|
||||
if( u && CV_XADD(&u->refcount, -1) == 1 )
|
||||
deallocate();
|
||||
u = NULL;
|
||||
data = datastart = dataend = datalimit = 0;
|
||||
datastart = dataend = datalimit = data = 0;
|
||||
size.p[0] = 0;
|
||||
}
|
||||
|
||||
@@ -2148,7 +2148,7 @@ MatConstIterator& MatConstIterator::operator = (const MatConstIterator& it )
|
||||
}
|
||||
|
||||
inline
|
||||
uchar* MatConstIterator::operator *() const
|
||||
const uchar* MatConstIterator::operator *() const
|
||||
{
|
||||
return ptr;
|
||||
}
|
||||
@@ -2281,7 +2281,7 @@ MatConstIterator operator - (const MatConstIterator& a, ptrdiff_t ofs)
|
||||
|
||||
|
||||
inline
|
||||
uchar* MatConstIterator::operator [](ptrdiff_t i) const
|
||||
const uchar* MatConstIterator::operator [](ptrdiff_t i) const
|
||||
{
|
||||
return *(*this + i);
|
||||
}
|
||||
@@ -2453,12 +2453,12 @@ MatIterator_<_Tp>::MatIterator_(Mat_<_Tp>* _m, int _row, int _col)
|
||||
{}
|
||||
|
||||
template<typename _Tp> inline
|
||||
MatIterator_<_Tp>::MatIterator_(const Mat_<_Tp>* _m, Point _pt)
|
||||
MatIterator_<_Tp>::MatIterator_(Mat_<_Tp>* _m, Point _pt)
|
||||
: MatConstIterator_<_Tp>(_m, _pt)
|
||||
{}
|
||||
|
||||
template<typename _Tp> inline
|
||||
MatIterator_<_Tp>::MatIterator_(const Mat_<_Tp>* _m, const int* _idx)
|
||||
MatIterator_<_Tp>::MatIterator_(Mat_<_Tp>* _m, const int* _idx)
|
||||
: MatConstIterator_<_Tp>(_m, _idx)
|
||||
{}
|
||||
|
||||
@@ -2592,7 +2592,7 @@ inline SparseMatConstIterator& SparseMatConstIterator::operator = (const SparseM
|
||||
template<typename _Tp> inline
|
||||
const _Tp& SparseMatConstIterator::value() const
|
||||
{
|
||||
return *(_Tp*)ptr;
|
||||
return *(const _Tp*)ptr;
|
||||
}
|
||||
|
||||
inline
|
||||
|
Reference in New Issue
Block a user