#pragma once #include #include #include #include #include #include #include #include struct SaveImgJob { std::string strPath; std::vector 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 m_Q; std::thread m_Thread; std::atomic m_bStop; };