From 2f87f8ee17c187844cdfcb45e43574a1be192d79 Mon Sep 17 00:00:00 2001 From: AaronFeng753 <52553688+AaronFeng753@users.noreply.github.com> Date: Thu, 20 Feb 2020 20:42:56 +0800 Subject: [PATCH] Add files via upload --- SRC/Waifu2x-Extension-QT/Anime4K.cpp | 3 +- .../Waifu2x-Extension-QT.pro.user | 2 +- SRC/Waifu2x-Extension-QT/files.cpp | 75 +- SRC/Waifu2x-Extension-QT/language_Chinese.qm | Bin 21227 -> 23372 bytes SRC/Waifu2x-Extension-QT/language_Chinese.ts | 629 ++-- SRC/Waifu2x-Extension-QT/language_English.ts | 613 ++-- SRC/Waifu2x-Extension-QT/main.cpp | 29 +- SRC/Waifu2x-Extension-QT/mainwindow.cpp | 186 +- SRC/Waifu2x-Extension-QT/mainwindow.h | 28 +- SRC/Waifu2x-Extension-QT/mainwindow.ui | 2583 +++++++++-------- SRC/Waifu2x-Extension-QT/settings.cpp | 22 +- SRC/Waifu2x-Extension-QT/video.cpp | 4 +- SRC/Waifu2x-Extension-QT/waifu2x.cpp | 8 +- .../waifu2x_converter.cpp | 72 +- .../waifu2x_ncnn_vulkan.cpp | 10 +- 15 files changed, 2493 insertions(+), 1771 deletions(-) diff --git a/SRC/Waifu2x-Extension-QT/Anime4K.cpp b/SRC/Waifu2x-Extension-QT/Anime4K.cpp index faf4995f1..57e873a05 100644 --- a/SRC/Waifu2x-Extension-QT/Anime4K.cpp +++ b/SRC/Waifu2x-Extension-QT/Anime4K.cpp @@ -59,7 +59,7 @@ int MainWindow::Anime4k_Video(QMap File_map) } //========================== QFileInfo fileinfo(SourceFile_fullPath); - QString file_name = fileinfo.baseName(); + QString file_name = file_getBaseName(fileinfo.filePath()); QString file_ext = fileinfo.suffix(); QString file_path = fileinfo.path(); if(file_path.right(1)=="/") @@ -287,7 +287,6 @@ int MainWindow::Anime4k_Video_scale(QString Frame_fileName,QMap } } } - //while(!Waifu2x->waitForStarted(100)&&!QProcess_stop) {} //============================ 调整大小 ==================================================== if(CustRes_isEnabled) { diff --git a/SRC/Waifu2x-Extension-QT/Waifu2x-Extension-QT.pro.user b/SRC/Waifu2x-Extension-QT/Waifu2x-Extension-QT.pro.user index a9bdc9a66..63a997ff6 100644 --- a/SRC/Waifu2x-Extension-QT/Waifu2x-Extension-QT.pro.user +++ b/SRC/Waifu2x-Extension-QT/Waifu2x-Extension-QT.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/SRC/Waifu2x-Extension-QT/files.cpp b/SRC/Waifu2x-Extension-QT/files.cpp index b7d902179..677dddec9 100644 --- a/SRC/Waifu2x-Extension-QT/files.cpp +++ b/SRC/Waifu2x-Extension-QT/files.cpp @@ -91,21 +91,7 @@ void MainWindow::Add_File_Folder(QString Full_Path) if(fileinfo.isFile()) { QString file_name = fileinfo.fileName(); - QString file_ext = fileinfo.suffix(); - QStringList nameFilters;//扩展名过滤列表 - nameFilters.append("gif");//添加gif - //读取用户设定的图片和视频扩展名列表 - QString Ext_image_str = ui->Ext_image->text(); - QStringList nameFilters_image = Ext_image_str.split(":"); - QString Ext_video_str = ui->Ext_video->text(); - QStringList nameFilters_video = Ext_video_str.split(":"); - nameFilters.append(nameFilters_video); - nameFilters.append(nameFilters_image); - //判断是否在扩展名支持列表内 - if (nameFilters.contains(file_ext)) - { - FileList_Add(file_name, Full_Path); - } + FileList_Add(file_name, Full_Path); } else { @@ -127,26 +113,8 @@ void MainWindow::Add_File_Folder(QString Full_Path) */ QStringList MainWindow::getFileNames(QString path) { - QStringList nameFilters; - nameFilters.append("*.gif"); - QString Ext_image_str = ui->Ext_image->text(); - QStringList nameFilters_image = Ext_image_str.split(":"); - for(int i = 0; i < nameFilters_image.size(); ++i) - { - QString tmp = nameFilters_image.at(i); - tmp = "*." + tmp; - nameFilters.append(tmp); - } - QString Ext_video_str = ui->Ext_video->text(); - QStringList nameFilters_video = Ext_video_str.split(":"); - for(int i = 0; i < nameFilters_video.size(); ++i) - { - QString tmp = nameFilters_video.at(i); - tmp = "*." + tmp; - nameFilters.append(tmp); - } QDir dir(path); - QStringList files = dir.entryList(nameFilters, QDir::Files | QDir::Writable, QDir::Name); + QStringList files = dir.entryList(QDir::Files | QDir::Writable, QDir::Name); return files; } /* @@ -159,7 +127,7 @@ int MainWindow::FileList_Add(QString fileName, QString SourceFile_fullPath) //============================ 判断是否为图片 =============================== QString Ext_image_str = ui->Ext_image->text(); QStringList nameFilters_image = Ext_image_str.split(":"); - if (nameFilters_image.contains(file_ext)) + if (nameFilters_image.contains(file_ext.toLower())) { AddNew_image=true; int rowNum = Table_image_get_rowNum(); @@ -176,8 +144,20 @@ int MainWindow::FileList_Add(QString fileName, QString SourceFile_fullPath) //============================ 判断是否为视频 =============================== QString Ext_video_str = ui->Ext_video->text(); QStringList nameFilters_video = Ext_video_str.split(":"); - if (nameFilters_video.contains(file_ext)) + if (nameFilters_video.contains(file_ext.toLower())) { + if(file_ext!="mp4"&&file_ext.toLower()=="mp4") + { + QString file_name = file_getBaseName(fileinfo.filePath()); + QString file_ext = fileinfo.suffix(); + QString file_path = fileinfo.path(); + if(file_path.right(1)=="/") + { + file_path = file_path.left(file_path.length() - 1); + } + QFile::rename(file_path+"/"+file_name+"."+file_ext,file_path+"/"+file_name+".mp4"); + SourceFile_fullPath = file_path+"/"+file_name+".mp4"; + } AddNew_video=true; int rowNum = Table_video_get_rowNum(); QMap map; @@ -191,7 +171,7 @@ int MainWindow::FileList_Add(QString fileName, QString SourceFile_fullPath) return 0; } //============================ 最后只能是gif =============================== - if(file_ext=="gif") + if(file_ext.toLower()=="gif") { int rowNum = Table_gif_get_rowNum(); QMap map; @@ -407,7 +387,7 @@ QStringList MainWindow::file_getFileNames_in_Folder_nofilter(QString path) if(files_new!=files_old) { files_old = files_new; - Delay_sec_sleep(1); + Delay_sec_sleep(2); } else { @@ -445,3 +425,22 @@ bool MainWindow::file_DelDir(const QString &path) } return dir.rmpath(dir.absolutePath()); // 删除文件夹 } +/* +重写的获取basename函数 +*/ +QString MainWindow::file_getBaseName(QString path){ + QFileInfo fileinfo(path); + QString file_fullname = fileinfo.fileName(); + QStringList parts = file_fullname.split("."); + QString file_basename=""; + for(int i=0; i<(parts.size()-1); i++) + { + file_basename+=parts.at(i); + file_basename+="."; + } + if(file_basename.right(1)==".") + { + file_basename = file_basename.left(file_basename.length() - 1); + } + return file_basename; +} diff --git a/SRC/Waifu2x-Extension-QT/language_Chinese.qm b/SRC/Waifu2x-Extension-QT/language_Chinese.qm index 1aa6a9b5d641c86c28056b341150a090a56cedca..7850c0fbcde768f11dd29bd8ef66f9a3aa3f1b2c 100644 GIT binary patch delta 3181 zcmb7F2~<;O7QQdbOY*X@Zz?J~XLIMN|NURg^0jVKD5Agn)z6RL*qZYuk z2X;--0EGM#9y9USaDV`hDuC&ii11WwnAc2X`_070?L=X855UNFqOs@@z?kbq%T*(Q z(==lJ8!P~KH?ecN1gzi_LhQV<86cvL*mu|$AT5&U`t%6^DIoSIa&bFjh;Kqf0P!l~ zO4?We_Z(vINI!t`5piq52LMrj<+#s1j~i>_Ol2n`VOP$aT`K`5rEnUKHUR!{8si7B z&gUGfUIs8Ble1{16(As#vox)JJcznazaSt1Y#&V7=i3dpT;`F>f8^C!T z=d>JGP95N!>$(q+PjW8wxgn8@oPnT90H0pY57D70-2(2I%gq3jeYukt;b+isZo)6g z0Mq)psY5FKp5hic*8&J{af>@}V7Z#B?Xo^WCYQK>8TTqaIL`e#4kz@U%k58o8&|r4 z+dnu8ASZ(R^MxQ>bqg;*&<`+9%`4n<2(^snmBhH>N^kP!RN-XG5MJZHf1vhDc~-)CZyoPw=e|>QTEXDWvm93N*_( zGWs|c2)B~y*#*cvlgwW8A%ILnHvfP)?+0Xi^C04z$Ui+CkE;zKH?4hy-`^lVPxeKr zu8_SkxG}Yg?AzFe#G1%|g(aaB9Rjfu@4aILE}tS1-*7=rK|Fw8j8%|Rhm!=J6Eq#} z1c-f4(9+O_?(PtDzw-*3X11Vb-F5(RwczyDr8u!oaE7Nt0(%AhiJ3T2wczqlKYFZP z$iEtgQgsMDGPYp~JcL21N;D-UOzJ?dh^7nG@mq2Ae!>DzOpD}!aPDap61Ij5=X>42 zNtO!VB&MP1mJ4@9HRD99gnNomv!n>&;rP1%(q7TT;sZF*O;Ju4<~MkU$dH2HyIdC4 zXl!WOm7-aQYQaJz>UEuJn~amE zY@pgdT!}=cQmg0Zp=Y?%zByNLwXX7w@C`K?b6(r zlvbU^{QFUo>aA!d&s7r3z#TMUfuvQQA`J>VxPVuUu(& zt_ z$xNM3(4V#(su-hR9zYizec7<+C5+>YbY8^TvOQ=2<6Sk$)WvN60rNV61ZG z@>7wBCy&Vgwo!#%_*g#ZiShD1A-}N?pVK?^SiQ!UNIu|>m#Luc-kLXFJH@47eAC%wI zl|qE0`&Ywdzlx9M4_{>`jAH#06pp)Cwu5rFt(J%c$pI}_OWsmtloYBpZHKHzph2{yn9qjbH*zhop zSDl}|T8^*U=N&D14h5wHCV2s-e7dXeTz?@FeJT%EP1oG4RTT3qX*=*!}4NY_EF)O*ORCDj*GVpuo{poUAuL zg{S2d*a(jcoM2fyoBL?ES)ONWr32}jTw7I5S3j%D?v(nleO^k}{K#5`14E`5u^2mz zcDH$WZ{~)$%~Iw?*%6?IYGA+!Ns#40OHxfWWelyZW{gQJ;q6|eu)_-#kbyu8!VRyO zHMdmMuM4~|dGK%vi;1o^KdY2Qn~ZdZ(ZU$$9D~kMZmOwbSE1yejnokAa^J9E>UT`* zocKm~x7w#{R`K}Sm=%f_IQeJm8t5{e zoshv~Hq)kZn$lP4Dj0fht~2#4df_ zxaZ=7zXMLIOuwhK%{h22NlaunhXu1uVeYmoVYi7$7j<7r(R0t)z3!;vt3Wsg;!mgb2bu|@?#bKM8VQ050HQfI@ z_9OpC?2ocX;*Vmo-E4o4s}~h!&C)QhtA_0U&3&yxH1m#~SjqBIr@F=V=gbgTN%rduKUqr2)5EXy+2L26k!72j=_VusSbwL05e@;I>vj6_+6nW*%S^^P wrpAKjWNxfGTadSgrCoSIyplGx#sMY=wzpk5$O`b7rLuK;W1-$S+f+~d2bQ~g;{X5v delta 2012 zcmYjRX;4&G7XIGr?)P55-juBc6hs7NQNkj`7Mew56Pl%?pkP=AM22m^0HP!9mIOiE z8U-d3$1x^@h$h;JqKOJFNz8&&WGuCmFcV1$j*Q08MvZ1p|A;kIHLvcy=brPO@B7aE z<^*%^eP*YFX*M7W0Nl<4E8YWQ_Ck8*FMzfjQtLdx*%z|*OTg?MkR8qgLR=vmcBVLI zIG4W*Bn80Z3n`tSfXB5jfCvwGfA9#H)r;VHeSmu#h293@E+KyJMS$%_Lfw2onujF6 zO@N8_Lvlv}VD|(|qkaaw$FRJ!6$svhB8v+FXhG-So&qkZICM7$aF~YU^NoPlV>~O; zQ=th4PUS#sD>EmK3N3zxNpW8R#78rkul55|s+qM}XMq{dnT=x=fNB@hvC|AlK4w0; za|kB*{DJA|bpxVmnN!DJ5F6*2(=if4_;2PrUpWxAhq)8)LjVP4^x_aO?;P`B!{33x zv#ev)O=4;;8)XirLRPl)_;w&5h^@a=5Bg)*>PINwde&5;2IhpZn^%~KX*JvC7Xd8V zz;c@c%Xq%(Nx%r9J;dEzWl^GKS#z@7j^N=wTLdB}gI?TMdJqB`jZb(D~; zmtGuRM2rkbuU#Dj!b7AF3J8GsrcAQFiKN;h3pINJJ^`{YS7Oj%T$a3=*1-l@^E&d> ztRUHLwja=3k-cL&91hI4$`0lbRnGmguI39AI4(QcN`+&7l3nPiAO><}SGs+vkX82m z>C-^;xNNj!CcqDJliwo)Px*{XNLfO_lDL$;2LNR@mwlZY3EIjv{74cx#c?|tMyZh) z?jKJA0bLc>*+!mHS~*j922rE^hC3hYMuc*$lQYY@C{QBN5@=77UvHld9^8nxX*VjpVcfP;kns3lO*93W^5A8kQoJcto_31n(BquE+GrsY?vpn)P$GVdyrqY}q3-g%qjb)t z$d4!qfYZ4AB-=vn<>dEn5YWYK@@IB#)UmS|son$l=7~v5ZV_`WVnHJTln;t41N(u6 zwPJDEb&_aMti8UC;_So?n+T}MF21#mMEQCDE2e^ zXdN!zxKc$D?G(qt-zFv!#D{~Veb80$SqVKTt|f};IlIVgc?zAjg6`QV3Y)$HCf`#0 z(X^2|J)o#Qx|+PDQgYsUAo7e-(d9<-&m=1Y`frmfbCt;xgfzHIX|N@TRw^@7NCIuU zvY?!hyWCg)shiAWKdjuiZ99#lTKQIEBxyfW`6)w*1I;SFj~elKt_s^)NoG!0txcdp zuDz5JuEYC_^sSs9A?+MAcKZaP$d1K#l4g zEqNmTeRbJaSu~ar>dLMcM72>}+d7w|IjF9?JcpjvM0KMbtvxO3?Kww*nG4kCz9-;Q z;xq`~N9zk3yQp92ex>FW+ly&muUYCtQcEP7!Y4YSPW7#3P2e%oc)zCQwfm&)u%Ky)RlG4hIlrQ~Ccn5yXMU*AT4rc}Wz3tLBP|ooU$W-sQ+1ZSX`K?w z#~wx|dS?2noT%)~RO7N)IU497V)m|YUkfPq-%)9>8b)f|ixS}TvOrjTS!F?f+4Pl_ zRAhC@+9I83u5_Aj<~{u_<(^)gR%%1^GFh0{Tm)E4m{MsTqbhLDad?)v?TdA+t6+{)wo6njmcFNo9G52MtvvE~roq4;b zujLbc1!KvMGD文件列表 (您可以拖拽文件或文件夹到此处) - + Drag and drop files or folders here (Image, GIF and Video) 将文件或文件夹拖拽并投放到此处 (图片,GIF和视频) - - + Hide all setting options. 隐藏所有设置选项. - - + + Hide settings 隐藏设置 - + Clear list 清空列表 - + Remove item 移除条目 - - + + Hide input path 隐藏输入路径 - + Save Files List 保存文件列表 - + Read Saved Files List 读取已保存的文件列表 - + File count: null 文件数量: null - + Settings 设置 - + SimSun + 宋体 + + + Automatically check for updates on startup. 启动时自动检查更新. - + Automatically check update 自动检查更新 - + Always hide Input path 一直隐藏输入路径 - + When the file processing status changes, the file list scrolls automatically. 当文件的处理状态改变时,文件列表自动滑动. - + File list scrolls automatically 自动滑动文件列表 - + Report issue 反馈 - + Check update 检查更新 - + Readme 说明文档 - + Save settings 保存设置 - + Please donate to developers to support continuous updates of this software. 请捐赠以支持本软件的持续更新. @@ -148,22 +151,22 @@ ★ 捐赠 ★ - + Run a compatibility test to see which engines your computer is compatible with. 进行兼容性测试以了解您的电脑与哪些引擎兼容. - + Compatibility test 兼容性测试 - + Reset settings 重置设置 - + Engine 引擎 @@ -178,18 +181,17 @@ 浏览 - + The result images will stay in the same folder of source images. 生成的图像将存放在源图像的同一路径下. - + waifu2x-ncnn-vulkan waifu2x-ncnn-vulkan - - + Tile size: This value will affacts GPU memory usage. Larger tile size means waifu2x will use more GPU memory and run faster. Smaller tile size means waifu2x will use less GPU memory and run slower. @@ -200,55 +202,55 @@ Smaller tile size means waifu2x will use less GPU memory and run slower. (仅在使用waifu2x-ncnn-vulkan引擎时生效.) - + Tile size: 块大小: - - + + Only works when using "waifu2x-ncnn-vulkan" engine. Other engines only support "2D Anime" image style. 仅在使用waifu2x-ncnn-vulkan引擎时生效. 其他引擎仅支持"2D动漫"图形样式. - + 2D Anime 2D动漫 - + 3D Real-life 3D写实 - - + + Select the GPU to use when enabling the "waifu2x-ncnn-vulkan" engine. 选择在启用waifu2x-ncnn-vulkan引擎时所使用的GPU. - + GPU ID: GPU ID: - + Image Style: 图像样式: - + Detect available GPU ID 查询可用的GPU ID - - + + GIF: GIF: - + Select the engine for processing GIF. waifu2x-ncnn-vulkan [ Speed:★★ Image Quality:★★★ ] waifu2x-converter [ Speed:★☆ Image Quality:★★☆ ] @@ -259,7 +261,7 @@ waifu2x-converter [ 速度:★☆ 画质:★★☆ ] 您可以运行兼容性测试以查看您的PC与哪些引擎兼容. - + Select the engine for processing Image. waifu2x-ncnn-vulkan [ Speed:★★ Image Quality:★★★ ] waifu2x-converter [ Speed:★☆ Image Quality:★★☆ ] @@ -270,7 +272,7 @@ waifu2x-converter [ 速度:★☆ 画质:★★☆ ] 您可以运行兼容性测试以查看您的PC与哪些引擎兼容. - + Select the engine for processing Video. waifu2x-ncnn-vulkan [ Speed:★★ Image Quality:★★★ ] waifu2x-converter [ Speed:★☆ Image Quality:★★☆ ] @@ -283,92 +285,213 @@ Anime4k [ 速度:★★★ 画质:☆ ] 您可以运行兼容性测试以查看您的PC与哪些引擎兼容. - - - + + + Image: 图片: - - - + + Minimize + 最小化 + + + + + Hide Text Browser + 隐藏文本框 + + + + + Video: 视频: - + + Tile size: This value will affacts GPU memory usage. +Larger tile size means waifu2x will use more GPU memory and run faster. +Smaller tile size means waifu2x will use less GPU memory and run slower. + 块大小: 这个值将影响显存使用量. +更大的块大小意味着waifu2x将使用更多显存运行的更快. +更小的块大小意味着waifu2x将使用更多显存运行的更慢. + + + + waifu2x-converter + waifu2x-converter + + + + Target processor: + 处理器: + + + + Block size: This value will affacts GPU memory usage. +Larger Block size means waifu2x will use more GPU memory and run faster. +Smaller Block size means waifu2x will use less GPU memory and run slower. + 块大小: 这个值将影响显存使用量. +更大的块大小意味着waifu2x将使用更多显存运行的更快. +更小的块大小意味着waifu2x将使用更多显存运行的更慢. + + + + Disable GPU + 禁用GPU + + + + Block size: + 块大小: + + + + Force to use OpenCL on Intel Platform. + 强制在Intel平台上启用OpenCL. + + + + Force OpenCL + 强制启用OpenCL + + + + Dump processor list + 输出处理器列表 + + + ★★ Donate ★★ ★★ 捐赠 ★★ - + Wiki - Wiki + 使用教程 - - + + Total:1 总数:1 - + + May cause loss of +image quality. + 可能会损失画质. + + + + When there are finished files in the list, the finished files will be + processed again when the processing process is started again. + 当文件列表内有已处理完成的文件时, +已完成的文件将在下次开始时被重复处理. + + + Optimizing the scaled gif will slightly reduce the image quality, but it can reduce the GIF file size. It is recommended to enable this option. 优化放大后的GIF会导致轻微的画质损失,但是可以压缩文件体积. 推荐您启用该功能. - + Optimize ".gif" 优化".gif" - + + Custom Font Settings (Restart the software to take effect) + 自定义字体设置 (重启软件以生效) + + + + Custom font size: + 自定义字体大小: + + + + Enable + 启用 + + + + Custom font: + 自定义字体: + + + + Language: + 语言: + + + + [Text browser] will be automatically hidden when the software starts. + [文本框] 将在软件启动时自动隐藏. + + + + Always hide Text Browser + 一直隐藏文本框 + + + + 宋体 + 宋体 + + + + Save Custom Font Settings + 保存自定义字体设置 + + + Compressed ".jpg" image quality: 压缩后的 ".jpg" 图像质量: - + 0(worst quality)~99 We recommend you use the default value(90) 0(质量最差)~99 我们建议您使用默认值(90) - - + + About 关于 - - + + We recommend that you restart the software after changing the language for the language settings to fully take effect. 我们建议您在更改语言设置后重启软件 以确保新的语言设置完全生效. - Global font size: (Restart the software to take effect) - 全局字体大小: + 全局字体大小: (重启本软件以生效) - + Settings will be saved automatically when you close the software. 当您关闭软件时将自动保存设置. - + Auto save settings 自动保存设置 - + [Input Path] will be automatically hidden when the software starts. 软件启动时将自动隐藏[输入路径]. @@ -377,167 +500,171 @@ the language for the language settings to fully take effect. 一直隐藏输入路径 - + Aspect Ratio: (Custom resolution) 纵横比: (自定义分辨率) - + Global font: +(Restart the software to take effect) + 全局字体: +(需重启软件以生效) + + Save - 保存 + 保存 - + Ignore Aspect Ratio 忽略纵横比 - + Keep Aspect Ratio 保持纵横比 - + Keep Aspect Ratio By Expanding 保持纵横比(扩展) - + [Settings] will be automatically hidden when the software starts. [设置] 将会在软件启动时自动隐藏. - + Always hide Settings 一直隐藏设置 - + Donate: 捐赠: - + Play Notification sound when all files in the list have been processed. 处理完列表内所有文件后播放提示音. - + Notification sound 提示音 - + Compress JPG files, almost lossless. 压缩JPG文件,近乎无损. - + Compress ".jpg" 压缩".jpg" - + Delete the original file after processing is complete. 处理完成后删除源文件. - + Delete original files 删除源文件 - + Automatically shut down the computer after processing all files in the list. 处理完列表内所有文件后自动关机. - + Turn off computer when finished 处理完成后自动关机 - + Save the scaled image as ".jpg".(Images are stored in ".png" format by default.) 将放大后的图片保存为".jpg".(图片默认保存为".png") - + Save as ".jpg" 保存为".jpg" - When there are finished files in the list, the finished files will be processed again when the processing process is started again. - 当再次开始处理文件列表时,列表内已处理完成的图片将会被再次处理. + 当再次开始处理文件列表时,列表内已处理完成的图片将会被再次处理. - + Re-process finished files 重复处理已完成的文件 - + Output internal Scale and Denoise progress of GIF and video process inside textbrowser. 在Textbrowser内输出视频和GIF的内部放大与降噪进度. - + Show internal progress 显示内部进度 - + Additional settings 附加设置 - + Input file extensions 文件扩展名 - + Number of threads 线程数量 - - + + Internal threads number of GIF. GIF内部线程数量. - - + + Internal: 内部: - - + + Internal threads number of Video. 视频内部线程数量. - + Custom resolution 自定义分辨率 - + Width: 宽度: - + Height: 高度: - + 1.Set the height and width of the resolution. 2.Select a file in the file list. 3.Click the Apply button to set the resolution. @@ -546,65 +673,65 @@ the language for the language settings to fully take effect. 3.按下"应用"键以设定分辨率. - + Apply 应用 - + 1.Select a file in the file list. 2.Click the Cancel button to cancel the custom resolution. 1.在文件列表内选择一个文件. 2.按下取消键以取消自定义分辨率. - + Cancel 取消 - + Scale ratio and Denoise level 放大倍数与降噪等级 - - - - - - + + + + + + Range: 1 ~ 999999999 Range: 1 ~ Infinite 范围: 1 ~ 999999999 - + Image Scale ratio: 图片放大倍数: - + GIF Denoise level: GIF降噪等级: - + Video Scale ratio: 视频放大倍数: - + Image Denoise level: 图片降噪等级: - + GIF Scale ratio: GIF放大倍数: - + Video Denoise level: 视频降噪等级: @@ -613,37 +740,37 @@ the language for the language settings to fully take effect. mp4:3gp:avi:flv:mkv:mov:mpg:Ogg:vob:webm:wmv - Language - 语言 + 语言 - Current Language: - 当前语言: + 当前语言: - + Stop 停止 - + Clear text browser. 清空Text browser. - + Clear 清空 - + + Time remaining:NULL 剩余时间:未知 - + + Time cost:NULL 耗时:未知 @@ -652,17 +779,18 @@ the language for the language settings to fully take effect. 清空TextBrowser - + + ETA:NULL 预计完成时间:未知 - + Start 开始 - + Font size: 字体大小: @@ -732,26 +860,26 @@ the language for the language settings to fully take effect. - - - + + + Error 错误 - + No items are currently selected. 当前未选中任何项目. - - - - + + + + Warning 警告 @@ -767,16 +895,16 @@ the language for the language settings to fully take effect. - - + + The file format is not supported, please enter supported file format, or add more file extensions yourself. 不支持当前文件格式,请输入可以支持的文件格式,或者自行添加文件扩展名. - - - - + + + + Notification 通知 @@ -804,25 +932,25 @@ Do you wanna update now??? - + YES - + NO - - + + Settings saved successfully! 成功保存设置参数! - + The settings file has been reset, please restart the software manually for the default settings to take effect. 设置配置文件已重置,请手动重启软件以应用默认设置. @@ -835,23 +963,23 @@ Do you wanna update now??? - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + @@ -876,9 +1004,9 @@ Do you wanna update now??? - - - + + + @@ -887,22 +1015,22 @@ Do you wanna update now??? - + ]. Error: [Cannot convert video format to mp4.] ]. 错误: [无法将视频转换为mp4格式.] - + ]. Error: [Unable to split video into pictures.] ]. 错误: [无法将视频拆分为图片.] - - + + File name:[ @@ -915,22 +1043,22 @@ Do you wanna update now??? - + ]. Error: [Unable to scale all frames.] ]. 错误: [无法放大所有帧.] - + ]. Error: [Unable to assemble pictures into videos.] ]. 错误: [无法将帧图片组装为视频.] - - + + @@ -939,123 +1067,121 @@ Do you wanna update now??? ]. 错误: [无法读取源文件的分辨率, 故无法将图片调整至自定义的分辨率.] - + Time cost:[ 耗时:[ - + Time remaining:[ 剩余时间:[ - + Unable to start processing files: The file list is empty or there are no available files to process. 无法开始处理文件: 文件列表为空或者列表内无可供处理的文件. - + Start processing files. 开始处理文件. - + Trying to stop, please wait... 尝试停止, 请稍等... - + Processing of files has stopped. 已停止处理文件. - + It was detected that the program executed an automatic shutdown of the computer when it was last run. The last File List was automatically saved before the shutdown. You can manually load the File List to view the file processing status. 检测到软件上次运行时执行了自动关机. 上次的文件列表已在关机前自动保存. 您可以手动加载列表已查看文件处理状况. - + Thank you! :) 谢谢您! :) - - + + Input path does not exist. 输入的路径不存在. - - - - - - + + + + + + Range:-1(No noise reduction)~3 范围:-1(不降噪)~3 - - - - - - Range:0(No noise reduction)~2 - 范围:0(不降噪)~2 + 范围:0(不降噪)~2 + + + + + + + + + Range:0(No noise reduction)~3 + 范围:0(不降噪)~3 - - + + Anime4K engine does not support noise reduction. Anime4K引擎不支持降噪. - - + + Show settings 显示设置 - - - Show all setting options. - 显示所有设置选项. - - - - + + Show input path 显示输入路径 - + Error: Language files cannot be loaded properly. 错误: 找不到语言文件. - + File list is empty! 文件列表为空! - + Write to the file, please wait. 写入文件中,请稍等. - + Please wait while reading the file. 请稍等,读取文件中. - + Cannot find the saved Files List! 找不到已保存的文件列表! - + Do you like using this software? If you like the software, please donate to support the developers to ensure the software is continuously updated. (This popup will only pop up once after the software is installed.) @@ -1064,29 +1190,45 @@ If you like the software, please donate to support the developers to ensure the (本弹窗仅会在软件安装后弹出一次.) - + We do not recommend that you cancel the automatic check for updates as this may prevent you from receiving timely bug fixes. 我们不建议您关闭[自动检查更新],因为这可能导致您无法及时接收bug修复. - - - - + + + + Total:%1 总数:%1 - + Select file open file 选择文件 - + All file( 所有文件( + + + + Show Text Browser + 显示文本框 + + + + Detecting available Processor, please wait. + 检测可用处理器中,请稍等. + + + + No available Processor detected! + 未检测到可用处理器! + All file(*.*); 所有文件(*.*); @@ -1157,72 +1299,73 @@ If you like the software, please donate to support the developers to ensure the 兼容性测试已完成! - + Detecting available GPU, please wait. 检测可用显卡中,请稍等. - + + Detection is complete! 检测完成! - + No available GPU ID detected! 未检测到可用的GPU! - + ]. Error: [Unable to scale the picture.] ]. 错误: [无法放大图片.] - + ]. Error: [Unable to resize the scaled picture to the target size] ]. 错误: [无法将放大后的图片调整至自定义的分辨率] - + ]. Error: [Cannot save scaled picture as .jpg.] ]. 错误: [无法将图片保存为 .jpg.] - + ]. Error: [Can't get Duration value of GIF file.] ]. 错误: [无法获取gif的帧延时.] - + ]. Error: [Can't split GIF into frames.] ]. 错误: [无法拆分gif.] - - + + ] Scale and Denoise progress:[ ] 放大与降噪进度:[ - + ]. Error: [Failed to scale frames.] ]. 错误: [无法放大当前帧.] - + ]. Error: [Unable to assemble gif.] ]. 错误: [无法组装gif.] - + ]. Error: [Can't optimize gif.] ]. 错误: [无法优化gif.] diff --git a/SRC/Waifu2x-Extension-QT/language_English.ts b/SRC/Waifu2x-Extension-QT/language_English.ts index 007b75284..17f67f890 100644 --- a/SRC/Waifu2x-Extension-QT/language_English.ts +++ b/SRC/Waifu2x-Extension-QT/language_English.ts @@ -36,212 +36,206 @@ - + Remove item - + Clear list - - + Hide all setting options. - - + + Hide settings - - + + Hide input path - + Drag and drop files or folders here (Image, GIF and Video) - + Save Files List - + Read Saved Files List - + File count: null - + Settings - + Scale ratio and Denoise level - - - - - - + + + + + + Range: 1 ~ 999999999 - + Image Scale ratio: - + GIF Denoise level: - + Video Scale ratio: - + Image Denoise level: - + GIF Scale ratio: - + Video Denoise level: - + Output internal Scale and Denoise progress of GIF and video process inside textbrowser. - + Show internal progress - + Compress JPG files, almost lossless. - + Compress ".jpg" - + Save the scaled image as ".jpg".(Images are stored in ".png" format by default.) - + Save as ".jpg" - + Optimizing the scaled gif will slightly reduce the image quality, but it can reduce the GIF file size. It is recommended to enable this option. - + Optimize ".gif" - - When there are finished files in the list, the finished files will be processed again when the processing process is started again. - - - - + Re-process finished files - + Play Notification sound when all files in the list have been processed. - + Notification sound - + Automatically shut down the computer after processing all files in the list. - + Turn off computer when finished - + Delete the original file after processing is complete. - + Delete original files - + Automatically check for updates on startup. - + Automatically check update - + Always hide Input path - + When the file processing status changes, the file list scrolls automatically. - + File list scrolls automatically - + Engine @@ -256,18 +250,17 @@ It is recommended to enable this option. - + The result images will stay in the same folder of source images. - + waifu2x-ncnn-vulkan - - + Tile size: This value will affacts GPU memory usage. Larger tile size means waifu2x will use more GPU memory and run faster. Smaller tile size means waifu2x will use less GPU memory and run slower. @@ -275,55 +268,55 @@ Smaller tile size means waifu2x will use less GPU memory and run slower. - + Tile size: - - + + Only works when using "waifu2x-ncnn-vulkan" engine. Other engines only support "2D Anime" image style. - + 2D Anime - + 3D Real-life - - + + Select the GPU to use when enabling the "waifu2x-ncnn-vulkan" engine. - + GPU ID: - + Image Style: - + Detect available GPU ID - - + + GIF: - + Select the engine for processing GIF. waifu2x-ncnn-vulkan [ Speed:★★ Image Quality:★★★ ] waifu2x-converter [ Speed:★☆ Image Quality:★★☆ ] @@ -331,7 +324,7 @@ You can run compatibility test to see which engines your PC is compatible with.< - + Select the engine for processing Image. waifu2x-ncnn-vulkan [ Speed:★★ Image Quality:★★★ ] waifu2x-converter [ Speed:★☆ Image Quality:★★☆ ] @@ -339,7 +332,7 @@ You can run compatibility test to see which engines your PC is compatible with.< - + Select the engine for processing Video. waifu2x-ncnn-vulkan [ Speed:★★ Image Quality:★★★ ] waifu2x-converter [ Speed:★☆ Image Quality:★★☆ ] @@ -348,279 +341,378 @@ You can run compatibility test to see which engines your PC is compatible with.< - - - + + + Image: - - - + + Minimize + + + + + + Hide Text Browser + + + + + + Video: - + + Tile size: This value will affacts GPU memory usage. +Larger tile size means waifu2x will use more GPU memory and run faster. +Smaller tile size means waifu2x will use less GPU memory and run slower. + + + + + waifu2x-converter + + + + + Target processor: + + + + + Block size: This value will affacts GPU memory usage. +Larger Block size means waifu2x will use more GPU memory and run faster. +Smaller Block size means waifu2x will use less GPU memory and run slower. + + + + + Disable GPU + + + + + Block size: + + + + + Force to use OpenCL on Intel Platform. + + + + + Force OpenCL + + + + + Dump processor list + + + + ★★ Donate ★★ - + Wiki - - + + Total:1 - + + May cause loss of +image quality. + + + + + When there are finished files in the list, the finished files will be + processed again when the processing process is started again. + + + + Additional settings - + + Custom Font Settings (Restart the software to take effect) + + + + + Custom font size: + + + + + Enable + + + + + Custom font: + + + + + 宋体 + + + + + Save Custom Font Settings + + + + Compressed ".jpg" image quality: - + + [Text browser] will be automatically hidden when the software starts. + + + + + Always hide Text Browser + + + + 0(worst quality)~99 We recommend you use the default value(90) - + Report issue - - + + About - - Global font size: -(Restart the software to take effect) + + Language: - + Settings will be saved automatically when you close the software. - + Auto save settings - + [Input Path] will be automatically hidden when the software starts. - + Aspect Ratio: (Custom resolution) - - Save - - - - + Ignore Aspect Ratio - + Keep Aspect Ratio - + Keep Aspect Ratio By Expanding - + [Settings] will be automatically hidden when the software starts. - + Always hide Settings - + Donate: - + Check update - + Readme - + Save settings - + Please donate to developers to support continuous updates of this software. - + Run a compatibility test to see which engines your computer is compatible with. - + Compatibility test - + Reset settings - + Number of threads - - + + Internal threads number of GIF. - - + + Internal: - - + + Internal threads number of Video. - + Custom resolution - + Width: - + Height: - + 1.Set the height and width of the resolution. 2.Select a file in the file list. 3.Click the Apply button to set the resolution. - + Apply - + 1.Select a file in the file list. 2.Click the Cancel button to cancel the custom resolution. - + Cancel - - + + We recommend that you restart the software after changing the language for the language settings to fully take effect. - + Input file extensions - - Language - - - - - Current Language: - - - - + Font size: - + Stop - + + Time cost:NULL - + + ETA:NULL - + Clear text browser. - + Clear - + + Time remaining:NULL - + Start @@ -690,26 +782,26 @@ the language for the language settings to fully take effect. - - - + + + Error - + No items are currently selected. - - - - + + + + Warning @@ -725,16 +817,16 @@ the language for the language settings to fully take effect. - - + + The file format is not supported, please enter supported file format, or add more file extensions yourself. - - - - + + + + Notification @@ -754,25 +846,25 @@ Do you wanna update now??? - + YES - + NO - - + + Settings saved successfully! - + The settings file has been reset, please restart the software manually for the default settings to take effect. @@ -785,23 +877,23 @@ Do you wanna update now??? - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + @@ -826,9 +918,9 @@ Do you wanna update now??? - - - + + + @@ -837,22 +929,22 @@ Do you wanna update now??? - + ]. Error: [Cannot convert video format to mp4.] - + ]. Error: [Unable to split video into pictures.] - - + + File name:[ @@ -865,22 +957,22 @@ Do you wanna update now??? - + ]. Error: [Unable to scale all frames.] - + ]. Error: [Unable to assemble pictures into videos.] - - + + @@ -889,152 +981,162 @@ Do you wanna update now??? - + Time cost:[ - + Time remaining:[ - + Unable to start processing files: The file list is empty or there are no available files to process. - + Start processing files. - + Trying to stop, please wait... - + Processing of files has stopped. - + It was detected that the program executed an automatic shutdown of the computer when it was last run. The last File List was automatically saved before the shutdown. You can manually load the File List to view the file processing status. - + Thank you! :) - - + + Input path does not exist. - - - - - - + + + + + + Range:-1(No noise reduction)~3 - - - - - - - Range:0(No noise reduction)~2 + + + + + + + Range:0(No noise reduction)~3 - - + + Anime4K engine does not support noise reduction. - - + + Show settings - - - Show all setting options. - - - - - + + Show input path - + Error: Language files cannot be loaded properly. - + File list is empty! - + Write to the file, please wait. - + Please wait while reading the file. - + Cannot find the saved Files List! - + Do you like using this software? If you like the software, please donate to support the developers to ensure the software is continuously updated. (This popup will only pop up once after the software is installed.) - + We do not recommend that you cancel the automatic check for updates as this may prevent you from receiving timely bug fixes. - - - - + + + + Total:%1 - + Select file open file - + All file( + + + + Show Text Browser + + + + + Detecting available Processor, please wait. + + + + + No available Processor detected! + + ]. Error: [Unable to get video frame rate.] @@ -1097,72 +1199,73 @@ If you like the software, please donate to support the developers to ensure the - + Detecting available GPU, please wait. - + + Detection is complete! - + No available GPU ID detected! - + ]. Error: [Unable to scale the picture.] - + ]. Error: [Unable to resize the scaled picture to the target size] - + ]. Error: [Cannot save scaled picture as .jpg.] - + ]. Error: [Can't get Duration value of GIF file.] - + ]. Error: [Can't split GIF into frames.] - - + + ] Scale and Denoise progress:[ - + ]. Error: [Failed to scale frames.] - + ]. Error: [Unable to assemble gif.] - + ]. Error: [Can't optimize gif.] diff --git a/SRC/Waifu2x-Extension-QT/main.cpp b/SRC/Waifu2x-Extension-QT/main.cpp index 8d9c95e5d..4982e76e1 100644 --- a/SRC/Waifu2x-Extension-QT/main.cpp +++ b/SRC/Waifu2x-Extension-QT/main.cpp @@ -31,31 +31,34 @@ int main(int argc, char *argv[]) /* Change log: -- 新特性:自定义".jpg"文件压缩后的图像质量 -- 完善浏览文件对话框的文件扩展名过滤 -- 更新ImageMagick(7.0.9-22-Q16-x64) +- 新特性: waifu2x-converter 支持更多降噪等级 +- 新特性:新增 waifu2x-converter 引擎自定义设置 +- 新特性:自定义字体 +- 新特性:最小化窗体 +- 新特性:隐藏文本框 +- 更新 waifu2x-converter (v5.3.3) (感谢 NyanMisaka 反馈) +- 界面布局调整 - 提高稳定性 -- 完善简体中文支持 -- 其他改进 -- 修复bug:程序关闭后滞留后台 +- 其他多项改进 +- 修复bug:当文件扩展名大写时无法正确识别(感谢 zhehenkaifa 反馈) +- 修复bug:当视频扩展名为".MP4"而非".mp4"时, 会导致错误 +- 修复bug:当文件名称内有多余的"."时会导致软件错误(感谢 我叫黄伟达 反馈) +- 修复bug:某些特殊情况下无法停止处理 -------------------------------------------------------------------------- To do: -- 完善浏览文件对话框 +- 无损改变图片分辨率 - gif看看能不能组装的时候调整大小 - 视频看看能不能组装时统一调整大小 +- convert试试double的scale - 移动到回收站 -- 潜在的:stop后有的qprocess无法退出 -- 性能优化(重写函数加入return) - 提高稳定性 - 改进剩余时间算法 -- 检测当前所在路径是否要启动管理员权限 -- 写 user guide -- 写注释 - 用python写一个视频的特殊字符路径检测(路径输入到python ext 让他看能不能判断exist) - 放大视频时, 判断磁盘空间够不够, 提取十个帧取平均值然后计算用量 - 分辨率自定义增加apply to all和cancel all - tableview看能不能自动适配大小的同时, 还让用户自主调节 - 扫描子文件夹 +- 隐藏到托盘 */ /* @@ -65,7 +68,7 @@ Integrated component(In releases): - ffmpeg version 4.2.2 - gifsicle version 1.92 - Waifu2x-converter version: 2015-11-30T02:17:24 -- ImageMagick 7.0.9-12-portable-Q16-x64 +- ImageMagick 7.0.9-22-Q16-x64 */ /* diff --git a/SRC/Waifu2x-Extension-QT/mainwindow.cpp b/SRC/Waifu2x-Extension-QT/mainwindow.cpp index 3c81d6bf6..466e26a2b 100644 --- a/SRC/Waifu2x-Extension-QT/mainwindow.cpp +++ b/SRC/Waifu2x-Extension-QT/mainwindow.cpp @@ -29,6 +29,7 @@ MainWindow::MainWindow(QWidget *parent) translator = new QTranslator(this); //============== ui->tabWidget->setCurrentIndex(0);//显示home tab + ui->tabWidget_waifu2xSettings->setCurrentIndex(0); TextBrowser_StartMes();//显示启动msg this->setAcceptDrops(true);//mainwindow接收drop Init_Table();//初始化table @@ -71,6 +72,8 @@ MainWindow::MainWindow(QWidget *parent) connect(this, SIGNAL(Send_CheckUpadte_NewUpdate(QString)), this, SLOT(CheckUpadte_NewUpdate(QString))); connect(this, SIGNAL(Send_SystemShutDown()), this, SLOT(SystemShutDown())); connect(this, SIGNAL(Send_Donate_Notification()), this, SLOT(Donate_Notification())); + //Send_Waifu2x_DumpProcessorList_converter_finished + connect(this, SIGNAL(Send_Waifu2x_DumpProcessorList_converter_finished()), this, SLOT(Waifu2x_DumpProcessorList_converter_finished())); //====== TimeCostTimer = new QTimer(); connect(TimeCostTimer, SIGNAL(timeout()), this, SLOT(TimeSlot())); @@ -82,6 +85,7 @@ MainWindow::MainWindow(QWidget *parent) AutoUpdate = QtConcurrent::run(this, &MainWindow::CheckUpadte_Auto);//自动检查更新线程 SystemShutDown_isAutoShutDown();//上次是否自动关机 Donate_Count();//捐赠统计 + this->adjustSize(); } MainWindow::~MainWindow() @@ -179,7 +183,15 @@ QString MainWindow::Seconds2hms(long unsigned int seconds) void MainWindow::Set_Font_fixed() { - QFont font = qApp->font(); + QFont font; + if(ui->checkBox_isCustFontEnable->checkState()) + { + font = ui->fontComboBox_CustFont->currentFont(); + } + else + { + font = qApp->font(); + } font.setPixelSize(ui->spinBox_GlobalFontSize->value()); qApp->setFont(font); } @@ -248,6 +260,9 @@ void MainWindow::on_pushButton_Start_clicked() ui->comboBox_AspectRatio_custRes->setEnabled(0); ui->spinBox_JPGCompressedQuality->setEnabled(0); progressbar_clear(); + ui->label_TimeCost->setText(tr("Time cost:NULL")); + ui->label_ETA->setText(tr("ETA:NULL")); + ui->label_TimeRemain->setText(tr("Time remaining:NULL")); //========== TimeCostTimer->start(1000); TimeCost=0; @@ -276,12 +291,12 @@ void MainWindow::Wait_waifu2x_stop() if(waifu2x_STOP_confirm||ThreadNumRunning==0) { waifu2x_STOP_confirm = false; - waifu2x_STOP = false; emit TextBrowser_NewMessage(tr("Processing of files has stopped.")); break; } Delay_msec_sleep(300); } + Waifu2xMain.cancel(); emit Send_Waifu2x_Finished_manual(); } /* @@ -631,11 +646,11 @@ void MainWindow::on_comboBox_Engine_Image_currentIndexChanged(int index) } case 1: { - ui->spinBox_DenoiseLevel_image->setRange(0,2); + ui->spinBox_DenoiseLevel_image->setRange(0,3); ui->spinBox_DenoiseLevel_image->setValue(2); ui->spinBox_DenoiseLevel_image->setEnabled(1); - ui->spinBox_DenoiseLevel_image->setToolTip(tr("Range:0(No noise reduction)~2")); - ui->label_ImageDenoiseLevel->setToolTip(tr("Range:0(No noise reduction)~2")); + ui->spinBox_DenoiseLevel_image->setToolTip(tr("Range:0(No noise reduction)~3")); + ui->label_ImageDenoiseLevel->setToolTip(tr("Range:0(No noise reduction)~3")); return; } } @@ -656,11 +671,11 @@ void MainWindow::on_comboBox_Engine_GIF_currentIndexChanged(int index) } case 1: { - ui->spinBox_DenoiseLevel_gif->setRange(0,2); + ui->spinBox_DenoiseLevel_gif->setRange(0,3); ui->spinBox_DenoiseLevel_gif->setValue(2); ui->spinBox_DenoiseLevel_gif->setEnabled(1); - ui->spinBox_DenoiseLevel_gif->setToolTip(tr("Range:0(No noise reduction)~2")); - ui->label_GIFDenoiseLevel->setToolTip(tr("Range:0(No noise reduction)~2")); + ui->spinBox_DenoiseLevel_gif->setToolTip(tr("Range:0(No noise reduction)~3")); + ui->label_GIFDenoiseLevel->setToolTip(tr("Range:0(No noise reduction)~3")); return; } } @@ -681,11 +696,11 @@ void MainWindow::on_comboBox_Engine_Video_currentIndexChanged(int index) } case 1: { - ui->spinBox_DenoiseLevel_video->setRange(0,2); + ui->spinBox_DenoiseLevel_video->setRange(0,3); ui->spinBox_DenoiseLevel_video->setValue(2); ui->spinBox_DenoiseLevel_video->setEnabled(1); - ui->spinBox_DenoiseLevel_video->setToolTip(tr("Range:0(No noise reduction)~2")); - ui->label_VideoDenoiseLevel->setToolTip(tr("Range:0(No noise reduction)~2")); + ui->spinBox_DenoiseLevel_video->setToolTip(tr("Range:0(No noise reduction)~3")); + ui->label_VideoDenoiseLevel->setToolTip(tr("Range:0(No noise reduction)~3")); return; } case 2: @@ -718,6 +733,11 @@ void MainWindow::on_pushButton_compatibilityTest_clicked() ui->pushButton_Start->setEnabled(0); ui->pushButton_compatibilityTest->setEnabled(0); ui->pushButton_DetectGPU->setEnabled(0); + ui->pushButton_DumpProcessorList_converter->setEnabled(0); + if(!ui->textBrowser->isVisible()) + { + on_pushButton_HideTextBro_clicked(); + } QtConcurrent::run(this, &MainWindow::Waifu2x_Compatibility_Test); } @@ -741,13 +761,11 @@ void MainWindow::on_pushButton_HideSettings_clicked() { ui->groupBox_Setting->setVisible(0); ui->pushButton_HideSettings->setText(tr("Show settings")); - ui->pushButton_HideSettings->setToolTip(tr("Show all setting options.")); } else { ui->groupBox_Setting->setVisible(1); ui->pushButton_HideSettings->setText(tr("Hide settings")); - ui->pushButton_HideSettings->setToolTip(tr("Hide all setting options.")); } } @@ -770,6 +788,7 @@ void MainWindow::on_pushButton_DetectGPU_clicked() { ui->pushButton_Start->setEnabled(0); ui->pushButton_DetectGPU->setEnabled(0); + ui->pushButton_DumpProcessorList_converter->setEnabled(0); ui->pushButton_compatibilityTest->setEnabled(0); Available_GPUID.clear(); QtConcurrent::run(this, &MainWindow::Waifu2x_DetectGPU); @@ -1034,7 +1053,6 @@ void MainWindow::on_checkBox_AlwaysHideSettings_stateChanged(int arg1) { ui->groupBox_Setting->setVisible(0); ui->pushButton_HideSettings->setText(tr("Show settings")); - ui->pushButton_HideSettings->setToolTip(tr("Show all setting options.")); } } @@ -1175,3 +1193,143 @@ void MainWindow::on_pushButton_wiki_clicked() { QDesktopServices::openUrl(QUrl("https://github.com/AaronFeng753/Waifu2x-Extension-GUI/wiki")); } +/* +最小化 +*/ +void MainWindow::on_pushButton_Minimize_clicked() +{ + if(ui->groupBox_Input->isVisible())on_pushButton_HideInput_clicked(); + if(ui->groupBox_Setting->isVisible())on_pushButton_HideSettings_clicked(); + if(ui->textBrowser->isVisible())on_pushButton_HideTextBro_clicked(); + this->adjustSize(); +} + +void MainWindow::on_pushButton_HideTextBro_clicked() +{ + if(ui->textBrowser->isVisible()) + { + ui->textBrowser->setVisible(0); + ui->pushButton_HideTextBro->setText(tr("Show Text Browser")); + } + else + { + ui->textBrowser->setVisible(1); + ui->pushButton_HideTextBro->setText(tr("Hide Text Browser")); + } +} + +void MainWindow::on_checkBox_AlwaysHideTextBrowser_stateChanged(int arg1) +{ + if(ui->checkBox_AlwaysHideTextBrowser->checkState()) + { + ui->textBrowser->setVisible(0); + ui->pushButton_HideTextBro->setText(tr("Show Text Browser")); + } +} + +void MainWindow::on_pushButton_DumpProcessorList_converter_clicked() +{ + ui->pushButton_Start->setEnabled(0); + ui->pushButton_DetectGPU->setEnabled(0); + ui->pushButton_DumpProcessorList_converter->setEnabled(0); + ui->pushButton_compatibilityTest->setEnabled(0); + Available_ProcessorList_converter.clear(); + QtConcurrent::run(this, &MainWindow::Waifu2x_DumpProcessorList_converter); +} + +int MainWindow::Waifu2x_DumpProcessorList_converter() +{ + emit Send_TextBrowser_NewMessage(tr("Detecting available Processor, please wait.")); + //=============== + QString InputPath = Current_Path + "/Compatibility_Test/Compatibility_Test.jpg"; + QString OutputPath = Current_Path + "/Compatibility_Test/res.jpg"; + QFile::remove(OutputPath); + //============== + QString Waifu2x_folder_path = Current_Path + "/waifu2x-converter"; + QString program = Waifu2x_folder_path + "/waifu2x-converter-cpp.exe"; + QString model_path= Waifu2x_folder_path + "/models_rgb"; + //========= + int Processor_ID=0; + //========= + while(true) + { + QFile::remove(OutputPath); + QProcess *Waifu2x = new QProcess(); + QString Processor_str = " -p "+QString::number(Processor_ID,10)+" "; + QString cmd = "\"" + program + "\"" + " -i " + "\"" + InputPath + "\"" + " -o " + "\"" + OutputPath + "\"" + " --scale-ratio 2 --noise-level 1 --model-dir " + "\"" + model_path + "\""+Processor_str; + Waifu2x->start(cmd); + while(!Waifu2x->waitForStarted(100)&&!QProcess_stop) {} + while(!Waifu2x->waitForFinished(100)&&!QProcess_stop) {} + if(file_isFileExist(OutputPath)) + { + Available_ProcessorList_converter.append(QString::number(Processor_ID,10)); + Processor_ID++; + QFile::remove(OutputPath); + } + else + { + break; + } + } + QFile::remove(OutputPath); + //=============== + emit Send_TextBrowser_NewMessage(tr("Detection is complete!")); + if(Available_ProcessorList_converter.isEmpty()) + { + Send_TextBrowser_NewMessage(tr("No available Processor detected!")); + } + else + { + QProcess *Waifu2x = new QProcess(); + QString Processor_str = " -p "+QString::number(Processor_ID,10)+" "; + QString cmd = "\"" + program + "\"" + " -l "; + Waifu2x->start(cmd); + while(!Waifu2x->waitForStarted(100)&&!QProcess_stop) {} + while(!Waifu2x->waitForFinished(100)&&!QProcess_stop) {} + ui->textBrowser->append(Waifu2x->readAllStandardOutput()); + } + emit Send_Waifu2x_DumpProcessorList_converter_finished(); + return 0; +} +int MainWindow::Waifu2x_DumpProcessorList_converter_finished() +{ + ui->pushButton_Start->setEnabled(1); + ui->pushButton_DetectGPU->setEnabled(1); + ui->pushButton_compatibilityTest->setEnabled(1); + ui->pushButton_DumpProcessorList_converter->setEnabled(1); + //==== + ui->comboBox_TargetProcessor_converter->clear(); + ui->comboBox_TargetProcessor_converter->addItem("auto"); + if(!Available_ProcessorList_converter.isEmpty()) + { + for(int i=0; icomboBox_TargetProcessor_converter->addItem(Available_ProcessorList_converter.at(i)); + } + } + return 0; +} + +void MainWindow::on_comboBox_TargetProcessor_converter_currentIndexChanged(int index) +{ + if(ui->comboBox_TargetProcessor_converter->currentText()!="auto") + { + Processor_converter_STR = " -p "+ui->comboBox_TargetProcessor_converter->currentText()+" "; + } + else + { + Processor_converter_STR=""; + } +} + +void MainWindow::on_Ext_image_textChanged(const QString &arg1) +{ + QString lower = ui->Ext_image->text().toLower(); + ui->Ext_image->setText(lower); +} + +void MainWindow::on_Ext_video_textChanged(const QString &arg1) +{ + QString lower = ui->Ext_video->text().toLower(); + ui->Ext_video->setText(lower); +} diff --git a/SRC/Waifu2x-Extension-QT/mainwindow.h b/SRC/Waifu2x-Extension-QT/mainwindow.h index 73b563fce..2773ed9a3 100644 --- a/SRC/Waifu2x-Extension-QT/mainwindow.h +++ b/SRC/Waifu2x-Extension-QT/mainwindow.h @@ -50,8 +50,7 @@ #include #include #include - -#include +#include QT_BEGIN_NAMESPACE namespace Ui @@ -69,7 +68,7 @@ class MainWindow : public QMainWindow MainWindow(QWidget *parent = nullptr); //======================= - QString VERSION="v0.37-beta";//软件版本号 + QString VERSION="v0.41-beta";//软件版本号 //======================= QTranslator * translator;//界面翻译 //======= @@ -109,6 +108,7 @@ class MainWindow : public QMainWindow //void file_copyFile(QString sourceDir, QString toDir, bool coverFileIfExist);//复制文件 QStringList file_getFileNames_in_Folder_nofilter(QString path);//读取文件夹内文件列表并返回(无过滤器) bool file_DelDir(const QString &path);//删除文件夹(无论是否为空,强制删除) + QString file_getBaseName(QString path);//获取basename //================================= Table ================================= void Init_Table();//初始化三个tableview @@ -180,7 +180,9 @@ class MainWindow : public QMainWindow QStringList Available_GPUID;//可用GPU ID列表 QString GPU_ID_STR="";//向vulkan命令行cmd插入的gpuid命令,如果auto则为空 - + int Waifu2x_DumpProcessorList_converter(); + QStringList Available_ProcessorList_converter; + QString Processor_converter_STR=""; //================================ progressbar =================================== int Progressbar_MaxVal = 0;//进度条最大值 @@ -309,6 +311,8 @@ public slots: int Donate_Notification();//捐赠弹窗 + int Waifu2x_DumpProcessorList_converter_finished(); + @@ -407,6 +411,20 @@ private slots: void on_pushButton_wiki_clicked(); + void on_pushButton_Minimize_clicked(); + + void on_pushButton_HideTextBro_clicked(); + + void on_checkBox_AlwaysHideTextBrowser_stateChanged(int arg1); + + void on_pushButton_DumpProcessorList_converter_clicked(); + + void on_comboBox_TargetProcessor_converter_currentIndexChanged(int index); + + void on_Ext_image_textChanged(const QString &arg1); + + void on_Ext_video_textChanged(const QString &arg1); + signals: void Send_PrograssBar_Range_min_max(int, int); void Send_progressbar_Add(); @@ -445,6 +463,8 @@ private slots: void Send_Donate_Notification(); + void Send_Waifu2x_DumpProcessorList_converter_finished(); + private: Ui::MainWindow *ui; diff --git a/SRC/Waifu2x-Extension-QT/mainwindow.ui b/SRC/Waifu2x-Extension-QT/mainwindow.ui index b53d86176..3e80f63aa 100644 --- a/SRC/Waifu2x-Extension-QT/mainwindow.ui +++ b/SRC/Waifu2x-Extension-QT/mainwindow.ui @@ -6,8 +6,8 @@ 0 0 - 1518 - 818 + 1548 + 851 @@ -40,7 +40,7 @@ height:35 QTabWidget::Rounded - 1 + 0 @@ -223,19 +223,6 @@ padding:10px; Files List (You can drag and drop files or folders into here) - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -273,6 +260,59 @@ padding:10px; + + + + QPushButton{ +background-color: rgb(26, 188, 156); +color: rgb(255, 255, 255); +border-style:outset; +border-radius:8px; +padding:10px; +} +QPushButton:hover{ +background-color: rgb(29, 214, 177); +color: rgb(255, 255, 255); +border-style:outset; +border-radius:8px; +padding:10px; +} +QPushButton:pressed{ +background-color: rgb(23, 173, 143); +color: rgb(255, 255, 255); +border-style:outset; +border-radius:8px; +padding:10px; +} +QPushButton:disabled{ +background-color: rgb(166, 166, 166); +color: rgb(255, 255, 255); +border-style:outset; +border-radius:8px; +padding:10px; +} + + + Hide input path + + + + + + + + + + QFrame::Box + + + 0 + + + File count: null + + + @@ -316,19 +356,53 @@ padding:10px; - - - - + + + + Qt::Horizontal - - QFrame::Box + + + 40 + 20 + - - 0 + + + + + + QPushButton{ +background-color: rgb(178, 58, 238); +color: rgb(255, 255, 255); +border-style:outset; +border-radius:8px; +padding:10px; +} +QPushButton:hover{ +background-color: rgb(191, 62, 255); +color: rgb(255, 255, 255); +border-style:outset; +border-radius:8px; +padding:10px; +} +QPushButton:pressed{ +background-color: rgb(154, 50, 205); +color: rgb(255, 255, 255); +border-style:outset; +border-radius:8px; +padding:10px; +} +QPushButton:disabled{ +background-color: rgb(166, 166, 166); +color: rgb(255, 255, 255); +border-style:outset; +border-radius:8px; +padding:10px; +} - File count: null + Save Files List @@ -372,31 +446,25 @@ padding:10px; - - - - - 110 - 16777215 - - + + QPushButton{ -background-color: rgb(255, 181, 6); +background-color: rgb(231, 76, 60); color: rgb(255, 255, 255); border-style:outset; border-radius:8px; padding:10px; } QPushButton:hover{ -background-color: rgb(255, 200, 50); +background-color: rgb(255, 102, 64); color: rgb(255, 255, 255); border-style:outset; border-radius:8px; padding:10px; } QPushButton:pressed{ -background-color: rgb(255, 170, 0); +background-color: rgb(204, 65, 53); color: rgb(255, 255, 255); border-style:outset; border-radius:8px; @@ -411,11 +479,11 @@ padding:10px; } - Remove item + Minimize - + @@ -565,13 +633,13 @@ selection-background-color: rgb(178, 58, 238); Arial 13 - 9 + 50 false false - font: 75 13pt "Arial"; + QFrame::Box @@ -593,25 +661,31 @@ selection-background-color: rgb(178, 58, 238); - - + + + + + 110 + 16777215 + + QPushButton{ -background-color: rgb(26, 188, 156); +background-color: rgb(255, 181, 6); color: rgb(255, 255, 255); border-style:outset; border-radius:8px; padding:10px; } QPushButton:hover{ -background-color: rgb(29, 214, 177); +background-color: rgb(255, 200, 50); color: rgb(255, 255, 255); border-style:outset; border-radius:8px; padding:10px; } QPushButton:pressed{ -background-color: rgb(23, 173, 143); +background-color: rgb(255, 170, 0); color: rgb(255, 255, 255); border-style:outset; border-radius:8px; @@ -626,12 +700,32 @@ padding:10px; } - Hide input path + Remove item - - + + + + QFrame::Sunken + + + 1 + + + Qt::Vertical + + + + + + + Qt::Vertical + + + + + QPushButton{ background-color: rgb(178, 58, 238); @@ -663,28 +757,15 @@ padding:10px; } - Save Files List - - - - - - - QFrame::Sunken - - - 1 - - - Qt::Vertical + Hide Text Browser - - + + 0 @@ -694,315 +775,39 @@ padding:10px; 16777215 - 210 + 16777215 - + Settings - - - - - Font size: - - - - - - - Clear text browser. - - - QPushButton{ - background-color: rgb(0, 140, 158); -color: rgb(255, 255, 255); -border-style:outset; -border-radius:8px; -padding:10px; -} -QPushButton:hover{ - background-color: rgb(0, 190, 211); -color: rgb(255, 255, 255); -border-style:outset; -border-radius:8px; -padding:10px; -} -QPushButton:pressed{ - background-color: rgb(0, 108, 120); -color: rgb(255, 255, 255); -border-style:outset; -border-radius:8px; -padding:10px; -} -QPushButton:disabled{ -background-color: rgb(166, 166, 166); -color: rgb(255, 255, 255); -border-style:outset; -border-radius:8px; -padding:10px; -} - - - Clear - - - - - - - - 70 - 16777215 - - - - QPushButton{ -background-color: rgb(231, 76, 60); -color: rgb(255, 255, 255); -border-style:outset; -border-radius:8px; -padding:10px; -} -QPushButton:hover{ -background-color: rgb(255, 102, 64); -color: rgb(255, 255, 255); -border-style:outset; -border-radius:8px; -padding:10px; -} -QPushButton:pressed{ -background-color: rgb(204, 65, 53); -color: rgb(255, 255, 255); -border-style:outset; -border-radius:8px; -padding:10px; -} -QPushButton{ -background-color: rgb(231, 76, 60); -color: rgb(255, 255, 255); -border-style:outset; -border-radius:8px; -padding:10px; -} -QPushButton:hover{ -background-color: rgb(255, 102, 64); -color: rgb(255, 255, 255); -border-style:outset; -border-radius:8px; -padding:10px; -} -QPushButton:disabled{ - background-color: rgb(166, 166, 166); -color: rgb(255, 255, 255); -border-style:outset; -border-radius:8px; -padding:10px; -} - - - Stop - - - - - - - 1 - - - 9 - - - - - - - - 0 - 0 - - - - - 70 - 16777215 - - - - The result images will stay in the same folder of source images. - - - QPushButton{ -background-color: rgb(26, 188, 156); -color: rgb(255, 255, 255); -border-style:outset; -border-radius:8px; -padding:10px; -} -QPushButton:hover{ -background-color: rgb(29, 214, 177); -color: rgb(255, 255, 255); -border-style:outset; -border-radius:8px; -padding:10px; -} -QPushButton:pressed{ -background-color: rgb(23, 173, 143); -color: rgb(255, 255, 255); -border-style:outset; -border-radius:8px; -padding:10px; -} -QPushButton:disabled{ -background-color: rgb(166, 166, 166); -color: rgb(255, 255, 255); -border-style:outset; -border-radius:8px; -padding:10px; -} - - - Start - - - - - - - QFrame::Box - - - 1 - - - ETA:NULL - - - - - - - QFrame::Box - - - 1 - - - Time cost:NULL - - - - - - - QFrame::Box - - - QFrame::Plain - - - 1 - - - 0/0 - - - - - - - QFrame::Box - - - 1 - - - Time remaining:NULL - - - - - - - 0 - - - %p% - - - - - - - - 16777215 - 16777215 - - - - - Arial - - - - false - - - - - - - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - Settings - - - - - - Scale ratio and Denoise level + + + + + Scale ratio and Denoise level - - - - Range: 1 ~ 999999999 - + + - Image Scale ratio: + GIF Denoise level: - - - - ArrowCursor + + + + true Qt::WheelFocus - - Range: 1 ~ 999999999 - - 1 + -1 - 999999999 + 3 1 @@ -1018,25 +823,18 @@ padding:10px; - - - - Qt::Vertical - - - - - + + Range: 1 ~ 999999999 - GIF Scale ratio: + Image Scale ratio: - - + + ArrowCursor @@ -1073,32 +871,26 @@ padding:10px; - - - - Range: 1 ~ 999999999 - - - Video Scale ratio: + + + + Qt::Vertical - - - - ArrowCursor + + + + true Qt::WheelFocus - - Range: 1 ~ 999999999 - - 1 + -1 - 999999999 + 3 1 @@ -1114,26 +906,22 @@ padding:10px; - - - - Image Denoise level: - - - - - - - true + + + + ArrowCursor Qt::WheelFocus + + Range: 1 ~ 999999999 + - -1 + 1 - 3 + 999999999 1 @@ -1149,26 +937,29 @@ padding:10px; - - + + - GIF Denoise level: + Video Denoise level: - - - - true + + + + ArrowCursor Qt::WheelFocus + + Range: 1 ~ 999999999 + - -1 + 1 - 3 + 999999999 1 @@ -1184,15 +975,35 @@ padding:10px; - - + + + + Range: 1 ~ 999999999 + - Video Denoise level: + Video Scale ratio: - - + + + + Range: 1 ~ 999999999 + + + GIF Scale ratio: + + + + + + + Image Denoise level: + + + + + true @@ -1234,188 +1045,16 @@ padding:10px; Engine - - - - waifu2x-ncnn-vulkan - - - - - - - 16777215 - 16777215 - - - - Tile size: This value will affacts GPU memory usage. -Larger tile size means waifu2x will use more GPU memory and run faster. -Smaller tile size means waifu2x will use less GPU memory and run slower. -(Only works when using "waifu2x-ncnn-vulkan" engine.) - - - Tile size: - - - - - - - - 120 - 0 - - - - Only works when using "waifu2x-ncnn-vulkan" engine. Other engines only support "2D Anime" image style. - - - 2D Anime - - - - 2D Anime - - - - - 3D Real-life - - - - - - - - Select the GPU to use when enabling the "waifu2x-ncnn-vulkan" engine. - - - GPU ID: - - - - - - - true - - - Select the GPU to use when enabling the "waifu2x-ncnn-vulkan" engine. - - - auto - - - - auto - - - - - - - - Tile size: This value will affacts GPU memory usage. -Larger tile size means waifu2x will use more GPU memory and run faster. -Smaller tile size means waifu2x will use less GPU memory and run slower. -(Only works when using "waifu2x-ncnn-vulkan" engine.) - - - 10 - - - 10000 - - - 10 - - - 200 - - - - - - - - 16777215 - 16777215 - - - - Only works when using "waifu2x-ncnn-vulkan" engine. Other engines only support "2D Anime" image style. - - - Image Style: - - - - - - - true - - - QPushButton{ -background-color: rgb(178, 58, 238); -color: rgb(255, 255, 255); -border-style:outset; -border-radius:8px; -padding:10px; -} -QPushButton:hover{ -background-color: rgb(191, 62, 255); -color: rgb(255, 255, 255); -border-style:outset; -border-radius:8px; -padding:10px; -} -QPushButton:pressed{ -background-color: rgb(154, 50, 205); -color: rgb(255, 255, 255); -border-style:outset; -border-radius:8px; -padding:10px; -} -QPushButton:disabled{ -background-color: rgb(166, 166, 166); -color: rgb(255, 255, 255); -border-style:outset; -border-radius:8px; -padding:10px; -} - - - Detect available GPU ID - - - - - - - - - - - 16777215 - 16777215 - - - - GIF: - - - - - + + true - Select the engine for processing GIF. + Select the engine for processing Video. waifu2x-ncnn-vulkan [ Speed:★★ Image Quality:★★★ ] waifu2x-converter [ Speed:★☆ Image Quality:★★☆ ] +Anime4k [ Speed:★★★ Image Quality:☆ ] You can run compatibility test to see which engines your PC is compatible with. @@ -1431,21 +1070,20 @@ You can run compatibility test to see which engines your PC is compatible with.< waifu2x-converter + + + Anime4k + + - - + + true - - - 200 - 0 - - - Select the engine for processing Image. + Select the engine for processing GIF. waifu2x-ncnn-vulkan [ Speed:★★ Image Quality:★★★ ] waifu2x-converter [ Speed:★☆ Image Quality:★★☆ ] You can run compatibility test to see which engines your PC is compatible with. @@ -1465,16 +1103,34 @@ You can run compatibility test to see which engines your PC is compatible with.< - - + + + + + 16777215 + 16777215 + + + + Video: + + + + + true + + + 200 + 0 + + - Select the engine for processing Video. + Select the engine for processing Image. waifu2x-ncnn-vulkan [ Speed:★★ Image Quality:★★★ ] waifu2x-converter [ Speed:★☆ Image Quality:★★☆ ] -Anime4k [ Speed:★★★ Image Quality:☆ ] You can run compatibility test to see which engines your PC is compatible with. @@ -1490,15 +1146,10 @@ You can run compatibility test to see which engines your PC is compatible with.< waifu2x-converter - - - Anime4k - - - - + + 16777215 @@ -1506,12 +1157,12 @@ You can run compatibility test to see which engines your PC is compatible with.< - Image: + GIF: - - + + 16777215 @@ -1519,60 +1170,349 @@ You can run compatibility test to see which engines your PC is compatible with.< - Video: + Image: - - - - - - - - 0 - 0 - - - - - 250 - 16777215 - - - - - - - - - - - 9 - 50 - false - false - false - false - + + + + QTabBar::tab{ +height:28 +} - - Please donate to developers to support continuous updates of this software. + + 1 - - QPushButton{ -background-color: rgb(231, 76, 60); -color: rgb(255, 255, 255); -border-style:outset; -border-radius:8px; -padding:10px; -} -QPushButton:hover{ -background-color: rgb(255, 102, 64); -color: rgb(255, 255, 255); -border-style:outset; -border-radius:8px; -padding:10px; + + true + + + false + + + false + + + false + + + + waifu2x-ncnn-vulkan + + + + + + + 16777215 + 16777215 + + + + Only works when using "waifu2x-ncnn-vulkan" engine. Other engines only support "2D Anime" image style. + + + Image Style: + + + + + + + + 120 + 0 + + + + Only works when using "waifu2x-ncnn-vulkan" engine. Other engines only support "2D Anime" image style. + + + 2D Anime + + + + 2D Anime + + + + + 3D Real-life + + + + + + + + + 16777215 + 16777215 + + + + Tile size: This value will affacts GPU memory usage. +Larger tile size means waifu2x will use more GPU memory and run faster. +Smaller tile size means waifu2x will use less GPU memory and run slower. +(Only works when using "waifu2x-ncnn-vulkan" engine.) + + + Tile size: + + + + + + + Tile size: This value will affacts GPU memory usage. +Larger tile size means waifu2x will use more GPU memory and run faster. +Smaller tile size means waifu2x will use less GPU memory and run slower. + + + 10 + + + 10000 + + + 10 + + + 200 + + + + + + + Select the GPU to use when enabling the "waifu2x-ncnn-vulkan" engine. + + + GPU ID: + + + + + + + true + + + Select the GPU to use when enabling the "waifu2x-ncnn-vulkan" engine. + + + auto + + + + auto + + + + + + + + true + + + QPushButton{ +background-color: rgb(178, 58, 238); +color: rgb(255, 255, 255); +border-style:outset; +border-radius:8px; +padding:10px; +} +QPushButton:hover{ +background-color: rgb(191, 62, 255); +color: rgb(255, 255, 255); +border-style:outset; +border-radius:8px; +padding:10px; +} +QPushButton:pressed{ +background-color: rgb(154, 50, 205); +color: rgb(255, 255, 255); +border-style:outset; +border-radius:8px; +padding:10px; +} +QPushButton:disabled{ +background-color: rgb(166, 166, 166); +color: rgb(255, 255, 255); +border-style:outset; +border-radius:8px; +padding:10px; +} + + + Detect available GPU ID + + + + + + + + waifu2x-converter + + + + + + Target processor: + + + + + + + true + + + + auto + + + + + + + + Block size: This value will affacts GPU memory usage. +Larger Block size means waifu2x will use more GPU memory and run faster. +Smaller Block size means waifu2x will use less GPU memory and run slower. + + + 1 + + + 999999999 + + + 300 + + + + + + + Disable GPU + + + + + + + Block size: + + + + + + + Force to use OpenCL on Intel Platform. + + + Force OpenCL + + + + + + + true + + + QPushButton{ + background-color: rgb(238, 119, 133); +color: rgb(255, 255, 255); +border-style:outset; +border-radius:8px; +padding:10px; +} +QPushButton:hover{ + background-color: rgb(255, 127, 144); +color: rgb(255, 255, 255); +border-style:outset; +border-radius:8px; +padding:10px; +} +QPushButton:pressed{ + background-color: rgb(226, 112, 128); +color: rgb(255, 255, 255); +border-style:outset; +border-radius:8px; +padding:10px; +} +QPushButton:disabled{ +background-color: rgb(166, 166, 166); +color: rgb(255, 255, 255); +border-style:outset; +border-radius:8px; +padding:10px; +} + + + Dump processor list + + + + + + + + + + + + + + + 0 + 0 + + + + + 250 + 16777215 + + + + + + + + + + + 9 + 50 + false + false + false + false + + + + Please donate to developers to support continuous updates of this software. + + + QPushButton{ +background-color: rgb(231, 76, 60); +color: rgb(255, 255, 255); +border-style:outset; +border-radius:8px; +padding:10px; +} +QPushButton:hover{ +background-color: rgb(255, 102, 64); +color: rgb(255, 255, 255); +border-style:outset; +border-radius:8px; +padding:10px; } QPushButton:pressed{ background-color: rgb(204, 65, 53); @@ -1594,28 +1534,25 @@ padding:10px; - - - - Run a compatibility test to see which engines your computer is compatible with. - + + QPushButton{ - background-color: rgb(92, 172, 238); +background-color: rgb(178, 58, 238); color: rgb(255, 255, 255); border-style:outset; border-radius:8px; padding:10px; } QPushButton:hover{ - background-color: rgb(99, 184, 255); +background-color: rgb(191, 62, 255); color: rgb(255, 255, 255); border-style:outset; border-radius:8px; padding:10px; } QPushButton:pressed{ -background-color: rgb(79, 148,205); +background-color: rgb(154, 50, 205); color: rgb(255, 255, 255); border-style:outset; border-radius:8px; @@ -1630,35 +1567,32 @@ padding:10px; } - Compatibility test + Wiki - - - - - 9 - false - + + + + Run a compatibility test to see which engines your computer is compatible with. QPushButton{ -background-color: rgb(26, 188, 156); + background-color: rgb(92, 172, 238); color: rgb(255, 255, 255); border-style:outset; border-radius:8px; padding:10px; } QPushButton:hover{ -background-color: rgb(29, 214, 177); + background-color: rgb(99, 184, 255); color: rgb(255, 255, 255); border-style:outset; border-radius:8px; padding:10px; } QPushButton:pressed{ -background-color: rgb(23, 173, 143); +background-color: rgb(79, 148,205); color: rgb(255, 255, 255); border-style:outset; border-radius:8px; @@ -1673,29 +1607,35 @@ padding:10px; } - Check update + Compatibility test - - + + + + + 9 + false + + QPushButton{ -background-color: rgb(178, 58, 238); +background-color: rgb(26, 188, 156); color: rgb(255, 255, 255); border-style:outset; border-radius:8px; padding:10px; } QPushButton:hover{ -background-color: rgb(191, 62, 255); +background-color: rgb(29, 214, 177); color: rgb(255, 255, 255); border-style:outset; border-radius:8px; padding:10px; } QPushButton:pressed{ -background-color: rgb(154, 50, 205); +background-color: rgb(23, 173, 143); color: rgb(255, 255, 255); border-style:outset; border-radius:8px; @@ -1710,7 +1650,7 @@ padding:10px; } - Wiki + Check update @@ -1732,50 +1672,50 @@ padding:10px; Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - 50 - 16777215 - - + + - + Internal threads number of Video. - - + + 1 - - + + 1000 - - Image: + + 1 + + + 1 - - - - Qt::Horizontal + + + + QFrame::Box + + + Total:1 - - - + + + 50 16777215 - GIF: + Video: - - + + 1 @@ -1790,8 +1730,28 @@ padding:10px; - - + + + + + 50 + 16777215 + + + + GIF: + + + + + + + Qt::Horizontal + + + + + 70 @@ -1805,18 +1765,15 @@ padding:10px; - Internal threads number of GIF. + Internal threads number of Video. Internal: - - - - Internal threads number of GIF. - + + 1 @@ -1831,26 +1788,32 @@ padding:10px; - - - - QFrame::Box - - - Total:1 + + + + Qt::Horizontal - - + + 50 16777215 + + + + + + + + + - Video: + Image: @@ -1870,8 +1833,8 @@ padding:10px; - - + + 70 @@ -1885,17 +1848,17 @@ padding:10px; - Internal threads number of Video. + Internal threads number of GIF. Internal: - - + + - Internal threads number of Video. + Internal threads number of GIF. 1 @@ -1921,29 +1884,6 @@ padding:10px; - - - - Qt::Horizontal - - - - - - - 1 - - - 1000 - - - 1 - - - 1 - - - @@ -1965,20 +1905,6 @@ padding:10px; Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - Width: - - - - - - - Height: - - - @@ -2021,6 +1947,46 @@ padding:10px; + + + + 1 + + + 999999999 + + + 100 + + + + + + + 1 + + + 999999999 + + + 100 + + + + + + + Height: + + + + + + + Width: + + + @@ -2076,29 +2042,14 @@ padding:10px; - - - - 1 - - - 999999999 - - - 100 - - - - - - - 1 - - - 999999999 + + + + QFrame::NoFrame - - 100 + + May cause loss of +image quality. @@ -2111,16 +2062,13 @@ padding:10px; - - + + - Output internal Scale and Denoise progress of GIF and video process inside textbrowser. + Automatically shut down the computer after processing all files in the list. - Show internal progress - - - true + Turn off computer when finished @@ -2134,47 +2082,37 @@ padding:10px; - - - - Delete the original file after processing is complete. - - - Delete original files - - - - When there are finished files in the list, the finished files will be processed again when the processing process is started again. + When there are finished files in the list, the finished files will be + processed again when the processing process is started again. Re-process finished files - - + + - Play Notification sound when all files in the list have been processed. + Output internal Scale and Denoise progress of GIF and video process inside textbrowser. - Notification sound + Show internal progress true - - + + - Optimizing the scaled gif will slightly reduce the image quality, but it can reduce the GIF file size. -It is recommended to enable this option. + Delete the original file after processing is complete. - Optimize ".gif" + Delete original files @@ -2191,13 +2129,27 @@ It is recommended to enable this option. - - + + - Automatically shut down the computer after processing all files in the list. + Optimizing the scaled gif will slightly reduce the image quality, but it can reduce the GIF file size. +It is recommended to enable this option. - Turn off computer when finished + Optimize ".gif" + + + + + + + Play Notification sound when all files in the list have been processed. + + + Notification sound + + + true @@ -2207,6 +2159,288 @@ It is recommended to enable this option. + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 60 + + + + + + + + + + 1 + + + 9 + + + + + + + QFrame::Box + + + 1 + + + Time cost:NULL + + + + + + + + 70 + 16777215 + + + + QPushButton{ +background-color: rgb(231, 76, 60); +color: rgb(255, 255, 255); +border-style:outset; +border-radius:8px; +padding:10px; +} +QPushButton:hover{ +background-color: rgb(255, 102, 64); +color: rgb(255, 255, 255); +border-style:outset; +border-radius:8px; +padding:10px; +} +QPushButton:pressed{ +background-color: rgb(204, 65, 53); +color: rgb(255, 255, 255); +border-style:outset; +border-radius:8px; +padding:10px; +} +QPushButton{ +background-color: rgb(231, 76, 60); +color: rgb(255, 255, 255); +border-style:outset; +border-radius:8px; +padding:10px; +} +QPushButton:hover{ +background-color: rgb(255, 102, 64); +color: rgb(255, 255, 255); +border-style:outset; +border-radius:8px; +padding:10px; +} +QPushButton:disabled{ + background-color: rgb(166, 166, 166); +color: rgb(255, 255, 255); +border-style:outset; +border-radius:8px; +padding:10px; +} + + + Stop + + + + + + + QFrame::Box + + + 1 + + + ETA:NULL + + + + + + + Font size: + + + + + + + 0 + + + %p% + + + + + + + + 0 + 0 + + + + + 70 + 16777215 + + + + The result images will stay in the same folder of source images. + + + QPushButton{ +background-color: rgb(26, 188, 156); +color: rgb(255, 255, 255); +border-style:outset; +border-radius:8px; +padding:10px; +} +QPushButton:hover{ +background-color: rgb(29, 214, 177); +color: rgb(255, 255, 255); +border-style:outset; +border-radius:8px; +padding:10px; +} +QPushButton:pressed{ +background-color: rgb(23, 173, 143); +color: rgb(255, 255, 255); +border-style:outset; +border-radius:8px; +padding:10px; +} +QPushButton:disabled{ +background-color: rgb(166, 166, 166); +color: rgb(255, 255, 255); +border-style:outset; +border-radius:8px; +padding:10px; +} + + + Start + + + + + + + QFrame::Box + + + QFrame::Plain + + + 1 + + + 0/0 + + + + + + + QFrame::Box + + + 1 + + + Time remaining:NULL + + + + + + + Clear text browser. + + + QPushButton{ + background-color: rgb(0, 140, 158); +color: rgb(255, 255, 255); +border-style:outset; +border-radius:8px; +padding:10px; +} +QPushButton:hover{ + background-color: rgb(0, 190, 211); +color: rgb(255, 255, 255); +border-style:outset; +border-radius:8px; +padding:10px; +} +QPushButton:pressed{ + background-color: rgb(0, 108, 120); +color: rgb(255, 255, 255); +border-style:outset; +border-radius:8px; +padding:10px; +} +QPushButton:disabled{ +background-color: rgb(166, 166, 166); +color: rgb(255, 255, 255); +border-style:outset; +border-radius:8px; +padding:10px; +} + + + Clear + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 170 + + + + + Arial + + + + false + + + @@ -2217,8 +2451,8 @@ It is recommended to enable this option. Additional settings - - + + @@ -2229,7 +2463,7 @@ It is recommended to enable this option. 0 - 350 + 380 @@ -2263,86 +2497,26 @@ It is recommended to enable this option. - - + + - 1000 - 200 + 16777215 + 260 - + - - - Language - - - - - - - 16777215 - 16777215 - - - - We recommend that you restart the software after changing -the language for the language settings to fully take effect. - - - Current Language: - - - - - - - - 150 - 0 - - - - We recommend that you restart the software after changing -the language for the language settings to fully take effect. - - - English - - - - English - - - - - 简体中文 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - + + + 528 + 16777215 + + Input file extensions @@ -2408,139 +2582,37 @@ the language for the language settings to fully take effect. - - - - - - - - - - - - - - 0 - 0 - - - - Automatically check for updates on startup. - - - Automatically check update - - - true - - - - - - - Aspect Ratio: -(Custom resolution) - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - Settings will be saved automatically when you close the software. - - - Auto save settings - - - true - - - - - - - When the file processing status changes, the file list scrolls automatically. - - - File list scrolls automatically - - - true - - - - - - - [Input Path] will be automatically hidden when the software starts. - - - Always hide Input path - - - - - - - Global font size: -(Restart the software to take effect) - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - + + + - 280 - 0 + 200 + 16777215 - - 0 + + - - - Ignore Aspect Ratio - - - - - Keep Aspect Ratio - - - - - Keep Aspect Ratio By Expanding - - - - - - - - QPushButton{ -background-color: rgb(26, 188, 156); + + + + + QPushButton{ +background-color: rgb(238, 99, 99); color: rgb(255, 255, 255); border-style:outset; border-radius:8px; padding:10px; } QPushButton:hover{ -background-color: rgb(29, 214, 177); +background-color: rgb(255, 106, 106); color: rgb(255, 255, 255); border-style:outset; border-radius:8px; padding:10px; } QPushButton:pressed{ -background-color: rgb(23, 173, 143); +background-color: rgb(205, 85, 85); color: rgb(255, 255, 255); border-style:outset; border-radius:8px; @@ -2553,93 +2625,36 @@ border-style:outset; border-radius:8px; padding:10px; } - - - Save - - - - - - - 1 - - - 999 - - - 15 - - - - - - - Compressed ".jpg" image quality: - - - - - - - 0(worst quality)~99 -We recommend you use the default value(90) - - - 0 - - - 90 - - - - - - - [Settings] will be automatically hidden when the software starts. - - - Always hide Settings - - - - - - - - - - - 200 - 16777215 - - - - - - - - - - true - - - QPushButton{ -background-color: rgb(178, 58, 238); + + + Reset settings + + + + + + + + false + + + + QPushButton{ +background-color: rgb(255, 181, 6); color: rgb(255, 255, 255); border-style:outset; border-radius:8px; padding:10px; } QPushButton:hover{ -background-color: rgb(191, 62, 255); +background-color: rgb(255, 200, 50); color: rgb(255, 255, 255); border-style:outset; border-radius:8px; padding:10px; } QPushButton:pressed{ -background-color: rgb(154, 50, 205); +background-color: rgb(255, 170, 0); color: rgb(255, 255, 255); border-style:outset; border-radius:8px; @@ -2652,36 +2667,31 @@ border-style:outset; border-radius:8px; padding:10px; } - - - Save settings - - - - - - - - false - - - - QPushButton{ -background-color: rgb(231, 76, 60); + + + Readme + + + + + + + QPushButton{ +background-color: rgb(52, 152, 219); color: rgb(255, 255, 255); border-style:outset; border-radius:8px; padding:10px; } QPushButton:hover{ -background-color: rgb(255, 102, 64); +background-color: rgb(60, 177, 255); color: rgb(255, 255, 255); border-style:outset; border-radius:8px; padding:10px; } QPushButton:pressed{ -background-color: rgb(204, 65, 53); +background-color: rgb(45, 134, 193); color: rgb(255, 255, 255); border-style:outset; border-radius:8px; @@ -2694,31 +2704,34 @@ border-style:outset; border-radius:8px; padding:10px; } - - - Report issue - - - - - - - QPushButton{ -background-color: rgb(238, 99, 99); + + + About + + + + + + + true + + + QPushButton{ +background-color: rgb(178, 58, 238); color: rgb(255, 255, 255); border-style:outset; border-radius:8px; padding:10px; } QPushButton:hover{ -background-color: rgb(255, 106, 106); +background-color: rgb(191, 62, 255); color: rgb(255, 255, 255); border-style:outset; border-radius:8px; padding:10px; } QPushButton:pressed{ -background-color: rgb(205, 85, 85); +background-color: rgb(154, 50, 205); color: rgb(255, 255, 255); border-style:outset; border-radius:8px; @@ -2731,36 +2744,36 @@ border-style:outset; border-radius:8px; padding:10px; } - - - Reset settings - - - - - - - - false - - - - QPushButton{ -background-color: rgb(255, 181, 6); + + + Save settings + + + + + + + + false + + + + QPushButton{ +background-color: rgb(231, 76, 60); color: rgb(255, 255, 255); border-style:outset; border-radius:8px; padding:10px; } QPushButton:hover{ -background-color: rgb(255, 200, 50); +background-color: rgb(255, 102, 64); color: rgb(255, 255, 255); border-style:outset; border-radius:8px; padding:10px; } QPushButton:pressed{ -background-color: rgb(255, 170, 0); +background-color: rgb(204, 65, 53); color: rgb(255, 255, 255); border-style:outset; border-radius:8px; @@ -2773,31 +2786,85 @@ border-style:outset; border-radius:8px; padding:10px; } - - - Readme - + + + Report issue + + + + - - - - QPushButton{ -background-color: rgb(52, 152, 219); + + + + Custom Font Settings (Restart the software to take effect) + + + + + + Custom font size: + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + Enable + + + + + + + Custom font: + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + 宋体 + + + + 宋体 + + + + + + + + + 16777215 + 16777215 + + + + QPushButton{ +background-color: rgb(26, 188, 156); color: rgb(255, 255, 255); border-style:outset; border-radius:8px; padding:10px; } QPushButton:hover{ -background-color: rgb(60, 177, 255); +background-color: rgb(29, 214, 177); color: rgb(255, 255, 255); border-style:outset; border-radius:8px; padding:10px; } QPushButton:pressed{ -background-color: rgb(45, 134, 193); +background-color: rgb(23, 173, 143); color: rgb(255, 255, 255); border-style:outset; border-radius:8px; @@ -2810,10 +2877,220 @@ border-style:outset; border-radius:8px; padding:10px; } + + + Save Custom Font Settings + + + + + + + + 16777215 + 16777215 + + + + 1 + + + 999 + + + 15 + + + + + + + + + + - - About - + + + + + + 0 + 0 + + + + Automatically check for updates on startup. + + + Automatically check update + + + true + + + + + + + 0(worst quality)~99 +We recommend you use the default value(90) + + + 0 + + + 90 + + + + + + + + 280 + 0 + + + + 0 + + + + Ignore Aspect Ratio + + + + + Keep Aspect Ratio + + + + + Keep Aspect Ratio By Expanding + + + + + + + + Compressed ".jpg" image quality: + + + + + + + Aspect Ratio: +(Custom resolution) + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 16777215 + 16777215 + + + + We recommend that you restart the software after changing +the language for the language settings to fully take effect. + + + Language: + + + + + + + + 150 + 0 + + + + We recommend that you restart the software after changing +the language for the language settings to fully take effect. + + + English + + + + English + + + + + 简体中文 + + + + + + + + [Input Path] will be automatically hidden when the software starts. + + + Always hide Input path + + + + + + + When the file processing status changes, the file list scrolls automatically. + + + File list scrolls automatically + + + true + + + + + + + [Settings] will be automatically hidden when the software starts. + + + Always hide Settings + + + + + + + Settings will be saved automatically when you close the software. + + + Auto save settings + + + true + + + + + + + [Text browser] will be automatically hidden when the software starts. + + + Always hide Text Browser + + + + diff --git a/SRC/Waifu2x-Extension-QT/settings.cpp b/SRC/Waifu2x-Extension-QT/settings.cpp index e5422f8b4..df2efdcf2 100644 --- a/SRC/Waifu2x-Extension-QT/settings.cpp +++ b/SRC/Waifu2x-Extension-QT/settings.cpp @@ -29,6 +29,7 @@ int MainWindow::Settings_Save() QFile::remove(settings_ini); //================= QSettings *configIniWrite = new QSettings(settings_ini, QSettings::IniFormat); + configIniWrite->setIniCodec(QTextCodec::codecForName("UTF-8")); //================= 添加警告 ========================= configIniWrite->setValue("/Warning/EN", "Do not modify this file! It may cause the program to crash! If problems occur after the modification, delete this article and restart the program."); //==================== 存储版本识别 ================================== @@ -56,6 +57,9 @@ int MainWindow::Settings_Save() configIniWrite->setValue("/settings/VideoEngine", ui->comboBox_Engine_Video->currentIndex()); configIniWrite->setValue("/settings/ImageStyle", ui->comboBox_ImageStyle->currentIndex()); configIniWrite->setValue("/settings/TileSize", ui->spinBox_TileSize->value()); + configIniWrite->setValue("/settings/BlockSizeConverter", ui->spinBox_BlockSize_converter->value()); + configIniWrite->setValue("/settings/DisableGPUConverter", ui->checkBox_DisableGPU_converter->checkState()); + configIniWrite->setValue("/settings/ForceOpenCLConverter", ui->checkBox_ForceOpenCL_converter->checkState()); //================== 存储 扩展名 ================================= configIniWrite->setValue("/settings/ImageEXT", ui->Ext_image->text()); configIniWrite->setValue("/settings/VideoEXT", ui->Ext_video->text()); @@ -72,13 +76,16 @@ int MainWindow::Settings_Save() configIniWrite->setValue("/settings/AutoSaveSettings", ui->checkBox_AutoSaveSettings->checkState()); configIniWrite->setValue("/settings/AlwaysHideInput", ui->checkBox_AlwaysHideInput->checkState()); configIniWrite->setValue("/settings/AlwaysHideSettings", ui->checkBox_AlwaysHideSettings->checkState()); + configIniWrite->setValue("/settings/AlwaysHideTextBrowser", ui->checkBox_AlwaysHideTextBrowser->checkState()); configIniWrite->setValue("/settings/JPGCompressedQuality", ui->spinBox_JPGCompressedQuality->value()); //===================== 存储 textbrowser 设置 ===================== configIniWrite->setValue("/settings/TextBrowserFontSize", ui->spinBox_textbrowser_fontsize->value()); //===================== 存储语言设置 ================================ configIniWrite->setValue("/settings/Language", ui->comboBox_language->currentIndex()); - //================== 存储全局字体大小 ========================= + //================== 存储全局字体 ========================= configIniWrite->setValue("/settings/GlobalFontSize", ui->spinBox_GlobalFontSize->value()); + configIniWrite->setValue("/settings/CustFont", ui->fontComboBox_CustFont->currentFont()); + configIniWrite->setValue("/settings/CustFont_isEnabled", ui->checkBox_isCustFontEnable->checkState()); //========== Send_TextBrowser_NewMessage(tr("Settings saved successfully!")); return 0; @@ -102,6 +109,7 @@ int MainWindow::Settings_Read_Apply() on_checkBox_ReProcFinFiles_stateChanged(0); on_checkBox_AlwaysHideInput_stateChanged(0); on_checkBox_AlwaysHideSettings_stateChanged(0); + on_checkBox_AlwaysHideTextBrowser_stateChanged(0); //==== on_comboBox_GPUID_currentIndexChanged(0); on_comboBox_Engine_GIF_currentIndexChanged(0); @@ -124,6 +132,7 @@ int MainWindow::Settings_Read_Apply() else { QSettings *configIniRead_ver = new QSettings(settings_ini, QSettings::IniFormat); + configIniRead_ver->setIniCodec(QTextCodec::codecForName("UTF-8")); QString Settings_VERSION = configIniRead_ver->value("/settings/VERSION").toString(); if(Settings_VERSION!=VERSION) { @@ -137,6 +146,7 @@ int MainWindow::Settings_Read_Apply() on_checkBox_ReProcFinFiles_stateChanged(0); on_checkBox_AlwaysHideInput_stateChanged(0); on_checkBox_AlwaysHideSettings_stateChanged(0); + on_checkBox_AlwaysHideTextBrowser_stateChanged(0); //==== on_comboBox_GPUID_currentIndexChanged(0); on_comboBox_Engine_GIF_currentIndexChanged(0); @@ -159,8 +169,11 @@ int MainWindow::Settings_Read_Apply() } //================= QSettings *configIniRead = new QSettings(settings_ini, QSettings::IniFormat); - //=================== 加载全局字体大小设置 ========================= + configIniRead->setIniCodec(QTextCodec::codecForName("UTF-8")); + //=================== 加载全局字体设置 ========================= ui->spinBox_GlobalFontSize->setValue(configIniRead->value("/settings/GlobalFontSize").toInt()); + ui->fontComboBox_CustFont->setCurrentFont(configIniRead->value("/settings/CustFont").value()); + ui->checkBox_isCustFontEnable->setChecked(configIniRead->value("/settings/CustFont_isEnabled").toBool()); Set_Font_fixed(); //======= 加载放大值和降噪值 ====== ui->spinBox_ScaleRatio_image->setValue(configIniRead->value("/settings/ImageScaleRatio").toInt()); @@ -182,6 +195,9 @@ int MainWindow::Settings_Read_Apply() ui->comboBox_Engine_Video->setCurrentIndex(configIniRead->value("/settings/VideoEngine").toInt()); ui->comboBox_ImageStyle->setCurrentIndex(configIniRead->value("/settings/ImageStyle").toInt()); ui->spinBox_TileSize->setValue(configIniRead->value("/settings/TileSize").toInt()); + ui->spinBox_BlockSize_converter->setValue(configIniRead->value("/settings/BlockSizeConverter").toInt()); + ui->checkBox_DisableGPU_converter->setChecked(configIniRead->value("/settings/DisableGPUConverter").toBool()); + ui->checkBox_ForceOpenCL_converter->setChecked(configIniRead->value("/settings/ForceOpenCLConverter").toBool()); //================= 加载 扩展名 =========================== ui->Ext_image->setText(configIniRead->value("/settings/ImageEXT").toString()); ui->Ext_video->setText(configIniRead->value("/settings/VideoEXT").toString()); @@ -198,6 +214,7 @@ int MainWindow::Settings_Read_Apply() ui->checkBox_AutoSaveSettings->setChecked(configIniRead->value("/settings/AutoSaveSettings").toBool()); ui->checkBox_AlwaysHideInput->setChecked(configIniRead->value("/settings/AlwaysHideInput").toBool()); ui->checkBox_AlwaysHideSettings->setChecked(configIniRead->value("/settings/AlwaysHideSettings").toBool()); + ui->checkBox_AlwaysHideTextBrowser->setChecked(configIniRead->value("/settings/AlwaysHideTextBrowser").toBool()); ui->spinBox_JPGCompressedQuality->setValue(configIniRead->value("/settings/JPGCompressedQuality").toInt()); //=================== 加载 textbrowser 设置 ========================== ui->spinBox_textbrowser_fontsize->setValue(configIniRead->value("/settings/TextBrowserFontSize").toInt()); @@ -209,6 +226,7 @@ int MainWindow::Settings_Read_Apply() on_checkBox_ReProcFinFiles_stateChanged(0); on_checkBox_AlwaysHideInput_stateChanged(0); on_checkBox_AlwaysHideSettings_stateChanged(0); + on_checkBox_AlwaysHideTextBrowser_stateChanged(0); //==== on_comboBox_GPUID_currentIndexChanged(0); on_comboBox_Engine_GIF_currentIndexChanged(0); diff --git a/SRC/Waifu2x-Extension-QT/video.cpp b/SRC/Waifu2x-Extension-QT/video.cpp index 1c97e0fcc..44c553599 100644 --- a/SRC/Waifu2x-Extension-QT/video.cpp +++ b/SRC/Waifu2x-Extension-QT/video.cpp @@ -61,7 +61,7 @@ void MainWindow::video_video2images(QString VideoPath,QString FrameFolderPath,QS { video_dir = video_dir.left(video_dir.length() - 1); } - QString video_filename = vfinfo.baseName(); + QString video_filename = file_getBaseName(vfinfo.filePath()); QString video_ext = vfinfo.suffix(); QString video_mp4_fullpath = video_dir+"/"+video_filename+".mp4"; //============== @@ -111,7 +111,7 @@ int MainWindow::video_images2video(QString VideoPath,QString video_mp4_scaled_fu { video_dir = video_dir.left(video_dir.length() - 1); } - QString video_filename = vfinfo.baseName(); + QString video_filename = file_getBaseName(vfinfo.filePath()); QString video_ext = vfinfo.suffix(); int fps = video_get_fps(VideoPath); if(fps<=0) diff --git a/SRC/Waifu2x-Extension-QT/waifu2x.cpp b/SRC/Waifu2x-Extension-QT/waifu2x.cpp index e913fa282..8c1163498 100644 --- a/SRC/Waifu2x-Extension-QT/waifu2x.cpp +++ b/SRC/Waifu2x-Extension-QT/waifu2x.cpp @@ -272,10 +272,10 @@ int MainWindow::Waifu2x_Compatibility_Test() QFile::remove(OutputPath); //================ Waifu2x_folder_path = Current_Path + "/waifu2x-converter"; - program = Waifu2x_folder_path + "/waifu2x-converter_x64.exe"; + program = Waifu2x_folder_path + "/waifu2x-converter-cpp.exe"; model_path= Waifu2x_folder_path + "/models_rgb"; - QString Denoise_cmd = " --noise_level 1 "; - cmd = "\"" + program + "\"" + " -i " + "\"" + InputPath + "\"" + " -o " + "\"" + OutputPath + "\"" + " --scale_ratio 2" + Denoise_cmd + " --model_dir " + "\"" + model_path + "\""; + QString Denoise_cmd = " --noise-level 1 "; + cmd = "\"" + program + "\"" + " -i " + "\"" + InputPath + "\"" + " -o " + "\"" + OutputPath + "\"" + " --scale-ratio 2" + Denoise_cmd + " --model-dir " + "\"" + model_path + "\""; QProcess *Waifu2x_converter = new QProcess(); Waifu2x_converter->start(cmd); while(!Waifu2x_converter->waitForStarted(100)&&!QProcess_stop) {} @@ -321,6 +321,7 @@ int MainWindow::Waifu2x_Compatibility_Test_finished() ui->pushButton_Start->setEnabled(1); ui->pushButton_compatibilityTest->setEnabled(1); ui->pushButton_DetectGPU->setEnabled(1); + ui->pushButton_DumpProcessorList_converter->setEnabled(1); return 0; } @@ -374,6 +375,7 @@ int MainWindow::Waifu2x_DetectGPU_finished() ui->pushButton_Start->setEnabled(1); ui->pushButton_DetectGPU->setEnabled(1); ui->pushButton_compatibilityTest->setEnabled(1); + ui->pushButton_DumpProcessorList_converter->setEnabled(1); //==== ui->comboBox_GPUID->clear(); ui->comboBox_GPUID->addItem("auto"); diff --git a/SRC/Waifu2x-Extension-QT/waifu2x_converter.cpp b/SRC/Waifu2x-Extension-QT/waifu2x_converter.cpp index 416eef114..89d35ad09 100644 --- a/SRC/Waifu2x-Extension-QT/waifu2x_converter.cpp +++ b/SRC/Waifu2x-Extension-QT/waifu2x_converter.cpp @@ -25,10 +25,13 @@ int MainWindow::Waifu2x_Converter_Image(QMap File_map) //============================= 读取设置 ================================ int ScaleRatio = ui->spinBox_ScaleRatio_image->value(); int DenoiseLevel = ui->spinBox_DenoiseLevel_image->value(); + int BlockSize = ui->spinBox_BlockSize_converter->value(); bool DelOriginal = ui->checkBox_DelOriginal->checkState(); bool SaveAsJPG = ui->checkBox_SaveAsJPG->checkState(); bool CompressJPG = ui->checkBox_CompressJPG->checkState(); bool ReProcFinFiles = ui->checkBox_ReProcFinFiles->checkState(); + bool DisableGPU = ui->checkBox_DisableGPU_converter->checkState(); + bool ForceOpenCL = ui->checkBox_ForceOpenCL_converter->checkState(); //========================= 拆解map得到参数 ============================= int rowNum = File_map["rowNum"].toInt(); QString status = "Processing"; @@ -64,7 +67,7 @@ int MainWindow::Waifu2x_Converter_Image(QMap File_map) } //======================================================= QFileInfo fileinfo(SourceFile_fullPath); - QString file_name = fileinfo.baseName(); + QString file_name = file_getBaseName(fileinfo.filePath()); QString file_ext = fileinfo.suffix(); QString file_path = fileinfo.path(); if(file_path.right(1)=="/") @@ -75,18 +78,16 @@ int MainWindow::Waifu2x_Converter_Image(QMap File_map) //============================== 放大 ======================================= QProcess *Waifu2x = new QProcess(); QString Waifu2x_folder_path = Current_Path + "/waifu2x-converter"; - QString program = Waifu2x_folder_path + "/waifu2x-converter_x64.exe"; + QString program = Waifu2x_folder_path + "/waifu2x-converter-cpp.exe"; QString model_path= Waifu2x_folder_path + "/models_rgb"; - QString Denoise_cmd = ""; - if(DenoiseLevel==0) - { - Denoise_cmd = " "; - } - else - { - Denoise_cmd = " --noise_level " + QString::number(DenoiseLevel, 10); - } - QString cmd = "\"" + program + "\"" + " -i " + "\"" + SourceFile_fullPath + "\"" + " -o " + "\"" + OutPut_Path + "\"" + " --scale_ratio " + QString::number(ScaleRatio, 10) + Denoise_cmd + " --model_dir " + "\"" + model_path + "\""; + QString Denoise_cmd = " --noise-level " + QString::number(DenoiseLevel, 10); + QString DisableGPU_cmd =""; + if(DisableGPU)DisableGPU_cmd =" --disable-gpu "; + QString ForceOpenCL_cmd =""; + if(ForceOpenCL)ForceOpenCL_cmd =" --force-OpenCL "; + //==== + QString cmd = "\"" + program + "\"" + " -i " + "\"" + SourceFile_fullPath + "\"" + " -o " + "\"" + OutPut_Path + "\"" + " --scale-ratio " + QString::number(ScaleRatio, 10) + Denoise_cmd + " --model-dir " + "\"" + model_path + "\" --block-size "+QString::number(BlockSize, 10)+DisableGPU_cmd+ForceOpenCL_cmd+Processor_converter_STR; + //======== Waifu2x->start(cmd); while(!Waifu2x->waitForStarted(100)&&!QProcess_stop) {} while(!Waifu2x->waitForFinished(500)&&!QProcess_stop) @@ -100,6 +101,7 @@ int MainWindow::Waifu2x_Converter_Image(QMap File_map) return 0; } } + //======== if(!file_isFileExist(OutPut_Path)) { emit Send_TextBrowser_NewMessage(tr("Error occured when processing [")+SourceFile_fullPath+tr("]. Error: [Unable to scale the picture.]")); @@ -265,7 +267,7 @@ int MainWindow::Waifu2x_Converter_GIF(QMap File_map) } //========================== QFileInfo fileinfo(SourceFile_fullPath); - QString file_name = fileinfo.baseName(); + QString file_name = file_getBaseName(fileinfo.filePath()); QString file_ext = fileinfo.suffix(); QString file_path = fileinfo.path(); if(file_path.right(1)=="/") @@ -442,22 +444,21 @@ int MainWindow::Waifu2x_Converter_GIF_scale(QString Frame_fileName,QMapspinBox_ScaleRatio_gif->value(); int DenoiseLevel = ui->spinBox_DenoiseLevel_gif->value(); + int BlockSize = ui->spinBox_BlockSize_converter->value(); + bool DisableGPU = ui->checkBox_DisableGPU_converter->checkState(); + bool ForceOpenCL = ui->checkBox_ForceOpenCL_converter->checkState(); //======================================================================== QProcess *Waifu2x = new QProcess(); QString Waifu2x_folder_path = Current_Path + "/waifu2x-converter"; - QString program = Waifu2x_folder_path + "/waifu2x-converter_x64.exe"; + QString program = Waifu2x_folder_path + "/waifu2x-converter-cpp.exe"; QString model_path= Waifu2x_folder_path + "/models_rgb"; QString InputPath = SplitFramesFolderPath+"/"+Frame_fileName; QString OutputPath = ScaledFramesFolderPath+"/"+Frame_fileName; - QString Denoise_cmd = ""; - if(DenoiseLevel==0) - { - Denoise_cmd = " "; - } - else - { - Denoise_cmd = " --noise_level " + QString::number(DenoiseLevel, 10); - } + QString Denoise_cmd = " --noise-level " + QString::number(DenoiseLevel, 10); + QString DisableGPU_cmd =""; + if(DisableGPU)DisableGPU_cmd =" --disable-gpu "; + QString ForceOpenCL_cmd =""; + if(ForceOpenCL)ForceOpenCL_cmd =" --force-OpenCL "; //====== bool CustRes_isEnabled = false; int CustRes_height=0; @@ -477,7 +478,7 @@ int MainWindow::Waifu2x_Converter_GIF_scale(QString Frame_fileName,QMapstart(cmd); while(!Waifu2x->waitForStarted(100)&&!QProcess_stop) {} while(!Waifu2x->waitForFinished(500)&&!QProcess_stop) @@ -559,7 +560,7 @@ int MainWindow::Waifu2x_Converter_Video(QMap File_map) } //========================== QFileInfo fileinfo(SourceFile_fullPath); - QString file_name = fileinfo.baseName(); + QString file_name = file_getBaseName(fileinfo.filePath()); QString file_ext = fileinfo.suffix(); QString file_path = fileinfo.path(); if(file_path.right(1)=="/") @@ -747,23 +748,22 @@ int MainWindow::Waifu2x_Converter_Video_scale(QString Frame_fileName,QMapspinBox_ScaleRatio_video->value(); int DenoiseLevel = ui->spinBox_DenoiseLevel_video->value(); + int BlockSize = ui->spinBox_BlockSize_converter->value(); + bool DisableGPU = ui->checkBox_DisableGPU_converter->checkState(); + bool ForceOpenCL = ui->checkBox_ForceOpenCL_converter->checkState(); QString Frame_fileFullPath = SplitFramesFolderPath+"/"+Frame_fileName; //======================================================================== QProcess *Waifu2x = new QProcess(); QString Waifu2x_folder_path = Current_Path + "/waifu2x-converter"; - QString program = Waifu2x_folder_path + "/waifu2x-converter_x64.exe"; + QString program = Waifu2x_folder_path + "/waifu2x-converter-cpp.exe"; QString model_path= Waifu2x_folder_path + "/models_rgb"; QString InputPath = SplitFramesFolderPath+"/"+Frame_fileName; QString OutputPath = ScaledFramesFolderPath+"/"+Frame_fileName; - QString Denoise_cmd = ""; - if(DenoiseLevel==0) - { - Denoise_cmd = " "; - } - else - { - Denoise_cmd = " --noise_level " + QString::number(DenoiseLevel, 10); - } + QString Denoise_cmd = " --noise-level " + QString::number(DenoiseLevel, 10); + QString DisableGPU_cmd =""; + if(DisableGPU)DisableGPU_cmd =" --disable-gpu "; + QString ForceOpenCL_cmd =""; + if(ForceOpenCL)ForceOpenCL_cmd =" --force-OpenCL "; //====== bool CustRes_isEnabled = false; int CustRes_height=0; @@ -783,7 +783,7 @@ int MainWindow::Waifu2x_Converter_Video_scale(QString Frame_fileName,QMapstart(cmd); while(!Waifu2x->waitForStarted(100)&&!QProcess_stop) {} while(!Waifu2x->waitForFinished(500)&&!QProcess_stop) diff --git a/SRC/Waifu2x-Extension-QT/waifu2x_ncnn_vulkan.cpp b/SRC/Waifu2x-Extension-QT/waifu2x_ncnn_vulkan.cpp index f27735a6e..913e00945 100644 --- a/SRC/Waifu2x-Extension-QT/waifu2x_ncnn_vulkan.cpp +++ b/SRC/Waifu2x-Extension-QT/waifu2x_ncnn_vulkan.cpp @@ -73,7 +73,7 @@ int MainWindow::Waifu2x_NCNN_Vulkan_Image(QMap File_map) } //=============== QFileInfo fileinfo(SourceFile_fullPath); - QString file_name = fileinfo.baseName(); + QString file_name = file_getBaseName(fileinfo.filePath()); QString file_ext = fileinfo.suffix(); QString file_path = fileinfo.path(); if(file_path.right(1)=="/") @@ -314,7 +314,7 @@ int MainWindow::Waifu2x_NCNN_Vulkan_GIF(QMap File_map) } //========================== QFileInfo fileinfo(SourceFile_fullPath); - QString file_name = fileinfo.baseName(); + QString file_name = file_getBaseName(fileinfo.filePath()); QString file_ext = fileinfo.suffix(); QString file_path = fileinfo.path(); if(file_path.right(1)=="/") @@ -515,7 +515,7 @@ int MainWindow::Waifu2x_NCNN_Vulkan_GIF_scale(QString Frame_fileName,QMap File_map) } //========================== QFileInfo fileinfo(SourceFile_fullPath); - QString file_name = fileinfo.baseName(); + QString file_name = file_getBaseName(fileinfo.filePath()); QString file_ext = fileinfo.suffix(); QString file_path = fileinfo.path(); if(file_path.right(1)=="/") @@ -855,7 +855,7 @@ int MainWindow::Waifu2x_NCNN_Vulkan_Video_scale(QString Frame_fileName,QMap