aboutsummaryrefslogtreecommitdiff
path: root/include/QuickMedia.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-09-17 19:20:36 +0200
committerdec05eba <dec05eba@protonmail.com>2020-09-17 19:27:00 +0200
commit3b21eda9ad3b2ece9c6e5472eb419fb4d88424bd (patch)
tree033558bb30d6ca9e580a59696e330e4e6bc1274a /include/QuickMedia.hpp
parent5e7215b4675955fee8197076914599fe62f39c26 (diff)
Add image upscaling with waifu2x-ncnn-vulkan, async load images in scroll image view mode
Diffstat (limited to 'include/QuickMedia.hpp')
-rw-r--r--include/QuickMedia.hpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/QuickMedia.hpp b/include/QuickMedia.hpp
index b2c499c..d3bff47 100644
--- a/include/QuickMedia.hpp
+++ b/include/QuickMedia.hpp
@@ -11,7 +11,11 @@
#include <json/value.h>
#include <unordered_set>
#include <future>
+#include <thread>
+#include <mutex>
+#include <condition_variable>
#include <stack>
+#include <deque>
#include <X11/Xlib.h>
#include <X11/Xatom.h>
@@ -23,6 +27,11 @@ namespace QuickMedia {
SINGLE,
SCROLL
};
+
+ struct CopyOp {
+ Path source;
+ Path destination;
+ };
class Program {
public:
@@ -94,12 +103,18 @@ namespace QuickMedia {
std::future<BodyItems> search_suggestion_future;
std::future<std::string> autocomplete_future;
std::future<void> image_download_future;
+ std::thread image_upscale_thead;
+ std::mutex image_upscale_mutex;
+ std::deque<CopyOp> images_to_upscale;
+ std::condition_variable image_upscale_cv;
std::string downloading_chapter_url;
bool image_download_cancel = false;
int exit_code = 0;
std::string resources_root;
bool use_tor = false;
bool use_system_mpv_config = false;
+ bool upscale_images = false;
+ bool running = false;
// TODO: Save this to config file when switching modes
ImageViewMode image_view_mode = ImageViewMode::SINGLE;
Body *related_media_body;