3737using namespace SourceXPy ;
3838namespace py = boost::python;
3939namespace np = boost::python::numpy;
40+ namespace se = SourceXtractor;
4041
4142namespace {
4243
@@ -129,7 +130,9 @@ BOOST_PYTHON_MODULE(_SEPythonModule) {
129130
130131 py::class_<AttachedSource, boost::noncopyable>(" Source" , py::no_init)
131132 .def (" __getattr__" , &AttachedSource::attribute)
132- .def (" detach" , &AttachedSource::detach);
133+ .def (" detach" , &AttachedSource::detach)
134+ .def (" create" , &OwnedSource::create, py::args (" context" , " detection_frame" , " detection_id" , " pixel_coordinates" ))
135+ .staticmethod (" create" );
133136 py::register_ptr_to_python<std::shared_ptr<AttachedSource>>();
134137
135138 py::class_<OwnedSource, py::bases<AttachedSource>, boost::noncopyable>(" OwnedSource" , py::no_init)
@@ -150,7 +153,7 @@ BOOST_PYTHON_MODULE(_SEPythonModule) {
150153 .def (" __iter__" , &SourceGroup::iter);
151154 py::register_ptr_to_python<std::shared_ptr<SourceGroup>>();
152155
153- py::class_<ProcessSourcesEvent>(" ProcessSourcesEvent" , py::no_init).def (" __repr__" , &ProcessSourcesEvent::repr );
156+ py::class_<se:: ProcessSourcesEvent>(" ProcessSourcesEvent" , py::no_init).def (" __repr__" , &ProcessSourcesEventRepr );
154157
155158 py::class_<SourceReceiverIfce, boost::noncopyable>(" SourceReceiver" , py::no_init);
156159 py::class_<GroupReceiverIfce, boost::noncopyable>(" GroupReceiverIfce" , py::no_init);
@@ -196,6 +199,10 @@ BOOST_PYTHON_MODULE(_SEPythonModule) {
196199 .def (" __call__" , &FitsOutput::call)
197200 .def (" get" , &FitsOutput::get, (py::arg (" timeout" ) = std::chrono::microseconds::max ()));
198201
202+ // For custom segmentation
203+ py::def (" AllFramesDone" , &AllFramesDone::create);
204+
205+ // Import pyston into the interpreter so it is importable without tweaking PYTHONPATH
199206#if PY_MAJOR_VERSION >= 3
200207 PyObject* pyston = PyInit_pyston ();
201208#else
0 commit comments