Several type of formal refactoring:
1. someMatrix.data -> someMatrix.prt() 2. someMatrix.data + someMatrix.step * lineIndex -> someMatrix.ptr( lineIndex ) 3. (SomeType*) someMatrix.data -> someMatrix.ptr<SomeType>() 4. someMatrix.data -> !someMatrix.empty() ( or !someMatrix.data -> someMatrix.empty() ) in logical expressions
This commit is contained in:
@@ -230,7 +230,7 @@ pyrDown_( const Mat& _src, Mat& _dst, int borderType )
|
||||
|
||||
for( int y = 0; y < dsize.height; y++ )
|
||||
{
|
||||
T* dst = (T*)(_dst.data + _dst.step*y);
|
||||
T* dst = _dst.ptr<T>(y);
|
||||
WT *row0, *row1, *row2, *row3, *row4;
|
||||
|
||||
// fill the ring buffer (horizontal convolution and decimation)
|
||||
@@ -238,7 +238,7 @@ pyrDown_( const Mat& _src, Mat& _dst, int borderType )
|
||||
{
|
||||
WT* row = buf + ((sy - sy0) % PD_SZ)*bufstep;
|
||||
int _sy = borderInterpolate(sy, ssize.height, borderType);
|
||||
const T* src = (const T*)(_src.data + _src.step*_sy);
|
||||
const T* src = _src.ptr<T>(_sy);
|
||||
int limit = cn;
|
||||
const int* tab = tabL;
|
||||
|
||||
@@ -340,8 +340,8 @@ pyrUp_( const Mat& _src, Mat& _dst, int)
|
||||
|
||||
for( int y = 0; y < ssize.height; y++ )
|
||||
{
|
||||
T* dst0 = (T*)(_dst.data + _dst.step*y*2);
|
||||
T* dst1 = (T*)(_dst.data + _dst.step*(y*2+1));
|
||||
T* dst0 = _dst.ptr<T>(y*2);
|
||||
T* dst1 = _dst.ptr<T>(y*2+1);
|
||||
WT *row0, *row1, *row2;
|
||||
|
||||
if( y*2+1 >= dsize.height )
|
||||
@@ -352,7 +352,7 @@ pyrUp_( const Mat& _src, Mat& _dst, int)
|
||||
{
|
||||
WT* row = buf + ((sy - sy0) % PU_SZ)*bufstep;
|
||||
int _sy = borderInterpolate(sy*2, dsize.height, BORDER_REFLECT_101)/2;
|
||||
const T* src = (const T*)(_src.data + _src.step*_sy);
|
||||
const T* src = _src.ptr<T>(_sy);
|
||||
|
||||
if( ssize.width == cn )
|
||||
{
|
||||
|
Reference in New Issue
Block a user