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 HOM_Color&);)
38  : myColor(color.myColor)
39  { HOM_CONSTRUCT_OBJECT(this) }
40 
41  SWIGOUT(%ignore HOM_Color(const UT_Color&);)
42  HOM_Color(const UT_Color &color)
43  : myColor(color)
44  { HOM_CONSTRUCT_OBJECT(this) }
45 
47  { HOM_DESTRUCT_OBJECT(this) }
48 
50  { return color.myPointer && myColor == color.myPointer->myColor; }
51 
53  { return !operator==(color); }
54 
55  int __hash__();
57 
58  SWIGOUT(%ignore operator=;)
59  HOM_Color &operator=(const HOM_Color& color)
60  {
61  myColor = color.myColor;
62  return *this;
63  }
64 
65  std::vector<float> rgb();
66  std::vector<float> hsv();
67  std::vector<float> hsl();
68  std::vector<float> xyz();
69  std::vector<float> lab();
70  std::vector<float> tmi();
71 
72  void setRGB(const std::vector<float> &tuple);
73  void setHSV(const std::vector<float> &tuple);
74  void setHSL(const std::vector<float> &tuple);
75  void setXYZ(const std::vector<float> &tuple);
76  void setLAB(const std::vector<float> &tuple);
77  void setTMI(const std::vector<float> &tuple);
78 
79  static std::string ocio_configPath();
80  static std::vector<std::string> ocio_spaces();
81  static std::vector<std::string> ocio_activeDisplays();
82  static std::vector<std::string> ocio_activeViews();
83  static std::vector<std::string> ocio_looks();
84  static std::vector<std::string> ocio_roles();
85  static std::vector<std::string> ocio_views(const char *display);
86  static std::string ocio_defaultDisplay();
87  static std::string ocio_defaultView();
88 
89  static void reloadOCIO();
90 
91  SWIGOUT(%ignore colorTypeForEnumValue;)
92  static UT_ColorType colorTypeForEnumValue(HOM_EnumValue &enum_value);
93  SWIGOUT(%ignore colorTypeToEnumValue;)
94  static HOM_EnumValue & colorTypeToEnumValue(UT_ColorType basis);
95 
97  { return &myColor; }
98 
99 
100  SWIGOUT(%ignore myColor;)
101  UT_Color myColor;
102 };
103 
104 #endif
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1221
UT_Color myColor
Definition: HOM_Color.h:101
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1238
HOM_Color(const UT_Color &color)
Definition: HOM_Color.h:42
OIIO_API bool rename(string_view from, string_view to, std::string &err)
GLuint color
Definition: glcorearb.h:1260
GLboolean GLboolean g
Definition: glcorearb.h:1221
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
HOM_Color(const HOM_Color &color)
Definition: HOM_Color.h:37
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:353
HOM_Color(float r, float g, float b)
Definition: HOM_Color.h:32
~HOM_Color()
Definition: HOM_Color.h:46
bool operator==(HOM_PtrOrNull< HOM_Color > color)
Definition: HOM_Color.h:49
bool operator!=(HOM_PtrOrNull< HOM_Color > color)
Definition: HOM_Color.h:52
#define HOM_API
Definition: HOM_API.h:13
int __hash__() override=0
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1237
GLsizei const GLchar *const * string
Definition: glcorearb.h:813
void * _asVoidPointer()
Definition: HOM_Color.h:96
UT_ColorType
Definition: UT_Color.h:24
GLfloat f
Definition: glcorearb.h:1925
HOM_Color()
Definition: HOM_Color.h:26
GLboolean r
Definition: glcorearb.h:1221
bool operator==(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Equality operator, does exact floating point comparisons.
Definition: Mat3.h:556