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 
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  SWIGOUT(%newobject ocio_transform;)
90  HOM_Color *ocio_transform(std::string src_colorspace,
91  std::string dest_colorspace,
92  std::string looks);
93  SWIGOUT(%newobject ocio_viewTransform;)
94  HOM_Color *ocio_viewTransform(std::string src_colorspace,
95  std::string display,
97 
98  static void reloadOCIO();
99 
100  SWIGOUT(%ignore colorTypeForEnumValue;)
101  static UT_ColorType colorTypeForEnumValue(HOM_EnumValue &enum_value);
102  SWIGOUT(%ignore colorTypeToEnumValue;)
103  static HOM_EnumValue & colorTypeToEnumValue(UT_ColorType basis);
104 
106  { return &myColor; }
107 
108 
109  SWIGOUT(%ignore myColor;)
110  UT_Color myColor;
111 };
112 
113 #endif
UT_Color myColor
Definition: HOM_Color.h:110
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1303
HOM_Color(const UT_Color &color)
Definition: HOM_Color.h:42
GLsizei const GLchar *const * string
Definition: glcorearb.h:814
GLboolean GLboolean g
Definition: glcorearb.h:1222
#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:349
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
GLfloat f
Definition: glcorearb.h:1926
bool operator!=(HOM_PtrOrNull< HOM_Color > color)
Definition: HOM_Color.h:52
#define HOM_API
Definition: HOM_API.h:13
void ignore(T const &) VULKAN_HPP_NOEXCEPT
Definition: vulkan.hpp:6508
int __hash__() override=0
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1302
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1222
void * _asVoidPointer()
Definition: HOM_Color.h:105
UT_ColorType
Definition: UT_Color.h:24
GLuint color
Definition: glcorearb.h:1261
OIIO_UTIL_API bool rename(string_view from, string_view to, std::string &err)
Definition: core.h:982
HOM_Color()
Definition: HOM_Color.h:26
GLboolean r
Definition: glcorearb.h:1222
bool operator==(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Equality operator, does exact floating point comparisons.
Definition: Mat3.h:542