@@ -137,7 +137,7 @@ const std::vector<Waifu2x::stOutputExtentionElement> Waifu2x::OutputExtentionLis
137
137
{ L" .exr" , { 8 , 16 , 32 }, boost::optional<int >(), boost::optional<int >(), boost::optional<int >(), boost::optional<int >() },
138
138
{ L" .ppm" , { 8 , 16 }, boost::optional<int >(), boost::optional<int >(), boost::optional<int >(), boost::optional<int >() },
139
139
{ L" .webp" , { 8 }, 1 , 100 , 100 , cv::IMWRITE_WEBP_QUALITY },
140
- { L" .tga" , { 8 }, boost::optional< int >(), boost::optional< int >(), boost::optional< int >(), boost::optional< int >() },
140
+ { L" .tga" , { 8 }, 0 , 1 , 0 , 0 },
141
141
};
142
142
143
143
#ifndef CUDA_CHECK_WAIFU2X
@@ -1357,6 +1357,27 @@ Waifu2x::eWaifu2xError Waifu2x::WriteMat(const cv::Mat &im, const boost::filesys
1357
1357
if (!os)
1358
1358
return eWaifu2xError_FailedOpenOutputFile;
1359
1359
1360
+ // RLE圧縮の設定
1361
+ bool isSet = false ;
1362
+ const auto &OutputExtentionList = Waifu2x::OutputExtentionList;
1363
+ for (const auto &elm : OutputExtentionList)
1364
+ {
1365
+ if (elm.ext == L" .tga" )
1366
+ {
1367
+ if (elm.imageQualitySettingVolume && output_quality)
1368
+ {
1369
+ stbi_write_tga_with_rle = *output_quality;
1370
+ isSet = true ;
1371
+ }
1372
+
1373
+ break ;
1374
+ }
1375
+ }
1376
+
1377
+ // 設定されなかったのでデフォルトにする
1378
+ if (!isSet)
1379
+ stbi_write_tga_with_rle = 1 ;
1380
+
1360
1381
if (!stbi_write_tga_to_func (Waifu2x_stbi_write_func, &os, im.size ().width , im.size ().height , im.channels (), data))
1361
1382
return eWaifu2xError_FailedOpenOutputFile;
1362
1383
0 commit comments