|
| 1 | +#ifdef NANOGUI_PYTHON |
| 2 | + |
| 3 | +#include "python.h" |
| 4 | +#include <nanogui/chroma.h> |
| 5 | +#include <nanobind/stl/array.h> |
| 6 | + |
| 7 | +using namespace nanogui::ituth273; |
| 8 | + |
| 9 | +void register_chroma(nb::module_ &m_) { |
| 10 | + auto m = m_.def_submodule("ituth273"); |
| 11 | + |
| 12 | + nb::enum_<ColorPrimaries>(m, "ColorPrimaries") |
| 13 | + .value("BT709", ColorPrimaries::BT709) |
| 14 | + .value("Unspecified", ColorPrimaries::Unspecified) |
| 15 | + .value("BT470M", ColorPrimaries::BT470M) |
| 16 | + .value("BT470BG", ColorPrimaries::BT470BG) |
| 17 | + .value("SMTPE170M", ColorPrimaries::SMPTE170M) |
| 18 | + .value("SMTP240M", ColorPrimaries::SMPTE240M) |
| 19 | + .value("Film", ColorPrimaries::Film) |
| 20 | + .value("BT2020", ColorPrimaries::BT2020) |
| 21 | + .value("SMTPE428", ColorPrimaries::SMPTE428) |
| 22 | + .value("SMTPE431", ColorPrimaries::SMPTE431) |
| 23 | + .value("SMTPE432", ColorPrimaries::SMPTE432) |
| 24 | + .value("Weird", ColorPrimaries::Weird); |
| 25 | + |
| 26 | + |
| 27 | + m.def("chroma_to_rec709_matrix", &chroma_to_rec709_matrix); |
| 28 | + m.def("chroma", &chroma); |
| 29 | + m.def("from_screen", &from_screen); |
| 30 | +}; |
| 31 | + |
| 32 | +#endif |
0 commit comments