#pragma once

#include "../../../include/dv-processing/features/tracker_base.hpp"

#include <pybind11/pybind11.h>

namespace py = pybind11;

/**
 * @brief Bind features::TrackerBase to python
 * @param m pybind The module to bind to
 */
void bind_tracker_base(py::module &m) {
	py::class_<dv::features::TrackerBase::Result, std::shared_ptr<dv::features::TrackerBase::Result>>(
		m, "TrackingResult")
		.def_readonly("timestamp", &dv::features::TrackerBase::Result::timestamp)
		.def_readonly("keypoints", &dv::features::TrackerBase::Result::keypoints)
		.def_readonly("asKeyFrame", &dv::features::TrackerBase::Result::asKeyFrame);

	py::class_<dv::features::TrackerBase>(m, "TrackerBase",
		"A base class for implementing feature trackers, that track sets of features against streams of various "
		"inputs. This class specifically does not define an input type, so it could be defined by the specific "
		"implementation.")
		.def("setMaxTracks", &dv::features::TrackerBase::setMaxTracks, py::arg("maxTracks"),
			"Set the maximum number of tracks.")
		.def("getMaxTracks", &dv::features::TrackerBase::getMaxTracks, "Get the maximum number of tracks.")
		.def("getLastFrameResults", &dv::features::TrackerBase::getLastFrameResults,
			"Retrieve cached last frame detection results.")
		.def("runTracking", &dv::features::TrackerBase::runTracking, "Perform the tracking and cache the results.")
		.def("removeTracks", &dv::features::TrackerBase::removeTracks, py::arg("trackIds"),
			"Remove tracks from cached results, so the wouldn't be tracked anymore. TrackIds are the `class_id` value "
			"of the keypoint structure.");
}
