#ifndef DEPTHGUIDE_IMAGE_VIEWER_H #define DEPTHGUIDE_IMAGE_VIEWER_H #include "core/object_manager.h" #include "render/render_utility.h" #include #include enum image_viewer_mode { VIEW_COLOR_ONLY, VIEW_DEPTH_ONLY, VIEW_COLOR_DEPTH, VIEW_STEREO, VIEW_CUSTOM }; class image_viewer { public: struct create_config { static constexpr auto max_custom_size = 2; image_viewer_mode mode = VIEW_COLOR_DEPTH; bool flip_y = false; smart_cuda_stream *stream = nullptr; union { struct { color_format fmt; obj_name_type name; } color; struct { obj_name_type name; } depth; struct { color_format c_fmt; obj_name_type c_name, d_name; } color_depth; struct { color_format c_fmt; obj_name_type left_name, right_name; } stereo; } extra = {}; struct { struct item_type { using render_func_type = std::function; std::string name; render_func_type render_func; }; using item_list_type = boost::container::static_vector; item_list_type item_list; } custom; }; explicit image_viewer(create_config conf); ~image_viewer(); void show(); void render(); private: struct impl; std::unique_ptr pimpl; }; #endif //DEPTHGUIDE_IMAGE_VIEWER_H