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:
@@ -183,7 +183,7 @@ bool BmpDecoder::readHeader()
|
||||
|
||||
bool BmpDecoder::readData( Mat& img )
|
||||
{
|
||||
uchar* data = img.data;
|
||||
uchar* data = img.ptr();
|
||||
int step = (int)img.step;
|
||||
bool color = img.channels() > 1;
|
||||
uchar gray_palette[256];
|
||||
@@ -553,7 +553,7 @@ bool BmpEncoder::write( const Mat& img, const std::vector<int>& )
|
||||
width *= channels;
|
||||
for( int y = height - 1; y >= 0; y-- )
|
||||
{
|
||||
strm.putBytes( img.data + img.step*y, width );
|
||||
strm.putBytes( img.ptr(y), width );
|
||||
if( fileStep > width )
|
||||
strm.putBytes( zeropad, fileStep - width );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user