#include "dv-processing/data/depth_frame_base.hpp"

#include <pybind11/pybind11.h>

namespace py = pybind11;

/**
 * @brief Bind DepthFrame class to python
 * @param m pybind The module to bind to
 */
void bind_depth_frame_base(py::module &m) {
	using pybind11::operator""_a;

	py::class_<dv::DepthFrame>(m, "DepthFrame")
		.def(py::init())
		.def(py::init<int64_t, int16_t, int16_t, uint16_t, uint16_t, uint16_t, const std::vector<uint16_t> &>(),
			"timestamp"_a, "sizeX"_a, "sizeY"_a, "minDepth"_a, "maxDepth"_a, "step"_a, "depth"_a)
		.def_readwrite("timestamp", &dv::DepthFrame::timestamp, "Microsecond timestamp of the depth frame")
		.def_readwrite("sizeX", &dv::DepthFrame::sizeX, "Width of the frame")
		.def_readwrite("sizeY", &dv::DepthFrame::sizeY, "Height of the frame")
		.def_readwrite("minDepth", &dv::DepthFrame::minDepth, "Minimum measurable depth")
		.def_readwrite("maxDepth", &dv::DepthFrame::maxDepth, "Maximum measurable depth")
		.def_readwrite("step", &dv::DepthFrame::step, "Depth measurement step in millimeters, usually 1mm")
		.def_readwrite("depth", &dv::DepthFrame::depth, "Actual depth values")
		.def(
			"time",
			[](const dv::DepthFrame &self) {
				return dv::toTimePoint(self.timestamp);
			},
			"Timestamp of the captured data, compatible with python time library");
}
