-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathoiio.cpp
More file actions
40 lines (30 loc) · 814 Bytes
/
Copy pathoiio.cpp
File metadata and controls
40 lines (30 loc) · 814 Bytes
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
extern "C" {
#include "_cgo_export.h"
}
#include <OpenImageIO/imageio.h>
#include <string>
extern "C" {
bool OIIO_attribute_int(const char* name, int val) {
return OIIO::attribute(name, val);
}
bool OIIO_attribute_float(const char* name, float val) {
return OIIO::attribute(name, val);
}
bool OIIO_attribute_string(const char* name, const char* val) {
return OIIO::attribute(name, OIIO::string_view(val));
}
bool OIIO_getattribute_int(const char* name, int* val) {
return OIIO::getattribute(name, *val);
}
bool OIIO_getattribute_float(const char* name, float* val) {
return OIIO::getattribute(name, *val);
}
bool OIIO_getattribute_string(const char* name, char** val) {
std::string s;
bool ok = OIIO::getattribute(name, s);
if (ok) {
*val = strdup(s.c_str());
}
return ok;
}
} // extern "C"