image_saver_impl.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef DEPTHGUIDE_IMAGE_SAVER_IMPL_H
  2. #define DEPTHGUIDE_IMAGE_SAVER_IMPL_H
  3. #include "module/image_saver.h"
  4. #include "core/cuda_helper.hpp"
  5. using boost::asio::io_context;
  6. struct image_saver::impl {
  7. enum {
  8. SAVE_JPG,
  9. SAVE_PNG,
  10. SAVE_RAW,
  11. SAVE_PLY,
  12. };
  13. enum {
  14. DATA_IMG,
  15. DATA_PC
  16. };
  17. struct item_store_type {
  18. std::string ui_name;
  19. obj_name_type img_name;
  20. bool checked = false;
  21. int data_type = DATA_IMG;
  22. int save_type = SAVE_PNG;
  23. impl *par = nullptr;
  24. // for point cloud
  25. void save_ply();
  26. // for image
  27. void save_jpg();
  28. void save_png();
  29. void save_raw();
  30. void process();
  31. };
  32. using item_list_type = std::vector<item_store_type>;
  33. item_list_type item_list;
  34. io_context *ctx = nullptr;
  35. smart_cuda_stream stream;
  36. size_t save_cnt = 0;
  37. explicit impl(const create_config &conf);
  38. void show();
  39. void process_all();
  40. };
  41. #endif //DEPTHGUIDE_IMAGE_SAVER_IMPL_H