Open3D (C++ API)  0.18.0+252c867
Color.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 <Eigen/Geometry>
11 
12 namespace open3d {
13 namespace visualization {
14 namespace gui {
15 
16 class Color {
17 public:
18  Color();
19  Color(float r, float g, float b, float a = 1.0);
20  Color(const Eigen::Vector3f& rgb); // not explicit: want auto-convert
21 
22  float GetRed() const;
23  float GetGreen() const;
24  float GetBlue() const;
25  float GetAlpha() const;
26 
27  void SetColor(float r, float g, float b, float a = 1.0);
28 
29  const float* GetPointer() const;
30  float* GetMutablePointer();
31 
35  Color Lightened(float amount);
36 
37  unsigned int ToABGR32() const;
38 
39  bool operator==(const Color& rhs) const;
40  bool operator!=(const Color& rhs) const;
41 
42 private:
43  float rgba_[4];
44 };
45 
46 } // namespace gui
47 } // namespace visualization
48 } // namespace open3d
Definition: Color.h:16
bool operator==(const Color &rhs) const
Definition: Color.cpp:25
float GetBlue() const
Definition: Color.cpp:36
float GetGreen() const
Definition: Color.cpp:35
void SetColor(float r, float g, float b, float a=1.0)
Definition: Color.cpp:39
const float * GetPointer() const
Definition: Color.cpp:49
float GetAlpha() const
Definition: Color.cpp:37
float GetRed() const
Definition: Color.cpp:34
bool operator!=(const Color &rhs) const
Definition: Color.cpp:30
Color Lightened(float amount)
Definition: Color.cpp:52
unsigned int ToABGR32() const
Definition: Color.cpp:59
float * GetMutablePointer()
Definition: Color.cpp:50
Color()
Definition: Color.cpp:17
Definition: PinholeCameraIntrinsic.cpp:16