From df45966c52bac2eb465cf05c1d6328bf0d00c5ac Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期六, 16 八月 2025 15:27:10 +0800
Subject: [PATCH] 1. 补提交添加保存图像的类
---
EdgeInspector_App/Thread/Thread_SaveFullImg.h | 45 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 45 insertions(+), 0 deletions(-)
diff --git a/EdgeInspector_App/Thread/Thread_SaveFullImg.h b/EdgeInspector_App/Thread/Thread_SaveFullImg.h
new file mode 100644
index 0000000..172302f
--- /dev/null
+++ b/EdgeInspector_App/Thread/Thread_SaveFullImg.h
@@ -0,0 +1,45 @@
+#pragma once
+#include <queue>
+#include <mutex>
+#include <condition_variable>
+#include <thread>
+#include <atomic>
+#include <vector>
+#include <string>
+#include <Windows.h>
+
+struct SaveImgJob
+{
+ std::string strPath;
+ std::vector<BYTE> vData;
+ int nWidth = 0;
+ int nHeight = 0;
+ int nStride = 0;
+ int nBpp = 1;
+ int nStartY = 0;
+ int nDimension = 0;
+ int nQuality = 80;
+};
+
+class CThread_SaveFullImg
+{
+public:
+ CThread_SaveFullImg();
+ ~CThread_SaveFullImg();
+
+ void CreateThread();
+ void StopThread();
+ void Enqueue(SaveImgJob&& oJob);
+ size_t GetPendingCount() const;
+
+private:
+ void ThreadProc();
+ BOOL SaveFullImageModern(const SaveImgJob& job);
+
+private:
+ mutable std::mutex m_Mtx;
+ std::condition_variable m_Cv;
+ std::queue<SaveImgJob> m_Q;
+ std::thread m_Thread;
+ std::atomic<bool> m_bStop;
+};
\ No newline at end of file
--
Gitblit v1.9.3