HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HOM_Color.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * COMMENTS:
7  */
8 
9 #ifndef __HOM_Color_h__
10 #define __HOM_Color_h__
11 
12 #include "HOM_API.h"
13 #include "HOM_Defines.h"
14 #include "HOM_Errors.h"
15 #include "HOM_PtrOrNull.h"
16 #include "HOM_Module.h"
17 #include <UT/UT_Color.h>
18 #include <vector>
19 #include <stdexcept>
20 
22 
24 {
25 public:
27  : myColor(UT_RGB, 0.0f, 0.0f, 0.0f)
28  { HOM_CONSTRUCT_OBJECT(this) }
29 
30  HOM_Color(const std::vector<float> &rgb_tuple);
31 
32  HOM_Color(float r, float g, float b)
33  : myColor(UT_RGB, r, g, b)
34  { HOM_CONSTRUCT_OBJECT(this) }
35 
36  SWIGOUT(%ignore HOM_Color(const UT_Color&);)
38  : myColor(color)
39  { HOM_CONSTRUCT_OBJECT(this) }
40 
42  { HOM_DESTRUCT_OBJECT(this) }
43 
45  { return color.myPointer && myColor == color.myPointer->myColor; }
46 
48  { return !operator==(color); }
49 
50  int __hash__();
52 
53  SWIGOUT(%ignore operator=;)
54  HOM_Color &operator=(const HOM_Color& color)
55  {
56  myColor = color.myColor;
57  return *this;
58  }
59 
60  std::vector<float> rgb();
61  std::vector<float> hsv();
62  std::vector<float> hsl();
63  std::vector<float> xyz();
64  std::vector<float> lab();
65  std::vector<float> tmi();
66 
67  void setRGB(const std::vector<float> &tuple);
68  void setHSV(const std::vector<float> &tuple);
69  void setHSL(const std::vector<float> &tuple);
70  void setXYZ(const std::vector<float> &tuple);
71  void setLAB(const std::vector<float> &tuple);
72  void setTMI(const std::vector<float> &tuple);
73 
74  static std::string ocio_configPath();
75  static std::vector<std::string> ocio_spaces();
76  static std::vector<std::string> ocio_activeDisplays();
77  static std::vector<std::string> ocio_activeViews();
78  static std::vector<std::string> ocio_looks();
79  static std::vector<std::string> ocio_roles();
80  static std::vector<std::string> ocio_views(const char *display);
81  static std::string ocio_defaultDisplay();
82  static std::string ocio_defaultView();
83 
84  static void reloadOCIO();
85 
86  SWIGOUT(%ignore colorTypeForEnumValue;)
87  static UT_ColorType colorTypeForEnumValue(HOM_EnumValue &enum_value);
88  SWIGOUT(%ignore colorTypeToEnumValue;)
89  static HOM_EnumValue & colorTypeToEnumValue(UT_ColorType basis);
90 
92  { return &myColor; }
93 
94 
95  SWIGOUT(%ignore myColor;)
96  UT_Color myColor;
97 };
98 
99 #endif
UT_Color myColor
Definition: HOM_Color.h:96
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1211
HOM_Color(const UT_Color &color)
Definition: HOM_Color.h:37
OIIO_API bool rename(string_view from, string_view to, std::string &err)
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:349
HOM_Color(float r, float g, float b)
Definition: HOM_Color.h:32
~HOM_Color()
Definition: HOM_Color.h:41
bool operator==(HOM_PtrOrNull< HOM_Color > color)
Definition: HOM_Color.h:44
bool operator!=(HOM_PtrOrNull< HOM_Color > color)
Definition: HOM_Color.h:47
GLclampf f
Definition: glew.h:3499
#define HOM_API
Definition: HOM_API.h:13
int __hash__() override=0
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1210
GLuint color
Definition: glew.h:7902
void * _asVoidPointer()
Definition: HOM_Color.h:91
GLdouble GLdouble GLdouble b
Definition: glew.h:9122
GLsizei const GLchar *const * string
Definition: glew.h:1844
UT_ColorType
Definition: UT_Color.h:24
GLdouble GLdouble GLdouble r
Definition: glew.h:1406
HOM_Color()
Definition: HOM_Color.h:26
bool operator==(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Equality operator, does exact floating point comparisons.
Definition: Mat3.h:549
GLboolean GLboolean g
Definition: glew.h:9477