#pragma once #include #include #include class G4Tiff { public: enum class Mode { FileMode, MemoryMode }; G4Tiff(cv::Mat& mat, Mode mode, std::string path, int threshold=120,int res=200); ~G4Tiff(); public: /* *内存传输模式时压缩图像数据去数据 */ void GetCompressedData(std::vector& cmpeddata); /* * 文件模式时使用 */ void SaveG4Tiff(); private: void save(cv::Mat& mat); private: void except(bool condition, const std::string& message = ""); std::string m_tmppath; int m_threshold; int m_res; Mode m_mode; cv::Mat m_mat; };