From 86e5156a9dad1005a26ffbebb7d3e921eaeb94f9 Mon Sep 17 00:00:00 2001 From: lltcggie Date: Mon, 20 Mar 2017 22:20:31 +0900 Subject: [PATCH] =?UTF-8?q?=E7=B8=A6=E6=A8=AA=E5=B9=85=E5=90=8C=E6=99=82?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E3=81=AE=E3=82=B3=E3=83=9E=E3=83=B3=E3=83=89?= =?UTF-8?q?=E3=83=A9=E3=82=A4=E3=83=B3=E3=82=AA=E3=83=97=E3=82=B7=E3=83=A7?= =?UTF-8?q?=E3=83=B3=E6=8C=87=E5=AE=9A=E6=96=B9=E6=B3=95=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- waifu2x-caffe-gui/MainDialog.cpp | 41 ++++++++++++++++---------------- waifu2x-caffe/Source.cpp | 3 --- 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/waifu2x-caffe-gui/MainDialog.cpp b/waifu2x-caffe-gui/MainDialog.cpp index b8fae24..6ba3b68 100644 --- a/waifu2x-caffe-gui/MainDialog.cpp +++ b/waifu2x-caffe-gui/MainDialog.cpp @@ -2129,9 +2129,6 @@ void DialogEvent::Create(HWND hWnd, WPARAM wParam, LPARAM lParam, LPVOID lpData) TCLAP::ValueArg cmdScaleHeight(L"h", L"scale_height", L"custom scale height", false, 0, L"double", cmd); - TCLAP::ValueArg cmdScaleWidthHeight(L"", L"scale_width_height", - L"custom scale width and height", false, 0, L"double", cmd); - std::vector cmdProcessConstraintV; cmdProcessConstraintV.push_back(L"cpu"); cmdProcessConstraintV.push_back(L"gpu"); @@ -2298,7 +2295,27 @@ void DialogEvent::Create(HWND hWnd, WPARAM wParam, LPARAM lParam, LPVOID lpData) isSetParam = true; } - if (cmdScaleWidth.isSet()) + if (cmdScaleWidth.isSet() && cmdScaleHeight.isSet()) + { + SendMessage(GetDlgItem(hWnd, IDC_RADIO_SCALE_RATIO), BM_SETCHECK, BST_UNCHECKED, 0); + SendMessage(GetDlgItem(hWnd, IDC_RADIO_SCALE_WIDTH), BM_SETCHECK, BST_UNCHECKED, 0); + SendMessage(GetDlgItem(hWnd, IDC_RADIO_SCALE_HEIGHT), BM_SETCHECK, BST_UNCHECKED, 0); + SendMessage(GetDlgItem(hWnd, IDC_RADIO_SCALE_WIDTH_HEIGHT), BM_SETCHECK, BST_CHECKED, 0); + + EnableWindow(GetDlgItem(dh, IDC_EDIT_SCALE_RATIO), FALSE); + EnableWindow(GetDlgItem(dh, IDC_EDIT_SCALE_WIDTH), FALSE); + EnableWindow(GetDlgItem(dh, IDC_EDIT_SCALE_HEIGHT), FALSE); + EnableWindow(GetDlgItem(dh, IDC_EDIT_SCALE_WIDTH_HEIGHT), TRUE); + + auto str = to_tstring(cmdScaleWidth.getValue()); + str += TEXT("x"); + str += to_tstring(cmdScaleHeight.getValue()); + + SetWindowText(GetDlgItem(dh, IDC_EDIT_SCALE_WIDTH_HEIGHT), str.c_str()); + + isSetParam = true; + } + else if (cmdScaleWidth.isSet()) { SendMessage(GetDlgItem(hWnd, IDC_RADIO_SCALE_RATIO), BM_SETCHECK, BST_UNCHECKED, 0); SendMessage(GetDlgItem(hWnd, IDC_RADIO_SCALE_WIDTH), BM_SETCHECK, BST_CHECKED, 0); @@ -2346,22 +2363,6 @@ void DialogEvent::Create(HWND hWnd, WPARAM wParam, LPARAM lParam, LPVOID lpData) isSetParam = true; } - else if (cmdScaleWidthHeight.isSet()) - { - SendMessage(GetDlgItem(hWnd, IDC_RADIO_SCALE_RATIO), BM_SETCHECK, BST_UNCHECKED, 0); - SendMessage(GetDlgItem(hWnd, IDC_RADIO_SCALE_WIDTH), BM_SETCHECK, BST_UNCHECKED, 0); - SendMessage(GetDlgItem(hWnd, IDC_RADIO_SCALE_HEIGHT), BM_SETCHECK, BST_UNCHECKED, 0); - SendMessage(GetDlgItem(hWnd, IDC_RADIO_SCALE_WIDTH_HEIGHT), BM_SETCHECK, BST_CHECKED, 0); - - EnableWindow(GetDlgItem(dh, IDC_EDIT_SCALE_RATIO), FALSE); - EnableWindow(GetDlgItem(dh, IDC_EDIT_SCALE_WIDTH), FALSE); - EnableWindow(GetDlgItem(dh, IDC_EDIT_SCALE_HEIGHT), FALSE); - EnableWindow(GetDlgItem(dh, IDC_EDIT_SCALE_WIDTH_HEIGHT), TRUE); - - SetWindowText(GetDlgItem(dh, IDC_EDIT_SCALE_WIDTH_HEIGHT), to_tstring(cmdScaleWidthHeight.getValue()).c_str()); - - isSetParam = true; - } if (cmdProcess.isSet()) { diff --git a/waifu2x-caffe/Source.cpp b/waifu2x-caffe/Source.cpp index ce840b6..81cdc37 100644 --- a/waifu2x-caffe/Source.cpp +++ b/waifu2x-caffe/Source.cpp @@ -108,9 +108,6 @@ int main(int argc, char** argv) TCLAP::ValueArg cmdScaleHeight("h", "scale_height", "custom scale height", false, 0, "double", cmd); - TCLAP::ValueArg cmdScaleWidthHeight("", "scale_width_height", - "custom scale width and height", false, 0, "double", cmd); - TCLAP::ValueArg cmdModelPath("", "model_dir", "path to custom model directory (don't append last / )", false, "models/upconv_7_anime_style_art_rgb", "string", cmd);