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