config.h 765 B

12345678910111213141516171819202122232425262728293031323334
  1. #pragma once
  2. #include <opencv2\highgui\highgui.hpp>
  3. #include "data_def_api.h"
  4. using namespace std;
  5. using namespace cv;
  6. namespace graft_cv{
  7. class CGCvConfig
  8. {
  9. public:
  10. CGCvConfig();
  11. ~CGCvConfig();
  12. void setConfParam(ConfigParam*);
  13. void write(FileStorage &fs)const;
  14. void read(const FileNode& node);
  15. private:
  16. ConfigParam* m_cparam;
  17. };
  18. //These write and read functions must exist as per the inline functions in operations.hpp
  19. static void write(FileStorage& fs, const std::string&, const CGCvConfig& x){
  20. x.write(fs);
  21. }
  22. static void read(const FileNode& node, CGCvConfig& x, const CGCvConfig& default_value = CGCvConfig()){
  23. if(node.empty())
  24. x = default_value;
  25. else
  26. x.read(node);
  27. }
  28. string get_cparam_info(ConfigParam* m_cparam);
  29. };