24 #include <pybind11/pybind11.h>
25 #include <pybind11/stl.h>
32 using namespace py::literals;
39 auto clsThreshold = wrappers.
wrapType(
41 [](
auto& mod,
auto&
cls) {
42 cls.def(py::init<double const, typename Threshold::ThresholdType const, bool const,
44 "value"_a,
"type"_a = Threshold::VALUE,
"polarity"_a = true,
45 "includeMultiplier"_a = 1.0);
47 cls.def(
"getType", &Threshold::getType);
48 cls.def_static(
"parseTypeString", Threshold::parseTypeString);
49 cls.def_static(
"getTypeString", Threshold::getTypeString);
50 cls.def(
"getValue", (double (Threshold::*)(const double) const) & Threshold::getValue,
56 cls.def(
"getPolarity", &Threshold::getPolarity);
57 cls.def(
"setPolarity", &Threshold::setPolarity);
58 cls.def(
"getIncludeMultiplier", &Threshold::getIncludeMultiplier);
59 cls.def(
"setIncludeMultiplier", &Threshold::setIncludeMultiplier);
62 wrappers.
wrapType(py::enum_<Threshold::ThresholdType>(clsThreshold,
"ThresholdType"),
63 [](
auto& mod,
auto& enm) {
64 enm.value(
"VALUE", Threshold::ThresholdType::VALUE);
65 enm.value(
"BITMASK", Threshold::ThresholdType::BITMASK);
68 enm.value(
"PIXEL_STDEV", Threshold::ThresholdType::PIXEL_STDEV);
72 wrappers.
wrap([](
auto& mod) {
73 mod.def(
"createThreshold",
createThreshold,
"value"_a,
"type"_a =
"value",
"polarity"_a =
true);