1 //
2 // Copyright 2016 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 //    names, trademarks, service marks, or product names of the Licensor
11 //    and its affiliates, except as required to comply with Section 4(c) of
12 //    the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 //     http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 #include <boost/python/def.hpp>
25 
26 #include "pxr/pxr.h"
27 #include "pxr/base/gf/gamma.h"
28 #include "pxr/base/gf/vec3f.h"
29 #include "pxr/base/gf/vec3d.h"
30 #include "pxr/base/gf/vec4f.h"
31 #include "pxr/base/gf/vec4d.h"
32 
33 #include "pxr/base/tf/wrapTypeHelpers.h"
34 
35 using namespace boost::python;
36 
37 PXR_NAMESPACE_USING_DIRECTIVE
38 
wrapGamma()39 void wrapGamma()
40 {
41     def("ApplyGamma", (GfVec3f(*)(GfVec3f const &,double))GfApplyGamma);
42     def("ApplyGamma", (GfVec3d(*)(GfVec3d const &,double))GfApplyGamma);
43     def("ApplyGamma", (GfVec3h(*)(GfVec3h const &,double))GfApplyGamma);
44     def("ApplyGamma", (GfVec4f(*)(GfVec4f const &,double))GfApplyGamma);
45     def("ApplyGamma", (GfVec4d(*)(GfVec4d const &,double))GfApplyGamma);
46     def("ApplyGamma", (GfVec4h(*)(GfVec4h const &,double))GfApplyGamma);
47     def("GetDisplayGamma",GfGetDisplayGamma);
48     def("ConvertDisplayToLinear",(GfVec3f(*)(GfVec3f const &))GfConvertDisplayToLinear);
49     def("ConvertDisplayToLinear",(GfVec3d(*)(GfVec3d const &))GfConvertDisplayToLinear);
50     def("ConvertDisplayToLinear",(GfVec3h(*)(GfVec3h const &))GfConvertDisplayToLinear);
51     def("ConvertDisplayToLinear",(GfVec4f(*)(GfVec4f const &))GfConvertDisplayToLinear);
52     def("ConvertDisplayToLinear",(GfVec4d(*)(GfVec4d const &))GfConvertDisplayToLinear);
53     def("ConvertDisplayToLinear",(GfVec4h(*)(GfVec4h const &))GfConvertDisplayToLinear);
54     def("ConvertLinearToDisplay",(GfVec3f(*)(GfVec3f const &))GfConvertLinearToDisplay);
55     def("ConvertLinearToDisplay",(GfVec3d(*)(GfVec3d const &))GfConvertLinearToDisplay);
56     def("ConvertLinearToDisplay",(GfVec3h(*)(GfVec3h const &))GfConvertLinearToDisplay);
57     def("ConvertLinearToDisplay",(GfVec4f(*)(GfVec4f const &))GfConvertLinearToDisplay);
58     def("ConvertLinearToDisplay",(GfVec4d(*)(GfVec4d const &))GfConvertLinearToDisplay);
59     def("ConvertLinearToDisplay",(GfVec4h(*)(GfVec4h const &))GfConvertLinearToDisplay);
60 }
61