// // SPDX-License-Identifier: BSD-3-Clause // Copyright Contributors to the OpenEXR Project. // // clang-format off #ifndef _PyImathColor3ArrayImpl_h_ #define _PyImathColor3ArrayImpl_h_ // // This .C file was turned into a header file so that instantiations // of the various V3* types can be spread across multiple files in // order to work around MSVC limitations. // #include #include #include #include #include "PyImath.h" #include "PyImathMathExc.h" #include "PyImathDecorators.h" namespace PyImath { using namespace boost::python; using namespace IMATH_NAMESPACE; // XXX fixme - template this // really this should get generated automatically... template static FixedArray Color3Array_get(FixedArray > &ca) { return FixedArray(&(ca.unchecked_index(0)[index]), ca.len(),3*ca.stride(),ca.handle(),ca.writable()); } // Currently we are only exposing the RGBA components. template class_ > > register_Color3Array() { class_ > > color3Array_class = FixedArray >::register_("Fixed length array of Imath::Color3"); color3Array_class .add_property("r",&Color3Array_get) .add_property("g",&Color3Array_get) .add_property("b",&Color3Array_get) ; return color3Array_class; } } // namespace PyImath #endif // _PyImathColor3ArrayImpl_h_