| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- #ifndef DEPTHGUIDE_CAMERA_AUGMENT_HELPER_V2_H
- #define DEPTHGUIDE_CAMERA_AUGMENT_HELPER_V2_H
- #include "augment_manager_v2.h"
- // sophiar
- #include "core/local_connection.h"
- #include <glm/glm.hpp>
- #include <memory>
- #include <variant>
- class cursor_guide;
- class camera_augment_helper_v2 {
- public:
- struct create_config {
- struct fixed_camera_config {
- float fov = 60.0f; // field of view
- std::string transform_var; // for sophiar
- };
- struct relative_camera_config {
- camera_augment_helper_v2 *parent = nullptr;
- glm::mat4 transform = glm::mat4(1.0f); // viewed in parent
- };
- struct freedom_camera_config {
- std::string transform_var; // for sophiar
- };
- using camera_config_type = std::variant<std::monostate,
- freedom_camera_config, fixed_camera_config, relative_camera_config>;
- camera_config_type camera;
- // sophiar
- sophiar_conn_type *sophiar_conn = nullptr;
- augment_manager_v2 *manager = nullptr;
- cursor_guide *act_guide = nullptr; // active guidance
- using io_context = boost::asio::io_context;
- io_context *ctx = nullptr;
- };
- explicit camera_augment_helper_v2(const create_config &conf);
- ~camera_augment_helper_v2();
- void render();
- struct output_config {
- cv::Size size;
- obj_name_type img_name;
- smart_cuda_stream *stream;
- };
- void render_image(output_config conf);
- void show();
- void sync_with(camera_augment_helper_v2 *other);
- void set_active_guidance(bool flag);
- struct guide_info {
- glm::vec2 pos;
- };
- void set_passive_guidance(bool flag, const guide_info &info);
- camera_info get_camera();
- // latency of image to tracked transform, offset < 0
- void set_fixed_transform_latency(int offset);
- private:
- struct impl;
- std::unique_ptr<impl> pimpl;
- };
- #endif //DEPTHGUIDE_CAMERA_AUGMENT_HELPER_V2_H
|