MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/Imath / register_Color4

Function register_Color4

src/python/PyImath/PyImathColor4.cpp:543–647  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

541
542template <class T>
543class_<Color4<T> >
544register_Color4()
545{
546 typedef PyImath::StaticFixedArray<Color4<T>,T,4> Color4_helper;
547 void (IMATH_NAMESPACE::Color4<T>::*getValue1)(Color4<T> &) const = &IMATH_NAMESPACE::Color4<T>::getValue;
548 void (IMATH_NAMESPACE::Color4<T>::*getValue2)(T &, T &, T &, T &) const = &IMATH_NAMESPACE::Color4<T>::getValue;
549
550 class_<Color4<T> > color4_class(Color4Name<T>::value, Color4Name<T>::value,init<Color4<T> >("copy construction"));
551 color4_class
552 .def("__init__",make_constructor(Color4_construct_default<T>),"initialize to (0,0,0,0)")
553 .def("__init__",make_constructor(Color4_construct_tuple<T>), "initialize to (r,g,b,a) with a python tuple")
554 .def("__init__",make_constructor(Color4_construct_list<T>), "initialize to (r,g,b,a) with a python list")
555 .def("__init__",make_constructor(Color4_component_construct1<T,float>))
556 .def("__init__",make_constructor(Color4_component_construct1<T,int>))
557 .def("__init__",make_constructor(Color4_component_construct2<T,float>))
558 .def("__init__",make_constructor(Color4_component_construct2<T,int>))
559 .def("__init__",make_constructor(Color4_color_construct<T,float>))
560 .def("__init__",make_constructor(Color4_color_construct<T,int>))
561 .def("__init__",make_constructor(Color4_color_construct<T,unsigned char>))
562 .def_readwrite("r", &Color4<T>::r)
563 .def_readwrite("g", &Color4<T>::g)
564 .def_readwrite("b", &Color4<T>::b)
565 .def_readwrite("a", &Color4<T>::a)
566 .def("__str__", &color4_str<T>)
567 .def("__repr__", &color4_repr<T>)
568 .def(self == self) // NOSONAR - suppress SonarCloud bug report.
569 .def(self != self) // NOSONAR - suppress SonarCloud bug report.
570 .def("__iadd__", &iadd<T>,return_internal_reference<>())
571 .def("__add__", &add<T>)
572 .def("__add__", &addTuple<T>)
573 .def("__add__", &addT<T>)
574 .def("__radd__", &addTuple<T>)
575 .def("__radd__", &addT<T>)
576 .def("__isub__", &isub<T>,return_internal_reference<>())
577 .def("__sub__", &sub<T>)
578 .def("__sub__", &subtractL<T>)
579 .def("__sub__", &subtractLT<T>)
580 .def("__rsub__", &subtractR<T>)
581 .def("__rsub__", &subtractRT<T>)
582 .def("__neg__", &neg<T>)
583 .def("negate",&negate<T>,return_internal_reference<>(),"component-wise multiplication by -1")
584 .def("__imul__", &imul<T>,return_internal_reference<>())
585 .def("__imul__", &imulT<T>,return_internal_reference<>())
586 .def("__mul__", &mul<T>)
587 .def("__mul__", &mulT<T>)
588 .def("__rmul__", &mulT<T>)
589 .def("__mul__", &mulTuple<T>)
590 .def("__rmul__", &mulTuple<T>)
591 .def("__idiv__", &idiv<T>,return_internal_reference<>())
592 .def("__idiv__", &idivT<T>,return_internal_reference<>())
593 .def("__itruediv__", &idiv<T>,return_internal_reference<>())
594 .def("__itruediv__", &idivT<T>,return_internal_reference<>())
595 .def("__div__", &div<T>)
596 .def("__div__", &divT<T>)
597 .def("__div__", &divTupleL<T>)
598 .def("__truediv__", &div<T>)
599 .def("__truediv__", &divT<T>)
600 .def("__truediv__", &divTupleL<T>)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected