mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 08:13:04 +04:00
Merge pull request #11417 from Turim:imgcodecs_cmake_decoders_customize_formats
* imgcodecs cmake: the option to customize supported formats list (WITH_IMGCODEC_HDR, WITH_IMGCODEC_SUNRASTER, WITH_IMGCODEC_PXM) * imgcodecs: fixes - fixed CMake scripts (=OFF doesn't really work) - restore dropped GDCM block - added _IMGCODEC_ prefix - fixed tests - include PAM format under WITH_IMGCODEC_PXM option
This commit is contained in:
committed by
Alexander Alekhin
parent
573e790107
commit
84584002f2
@@ -89,7 +89,9 @@ const string all_images[] =
|
||||
"readwrite/ordinary.bmp",
|
||||
"readwrite/rle8.bmp",
|
||||
"readwrite/test_1_c1.jpg",
|
||||
#ifdef HAVE_IMGCODEC_HDR
|
||||
"readwrite/rle.hdr"
|
||||
#endif
|
||||
};
|
||||
|
||||
const int basic_modes[] =
|
||||
@@ -207,11 +209,13 @@ const string all_exts[] =
|
||||
".jpg",
|
||||
#endif
|
||||
".bmp",
|
||||
#ifdef HAVE_IMGCODEC_PXM
|
||||
".pam",
|
||||
".ppm",
|
||||
".pgm",
|
||||
".pbm",
|
||||
".pnm"
|
||||
#endif
|
||||
};
|
||||
|
||||
vector<Size> all_sizes()
|
||||
@@ -227,6 +231,7 @@ INSTANTIATE_TEST_CASE_P(All, Imgcodecs_ExtSize,
|
||||
testing::ValuesIn(all_exts),
|
||||
testing::ValuesIn(all_sizes())));
|
||||
|
||||
#ifdef HAVE_IMGCODEC_PXM
|
||||
typedef testing::TestWithParam<bool> Imgcodecs_pbm;
|
||||
TEST_P(Imgcodecs_pbm, write_read)
|
||||
{
|
||||
@@ -259,6 +264,7 @@ TEST_P(Imgcodecs_pbm, write_read)
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(All, Imgcodecs_pbm, testing::Bool());
|
||||
#endif
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
@@ -274,6 +280,7 @@ TEST(Imgcodecs_Bmp, read_rle8)
|
||||
EXPECT_PRED_FORMAT2(cvtest::MatComparator(0, 0), rle, ord);
|
||||
}
|
||||
|
||||
#ifdef HAVE_IMGCODEC_HDR
|
||||
TEST(Imgcodecs_Hdr, regression)
|
||||
{
|
||||
string folder = string(cvtest::TS::ptr()->get_data_path()) + "/readwrite/";
|
||||
@@ -299,7 +306,9 @@ TEST(Imgcodecs_Hdr, regression)
|
||||
}
|
||||
remove(tmp_file_name.c_str());
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_IMGCODEC_PXM
|
||||
TEST(Imgcodecs_Pam, read_write)
|
||||
{
|
||||
string folder = string(cvtest::TS::ptr()->get_data_path()) + "readwrite/";
|
||||
@@ -326,5 +335,6 @@ TEST(Imgcodecs_Pam, read_write)
|
||||
remove(writefile.c_str());
|
||||
remove(writefile_no_param.c_str());
|
||||
}
|
||||
#endif
|
||||
|
||||
}} // namespace
|
||||
|
||||
@@ -112,8 +112,12 @@ const string exts[] = {
|
||||
"exr",
|
||||
#endif
|
||||
"bmp",
|
||||
#ifdef HAVE_IMGCODEC_PXM
|
||||
"ppm",
|
||||
"ras"
|
||||
#endif
|
||||
#ifdef HAVE_IMGCODEC_SUNRASTER
|
||||
"ras",
|
||||
#endif
|
||||
};
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(imgcodecs, Imgcodecs_Image, testing::ValuesIn(exts));
|
||||
|
||||
Reference in New Issue
Block a user