blob: dbf54967a568e90a6655b1209e268b2858b1b2c5 [file] [log] [blame]
Austin Schuh8c267c72023-11-18 14:05:14 -08001#include "frc971/orin/points.h"
2
3#include <iomanip>
4#include <ostream>
5
6namespace frc971 {
7namespace apriltag {
8
9std::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
19static_assert(sizeof(QuadBoundaryPoint) == 8,
20 "QuadBoundaryPoint didn't pack right.");
21
22std::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
32static_assert(sizeof(IndexPoint) == 8, "IndexPoint didn't pack right.");
33
34} // namespace apriltag
35} // namespace frc971