https://github.com/NSchertler/GeneralizedMotorcycleGraph
Revision ebd9979c9a23db6f8fa7ed0167965a7ad432bb76 authored by Nico Schertler on 05 April 2017, 08:16:54 UTC, committed by Nico Schertler on 05 April 2017, 08:16:54 UTC
# Conflicts: # src/common.cpp # src/screen.cpp
Tip revision: ebd9979c9a23db6f8fa7ed0167965a7ad432bb76 authored by Nico Schertler on 05 April 2017, 08:16:54 UTC
Merge remote-tracking branch 'upstream/master'
Merge remote-tracking branch 'upstream/master'
Tip revision: ebd9979
eigen.cpp
#ifdef NANOGUI_PYTHON
#include "python.h"
void register_eigen(py::module &m) {
py::class_<Color>(m, "Color", D(Color))
.def(py::init<int, int, int, int>(), D(Color, Color, 7))
.def(py::init<int, int>(), D(Color, Color, 5))
.def(py::init<float, float, float, float>(), D(Color, Color, 7))
.def(py::init<float, float>(), D(Color, Color, 5))
.def("contrastingColor", &Color::contrastingColor,
D(Color, contrastingColor))
.def_property("r", [](const Color &c) { return c.r(); },
[](Color &c, float v) { c.r() = v; }, D(Color, r))
.def_property("g", [](const Color &c) { return c.g(); },
[](Color &c, float v) { c.g() = v; }, D(Color, g))
.def_property("b", [](const Color &c) { return c.b(); },
[](Color &c, float v) { c.b() = v; }, D(Color, b))
.def("__repr__", [](const Color &c) {
std::ostringstream oss;
oss << c.transpose();
return oss.str();
});
}
#endif
Computing file changes ...