Skip to content

Commit

Permalink
Impl << operator for StereoPair and vector<StereoPair>
Browse files Browse the repository at this point in the history
  • Loading branch information
zrezke committed Dec 13, 2023
1 parent 9ad83da commit 3702e80
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions include/depthai/common/StereoPair.hpp
Original file line number Diff line number Diff line change
@@ -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<dai::StereoPair>& pairs) {
out << "[";
for(size_t i = 0; i < pairs.size(); i++) {
if(i != 0) {
out << ", ";
}
out << pairs.at(i);
}
out << "]";

return out;
}

0 comments on commit 3702e80

Please sign in to comment.