-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtransform.cpp
133 lines (110 loc) · 4.27 KB
/
transform.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#include <OpenColorIO/OpenColorIO.h>
#include "ocio.h"
#include "ocio_abi.h"
#include "storage.h"
namespace OCIO = OCIO_NAMESPACE;
namespace ocigo {
IndexMap<OCIO::TransformRcPtr> g_Transform_map;
}
extern "C" {
void deleteDisplayTransform(DisplayTransformId p) {
ocigo::g_Transform_map.remove(p);
}
DisplayTransformId DisplayTransform_Create() {
OCIO::DisplayTransformRcPtr ptr;
BEGIN_CATCH_ERR
ptr = OCIO::DisplayTransform::Create();
END_CATCH_ERR
return ocigo::g_Transform_map.add(OCIO_DYNAMIC_POINTER_CAST<OCIO::Transform>(ptr));
}
DisplayTransformId DisplayTransform_createEditableCopy(DisplayTransformId p) {
OCIO::TransformRcPtr tptr;
BEGIN_CATCH_ERR
tptr = ocigo::g_Transform_map.get(p).get()->createEditableCopy();
END_CATCH_ERR
if ( tptr == NULL) { return 0; }
return ocigo::g_Transform_map.add(tptr);
}
TransformDirection DisplayTransform_getDirection(DisplayTransformId p) {
TransformDirection ret;
BEGIN_CATCH_ERR
ret = (TransformDirection)(ocigo::g_Transform_map.get(p).get()->getDirection());
END_CATCH_ERR
return ret;
}
void DisplayTransform_setDirection(DisplayTransformId p, TransformDirection dir) {
BEGIN_CATCH_ERR
ocigo::g_Transform_map.get(p).get()->setDirection((OCIO::TransformDirection)dir);
END_CATCH_ERR
}
const char* DisplayTransform_getInputColorSpaceName(DisplayTransformId p) {
const char* ret = NULL;
BEGIN_CATCH_ERR
ret = OCIO_DYNAMIC_POINTER_CAST<OCIO::DisplayTransform>(ocigo::g_Transform_map.get(p))
.get()->getInputColorSpaceName();
END_CATCH_ERR
return ret;
}
void DisplayTransform_setInputColorSpaceName(DisplayTransformId p, const char* name) {
BEGIN_CATCH_ERR
OCIO_DYNAMIC_POINTER_CAST<OCIO::DisplayTransform>(ocigo::g_Transform_map.get(p))
.get()->setInputColorSpaceName(name);
END_CATCH_ERR
}
const char* DisplayTransform_getDisplay(DisplayTransformId p) {
const char* ret = NULL;
BEGIN_CATCH_ERR
ret = OCIO_DYNAMIC_POINTER_CAST<OCIO::DisplayTransform>(ocigo::g_Transform_map.get(p))
.get()->getDisplay();
END_CATCH_ERR
return ret;
}
void DisplayTransform_setDisplay(DisplayTransformId p, const char* name) {
BEGIN_CATCH_ERR
OCIO_DYNAMIC_POINTER_CAST<OCIO::DisplayTransform>(ocigo::g_Transform_map.get(p))
.get()->setDisplay(name);
END_CATCH_ERR
}
const char* DisplayTransform_getView(DisplayTransformId p) {
const char* ret = NULL;
BEGIN_CATCH_ERR
ret = OCIO_DYNAMIC_POINTER_CAST<OCIO::DisplayTransform>(ocigo::g_Transform_map.get(p))
.get()->getView();
END_CATCH_ERR
return ret;
}
void DisplayTransform_setView(DisplayTransformId p, const char* name) {
BEGIN_CATCH_ERR
OCIO_DYNAMIC_POINTER_CAST<OCIO::DisplayTransform>(ocigo::g_Transform_map.get(p))
.get()->setView(name);
END_CATCH_ERR
}
const char* DisplayTransform_getLooksOverride(DisplayTransformId p) {
const char* ret = NULL;
BEGIN_CATCH_ERR
ret = OCIO_DYNAMIC_POINTER_CAST<OCIO::DisplayTransform>(ocigo::g_Transform_map.get(p))
.get()->getLooksOverride();
END_CATCH_ERR
return ret;
}
void DisplayTransform_setLooksOverride(DisplayTransformId p, const char* looks) {
BEGIN_CATCH_ERR
OCIO_DYNAMIC_POINTER_CAST<OCIO::DisplayTransform>(ocigo::g_Transform_map.get(p))
.get()->setLooksOverride(looks);
END_CATCH_ERR
}
bool DisplayTransform_getLooksOverrideEnabled(DisplayTransformId p) {
bool ret = false;
BEGIN_CATCH_ERR
ret = OCIO_DYNAMIC_POINTER_CAST<OCIO::DisplayTransform>(ocigo::g_Transform_map.get(p))
.get()->getLooksOverrideEnabled();
END_CATCH_ERR
return ret;
}
void DisplayTransform_setLooksOverrideEnabled(DisplayTransformId p, bool enabled) {
BEGIN_CATCH_ERR
OCIO_DYNAMIC_POINTER_CAST<OCIO::DisplayTransform>(ocigo::g_Transform_map.get(p))
.get()->setLooksOverrideEnabled(enabled);
END_CATCH_ERR
}
}