Austin Schuh | 8c267c7 | 2023-11-18 14:05:14 -0800 | [diff] [blame^] | 1 | #include "frc971/orin/points.h" |
| 2 | |
| 3 | #include <iomanip> |
| 4 | #include <ostream> |
| 5 | |
| 6 | namespace frc971 { |
| 7 | namespace apriltag { |
| 8 | |
| 9 | std::ostream &operator<<(std::ostream &os, const QuadBoundaryPoint &point) { |
| 10 | std::ios_base::fmtflags original_flags = os.flags(); |
| 11 | |
| 12 | os << "key:" << std::hex << std::setw(16) << std::setfill('0') << point.key |
| 13 | << " rep01:" << std::setw(10) << point.rep01() << " pt:" << std::setw(6) |
| 14 | << point.point_bits(); |
| 15 | os.flags(original_flags); |
| 16 | return os; |
| 17 | } |
| 18 | |
| 19 | static_assert(sizeof(QuadBoundaryPoint) == 8, |
| 20 | "QuadBoundaryPoint didn't pack right."); |
| 21 | |
| 22 | std::ostream &operator<<(std::ostream &os, const IndexPoint &point) { |
| 23 | std::ios_base::fmtflags original_flags = os.flags(); |
| 24 | |
| 25 | os << "key:" << std::hex << std::setw(16) << std::setfill('0') << point.key |
| 26 | << " i:" << std::setw(3) << point.blob_index() << " t:" << std::setw(7) |
| 27 | << point.theta() << " p:" << std::setw(6) << point.point_bits(); |
| 28 | os.flags(original_flags); |
| 29 | return os; |
| 30 | } |
| 31 | |
| 32 | static_assert(sizeof(IndexPoint) == 8, "IndexPoint didn't pack right."); |
| 33 | |
| 34 | } // namespace apriltag |
| 35 | } // namespace frc971 |