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:
@@ -155,7 +155,7 @@ bool SunRasterDecoder::readHeader()
|
||||
bool SunRasterDecoder::readData( Mat& img )
|
||||
{
|
||||
int color = img.channels() > 1;
|
||||
uchar* data = img.data;
|
||||
uchar* data = img.ptr();
|
||||
int step = (int)img.step;
|
||||
uchar gray_palette[256];
|
||||
bool result = false;
|
||||
@@ -414,7 +414,7 @@ bool SunRasterEncoder::write( const Mat& img, const std::vector<int>& )
|
||||
strm.putDWord( 0 );
|
||||
|
||||
for( y = 0; y < height; y++ )
|
||||
strm.putBytes( img.data + img.step*y, fileStep );
|
||||
strm.putBytes( img.ptr(y), fileStep );
|
||||
|
||||
strm.close();
|
||||
result = true;
|
||||
|
||||
Reference in New Issue
Block a user