#pragma once

#include "../../core/utils.hpp"

namespace dv::io::camera {

enum class CameraModel : uint8_t {
	DVS128         = 0,
	DAVIS          = 1,
	DVXPLORER      = 2,
	DVXPLORER_M    = 3,
	DVXPLORER_S    = 4,
	DAVIS_GEN2     = 5,
	DVXPLORER_GEN2 = 6,
};

inline std::ostream &operator<<(std::ostream &os, const CameraModel &var) {
	switch (var) {
		case CameraModel::DVS128:
			return os << "DVS128";

		case CameraModel::DAVIS:
			return os << "DAVIS";

		case CameraModel::DVXPLORER:
			return os << "DVXPLORER";

		case CameraModel::DVXPLORER_M:
			return os << "DVXPLORER_M";

		case CameraModel::DVXPLORER_S:
			return os << "DVXPLORER_S";

		case CameraModel::DAVIS_GEN2:
			return os << "DAVIS_GEN2";

		case CameraModel::DVXPLORER_GEN2:
			return os << "DVXPLORER_GEN2";
	}

	return os;
}

enum class USBDeviceType : uint8_t {
	FX2      = 0,
	FX3_MB   = 1,
	FX3_BLUE = 2,
	FX3_RED  = 3,
	CX3_MIPI = 4,
	FX3_GEN2 = 5,
};

inline std::ostream &operator<<(std::ostream &os, const USBDeviceType &var) {
	switch (var) {
		case USBDeviceType::FX2:
			return os << "FX2";

		case USBDeviceType::FX3_MB:
			return os << "FX3_MB";

		case USBDeviceType::FX3_BLUE:
			return os << "FX3_BLUE";

		case USBDeviceType::FX3_RED:
			return os << "FX3_RED";

		case USBDeviceType::CX3_MIPI:
			return os << "CX3_MIPI";

		case USBDeviceType::FX3_GEN2:
			return os << "FX3_GEN2";
	}

	return os;
}

} // namespace dv::io::camera

// fmt compatibility for enum class printing.
template<>
struct fmt::formatter<dv::io::camera::CameraModel> : fmt::ostream_formatter {};

template<>
struct fmt::formatter<dv::io::camera::USBDeviceType> : fmt::ostream_formatter {};
