Open3D (C++ API)  0.18.0+252c867
ImageWidget.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2023 www.open3d.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
11 
13 
14 namespace open3d {
15 namespace visualization {
16 namespace gui {
17 
18 class ImageWidget : public Widget {
19  using Super = Widget;
20 
21 public:
22  ImageWidget();
25  explicit ImageWidget(const char* image_path);
27  explicit ImageWidget(std::shared_ptr<geometry::Image> image);
29  explicit ImageWidget(std::shared_ptr<t::geometry::Image> image);
34  float u0 = 0.0f,
35  float v0 = 0.0f,
36  float u1 = 1.0f,
37  float v1 = 1.0f);
38  ImageWidget(std::shared_ptr<UIImage> image);
39  ~ImageWidget();
40 
49  void UpdateImage(std::shared_ptr<geometry::Image> image);
50  void UpdateImage(std::shared_ptr<t::geometry::Image> image);
51 
52  std::shared_ptr<UIImage> GetUIImage() const;
53  void SetUIImage(std::shared_ptr<UIImage> image);
54 
56  const Constraints& constraints) const override;
57 
58  void Layout(const LayoutContext& context) override;
59 
60  DrawResult Draw(const DrawContext& context) override;
61 
62 private:
63  struct Impl;
64  std::unique_ptr<Impl> impl_;
65 };
66 
67 } // namespace gui
68 } // namespace visualization
69 } // namespace open3d
std::shared_ptr< core::Tensor > image
Definition: FilamentRenderer.cpp:183
ImGuiContext * context
Definition: Window.cpp:76
Definition: ImageWidget.h:18
void Layout(const LayoutContext &context) override
Definition: ImageWidget.cpp:90
ImageWidget()
Definition: ImageWidget.cpp:24
DrawResult Draw(const DrawContext &context) override
Definition: ImageWidget.cpp:94
std::shared_ptr< UIImage > GetUIImage() const
Definition: ImageWidget.cpp:68
void UpdateImage(std::shared_ptr< geometry::Image > image)
Definition: ImageWidget.cpp:60
~ImageWidget()
Definition: ImageWidget.cpp:58
void SetUIImage(std::shared_ptr< UIImage > image)
Definition: ImageWidget.cpp:72
Size CalcPreferredSize(const LayoutContext &context, const Constraints &constraints) const override
Definition: ImageWidget.cpp:76
Definition: Widget.h:49
Widget()
Definition: Widget.cpp:34
DrawResult
Definition: Widget.h:95
Definition: PinholeCameraIntrinsic.cpp:16
Definition: ImageWidget.cpp:20