Common.h 464 B

1234567891011121314151617181920212223242526
  1. #pragma once
  2. #include <opencv2/opencv.hpp>
  3. #include <cstring>
  4. enum ErrorCode
  5. {
  6. None = 0,
  7. DecodeError = 1,
  8. ConvertError = 2,
  9. CannyError = 3,
  10. ImageDiffError = 4,
  11. JudgeError = 5,
  12. };
  13. class ErrorMsg
  14. {
  15. public:
  16. ~ErrorMsg();
  17. static void SetErrorMsg(ErrorCode errorCode, std::vector<const char*> errorMsgs);
  18. static void GetErrorMsg(ErrorCode& errorCode, char* errorMsg, const int errorMaxLen);
  19. private:
  20. static char* _errorMsg;
  21. static ErrorCode _errorCode;
  22. };