From 3702e80eaa806c9547a1ddcf65337798d829a395 Mon Sep 17 00:00:00 2001 From: zrezke Date: Wed, 13 Dec 2023 14:30:48 +0100 Subject: [PATCH] Impl << operator for StereoPair and vector --- include/depthai/common/StereoPair.hpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 include/depthai/common/StereoPair.hpp diff --git a/include/depthai/common/StereoPair.hpp b/include/depthai/common/StereoPair.hpp new file mode 100644 index 000000000..9d4dc1a09 --- /dev/null +++ b/include/depthai/common/StereoPair.hpp @@ -0,0 +1,25 @@ +#pragma once + +#include "depthai-shared/common/StereoPair.hpp" + +// Global namespace +inline std::ostream& operator<<(std::ostream& out, const dai::StereoPair& pair) { + out << "{left: " << pair.left << ", "; + out << "right: " << pair.right << ", "; + out << "baseline: " << pair.baseline << ", "; + out << "isVertical: " << pair.isVertical << "}"; + return out; +} + +inline std::ostream& operator<<(std::ostream& out, const std::vector& pairs) { + out << "["; + for(size_t i = 0; i < pairs.size(); i++) { + if(i != 0) { + out << ", "; + } + out << pairs.at(i); + } + out << "]"; + + return out; +}