| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- #include "endo_guide.h"
- #include "core/imgui_utility.hpp"
- app_endo_guide::app_endo_guide(const create_config &_conf) {
- conf = _conf;
- // initialize object manager
- OBJ_SAVE(img_color, image_u8c3());
- // initialize modules
- auto uvc_cam_conf = uvc_camera_ui::create_config{
- .img_name = img_color, .ctx = conf.asio_ctx,
- };
- uvc_cam = std::make_unique<uvc_camera_ui>(uvc_cam_conf);
- auto bg_viewer_conf = image_viewer::create_config{
- .mode = VIEW_COLOR_ONLY, .flip_y = true,
- .stream = default_cuda_stream,
- };
- auto &bg_extra_conf = bg_viewer_conf.extra.color;
- bg_extra_conf.fmt = COLOR_RGB;
- bg_extra_conf.name = img_color;
- bg_viewer = std::make_unique<image_viewer>(bg_viewer_conf);
- }
- void app_endo_guide::show_ui() {
- if (ImGui::Begin("Endo Guide Control")) {
- ImGui::PushItemWidth(200);
- if (ImGui::CollapsingHeader("Camera")) {
- auto id_guard = imgui_id_guard("camera");
- uvc_cam->show();
- }
- }
- ImGui::End();
- }
- void app_endo_guide::render_background() {
- bg_viewer->render();
- }
|