mirror of
https://github.com/lltcggie/waifu2x-caffe.git
synced 2025-06-26 13:42:48 +00:00
GUIで分割サイズの選択方法を変更
This commit is contained in:
parent
7812908e20
commit
e973fb5206
@ -285,27 +285,6 @@ private:
|
|||||||
}
|
}
|
||||||
), list.end());
|
), list.end());
|
||||||
|
|
||||||
if (list.size() == 0)
|
|
||||||
{
|
|
||||||
// gcdがMinCommonDivisor未満だったら2の累乗を適当に追加していく
|
|
||||||
for (int i = 64; i <= 512; i *= 2)
|
|
||||||
list.push_back(i);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
int mindiff = INT_MAX;
|
|
||||||
for (int i = 0; i < list.size(); i++)
|
|
||||||
mindiff = std::min(mindiff, abs(DefaultCommonDivisor - list[i]));
|
|
||||||
|
|
||||||
// 全ての公約数とDefaultCommonDivisorとの最小の差が64以上ならDefaultCommonDivisor追加
|
|
||||||
if (mindiff >= 64)
|
|
||||||
{
|
|
||||||
list.push_back(DefaultCommonDivisor);
|
|
||||||
|
|
||||||
std::sort(list.begin(), list.end());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int mindiff = INT_MAX;
|
int mindiff = INT_MAX;
|
||||||
int defaultIndex = 0;
|
int defaultIndex = 0;
|
||||||
for (int i = 0; i < list.size(); i++)
|
for (int i = 0; i < list.size(); i++)
|
||||||
@ -323,6 +302,15 @@ private:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SendMessageA(hcrop, CB_ADDSTRING, 0, (LPARAM)"-----------------------");
|
||||||
|
|
||||||
|
// 2の累乗を適当に追加していく
|
||||||
|
for (int i = 64; i <= 512; i *= 2)
|
||||||
|
{
|
||||||
|
std::string str(std::to_string(i));
|
||||||
|
SendMessageA(hcrop, CB_ADDSTRING, 0, (LPARAM)str.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
if (GetWindowTextLength(hcrop) == 0)
|
if (GetWindowTextLength(hcrop) == 0)
|
||||||
SendMessage(hcrop, CB_SETCURSEL, defaultIndex, 0);
|
SendMessage(hcrop, CB_SETCURSEL, defaultIndex, 0);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user