| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- #ifndef DEPTHGUIDE_IMAGE_VIEWER_H
- #define DEPTHGUIDE_IMAGE_VIEWER_H
- #include "core/object_manager.h"
- #include "render/render_utility.h"
- #include <boost/container/static_vector.hpp>
- #include <memory>
- 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<void()>;
- std::string name;
- render_func_type render_func;
- };
- using item_list_type =
- boost::container::static_vector<item_type, max_custom_size>;
- item_list_type item_list;
- } custom;
- };
- explicit image_viewer(create_config conf);
- ~image_viewer();
- void show();
- void render();
- private:
- struct impl;
- std::unique_ptr<impl> pimpl;
- };
- #endif //DEPTHGUIDE_IMAGE_VIEWER_H
|