Open3D (C++ API)  0.18.0
ColorEdit.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 
10 #include <functional>
11 
13 
14 namespace open3d {
15 namespace visualization {
16 namespace gui {
17 
18 class ColorEdit : public Widget {
19 public:
20  ColorEdit();
21  ~ColorEdit() override;
22 
23  void SetValue(const Color& color);
24  void SetValue(float r, float g, float b);
25 
26  const Color& GetValue() const;
27 
29  const Constraints& constraints) const override;
30 
31  DrawResult Draw(const DrawContext& context) override;
32 
35  void SetOnValueChanged(std::function<void(const Color&)> on_value_changed);
36 
37 private:
38  struct Impl;
39  std::unique_ptr<Impl> impl_;
40 };
41 
42 } // namespace gui
43 } // namespace visualization
44 } // namespace open3d
math::float4 color
Definition: LineSetBuffers.cpp:45
ImGuiContext * context
Definition: Window.cpp:76
Definition: ColorEdit.h:18
Size CalcPreferredSize(const LayoutContext &context, const Constraints &constraints) const override
Definition: ColorEdit.cpp:49
void SetOnValueChanged(std::function< void(const Color &)> on_value_changed)
Definition: ColorEdit.cpp:44
~ColorEdit() override
Definition: ColorEdit.cpp:34
const Color & GetValue() const
Definition: ColorEdit.cpp:42
ColorEdit()
Definition: ColorEdit.cpp:30
DrawResult Draw(const DrawContext &context) override
Definition: ColorEdit.cpp:57
void SetValue(const Color &color)
Definition: ColorEdit.cpp:36
Definition: Color.h:16
Definition: Widget.h:49
DrawResult
Definition: Widget.h:95
Definition: PinholeCameraIntrinsic.cpp:16