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

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:
Adil Ibragimov
2014-08-13 15:08:27 +04:00
parent 30111a786a
commit 8a4a1bb018
134 changed files with 988 additions and 986 deletions
+9 -9
View File
@@ -515,7 +515,7 @@ public:
const int G2Y = 9617;
const int SHIFT = 14;
const T* bayer0 = (const T*)srcmat.data;
const T* bayer0 = srcmat.ptr<T>();
int bayer_step = (int)(srcmat.step/sizeof(T));
T* dst0 = (T*)dstmat.data;
int dst_step = (int)(dstmat.step/sizeof(T));
@@ -632,7 +632,7 @@ static void Bayer2Gray_( const Mat& srcmat, Mat& dstmat, int code )
}
size = dstmat.size();
T* dst0 = (T*)dstmat.data;
T* dst0 = dstmat.ptr<T>();
int dst_step = (int)(dstmat.step/sizeof(T));
if( size.height > 2 )
for( int i = 0; i < size.width; i++ )
@@ -676,7 +676,7 @@ public:
int dcn2 = dcn << 1;
int bayer_step = (int)(srcmat.step/sizeof(T));
const T* bayer0 = reinterpret_cast<const T*>(srcmat.data) + bayer_step * range.start;
const T* bayer0 = srcmat.ptr<T>() + bayer_step * range.start;
int dst_step = (int)(dstmat.step/sizeof(T));
T* dst0 = reinterpret_cast<T*>(dstmat.data) + (range.start + 1) * dst_step + dcn + 1;
@@ -893,7 +893,7 @@ static void Bayer2RGB_( const Mat& srcmat, Mat& dstmat, int code )
// filling the first and the last rows
size = dstmat.size();
T* dst0 = (T*)dstmat.data;
T* dst0 = dstmat.ptr<T>();
if( size.height > 2 )
for( int i = 0; i < size.width*dcn; i++ )
{
@@ -910,9 +910,9 @@ static void Bayer2RGB_( const Mat& srcmat, Mat& dstmat, int code )
static void Bayer2RGB_VNG_8u( const Mat& srcmat, Mat& dstmat, int code )
{
const uchar* bayer = srcmat.data;
const uchar* bayer = srcmat.ptr();
int bstep = (int)srcmat.step;
uchar* dst = dstmat.data;
uchar* dst = dstmat.ptr();
int dststep = (int)dstmat.step;
Size size = srcmat.size();
@@ -1482,7 +1482,7 @@ public:
int sstep = int(src.step / src.elemSize1()), dstep = int(dst.step / dst.elemSize1());
SIMDInterpolator vecOp;
const T* S = reinterpret_cast<const T*>(src.data + (range.start + 1) * src.step) + 1;
const T* S = src.ptr<T>(range.start + 1) + 1;
T* D = reinterpret_cast<T*>(dst.data + (range.start + 1) * dst.step) + dcn;
if (range.start % 2)
@@ -1589,8 +1589,8 @@ static void Bayer2RGB_EdgeAware_T(const Mat& src, Mat& dst, int code)
size = dst.size();
size.width *= dst.channels();
size_t dstep = dst.step / dst.elemSize1();
T* firstRow = reinterpret_cast<T*>(dst.data);
T* lastRow = reinterpret_cast<T*>(dst.data) + (size.height-1) * dstep;
T* firstRow = dst.ptr<T>();
T* lastRow = dst.ptr<T>() + (size.height-1) * dstep;
if (size.height > 2)
{