#pragma once

#include "../../../include/dv-processing/kinematics/pixel_motion_predictor.hpp"

#include <pybind11/pybind11.h>

namespace py = pybind11;

/**
 * @brief Bind kinematics::PixelMotionPredictor class to python
 * @param m pybind The module to bind to
 */
void bind_pixel_motion_predictor(py::module &m) {
	py::class_<dv::kinematics::PixelMotionPredictor>(m, "PixelMotionPredictor",
		"A buffer containing time increasing 3D transformations and capable of timewise linear interpolation between "
		"available transforms. Can be used with different underlying floating point types supported by Eigen.")
		.def(py::init<std::shared_ptr<dv::camera::CameraGeometry>>(), py::arg("cameraGeometry"),
			"Construct pixel motion predictor class.")
		.def("predictEvents", &dv::kinematics::PixelMotionPredictor::predictEvents, py::arg("events"), py::arg("dT"),
			py::arg("depth"),
			"Apply delta transformation to event input and generate new transformed event store with new events that "
			"are within the new camera perspective (after applying delta transform).")
		.def("predict", &dv::kinematics::PixelMotionPredictor::predict<Eigen::Vector2f, Eigen::Vector2f>,
			py::arg("point"), py::arg("dT"), py::arg("depth"),
			"Reproject given pixel coordinates using the delta transformation and depth.")
		.def("predictSequence",
			&dv::kinematics::PixelMotionPredictor::predictSequence<std::vector<Eigen::Vector2f>,
				std::vector<Eigen::Vector2f>>,
			py::arg("points"), py::arg("dT"), py::arg("depth"),
			"Apply delta transformation to coordinate input and generate new transformed coordinate array with new "
			"coordinates that are within the new camera perspective (after applying delta transform).")
		.def("isUseDistortion", &dv::kinematics::PixelMotionPredictor::isUseDistortion,
			"Is the distortion model enabled for the reprojection of coordinates.")
		.def("setUseDistortion", &dv::kinematics::PixelMotionPredictor::setUseDistortion, py::arg("useDistortion"),
			"Enable of disable the usage of a distortion model.");
}
