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

imgcodecs: tiff: to avoid using TIFFTAG_* directly for imwrite() params.

Normaly, we sets IMWRITE_* flags for imwrite() params.
But imgcodecs expects to use some TIFFTAG_* directory.
This patch introduce IMWRITE_TIFF_ROWSPERSTRIP and
IMWRITE_TIFF_PREDICTOR instead of TIFFTAG_*.
This commit is contained in:
Kumataro
2024-03-23 10:16:30 +09:00
parent 52f3f5a3f6
commit bbfded21ac
3 changed files with 8 additions and 6 deletions
+4 -4
View File
@@ -28,7 +28,7 @@ TEST(Imgcodecs_Tiff, decode_tile16384x16384)
string file4 = cv::tempfile(".tiff");
std::vector<int> params;
params.push_back(TIFFTAG_ROWSPERSTRIP);
params.push_back(IMWRITE_TIFF_ROWSPERSTRIP);
params.push_back(big.rows);
EXPECT_NO_THROW(cv::imwrite(file4, big, params));
EXPECT_NO_THROW(cv::imwrite(file3, big.colRange(0, big.cols - 1), params));
@@ -767,7 +767,7 @@ TEST(Imgcodecs_Tiff, readWrite_32FC3_RAW)
std::vector<int> params;
params.push_back(IMWRITE_TIFF_COMPRESSION);
params.push_back(1/*COMPRESSION_NONE*/);
params.push_back(COMPRESSION_NONE);
ASSERT_TRUE(cv::imwrite(filenameOutput, img, params));
const Mat img2 = cv::imread(filenameOutput, IMREAD_UNCHANGED);
@@ -824,9 +824,9 @@ TEST(Imgcodecs_Tiff, readWrite_predictor)
string out = cv::tempfile(".tif");
std::vector<int> params;
params.push_back(TIFFTAG_COMPRESSION);
params.push_back(IMWRITE_TIFF_COMPRESSION);
params.push_back(methods[i]);
params.push_back(TIFFTAG_PREDICTOR);
params.push_back(IMWRITE_TIFF_PREDICTOR);
params.push_back(PREDICTOR_HORIZONTAL);
EXPECT_NO_THROW(cv::imwrite(out, mat, params));