image_augment_helper.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #ifndef DEPTHGUIDE_IMAGE_AUGMENT_HELPER_H
  2. #define DEPTHGUIDE_IMAGE_AUGMENT_HELPER_H
  3. #include "core/object_manager.h"
  4. #include "render/render_utility.h"
  5. #include <boost/container/small_vector.hpp>
  6. #include <memory>
  7. class image_augment_helper {
  8. public:
  9. struct create_config {
  10. obj_name_type in_name = invalid_obj_name;
  11. obj_name_type out_name = invalid_obj_name;
  12. static constexpr auto reserve_cnt = 4;
  13. using render_func_type = std::function<void()>;
  14. using render_func_list_type =
  15. boost::container::small_vector<render_func_type, reserve_cnt>;
  16. render_func_list_type render_func_list;
  17. using fbo_config_type = smart_frame_buffer::create_config;
  18. fbo_config_type fbo_conf;
  19. bool flip_image = false;
  20. bool follow_image_size = true;
  21. smart_cuda_stream *stream = nullptr;
  22. };
  23. explicit image_augment_helper(const create_config &conf);
  24. ~image_augment_helper();
  25. void resize(cv::Size size);
  26. private:
  27. struct impl;
  28. std::unique_ptr<impl> pimpl;
  29. };
  30. class stereo_augment_helper {
  31. public:
  32. struct create_config {
  33. obj_name_type left_name = invalid_obj_name;
  34. obj_name_type right_name = invalid_obj_name;
  35. obj_name_type out_name = invalid_obj_name;
  36. cv::Size fbo_size;
  37. bool flip_image = false;
  38. smart_cuda_stream *stream = nullptr;
  39. };
  40. explicit stereo_augment_helper(const create_config &conf);
  41. ~stereo_augment_helper();
  42. void resize(cv::Size size);
  43. struct ui_config {
  44. bool follow_image_size = false;
  45. bool enable_halve_width = false;
  46. };
  47. void fix_ui_config(ui_config conf);
  48. void show();
  49. private:
  50. struct impl;
  51. std::unique_ptr<impl> pimpl;
  52. };
  53. #endif //DEPTHGUIDE_IMAGE_AUGMENT_HELPER_H