1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

Revert CV_TRY/CV_CATCH macros

This reverts commit 7349b8f5ce (partially).
This commit is contained in:
Alexander Alekhin
2018-11-08 19:46:25 +03:00
parent e5d7f446d6
commit b74b05d1b3
18 changed files with 119 additions and 118 deletions
+18 -18
View File
@@ -437,18 +437,18 @@ imread_( const String& filename, int flags, int hdrtype, Mat* mat=0 )
/// set the filename in the driver
decoder->setSource( filename );
CV_TRY
try
{
// read the header to make sure it succeeds
if( !decoder->readHeader() )
return 0;
}
CV_CATCH (cv::Exception, e)
catch (const cv::Exception& e)
{
std::cerr << "imread_('" << filename << "'): can't read header: " << e.what() << std::endl << std::flush;
return 0;
}
CV_CATCH_ALL
catch (...)
{
std::cerr << "imread_('" << filename << "'): can't read header: unknown exception" << std::endl << std::flush;
return 0;
@@ -493,16 +493,16 @@ imread_( const String& filename, int flags, int hdrtype, Mat* mat=0 )
// read the image data
bool success = false;
CV_TRY
try
{
if (decoder->readData(*data))
success = true;
}
CV_CATCH (cv::Exception, e)
catch (const cv::Exception& e)
{
std::cerr << "imread_('" << filename << "'): can't read data: " << e.what() << std::endl << std::flush;
}
CV_CATCH_ALL
catch (...)
{
std::cerr << "imread_('" << filename << "'): can't read data: unknown exception" << std::endl << std::flush;
}
@@ -559,18 +559,18 @@ imreadmulti_(const String& filename, int flags, std::vector<Mat>& mats)
decoder->setSource(filename);
// read the header to make sure it succeeds
CV_TRY
try
{
// read the header to make sure it succeeds
if( !decoder->readHeader() )
return 0;
}
CV_CATCH (cv::Exception, e)
catch (const cv::Exception& e)
{
std::cerr << "imreadmulti_('" << filename << "'): can't read header: " << e.what() << std::endl << std::flush;
return 0;
}
CV_CATCH_ALL
catch (...)
{
std::cerr << "imreadmulti_('" << filename << "'): can't read header: unknown exception" << std::endl << std::flush;
return 0;
@@ -598,16 +598,16 @@ imreadmulti_(const String& filename, int flags, std::vector<Mat>& mats)
// read the image data
Mat mat(size.height, size.width, type);
bool success = false;
CV_TRY
try
{
if (decoder->readData(mat))
success = true;
}
CV_CATCH (cv::Exception, e)
catch (const cv::Exception& e)
{
std::cerr << "imreadmulti_('" << filename << "'): can't read data: " << e.what() << std::endl << std::flush;
}
CV_CATCH_ALL
catch (...)
{
std::cerr << "imreadmulti_('" << filename << "'): can't read data: unknown exception" << std::endl << std::flush;
}
@@ -777,16 +777,16 @@ imdecode_( const Mat& buf, int flags, int hdrtype, Mat* mat=0 )
}
bool success = false;
CV_TRY
try
{
if (decoder->readHeader())
success = true;
}
CV_CATCH (cv::Exception, e)
catch (const cv::Exception& e)
{
std::cerr << "imdecode_('" << filename << "'): can't read header: " << e.what() << std::endl << std::flush;
}
CV_CATCH_ALL
catch (...)
{
std::cerr << "imdecode_('" << filename << "'): can't read header: unknown exception" << std::endl << std::flush;
}
@@ -839,16 +839,16 @@ imdecode_( const Mat& buf, int flags, int hdrtype, Mat* mat=0 )
}
success = false;
CV_TRY
try
{
if (decoder->readData(*data))
success = true;
}
CV_CATCH (cv::Exception, e)
catch (const cv::Exception& e)
{
std::cerr << "imdecode_('" << filename << "'): can't read data: " << e.what() << std::endl << std::flush;
}
CV_CATCH_ALL
catch (...)
{
std::cerr << "imdecode_('" << filename << "'): can't read data: unknown exception" << std::endl << std::flush;
}