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 
21 SWIGOUT(%rename(Color) HOM_Color;)
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::vector<std::string> ocio_spaces();
75 
76  SWIGOUT(%ignore colorTypeForEnumValue;)
77  static UT_ColorType colorTypeForEnumValue(HOM_EnumValue &enum_value);
78  SWIGOUT(%ignore colorTypeToEnumValue;)
79  static HOM_EnumValue & colorTypeToEnumValue(UT_ColorType basis);
80 
82  { return &myColor; }
83 
84 
85  SWIGOUT(%ignore myColor;)
86  UT_Color myColor;
87 };
88 
89 #endif
UT_Color myColor
Definition: HOM_Color.h:86
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1056
HOM_Color(const UT_Color &color)
Definition: HOM_Color.h:37
GLsizei const GLchar *const * string
Definition: glcorearb.h:813
GLuint color
Definition: glcorearb.h:1260
GLboolean GLboolean g
Definition: glcorearb.h:1221
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:344
HOM_Color(float r, float g, float b)
Definition: HOM_Color.h:32
virtual int __hash__()=0
~HOM_Color()
Definition: HOM_Color.h:41
bool operator==(HOM_PtrOrNull< HOM_Color > color)
Definition: HOM_Color.h:44
GLfloat f
Definition: glcorearb.h:1925
bool operator!=(HOM_PtrOrNull< HOM_Color > color)
Definition: HOM_Color.h:47
#define HOM_API
Definition: HOM_API.h:13
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1055
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1221
void * _asVoidPointer()
Definition: HOM_Color.h:81
UT_ColorType
Definition: UT_Color.h:24
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:590